Swap Order

Initiate Swap Order

This endpoint is called when a customer wants to make either a fiat-fiat or crypto-crypto swap for currencies.

It is an POST endpoint that takes your secretKey as a required parameter in the Header which verifies the integrity of your third-party application.

Your request should contain properties like the customer's email, phone number, customer deposit, and receipt methods, etc. See the example below;

Initates a swap order

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

Headers

NameTypeDescription

secretKey*

string

{your_secretKey}

Request Body

NameTypeDescription

email*

string

annadoe@gmail.com

phoneNumber

string

07012345678

userName

string

annadoe

payInCurrencyCode*

string

BUSD

payInCurrencyNetwork*

string

BEP20

receieveInCurrencyCode*

string

USDT

receieveInCurrencyNetwork*

string

POLYGON

orderAmount*

decimal

50

consumerDepositMethod

object

paymentMethod*

string

Crypto

paymentData

object

consumerReceiptMethod

object

paymentMethod*

string

Crypto

paymentData

object

walletAddress*

String

0x52434Ac4BE04393e020c9b16C327d04d4367Cbcd

network*

string

POLYGON

walletAddress

string

0x52434Ac4BE04393e020c9b16C327d04d4367Cbcd

network

string

BEP-20

{
    "data": {
        "orderReference": "XC_460ed3181a9b48a089bac1af671146d1",
        "receiveInCurrencyCode": "WNT",
        "payInCurrencyCode": "BUSD",
        "receivableAmount": 4.52285,
        "payableAmount": 50,
        "receivableAmountWithoutMarkup": 0,
        "providerName": "John Doe",
        "providerFirstName": "John",
        "providerLastName": "Doe",
        "providerEmail": "owolabidamilola98@gmail.com",
        "initiatedAt": "2022-11-15T11:46:02.1799889Z",
        "orderExpiryDate": "2022-11-15T11:53:02.1212106Z",
        "initiatedAtTimestamp": 1668512762121,
        "orderExpiryTimestamp": 1668513182121,
        "estimatedOrderCompletionTimestamp": null,
        "fundedProviderAtTimeStamp": null,
        "fundedCustomerAtTimeStamp": null,
        "orderCompletedAtTimeStamp": null,
        "p2POrderStatus": "Acknowledged",
        "disputeStatus": "NoDispute",
        "disputeReference": null,
        "orderType": "Swap",
        "providerContact": {
            "phoneNumber": "2348181186644",
            "whatsappNumber": ""
        },
        "customerContact": {
            "email": "annadoe@gmail.com",
            "name": "annadoe",
            "phoneNumber": "07064366723"
        },
        "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": "0x30b7D85f7CF498D556a9448243a7994bc4660790",
                "network": "BEP20",
                "currency": "BUSD"
            }
        },
        "consumerReceiptMethod": {
            "paymentMethod": "Crypto",
            "paymentType": 0,
            "paymentData": {
                "walletAddress": "0x30b7D85f7CF498D556a9448243a7994bc4660790",
                "network": "POLYGON",
                "currency": "WNT"
            }
        },
        "markupDetail": null,
        "providerTransactionMetadata": null,
        "customerTransactionMetadata": null
    },
    "status": "OK",
    "message": ""
}
Crypto-Crypto JSON Request Format
{
  "emailAddress": "annadoe@gmail.com",
  "phoneNumber": "07064366723",
  "userName": "annadoe",
  "payInCurrencyCode": "BUSD",
  "payInCurrencyNetwork": "BEP20",
  "receiveInCurrencyCode": "WNT",
  "receiveInCurrencyNetwork": "POLYGON",
  "orderAmount": 50,
  "consumerDepositMethod": {
    "paymentMethod": "Crypto",
    "paymentData": {
      "walletAddress": "0x30b7D85f7CF498D556a9448243a7994bc4660790",
      "network": "BEP20"
    }
  },
  "consumerReceiptMethod": {
    "paymentMethod": "Crypto",
    "paymentData": {
      "walletAddress": "0x30b7D85f7CF498D556a9448243a7994bc4660790",
      "network": "POLYGON"
    }
  }
}
Fiat-Fiat JSON Request Format
{
  "emailAddress": "annadoe@gmail.com",
  "phoneNumber": "07064366723",
  "userName": "annadoe",
  "payInCurrencyCode": "BUSD",
  "payInCurrencyNetwork": "BEP20",
  "receiveInCurrencyCode": "WNT",
  "receiveInCurrencyNetwork": "POLYGON",
  "orderAmount": 50,
  "consumerDepositMethod": {
    "paymentMethod": "Bank",
    "paymentData": {
      "accountName": "Anna Doe",
      "accountNumber": "0000187849",
      "bankName": "Access Bank"
    }
  },
  "consumerReceiptMethod": {
    "paymentMethod": "Bank",
    "paymentData": {
      "accountName": "Anna Doe",
      "accountNumber": "0000187849",
      "bankName": "Access Bank"
    }
  }
}
ParameterTypeDefinitions

emailAddress

string

Required This is the consumer's email address.

phoneNumber

string

Required This is the consumer's phone number.

userName

string

Required This is the consumer's username

payInCurrencyCode

enum

Required This is the currency code to pay with. Must be BUSD for sell order.

receiveInCurrencyCode

enum

Required This is the currency code to receive the currency in. Must be NGN for buy order.

orderAmount

decimal

Required The order amount by the consumer.

consumerDepositMethod

object

Required This holds the properties of the deposit method of the consumer.

paymentMethod

enum

Required The payment method by which transactions are made. It should be CRYPTOfor sell order.

paymentData

object

Required This holds the properties of the wallet details of the consumer.

walletAddress

string

Required The crypto wallet address of the consumer.

network

enum

Required This is the network on which the address is on. It could be BEP20, ERC20 or POLYGON.

consumerReceiptMethod

object

Required This holds the properties of the consumer receiving method. The paymentMethod prop must be Bank .

paymentData

object

Required This holds the properties of the consumer receiving bank account details.

accountName

string

Required This is the account name of the consumer.

accountNumber

string

Required The local bank account number of the consumer

bankName

string

Required This is the bank name of the consumer.

Last updated