Assigning Virtual Accounts

These endpoints are used to create, fetch and cancel orders.

There are 2 ways you can create an order on our system using Virtual Accounts. The first way we are responsible for assigning the Virtual account (https://prod-order-exchanger-api.fuspay.finance/api/v1/no-auth/PartnerP2P/CreateOrder/ and the other way you fetch an available account from our end an show to your users. We would explore the first way using the endpoint below. The other way is right below

This endpoint is used to create an order on Intrapay (Old Auto Assigned VA for NGN)

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

The endpoint above has been changed to https://prod-order-exchanger-api.fuspay.finance/api/v1/no-auth/PartnerP2P/CreateOrder/ for efficiency sake

So, if you want a redirect URL (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.

However, if you have a system for collecting the phone number and network (mobile money regions) or you want to collect in NIGERIA; you should not add x-partner-id and x-merchant-secret in the header, and send "intrapay_merchant_id" and partner_id in the request body instead

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.

Please make sure we have whitelisted all your IPs

Headers

Name
Type
Description

Authorization*

String

Bearer pk_partner_xxx

Content-Type*

String

application/json

x-partner-id

String

Your partner ID

x-merchant-secret

String

the merchant secret copied from intrapay dashboard(differs per country)

Request Body

Name
Type
Description

partner_order_id*

String

Id of order generated on partners's system

amount_to_collect*

String

amount seller or buy as listed

intrapay_merchant_id*

Number

merchant id on Intrapay (this is different per account)

timestamp*

Number

Time order was signed. 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 milleseconds (GMT+0)

currency*

String

currency the buyer is paying the merchant with

partner_callback_url*

String

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

partner_redirect_url*

String

provided by partner url to redirect buyer

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. Not needed in non mobile money regions. This should not be included if you are going to use our page to collect the number. Add country code 254XX671000

mobile_money_network

String

The mobile network operator. eg MTN, Safaricom(MPESA), ATM. Not needed in non mobile money regions. This should not be included if you are going to use our page to collect the number

partner_id

String

The partner Id returned from the onboarding endpoint

//API Response 
{
message:"OK",
redirect_url:""
}

//Response sent to callback URL
{
  "status": "success",
  "messsage": "",
  "virtual_account": {
  "account_name": "",
    "bank_name": "",
    "account_number": ""
  },
  "order_details": {
  "status": "PENDING",
  "partner_order_id": "",
  "intrapay_order_reference": ""
 }

}

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: '5',
    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);
});

Get Available Assignable Virtual Account

This endpoint is used to fetch free/available virtual accounts from your account pool.

POST https://exchanger-api.fuspay.finance/api/v1/no-auth/PartnerP2P/GetCollectionPoolAccounts?choose_bank=All/

This gives you ability to assign virtual account number to a collection order.

Virtual Account Number are used once until an order is fulfilled or timeout

This endpoint also gives you the ability to decide the bank generating the virtual account. if choose_bank=All virtual accounts from all bank partners (GTB, Globus) would be returned; However if set to GTB, only VAs from GTB would be returned.

Query Parameters

Name
Type
Description

choose_bank

String

to select the bank providing the virtual account eg choose_bank =GTB. This would return virtual accounts from GTB only

Headers

Name
Type
Description

Authorization*

String

Bearer pk_partner_xxx

Content-Type*

String

application/json

Request Body

Name
Type
Description

intrapay_merchant_id*

Number

merchant id on Intrapay (this is different per account)

signature*

String

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

partner_id

String

the partners id from partner onbaording endpoint

Response {
	"success": true,
	"message": "Collection Pool Accounts",
	"data": [
		{
			"virtual_account_id": xxx,
			"account_name": "xxxxx",
			"account_number": "xxxxxx",
			"status": "ACTIVE"
		},
        ....
    ]
}


//Active means account is not being used and is available for use 

Example Request- Code

Check if specific account is available for use

This endpoint is used to check if a specific account is available for use

GET https://exchanger-api.fuspay.finance/api/v1/no-auth/PartnerP2P/IsPoolAccountAvailable?account_number=xxxx/

Query Parameters

Name
Type
Description

account_number*

String

this is the account number you are trying to verify

Headers

Name
Type
Description

Authorization*

String

partners public key

Content-Type*

String

application/json

{
            success: true,
            message: m,
            data: data 
            
 }

//true means account is available for use 

Example Request- Code

Create Order- using Available Virtual Account from your Account Pool

This endpoint is used to create an order on Intrapay

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

This endpoint puts you in charge of assigning virtual accounts to your collection orders. So to create orders this way, we have provided an endpoint above where you can get the list of available Virtual accounts (Accounts not assigned to any transaction yet) and once you get the free VA you send it along with your new order.

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.

Headers

Name
Type
Description

Authorization*

String

Bearer pk_partner_xxx

Content-Type*

String

application/json

Request Body

Name
Type
Description

partner_order_id*

String

Id of order generated on partners's system

amount_to_collect*

String

amount seller or buy as listed

intrapay_merchant_id*

Number

merchant id on Intrapay (this is different per account)

timestamp*

Number

Time order was signed. 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 milleseconds (GMT+0)

currency*

String

currency the buyer is paying the merchant with

partner_callback_url*

String

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

partner_redirect_url*

String

provided by partner url to redirect buyer

signature*

String

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

assigned_virtual_account_number*

String

The virtual account picked from the get free account endpoint. eg 1234567890

partner_id*

String

The partner Id returned from the onboarding endpoint

//API Response 
{
message:"OK",
redirect_url:""
}

//Response sent to callback URL
{
  "status": "success",
  "messsage": "",
  "virtual_account": {
  "account_name": "",
    "bank_name": "",
    "account_number": ""
  },
  "order_details": {
  "status": "PENDING",
  "partner_order_id": "",
  "intrapay_order_reference": ""
 }

}

Example Request- Code

Fetch order

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

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

Order Status

PENDING - Order is open / pending

CANCELED - Order has been canceled

COMPLETED- Order has been completed and payment was made

EXPIRED- Order has expired

Payment Status

PENDING - Order payment is not received yet

PAID - Order payment has been completed and payment was made by the Buyer

REFUND - Buyer was refunded

The following transactions can be deemed as pending via API responses :

Mismatched ( with Bank Ref )

Pending (No bank Ref)

Abandoned - pending > 4hours

All pending are

Query Parameters

Name
Type
Description

partner_order_id*

String

the Id or reference of the order being checked

Headers

Name
Type
Description

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));

Cancel Order

This endpoint is used to cancel an order.

POST

Headers

Name
Type
Description

Content-Type*

String

application/json

Authorization*

String

Bearer pk_partner_xxx

Request Body

Name
Type
Description

partner_order_id*

String

Order id

signature*

String

sha-512-of-req-body-signed-with-SK_merchant_xxx+SK_partner_xxx

{
  "status": "success",
  "message": "",
  "partner_order_id": ""
}

example request -code

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

fetch("https://exchanger-api.fuspay.finance/api/v1/no-auth/PartnerP2P/CancelOrder", {
  "method": "POST",
  "headers": {
    "Content-Type": "application/json",
    "Authorization": "Bearer pk_partner_xxxx",
    "cookie": "connect.sid=s%253AoNBPv4ez8npeuKVKlS9KwX_1Dshiamlf.n8opjPuoF3XsU%252Be0VTLMUe6xzeAXmpCfQrpW9KW1KDs"
  },
  "body": {
    "partner_order_id": "",
    "signature": "sha-512-of-req-body-signed-with-SK_merchant_xxx+SK_partner_xxx"
  }
})
  .then(response => console.log(response))
  .catch(err => console.error(err));

Last updated