Order Management (Async)

The async endpoints are designed for speedy API response while creating and fetching orders.

Mobile Money Providers

Get the available mobile money operators of a country

GET https://exchanger-api.fuspay.finance/api/v1/no-auth/PartnerP2P/MobileMoney/

Headers

NameTypeDescription

Content-Type

String

application/json

{
    "ghana": {
        "Country": "Ghana",
        "list": [
            {
                "name": "MTN",
                "code": "MTN"
            },
            {
                "name": "Vodacom",
                "code": "VOD"
            },
            {
                "name": "Airtel Money",
                "code": "ATM"
            }
        ]
    },
    "kenya": {
        "Country": "Kenya",
        "list": [
            {
                "name": "MPESA (Safaricom)",
                "code": "MPESA"
            }
        ]
    },
    "uganda": {
        "Country": "Uganda",
        "list": [
            {
                "name": "MTN",
                "code": "MTN"
            },
            {
                "name": "Airtel Money",
                "code": "ATM"
            },
            {
                "name": "Warid Pesa",
                "code": "WARID"
            },
            {
                "name": "Orange money",
                "code": "ORANGE"
            }
        ]
    }
}

Digital Signature

This endpoint is used to sign the request body. and generate the digital signature.

POST https://exchanger-api.fuspay.finance/api/v1/no-auth/PartnerP2P/SignRequestSha512/

The object is signed without including the signature field.

Headers

NameTypeDescription

Content-Type*

String

application/json

Request Body

NameTypeDescription

partner_order_id*

String

the order id on partners end

amount_to_collect*

String

the amount to be collected

timestamp*

String

the time the order was created

order_expiration*

String

the time the order would expire

currency*

String

the currency of collection eg GHS, NGN

partner_callback_url*

String

the url where payment confirmation would be posted

partner_redirect_url*

String

partners site where users would be redirected after successful payment

secret*

String

merchant secret and partner secret concatenated

Sample code

const request = require('request');


const options = {
  method: 'POST',
  url: 'https://exchanger-api.fuspay.finance/api/v1/no-auth/PartnerP2P/SignRequestSha512',
  headers: {'Content-Type': 'application/json'},
  body: {
    partner_order_id: 'FUSPAY-00400-001-091-008',
    amount_to_collect: '3',
    timestamp: 1693285902419,
    order_expiration: 1693285902419,
    currency: 'GHS',
    partner_callback_url: 'https://webhook.site/xxxxxxxx',
    partner_redirect_url: 'https://google.com',
    secret: '4LJDHGA-SJTECNA-XXXX-XXXXsk_partner_ph25sjy-qtfeoxy-rqbvzyq-z-xx'
  },
  json: true
};

request(options, function (error, response, body) {
  if (error) throw new Error(error);

  console.log(body);
});

Create Order - Using Payment Pages

This endpoint is used to create an order on Intrapay

POST https://prod-order-exchanger-api.fuspay.finance/api/v1/no-auth/PartnerP2P/CreateOrder/

So, if you want a payment page (a screen that allows your users input their phone number & network), Please include x-partner-id, x-merchant-secret in the header and ignore intrapay_merchant_id in the request body.

Note: The intrapay merchant id is different for each account (currency) created on Intrapay. You can find your intrapay merchant id at the bottom left AFTER YOU HAVE SETUP the wallet of that currency.

The merchant secret is also different per currency. Find your merchant secret at the partner mapping screen by clicking on your name on the partner list.

Orders start to appear on Intrapay dashboard after user has visited the payment page and has accepted payment on their phone.

Headers

NameTypeDescription

x-merchant-secret*

String

The secret key of the merchant (this is different for each country) and can be gotten from your dashboard (partner mapping)

Content-Type*

String

application/json

x-partner-id*

String

The ID of the partner (Binance) sending the order

Authorization*

String

Authorization is a bearer token which is Partners public key

Request Body

NameTypeDescription

partner_order_id*

String

Id of order generated on partners' system

amount_to_collect*

String

amount seller or buy as listed

timestamp*

Number

Time order was created. unix or epoch time in milleseconds (GMT+0)

order_expiration*

String

the time to be elapsed before order becomes invalid. unix or epoch time in millseconds (GMT+0)

currency*

String

currency the buyer is paying the merchant with

partner_callback_url*

String

payment notification used by IntraPay to notify Partner System about the Payment status of the order

partner_redirect_url*

String

provided by partner. url to redirect partner's users

signature*

String

SHA-512 of request payload signed with both merchant and partner secret key(SK_merchant_xxx+SK_partner_xxx)

phone

String

The phone number of the sender. for Mobile Money only

mobile_money_network

String

This is the mobile money provider. eg MTN, VOD, ATM

//API response
OK 





//Callback Response 1
{ "partner_order_id": "FUSPAY-Y-20251", "callbak_data": "OK" }




//Callback response 2
{"": "https://intrapay.fuspay.finance/b2b?partner_id=p60037&currency=KHS&amount=1001&fee=0&order_id=593163277406920704&lang=eng-NG&country=kenya&tk=YN6ITFY-ECIEG2A-VCEAT2I-ARZKZEA7388"}

Example Request- Code

const request = require('request')
const options = {
  method: 'POST',
  url: 'http://localhost:5000/api/v1/no-auth/PartnerP2P/CreateOrder',
  headers: {
    'Content-Type': 'application/json',
    'x-partner-id': 'pxxxx',
    'x-merchant-secret': 'xxx-xxx-xxx',
    Authorization: 'Bearer pk_partner_xxxxxxxx'
  },
  body: {
    partner_order_id: 'my-server-order-id',
    amount_to_collect: '10',
    phone: "254XXXXXX",
    mobile_money_network: "MTN",
    timestamp: 1693285902419,
    order_expiration: 1693285902419,
    currency: 'GHS', // GHS | KHS | NGN | UGX | ZAR
    partner_callback_url: 'https://xxx...',
    partner_redirect_url: 'https://example.com?status=success&order=my-server-order-id',
    signature: 'fe04ee69d4f9a93c71f3d1bbf37d49d541e5c4fb159c4a75924f398262e2af146d0e2e33b1379a9b57c641d822c410158e03b64faab34dc98d528bfa234f9dd3'
  },
  json: true
};

request(options, function (error, response, body) {
  if (error) throw new Error(error);

  console.log(body);
});

Create Order-Without Payment Pages or in Nigeria

This endpoint is also used to create an order on Intrapay

POST https://prod-order-exchanger-api.fuspay.finance/api/v1/no-auth/PartnerP2P/CreateOrder/

If you have a payment page for collecting your end-user's phone number and network (mobile money regions) or you want to collect in NIGERIA; Please add "intrapay_merchant_id" and partner_id in the request body. For Nigeria, The virtual bank account is sent as a JSON response from the API

Note: The intrapay merchant id is different for each account (currency) created on Intrapay. You can find your intrapay merchant id at the bottom left AFTER YOU HAVE SETUP the wallet of that currency.

The merchant secret is also different per currency. Find your merchant secret at the partner mapping screen by clicking on your name on the partner list.

Once callback is received order appears on intrapay dashboard.

Headers

NameTypeDescription

Content-Type*

String

application/json

Authorization*

String

Authorization is a bearer token which is Partners public key

Request Body

NameTypeDescription

partner_order_id*

String

Id of order generated on partners' system

amount_to_collect*

String

amount seller or buy as listed

timestamp*

Number

Time order was created. unix or epoch time in milleseconds (GMT+0)

order_expiration*

String

the time to be elapsed before order becomes invalid. unix or epoch time in millseconds (GMT+0)

currency*

String

currency the buyer is paying the merchant with

partner_callback_url*

String

payment notification used by IntraPay to notify Partner System about the Payment status of the order

partner_redirect_url*

String

provided by partner. url to redirect partner's users

signature*

String

SHA-512 of request payload signed with both merchant and partner secret key(SK_merchant_xxx+SK_partner_xxx)

phone

String

The phone number of the sender. for Mobile Money only

mobile_money_network

String

This is the mobile money provider. eg MTN, VOD, ATM

intrapay_merchant_id*

String

The intrapay merchant id is found on your intrapay dashboard on your fiat tab.

partner_id*

String

this is the ID gotten from the partner onboard endpoint


//API Response 
{
message:"OK"
}


//callback response 1
{ "partner_order_id": "FUSPAY-Y-20251", "callbak_data": "OK" }


//callback response 2 
{ "status": "PENDING", "id": 271046, "partner_id": "p60037", "order_notify_url": " https://webhook.site/f968b3b6-964c-4418-bdb0-169f3c2c3e4c", "exchanger_user_id": 129, "intrapay_merchant_id": "intra_merchant_176833", "messsage": "Fetched successfully", "payment": { "status": "PENDING", "sender_name": "" }, "virtual_account": { "amount": 100, "account_name": "John Ibikunle", "bank_name": "GTB", "account_number": "0845342528", "virtual_account_id": 2 }, "order_details": {}
}

Example Request- Code

const request = require('request')
const options = {
  method: 'POST',
  url: 'http://localhost:5000/api/v1/no-auth/PartnerP2P/CreateOrder',
  headers: {
    'Content-Type': 'application/json',
    Authorization: 'Bearer pk_partner_xxxxxxxx'
  },
  body: {
    partner_order_id: 'my-server-order-id',
    amount_to_collect: '100',
    timestamp: 1693285902419,
    order_expiration: 1693285902419,
    currency: 'NGN', // GHS | KHS | NGN | UGX | ZAR
    intrapay_merchant_id: "",
    partner_id: "",
    partner_callback_url: 'https://xxx...',
    partner_redirect_url: 'https://example.com?status=success&order=my-server-order-id',
    signature: 'fe04ee69d4f9a93c71f3d1bbf37d49d541e5c4fb159c4a75924f398262e2af146d0e2e33b1379a9b57c641d822c410158e03b64faab34dc98d528bfa234f9dd3'
  },
  json: true
};

request(options, function (error, response, body) {
  if (error) throw new Error(error);

  console.log(body);
});

fetch order

This endpoint is used to fetch an order to verify its status

GET https://prod-order-exchanger-api.fuspay.finance/api/v1/no-auth/PartnerP2P/FetchOrder?partner_order_id=xx&partner_id=xx/

Order Status

Pending = newly created orders that has not been fulfilled in 45 mins

Completed = Order that has been fulfilled and a callback has been returned in 45 mins

Mismatched = this is when a user pays above or below the amount on the order.

Expired = Order that payment was made but callback wasnt returned in 45 mins

Abandoned = an order that a user hasnt paid into in over 45 mins

Claimed = in cases of mismatched and expired merchants can decide to claim the money paid

Query Parameters

NameTypeDescription

partner_order_id*

String

the id of the order generated

partner_id*

String

the Id of the partner

Headers

NameTypeDescription

Authorization*

String

partners public key

Content-Type*

String

application/json

{
  "status": "success",
  "messsage": "",
  "data": {
        "payment": {
            "status": "PENDING | PAID | REFUND"

            },
        "virtual_account": {
        "amount": "",
        "account_name": "",
        "bank_name": "",
        "account_number": ""
      },
     "order_details": {
     "status": "PENDING | COMPLETED | EXPIRED | CANCELED",
     "partner_order_id": "",
     "intrapay_order_reference": ""
     }

 }

}

Example Request- Code

const fetch = require('node-fetch');

fetch("https://exchanger-api.fuspay.finance/api/v1/no-auth/PartnerP2P/FetchOrder?partner_order_id=xxxxx", {
  "method": "GET",
  "headers": {
    "Content-Type": "application/json",
    "Authorization": "Bearer pk_partner_xxxx",
    "cookie": "connect.sid=s%253AoNBPv4ez8npeuKVKlS9KwX_1Dshiamlf.n8opjPuoF3XsU%252Be0VTLMUe6xzeAXmpCfQrpW9KW1KDs"
  }
})
  .then(response => console.log(response))
  .catch(err => console.error(err));

Last updated