Sell Order

This POST endpoint is responsible for making a sell order and returns the checkout url and access token.

The sell order POSTapi takes your publicKey as a required parameter and a body request containing properties like the customer's email, phone number, customer deposit and receipt methods etc.

A boolean property called deferPaymentMethod is added to the request body which can be set to true to delay providing your users' payment methods to initiate any of the order endpoints. It can also be set to false if you intend to provide the details and require a confirmation of the request immediately.

When deferPaymentMethod is set to true, a call to Initiate Order Created With Deferred Payment Method should be made to complete the order initiation.

See the example below;

Initiates a sell order

POST https://checkout-api-sandbox.xendbridge.com/api/ThirdPartyUI/Sell/Initiate

Headers

Request Body

{
    "data": {
        "checkoutReference": "XCHKS_16406281b0694800988a864be2d03852ebd164b74e6f4281a910c67af1dee344",
        "orderReference": "XS_fd48d48e071c40b78d7331790aacb74d",
        "checkoutUrl": "https://checkout-sandbox.xendbridge.com/order?ref=XCHKS_16406281b0694800988a864be2d03852ebd164b74e6f4281a910c67af1dee344",
        "accessToken": "490030",
        "receiveInCurrencyCode": "NGN",
        "payInCurrencyCode": "BUSD",
        "customerPayInCurrencyNetwork": "BEP20",
        "customerReceieveInCurrencyNetwork": "LOCAL",
        "receivableAmount": 3705.700,
        "payableAmount": 5.0,
        "receivableAmountWithoutMarkup": 0,
        "providerName": "John",
        "providerFirstName": "John",
        "providerLastName": "Doe",
        "providerEmail": "owolabidamilola98@gmail.com",
        "initiatedAt": "2023-02-13T11:43:55.0287619Z",
        "orderExpiryDate": "2023-02-13T11:50:54.7745953Z",
        "initiatedAtTimestamp": 1676288634774,
        "orderExpiryTimestamp": 1676289054774,
        "estimatedOrderCompletionTimestamp": null,
        "fundedProviderAtTimeStamp": null,
        "fundedCustomerAtTimeStamp": null,
        "orderCompletedAtTimeStamp": null,
        "p2POrderStatus": "Acknowledged",
        "disputeStatus": "NoDispute",
        "disputeReference": null,
        "orderType": "Sell",
        "providerContact": {
            "phoneNumber": "2348181186644",
            "whatsappNumber": ""
        },
        "customerContact": {
            "email": null,
            "name": null,
            "phoneNumber": null
        },
        "providerPaymentMethods": {
            "paymentMethod": "Crypto",
            "paymentType": "Crypto",
            "paymentData": [
                {
                    "walletAddress": "0xB13A251A67E7f7e7466758EF55A3aDD69A7C15A3",
                    "network": "BEP20",
                    "currency": "BUSD"
                }
            ],
            "orderPaymentMethod": {
                "walletAddress": "0xB13A251A67E7f7e7466758EF55A3aDD69A7C15A3",
                "network": "BEP20",
                "currency": "BUSD"
            }
        },
        "consumerDepositMethod": {
            "paymentMethod": "Crypto",
            "paymentType": 0,
            "paymentData": {
                "walletAddress": "0x52434Ac4BE04393e020c9b16C327d04d4367Cbcd",
                "network": "BEP20",
                "currency": "BUSD"
            }
        },
        "consumerReceiptMethod": {
            "paymentMethod": "Bank",
            "paymentType": 0,
            "paymentData": {
                "bankName": "Access Bank",
                "accountNumber": "0000187849",
                "accountName": "Emmanuel Diala",
                "address": null,
                "swiftCode": null,
                "iban": null,
                "sortCode": null,
                "currency": "NGN",
                "network": "LOCAL"
            }
        },
        "providerTransactionMetadata": null,
        "customerTransactionMetadata": null
    },
    "status": "OK",
    "message": ""
}
JSON Request Format
{
  "emailAddress": "annadoe@gmail.com",
  "phoneNumber": "07064366723",
  "userName": "annadoe",
  "payInCurrencyCode": "BUSD",
  "payInCurrencyNetwork": "BEP20",
  "receiveInCurrencyCode": "NGN",
  "receiveInCurrencyNetwork": "LOCAL",
  "orderAmount": 50,
  "consumerDepositMethod": {
    "paymentMethod": "Crypto",
    "paymentData": {
      "walletAddress": "QWEVDTWDGVT462E6EFYE9202Y239",
      "network": "BEP20"
    }
  },
  "consumerReceiptMethod": {
    "paymentMethod": "Bank",
    "paymentData": {
      "accountName": "Anna Doe",
      "accountNumber": "0000187849",
      "bankName": "Access Bank"
    }
  }
}

If deferPaymentMethod is set to true, you can provide the minimum payload below which starts the order initiation process and returns the checkoutUrl .

JSON Request Format
{
  "emailAddress": "johndoe@gmail.com",
  "phoneNumber": null,
  "userName": null,
  "payInCurrencyCode": "BUSD",
  "payInCurrencyNetwork": "BEP20",
  "receiveInCurrencyCode": "NGN",
  "receiveInCurrencyNetwork": "LOCAL",
  "orderAmount": 1,
  "deferPaymentMethod": true
}

Last updated