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

Request Body

//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

Headers

Request Body

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

Headers

{
            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

Request Body

//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

Headers

{
  "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

Request Body

{
  "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