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 publicKey
as a required parameter in the header and the body should contain 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 swap order
POST
https://checkout-api-sandbox.xendbridge.com/api/ThirdPartyUI/Swap/Initiate
Headers
Name | Type | Description |
---|---|---|
publicKey* | string | {publicKey} |
Request Body
Name | Type | Description |
---|---|---|
emailAddress* | string | annadoe@gmail.com |
phoneNumber* | string | 07064366723 |
userName* | string | annadoe |
payInCurrencyCode* | string | BUSD |
payInCurrencyNetwork* | string | BEP-20 |
receiveInCurrencyCode* | string | NGN |
receiveInCurrencyNetwork* | string | LOCAL |
orderAmount* | double | 50 |
consumerDepositMethod* | Object | |
paymentMethod* | string | Crypto |
paymentData* | Object | |
walletAddress* | string | 0x52434Ac4BE04393e020c9b16C327d04d4367Cbcd |
network* | string | BEP-20 |
consumerReceiptMethod* | Object | |
paymentMethod* | string | Crypto |
paymentData* | Object | |
walletAddress* | string | 0x52434Ac4BE04393e020c9b16C327d04d4367Cbcd |
network* | string | POLYGON |
deferPaymentMethod* | bool | false |
If deferPaymentMethod
is set to true, you can provide the minimum payload below which starts the order initiation process and returns the checkoutUrl .
Parameter | Type | Definitions |
---|---|---|
emailAddress | string |
|
phoneNumber | string |
|
userName | string |
|
payInCurrencyCode | enum |
|
receiveInCurrencyCode | enum |
|
orderAmount | decimal |
|
consumerDepositMethod | object |
|
paymentMethod | enum |
|
paymentData | object |
|
walletAddress | string |
|
network | enum |
|
consumerReceiptMethod | object |
|
paymentData | object |
|
accountName | string |
|
accountNumber | string |
|
bankName | string |
|
Last updated