Buy Order

Initiate Buy Order

The buy order POST api takes your secretKey as a required parameter which should be in your environment variables as it verifies the integrity of your third-party application.

You will send a POST request containing properties like the customer's email, phone number, customer deposit and receipt methods, etc. See example below

Initates a buy order

POST https://canary.xendbridge.com/api/peertopeerorder/buy/initiate

Headers

Request Body

{
    "data": {
        "orderReference": "XB_0877e5692ee946f491bafab275d3d522",
        "receiveInCurrencyCode": "BUSD",
        "payInCurrencyCode": "NGN",
        "receivableAmount": 0.11988108,
        "payableAmount": 50,
        "receivableAmountWithoutMarkup": 0,
        "providerName": "John Doe",
        "providerFirstName": "John",
        "providerLastName": "Doe",
        "providerEmail": "owolabidamilola98@gmail.com",
        "initiatedAt": "2022-05-06T10:56:29.8070515Z",
        "orderExpiryDate": "2022-05-06T11:11:26.3811357Z",
        "initiatedAtTimestamp": 1651834586381,
        "orderExpiryTimestamp": 1651835486381,
        "fundedProviderAtTimeStamp": null,
        "fundedCustomerAtTimeStamp": null,
        "orderCompletedAtTimeStamp": null,
        "p2POrderStatus": "Acknowledged",
        "disputeStatus": "NoDispute",
        "disputeReference": null,
        "orderType": "Buy",
        "providerContact": {
            "phoneNumber": "2348181186644",
            "whatsappNumber": ""
        },
        "customerContact": {
            "email": "annadoe@gmail.com",
            "name": "annadoe",
            "phoneNumber": "07064366723"
        },
        "providerPaymentMethods": {
            "paymentMethod": "Bank",
            "paymentType": "Bank",
            "paymentData": [
                {
                    "bankName": "Access",
                    "accountNumber": "0709876786",
                    "accountName": "John Doe",
                    "currency": "NGN",
                    "network": "LOCAL"
                }
            ],
            "orderPaymentMethod": {
                "bankName": "Access",
                "accountNumber": "0709876786",
                "accountName": "John Doe",
                "currency": "NGN",
                "network": "LOCAL"
            }
        },
        "consumerDepositMethod": {
            "paymentMethod": "Bank",
            "paymentType": 0,
            "paymentData": {
                "bankName": "Access Bank",
                "accountNumber": "0000187849",
                "accountName": "Emmanuel Diala",
                "currency": "NGN",
                "network": "LOCAL"
            }
        },
        "consumerReceiptMethod": {
            "paymentMethod": "Crypto",
            "paymentType": 0,
            "paymentData": {
                "walletAddress": "0x52434Ac4BE04393e020c9b16C327d04d4367Cbcd",
                "network": "BEP20",
                "currency": "BUSD"
            }
        },
        "providerTransactionMetadata": null
    },
    "status": "OK",
    "message": ""
}
JSON Request Format
{
  "emailAddress": "annadoe@gmail.com",
  "phoneNumber": "07064366723",
  "userName": "annadoe",
  "payInCurrencyCode": "NGN",
  "payInCurrencyNetwork": "LOCAL",
  "receiveInCurrencyCode": "BUSD",
  "receiveInCurrencyNetwork": "BEP20",
  "orderAmount": 50,
  "consumerDepositMethod": {
    "paymentMethod": "Bank",
    "paymentData": {
      "accountName": "Anna doe",
      "accountNumber": "0000187849",
      "bankName": "Access Bank"
    }
  },
  "consumerReceiptMethod": {
    "paymentMethod": "Crypto",
    "paymentData": {
      "walletAddress": "0x52434Ac4BE04393e020c9b16C327d04d4367Cbcd",
      "network": "BEP20"
    }
  }
}

Last updated