# Get Started

XendBridge APIs Documentation

XendBridge is a product of Binance and Google Launchpad-backed Xend Finance, which offers a peer-to-peer system that allows businesses to securely transact between fiat and cryptocurrency.

Below are the complete list and documentation of our external Restful APIs. You will also be able to utilize and test all of our APIs from here.

## Want to dive deep?

Dive a little deeper and start exploring our API reference to get an idea of everything that's possible with the API:

{% content-ref url="/pages/4HNcd9LyoOZDM4AzZkTm" %}
[API Reference](/reference/api-reference)
{% endcontent-ref %}

### Dashboard Walkthrough

To integrate seamlessly with XendBridge, sign up to our [website ](https://xendbridge.com)and provide a valid business document. Notify the team after successful signup and your account will get activated and you can begin testing on our test environment.

<figure><img src="/files/9OnUyFehzZ2hWf9Hcru7" alt=""><figcaption></figcaption></figure>

<figure><img src="/files/dzeKMClYuLJHlEAuZ7U5" alt=""><figcaption></figcaption></figure>

The first step after signing up, you would create a new **application** and upload a logo.

<div align="left"><figure><img src="/files/uqYPvcSQ7Eva3zCNJJ1i" alt=""><figcaption></figcaption></figure> <figure><img src="/files/JOfbnEMQXWFiVx9vJU3F" alt=""><figcaption></figcaption></figure></div>

Then the next step after creating the new app is to add supported **currencies** to the application.

<figure><img src="/files/SyDabD7hOudKKggUNhm4" alt=""><figcaption></figcaption></figure>

Next, we'd set an order timeout for your application for buying, selling, or swapping orders.

<figure><img src="/files/MlshBmsLbhBcBKle6vG5" alt=""><figcaption></figcaption></figure>

<figure><img src="/files/0GAXPVeO6e6t4yUpPEov" alt=""><figcaption></figcaption></figure>

Final step, we would then add the supported **payment methods** for the application.

<figure><img src="/files/460FgvSMu40FmzUZB0Yd" alt=""><figcaption></figcaption></figure>

### Get Your Secret and Public Keys <a href="#keys" id="keys"></a>

Your API requests are authenticated using **public** and **secret** keys. Any request that should require a key but doesn't include it will return an error.

You can get your secret and public key in the webhook section on the dashboard.

<figure><img src="/files/Ha9jx0aAnSwsVxCdPKQI" alt=""><figcaption></figcaption></figure>

### Renewing Keys

For our quarterly security checks and updates, we advise renewing your public and secret keys on intervals or quarterly. Here's where you can do this;

<figure><img src="/files/pmfS3U0ZcD9etK0HwzoJ" alt=""><figcaption></figcaption></figure>

### Want a quick integration?

If you are looking to quickly integrate xendbridge into your app and process payments, dive into our new **Checkout Portal** feature.

{% content-ref url="/pages/FSIb9uI81WfOc1Uju3oK" %}
[XENDBRIDGE PORTAL](/xendbridge-portal/checkout-url)
{% endcontent-ref %}

**OR**

Install any of our available **SDKs** and make method calls giving you the much-needed response without having to make api calls.

{% content-ref url="/pages/4HweE5Z1wac6h4ELCUbt" %}
[XENDBRIDGE SDKS](/xendbridge-sdks/xendbridge-nodejs-sdk)
{% endcontent-ref %}

## Environments <a href="#environments" id="environments"></a>

We have two base url environments available to third parties, they are the Sandbox and the Live environments.

**Sandbox Base Url**

```
https://canary.xendbridge.com
```

**Live Base Url**

```
https://xendbridge.xend.finance
```

### Socials and Links

[Website](https://xendbridge.com/)


# Third Party Order Operations

XendBridge offers order transactions between customers using multiple payment methods like crypto, bank, momo, mpesa, vodafone cash methods. This has all the endpoints that are needed for an order's operations.

* [Rate](/api-method-calls/third-party-order-operations/rate)
* [Buy Order](/api-method-calls/third-party-order-operations/buy-order)
* [Sell Order](/api-method-calls/third-party-order-operations/sell-order)
* [Swap Order](/api-method-calls/third-party-order-operations/swap-order)
* [Pending Order](/api-method-calls/third-party-order-operations/pending-order)
* [Pay For Order](/api-method-calls/third-party-order-operations/pay-for-order)
* [Cancel Order](/api-method-calls/third-party-order-operations/cancel-order)

### Supported Currencies and Networks <a href="#supported-currencies-networks" id="supported-currencies-networks"></a>

## Supported Currencies and Networks

<mark style="color:blue;">`GET`</mark> `https://canary.xendbridge.com/api/Currency/Currencies`

{% tabs %}
{% tab title="200: OK Success" %}

```json
{
  "data": {
    "currencies": [
      {
        "id": "b5bebc8a-61e4-4074-902c-326c5416179a",
        "name": "BUSD",
        "currencyType": "CRYPTO",
        "currencySymbol": "BUSD",
        "network": "ERC20",
        "networkUrl": null,
        "symbolUrl": "https://d2ey3ce1wbjugu.cloudfront.net/currencies/binance-usd-busd-logo.png",
        "countryFlagUrl": null,
        "currencySymbolText": "BUSD",
        "isActive": true
      },
      {
        "id": "22f4f68b-e988-4e7f-9cd2-fc4171492b55",
        "name": "BUSD",
        "currencyType": "CRYPTO",
        "currencySymbol": "BUSD",
        "network": "BEP20",
        "networkUrl": null,
        "symbolUrl": "https://res.cloudinary.com/chukwuemekanweke/image/upload/c_scale,w_480/v1638458463/currency_logos/binance-usd-busd-logo.png",
        "countryFlagUrl": null,
        "currencySymbolText": "BUSD",
        "isActive": true
      },
      {
        "id": "5fb638b4-0e93-44d5-ad5f-be37d04c12db",
        "name": "CELO",
        "currencyType": "CRYPTO",
        "currencySymbol": "CELO",
        "network": "CELO",
        "networkUrl": "https://d20owwgrrz4drp.cloudfront.net/network-images/celo.png",
        "symbolUrl": "https://d20owwgrrz4drp.cloudfront.net/currencies/celo_token.png",
        "countryFlagUrl": null,
        "currencySymbolText": "CELO",
        "isActive": true
      },
      {
        "id": "c20b9ca7-c213-4d13-b6f4-cdddc311ed2b",
        "name": "CELO EUR",
        "currencyType": "CRYPTO",
        "currencySymbol": "cEUR",
        "network": "CELO",
        "networkUrl": "https://d20owwgrrz4drp.cloudfront.net/network-images/celo.png",
        "symbolUrl": "https://d20owwgrrz4drp.cloudfront.net/currencies/ceur.png",
        "countryFlagUrl": null,
        "currencySymbolText": "cEUR",
        "isActive": true
      },
      {
        "id": "9fd7422d-b4e0-4277-9dad-bbd9e34000f4",
        "name": "CELO USD",
        "currencyType": "CRYPTO",
        "currencySymbol": "cUSD",
        "network": "CELO",
        "networkUrl": "https://d20owwgrrz4drp.cloudfront.net/network-images/celo.png",
        "symbolUrl": "https://d2ey3ce1wbjugu.cloudfront.net/currencies/cUSD.jpeg",
        "countryFlagUrl": null,
        "currencySymbolText": "cUSD",
        "isActive": true
      },
      {
        "id": "cbfacbc3-837e-4c49-9a14-3a3528bf52dd",
        "name": "Euro",
        "currencyType": "FIAT",
        "currencySymbol": "EUR",
        "network": "LOCAL",
        "networkUrl": null,
        "symbolUrl": null,
        "countryFlagUrl": "https://res.cloudinary.com/chukwuemekanweke/image/upload/v1656575524/xendcashlink_countries_flag/europe.jpg",
        "currencySymbolText": "EUR",
        "isActive": true
      },
      {
        "id": "32c67c0e-ed8f-40fb-ac0d-cb3cd238b710",
        "name": "Ghanaian Cedi",
        "currencyType": "FIAT",
        "currencySymbol": "GHC",
        "network": "LOCAL",
        "networkUrl": null,
        "symbolUrl": "https://res.cloudinary.com/chukwuemekanweke/image/upload/v1621375299/currency_logos/Ghana_Cedi.png",
        "countryFlagUrl": "https://res.cloudinary.com/chukwuemekanweke/image/upload/v1656575522/xendcashlink_countries_flag/ghana.jpg",
        "currencySymbolText": "GHC",
        "isActive": true
      },
      {
        "id": "456cf86a-358b-4048-a905-c03e1c07dc18",
        "name": "Kenyan Shilling",
        "currencyType": "FIAT",
        "currencySymbol": "KES",
        "network": "LOCAL",
        "networkUrl": null,
        "symbolUrl": "https://res.cloudinary.com/chukwuemekanweke/image/upload/v1621375299/currency_logos/Kenyan_Shilling.png",
        "countryFlagUrl": "https://res.cloudinary.com/chukwuemekanweke/image/upload/v1656575523/xendcashlink_countries_flag/kenya.jpg",
        "currencySymbolText": "KES",
        "isActive": true
      },
      {
        "id": "261c3f81-0dd5-4a3f-b9f2-2fc4f37464c9",
        "name": "Nigerian Naira",
        "currencyType": "FIAT",
        "currencySymbol": "NGN",
        "network": "LOCAL",
        "networkUrl": null,
        "symbolUrl": "https://res.cloudinary.com/chukwuemekanweke/image/upload/v1621375343/currency_logos/Naira.png",
        "countryFlagUrl": "https://res.cloudinary.com/chukwuemekanweke/image/upload/v1656575524/xendcashlink_countries_flag/nigeria.jpg",
        "currencySymbolText": "NGN",
        "isActive": true
      },
      {
        "id": "619f1cc1-dba5-4a56-8781-47ba8203ab70",
        "name": "TRX",
        "currencyType": "CRYPTO",
        "currencySymbol": "TRX",
        "network": "TRON",
        "networkUrl": "https://d20owwgrrz4drp.cloudfront.net/network-images/Tron_network.png",
        "symbolUrl": "https://d20owwgrrz4drp.cloudfront.net/currencies/tron.png",
        "countryFlagUrl": null,
        "currencySymbolText": "TRX",
        "isActive": true
      },
      {
        "id": "69245b4c-bed8-4935-b9af-14a31c4f9eda",
        "name": "US Dollar",
        "currencyType": "FIAT",
        "currencySymbol": "USD",
        "network": "LOCAL",
        "networkUrl": null,
        "symbolUrl": "https://res.cloudinary.com/chukwuemekanweke/image/upload/v1621375300/currency_logos/US_Dollar.png",
        "countryFlagUrl": "https://res.cloudinary.com/chukwuemekanweke/image/upload/v1656575523/xendcashlink_countries_flag/usa.jpg",
        "currencySymbolText": "USD",
        "isActive": true
      },
      {
        "id": "7b7698bf-199e-4d2a-af30-23a19ac2d75e",
        "name": "USD Coin",
        "currencyType": "CRYPTO",
        "currencySymbol": "USDC",
        "network": "POLYGON",
        "networkUrl": null,
        "symbolUrl": "https://res.cloudinary.com/oneassets/image/upload/v1660759353/assets/images/qkyd5vf6rjbl0d3tabxo.png",
        "countryFlagUrl": null,
        "currencySymbolText": "USDC",
        "isActive": true
      },
      {
        "id": "5eef3bf8-ee7a-4794-8a83-7c199a9de2a6",
        "name": "USD Coin",
        "currencyType": "CRYPTO",
        "currencySymbol": "USDC",
        "network": "ERC20",
        "networkUrl": null,
        "symbolUrl": "https://d2ey3ce1wbjugu.cloudfront.net/currencies/qkyd5vf6rjbl0d3tabxo.png",
        "countryFlagUrl": null,
        "currencySymbolText": "USDC",
        "isActive": true
      },
      {
        "id": "a9bbcc81-90bf-46a2-8bb7-ec254a782a06",
        "name": "USD Coin",
        "currencyType": "CRYPTO",
        "currencySymbol": "USDC",
        "network": "BEP20",
        "networkUrl": null,
        "symbolUrl": "https://res.cloudinary.com/oneassets/image/upload/v1660759353/assets/images/qkyd5vf6rjbl0d3tabxo.png",
        "countryFlagUrl": null,
        "currencySymbolText": "USDC",
        "isActive": true
      },
      {
        "id": "95080438-3599-42fe-af4d-f8fc590327e6",
        "name": "USD Tether",
        "currencyType": "CRYPTO",
        "currencySymbol": "USDT",
        "network": "ERC20",
        "networkUrl": null,
        "symbolUrl": "https://res.cloudinary.com/chukwuemekanweke/image/upload/v1621375342/currency_logos/USD_Tether.png",
        "countryFlagUrl": null,
        "currencySymbolText": "USDT",
        "isActive": true
      },
      {
        "id": "ddb47913-c57e-441c-9dde-2ac9a3dd9fb0",
        "name": "USD Tether",
        "currencyType": "CRYPTO",
        "currencySymbol": "USDT",
        "network": "BEP20",
        "networkUrl": null,
        "symbolUrl": "https://res.cloudinary.com/chukwuemekanweke/image/upload/v1621375342/currency_logos/USD_Tether.png",
        "countryFlagUrl": null,
        "currencySymbolText": "USDT",
        "isActive": true
      },
      {
        "id": "73df4776-65d1-443e-a7b6-9fa090a5eb99",
        "name": "USD Tether",
        "currencyType": "CRYPTO",
        "currencySymbol": "USDT",
        "network": "TRON",
        "networkUrl": "https://d20owwgrrz4drp.cloudfront.net/network-images/Tron_network.png",
        "symbolUrl": "https://d2ey3ce1wbjugu.cloudfront.net/currencies/USD_Tether.png",
        "countryFlagUrl": null,
        "currencySymbolText": "USDT",
        "isActive": true
      },
      {
        "id": "8d7824b2-e67f-4f7a-b865-8e80ac6f0853",
        "name": "USD Tether",
        "currencyType": "CRYPTO",
        "currencySymbol": "USDT",
        "network": "ERC20",
        "networkUrl": null,
        "symbolUrl": "https://d2ey3ce1wbjugu.cloudfront.net/currencies/USD_Tether.png",
        "countryFlagUrl": null,
        "currencySymbolText": "USDT",
        "isActive": true
      },
      {
        "id": "5925b766-0fc4-4cc6-879e-73c38f5c9e2e",
        "name": "USD Tether",
        "currencyType": "CRYPTO",
        "currencySymbol": "USDT",
        "network": "POLYGON",
        "networkUrl": null,
        "symbolUrl": "https://res.cloudinary.com/chukwuemekanweke/image/upload/v1621375342/currency_logos/USD_Tether.png",
        "countryFlagUrl": null,
        "currencySymbolText": "USDT",
        "isActive": true
      },
      {
        "id": "a0f5f367-977c-4166-8107-620a1b15c40a",
        "name": "Wicrypt Network Token",
        "currencyType": "CRYPTO",
        "currencySymbol": "WNT",
        "network": "POLYGON",
        "networkUrl": null,
        "symbolUrl": "https://assets.coingecko.com/coins/images/21223/small/wicrypt.PNG?1638740788",
        "countryFlagUrl": null,
        "currencySymbolText": "WNT",
        "isActive": true
      },
      {
        "id": "6a5cbade-592b-42b4-a35f-a6cacd2e0a46",
        "name": "Xend",
        "currencyType": "CRYPTO",
        "currencySymbol": "XEND",
        "network": "BEP20",
        "networkUrl": null,
        "symbolUrl": "https://res.cloudinary.com/chukwuemekanweke/image/upload/v1621375343/currency_logos/Xend.png",
        "countryFlagUrl": null,
        "currencySymbolText": "XEND",
        "isActive": true
      }
    ]
  },
  "status": "OK",
  "message": ""
}
```

{% endtab %}
{% endtabs %}

| CurrencyName     | CurrencyCode | CurrencyType | Network |
| ---------------- | ------------ | ------------ | ------- |
| Naira            | **NGN**      | **Fiat**     | LOCAL   |
| Ghana Cedis      | **GHC**      | **Fiat**     | LOCAL   |
| Kenyan Shilings  | **KES**      | **Fiat**     | LOCAL   |
| Euro             | **EUR**      | **Fiat**     | LOCAL   |
| US Dollar        | **USD**      | **Fiat**     | LOCAL   |
| Binance USD      | **BUSD**     | **Crypto**   | BEP20   |
| US Dollar Coin   | **USDC**     | **Crypto**   | BEP20   |
| US Dollar Tether | **USDT**     | **Crypto**   | BEP20   |
| Xend Coin        | **XEND**     | **Crypto**   | BEP20   |
| Wicrypt Token    | **WNT**      | **Crypto**   | POLYGON |
| US Dollar Coin   | **USDC**     | **Crypto**   | POLYGON |
| US Dollar Tether | **USDT**     | **Crypto**   | POLYGON |
| Tron             | **TRX**      | **Crypto**   | TRON    |
| US Dollar Tether | **USDT**     | **Crypto**   | TRON    |
| Celo             | **CELO**     | **Crypto**   | CELO    |
| Celo US Dollar   | **cUSD**     | **Crypto**   | CELO    |
| Celo Euro        | **cEUR**     | **Crypto**   | CELO    |


# Rate

Get Order Rate

The Get Order Rate `GET`endpoint gets the lowest possible exchange rate for an order placed by a consumer from a provider. This requires your `publickey` in the environment variables while the query params passed will be the `payInCurrencyCode` , `payInCurrencyNetwork` ,`recieveInCurrencyCode` , `recieveInCurrencyNetwork` & `orderAmount`.

The returned result will have a `rateValidityInSeconds`, `providerRateAmount`& `providerRateReference`. To get a response for a sell or swap order, switch to desired networks and currency inputs on request and make the call. See the example below;

## .../Rate?payInCurrencyCode=NGN\&payInCurrencyNetwork=LOCAL\&receiveInCurrencyCode=BUSD\&receiveInCurrencyNetwork=BEP20\&orderAmount=500

<mark style="color:blue;">`GET`</mark> `https://canary.xendbridge.com/api/PeerToPeerOrder...`

#### Query Parameters

| Name                                                       | Type    | Description |
| ---------------------------------------------------------- | ------- | ----------- |
| payInCurrencyCode<mark style="color:red;">\*</mark>        | string  | NGN         |
| payInCurrencyNetwork<mark style="color:red;">\*</mark>     | string  | LOCAL       |
| recieveInCurrencyCode<mark style="color:red;">\*</mark>    | string  | BUSD        |
| recieveInCurrencyNetwork<mark style="color:red;">\*</mark> | string  | BEP-20      |
| orderAmount<mark style="color:red;">\*</mark>              | decimal | 500         |

#### Headers

| Name      | Type   | Description       |
| --------- | ------ | ----------------- |
| publicKey | string | {your\_publicKey} |

{% tabs %}
{% tab title="200: OK Success" %}

```json
{
    "data": {
        "exchangeRate": 559.00,
        "maximumAmount": 10000.000000000,
        "minimumAmount": 5.000000000,
        "providerRateReference": "1382CB3D300346E6A183B720181E0D2B",
        "rateValidityInSeconds": 20
    },
    "status": "OK",
    "message": ""
}
```

{% endtab %}

{% tab title="401: Unauthorized " %}

{% endtab %}
{% endtabs %}

{% tabs %}
{% tab title="Request Fields" %}

<table><thead><tr><th>Parameters</th><th width="150">Type</th><th>Definitions</th></tr></thead><tbody><tr><td>payInCurrencyCode</td><td>string</td><td><code>Required</code> The currency to be paid in.</td></tr><tr><td>payInCurrencyNetwork</td><td>string</td><td><code>Required</code> The network of the currency to be paid in.</td></tr><tr><td>receiveInCurrencyCode</td><td>string</td><td><code>Required</code> The currency to be received in.</td></tr><tr><td>receiveInCurrencyNetwork</td><td>string</td><td><code>Required</code> The network of the currency to be receieved in.</td></tr><tr><td>orderAmount</td><td>string</td><td><code>Required</code> The amount of the order.</td></tr></tbody></table>
{% endtab %}

{% tab title="Response Fields" %}

<table><thead><tr><th>Parameters</th><th width="151.66666666666666">Type</th><th>Definitions</th></tr></thead><tbody><tr><td>exchangeRate</td><td>decimal</td><td>This is the exchange rate at which an order could be exchanged for</td></tr><tr><td>maximumAmount</td><td>decimal</td><td>This is the maximum amount a customer can order.</td></tr><tr><td>minimumAmount</td><td>decimal</td><td>This is the minimum amount a customer can order.</td></tr><tr><td>providerRateReference</td><td>string</td><td>This is the reference of the rates of a provider.</td></tr><tr><td>rateValidityInSeconds</td><td>int</td><td>This is the validity of an order rate of a provider in seconds.</td></tr></tbody></table>
{% endtab %}
{% endtabs %}


# 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

<mark style="color:green;">`POST`</mark> `https://canary.xendbridge.com/api/peertopeerorder/buy/initiate`

#### Headers

| Name                                        | Type   | Description       |
| ------------------------------------------- | ------ | ----------------- |
| secretKey<mark style="color:red;">\*</mark> | string | {your\_secretKey} |

#### Request Body

| Name                                                        | Type    | Description                                |
| ----------------------------------------------------------- | ------- | ------------------------------------------ |
| email<mark style="color:red;">\*</mark>                     | string  | <annadoe@gmail.com>                        |
| phoneNumber                                                 | string  | 07012345678                                |
| userName                                                    | string  | annadoe                                    |
| payInCurrencyCode<mark style="color:red;">\*</mark>         | string  | NGN                                        |
| payInCurrencyNetwork<mark style="color:red;">\*</mark>      | string  | LOCAL                                      |
| receieveInCurrencyCode<mark style="color:red;">\*</mark>    | string  | BUSD                                       |
| receieveInCurrencyNetwork<mark style="color:red;">\*</mark> | string  | BEP20                                      |
| orderAmount<mark style="color:red;">\*</mark>               | decimal | 50                                         |
| consumerDepositMethod                                       | object  |                                            |
| paymentMethod<mark style="color:red;">\*</mark>             | string  | Bank                                       |
| paymentData                                                 | object  |                                            |
| accountName<mark style="color:red;">\*</mark>               | string  | John Doe                                   |
| accountNumber<mark style="color:red;">\*</mark>             | string  | 0000187454                                 |
| bankName<mark style="color:red;">\*</mark>                  | string  | Access Bank                                |
| consumerReceiptMethod                                       | object  |                                            |
| paymentMethod<mark style="color:red;">\*</mark>             | string  | Crypto                                     |
| paymentData                                                 | object  |                                            |
| walletAddress<mark style="color:red;">\*</mark>             | String  | 0x52434Ac4BE04393e020c9b16C327d04d4367Cbcd |
| network<mark style="color:red;">\*</mark>                   | string  | BEP-20                                     |

{% tabs %}
{% tab title="200: OK Success" %}

```json
{
    "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": ""
}
```

{% endtab %}

{% tab title="400: Bad Request Iniating another buy order while one is not finished is not allowed." %}

```json
{
    "Status": 2,
    "Message": "You Have A Pending Buy Order",
    "Data": null
}
```

{% endtab %}
{% endtabs %}

<details>

<summary>JSON Request Format</summary>

```json
{
  "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"
    }
  }
}
```

</details>

{% tabs %}
{% tab title="Request Fields" %}

<table><thead><tr><th width="198.11337367685582">Parameters</th><th width="150">Type</th><th width="167">Definitions</th></tr></thead><tbody><tr><td>emailAddress</td><td>string</td><td><code>Required</code> This is the consumer's email address.</td></tr><tr><td>phoneNumber</td><td>string</td><td><code>Required</code> This is the consumer's phone number.</td></tr><tr><td>userName</td><td>string</td><td><code>Required</code> This is the consumer's username</td></tr><tr><td>payInCurrencyCode</td><td>enum</td><td><code>Required</code> This is the currency code to pay with. Must be <code>NGN</code> for buy order.</td></tr><tr><td>receiveInCurrencyCode</td><td>enum</td><td><code>Required</code> This is the currency code to receive the currency in. Must be <code>BUSD</code> for buy order.</td></tr><tr><td>orderAmount</td><td>decimal</td><td><code>Required</code> The order amount by the consumer.</td></tr><tr><td>consumerDepositMethod</td><td>object</td><td><code>Required</code> This holds the properties of the deposit method of the consumer which is are the bank details.</td></tr><tr><td>paymentMethod</td><td>enum</td><td><code>Required</code> The payment method by which transactions are made. It should be <code>BANK</code>for buy order.</td></tr><tr><td>paymentData</td><td>object</td><td><code>Required</code> This holds the properties of the bank details of the consumer.</td></tr><tr><td>accountName</td><td>string</td><td><code>Required</code> This is the account name of the consumer.</td></tr><tr><td>accountNumber</td><td>string</td><td><code>Required</code> The local account number of the consumer</td></tr><tr><td>bankName</td><td>string</td><td><code>Required</code> This is the bank name of the consumer.</td></tr><tr><td>consumerReceiptMethod</td><td>object</td><td><code>Required</code> This holds the properties of the consumer receiving method. The <code>paymentMethod</code> prop must be <code>Crypto</code> .</td></tr><tr><td>paymentData</td><td>object</td><td><code>Required</code> This holds the properties of the consumer receiving account details.</td></tr><tr><td>walletAddress</td><td>string</td><td><code>Required</code> The crypto wallet address of the consumer.</td></tr><tr><td>network</td><td>string</td><td><code>Required</code> This is the network on which the address is on.</td></tr></tbody></table>
{% endtab %}

{% tab title="Response Fields" %}

<table><thead><tr><th width="248.66666666666666">Parameters</th><th width="150">Type</th><th>Definitions</th></tr></thead><tbody><tr><td>orderReference</td><td>string</td><td>This the reference to a particular order.</td></tr><tr><td>receiveInCurrencyCode</td><td>enum</td><td>This is the currency code to receive the currency in.</td></tr><tr><td>payInCurrencyCode</td><td>enum</td><td>This is the currency code to pay with.</td></tr><tr><td>receivableAmount</td><td>decimal</td><td>This the receivable amount of the currency.</td></tr><tr><td>payableAmount</td><td>decimal</td><td>This is the payable amount of the currency.</td></tr><tr><td>providerName</td><td>string</td><td>This the provider's name.</td></tr><tr><td>providerFirstName</td><td>string</td><td>This is the provider's first name.</td></tr><tr><td>providerLastName</td><td>string</td><td>This is the provider's last name.</td></tr><tr><td>providerEmail</td><td>string</td><td>This is the provider's email address.</td></tr><tr><td>initiatedAt</td><td>DateTime</td><td>The date time the order was made.</td></tr><tr><td>orderExpiryDate</td><td>DateTime</td><td>The expiry date time of the order.</td></tr><tr><td>initiatedAtTimestamp</td><td>long</td><td>The time in milliseconds an order was made</td></tr><tr><td>orderExpiryTimestamp</td><td>long</td><td>The time in milliseconds of when thee order will expire.</td></tr><tr><td>fundedProviderAtTimeStamp</td><td>long</td><td>The time of when a customer indicates payment for an order in milliseconds.</td></tr><tr><td>fundedCustomerAtTimeStamp</td><td>long</td><td>The time of when a provider indicates payment of order to the customer in milliseconds</td></tr><tr><td>orderCompletedAtTimeStamp</td><td>long</td><td>The time in milliseconds an order was completed.</td></tr><tr><td>p2POrderStatus</td><td>enum</td><td>The status of the order at the curent time. It could be <code>Submitted</code>, <code>Cancelled</code>, <code>Acknowledged</code>, <code>FundedProvider</code>, <code>FundReceivedFromUser</code>, <code>FundedUser</code>, <code>Completed</code>, <code>OrderTimedOut</code></td></tr><tr><td>disputeStatus</td><td>enum</td><td>The status of the dispute on an order. It could either be <code>NoDispute</code>, <code>DisputeRaisedByCustomer</code>, <code>DisputeRaisedByProvider</code>, <code>DisputeRaisedByBothParties</code>, <code>DisputeResolved</code>or <code>CouldNotBeResolved</code>.</td></tr><tr><td>orderType</td><td>enum</td><td>This is the status of the order, whether it's a <code>Buy</code> or <code>Sell</code>.</td></tr><tr><td>providerContact</td><td>object</td><td>This is holds properties of a provider's contact information.</td></tr><tr><td>phoneNumber</td><td>string</td><td>The phone number of either the provider or customer.</td></tr><tr><td>whatsappNumber</td><td>string</td><td>The whatsapp number of either the provider or customer.</td></tr><tr><td>customerContact</td><td>object</td><td>This holds the props of the contact information.</td></tr><tr><td>email</td><td>string</td><td>This is an email address of the customer.</td></tr><tr><td>name</td><td>string</td><td>This is the name of the customer.</td></tr><tr><td>phoneNumber</td><td>string</td><td>The phone number of the customer</td></tr><tr><td>providerPaymentMethods</td><td>object</td><td>This holds the properties of the payment methods of the provider.</td></tr><tr><td>paymentMethod</td><td>enum</td><td>This is the method of payment. It could be <code>Bank</code> or <code>Crypto</code></td></tr><tr><td>paymentType</td><td>enum</td><td>This is the type of payment. It could be <code>Bank</code>, <code>Crypto</code>, <code>UserName</code>or <code>MobileMoney</code>.</td></tr><tr><td>paymentData</td><td>object</td><td>This holds the properties of the payment method.</td></tr><tr><td>bankName</td><td>string</td><td>The bank name of the the provider or customer.</td></tr><tr><td>accountNumber</td><td>string</td><td>The bank account number of the provider or customer.</td></tr><tr><td>accountName</td><td>string</td><td>The bank account name of the provider or customer.</td></tr><tr><td>currency</td><td>enum</td><td>The currency in which the order was made. It could be <code>BUSD</code> or <code>NGN</code>.</td></tr><tr><td>orderPaymentMethod</td><td>object</td><td>This holds properties of the payment method in which the order is to be made to.</td></tr><tr><td>consumerDepositMethod</td><td>object</td><td>This holds the properties of the consumer deposit details.</td></tr><tr><td>consumerrReceiptMethod</td><td>object</td><td>This holds the properties of the consumer receiving method details.</td></tr><tr><td>walletAddress</td><td>string</td><td>This is the crypto wallet address of the consumer.</td></tr><tr><td>network</td><td>enum</td><td>This is the network currently supported in the system which the wallet address is based on.</td></tr><tr><td>providerTransactionMetadata</td><td>object</td><td>This holds the properties of the transaction metadata of an order.</td></tr></tbody></table>
{% endtab %}
{% endtabs %}


# Sell Order

Initiate Sell Order

The sell 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;

## Initiates a sell order

<mark style="color:green;">`POST`</mark> `https://canary.xendbridge.com/api/peertopeerorder/sell/initiate`

#### Headers

| Name                                        | Type   | Description       |
| ------------------------------------------- | ------ | ----------------- |
| secretKey<mark style="color:red;">\*</mark> | string | {your\_secretKey} |

#### Request Body

| Name                                                        | Type    | Description                                |
| ----------------------------------------------------------- | ------- | ------------------------------------------ |
| email<mark style="color:red;">\*</mark>                     | string  | <annadoe@gmail.com>                        |
| phoneNumber                                                 | string  | 07012345678                                |
| userName                                                    | string  | annadoe                                    |
| payInCurrencyCode<mark style="color:red;">\*</mark>         | string  | BUSD                                       |
| payInCurrencyNetwork<mark style="color:red;">\*</mark>      | string  | BEP-20                                     |
| receieveInCurrencyCode<mark style="color:red;">\*</mark>    | string  | NGN                                        |
| receieveInCurrencyNetwork<mark style="color:red;">\*</mark> | string  | LOCAL                                      |
| orderAmount<mark style="color:red;">\*</mark>               | decimal | 50                                         |
| consumerDepositMethod                                       | object  |                                            |
| paymentMethod<mark style="color:red;">\*</mark>             | string  | Bank                                       |
| paymentData                                                 | object  |                                            |
| accountName<mark style="color:red;">\*</mark>               | string  | John Doe                                   |
| accountNumber<mark style="color:red;">\*</mark>             | string  | 0000187454                                 |
| bankName<mark style="color:red;">\*</mark>                  | string  | Access Bank                                |
| consumerReceiptMethod                                       | object  |                                            |
| paymentMethod<mark style="color:red;">\*</mark>             | string  | Crypto                                     |
| paymentData                                                 | object  |                                            |
| walletAddress<mark style="color:red;">\*</mark>             | String  | 0x52434Ac4BE04393e020c9b16C327d04d4367Cbcd |
| network<mark style="color:red;">\*</mark>                   | string  | BEP-20                                     |

{% tabs %}
{% tab title="200: OK Success" %}

```json
{
  "data": {
    "orderReference": "XS_37b9648ea5eb4e28a02858e4753b057d",
    "receiveInCurrencyCode": "NGN",
    "payInCurrencyCode": "BUSD",
    "receivableAmount": 20895,
    "payableAmount": 50,
    "receivableAmountWithoutMarkup": 0,
    "providerName": "John",
    "providerFirstName": "John",
    "providerLastName": "Doe",
    "providerEmail": "owolabidamilola98@gmail.com",
    "initiatedAt": "2022-05-06T11:08:13.1402548Z",
    "orderExpiryDate": "2022-05-06T11:23:11.3265504Z",
    "initiatedAtTimestamp": 1651835291326,
    "orderExpiryTimestamp": 1651836191326,
    "fundedProviderAtTimeStamp": null,
    "fundedCustomerAtTimeStamp": null,
    "orderCompletedAtTimeStamp": null,
    "p2POrderStatus": "Acknowledged",
    "disputeStatus": "NoDispute",
    "disputeReference": null,
    "orderType": "Sell",
    "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": "QWEVDTWDGVT462E6EFYE9202Y239",
        "network": "BEP20",
        "currency": "BUSD"
      }
    },
    "consumerReceiptMethod": {
      "paymentMethod": "Bank",
      "paymentType": 0,
      "paymentData": {
        "bankName": "Access Bank",
        "accountNumber": "0000187849",
        "accountName": "Emmanuel Diala",
        "currency": "NGN",
        "network": "LOCAL"
      }
    },
    "providerTransactionMetadata": null
  },
  "status": "OK",
  "message": ""
}
```

{% endtab %}

{% tab title="400: Bad Request Iniating another buy order while one is not finished is not allowed." %}

```json
{
    "Status": 2,
    "Message": "You Have A Pending Sell Order",
    "Data": null
}
```

{% endtab %}
{% endtabs %}

<details>

<summary>JSON Request Format</summary>

```json
{
  "emailAddress": "annadoe@gmail.com",
  "phoneNumber": "07064366723",
  "userName": "annadoe",
  "payInCurrencyCode": "BUSD",
  "payInCurrencyNetwork": "BEP20",
  "receiveInCurrencyCode": "NGN",
  "receiveInCurrencyNetwork": "LOCAL",
  "orderAmount": 50,
  "consumerDepositMethod": {
    "paymentMethod": "Crypto",
    "paymentData": {
      "walletAddress": "0x52434Ac4BE04393e020c9b16C327d04d4367Cbcd",
      "network": "BEP20"
    }
  },
  "consumerReceiptMethod": {
    "paymentMethod": "Bank",
    "paymentData": {
      "accountName": "Anna Doe",
      "accountNumber": "0000187849",
      "bankName": "Access Bank"
    }
  }
}
```

</details>

{% tabs %}
{% tab title="Request Fields" %}

| Parameter             | Type    | Definitions                                                                                                      |
| --------------------- | ------- | ---------------------------------------------------------------------------------------------------------------- |
| 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 `CRYPTO`for 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.                                                                |
| {% endtab %}          |         |                                                                                                                  |

{% tab title="Response Fields" %}

<table><thead><tr><th width="209.94541484716154">Parameter</th><th width="150">Type</th><th>Definitions</th></tr></thead><tbody><tr><td>orderReference</td><td>string</td><td>This the reference to a particular order.</td></tr><tr><td>receiveInCurrencyCode</td><td>enum</td><td>This is the currency code to receive the currency in.</td></tr><tr><td>payInCurrencyCode</td><td>enum</td><td>This is the currency code to pay with.</td></tr><tr><td>receivableAmount</td><td>decimal</td><td>This the receivable amount of the currency.</td></tr><tr><td>payableAmount</td><td>decimal</td><td>This is the payable amount of the currency.</td></tr><tr><td>providerName</td><td>string</td><td>This the provider's name.</td></tr><tr><td>providerFirstName</td><td>string</td><td>This is the provider's first name.</td></tr><tr><td>providerLastName</td><td>string</td><td>This is the provider's last name.</td></tr><tr><td>providerEmail</td><td>string</td><td>This is the provider's email address.</td></tr><tr><td>initiatedAt</td><td>DateTime</td><td>The date time the order was made.</td></tr><tr><td>orderExpiryDate</td><td>DateTime</td><td>The expiry date time of the order.</td></tr><tr><td>initiatedAtTimestamp</td><td>long</td><td>The time in milliseconds an order was made</td></tr><tr><td>orderExpiryTimestamp</td><td>long</td><td>The time in milliseconds of when thee order will expire.</td></tr><tr><td>fundedProviderAtTimeStamp</td><td>long</td><td>The time of when a customer indicates payment for an order in milliseconds.</td></tr><tr><td>fundedCustomerAtTimeStamp</td><td>long</td><td>The time of when a provider indicates payment of order to the customer in milliseconds</td></tr><tr><td>orderCompletedAtTimeStamp</td><td>long</td><td>The time in milliseconds an order was completed.</td></tr><tr><td>p2POrderStatus</td><td>enum</td><td>The status of the order at the curent time. It could be <code>Submitted</code>, <code>Cancelled</code>, <code>Acknowledged</code>, <code>FundedProvider</code>, <code>FundReceivedFromUser</code>, <code>FundedUser</code>, <code>Completed</code>, <code>OrderTimedOut</code></td></tr><tr><td>disputeStatus</td><td>enum</td><td>The status of the dispute on an order. It could either be <code>NoDispute</code>, <code>DisputeRaisedByCustomer</code>, <code>DisputeRaisedByProvider</code>, <code>DisputeRaisedByBothParties</code>, <code>DisputeResolved</code>or <code>CouldNotBeResolved</code>.</td></tr><tr><td>orderType</td><td>enum</td><td>This is the status of the order, whether it's a <code>Buy</code> or <code>Sell</code>.</td></tr><tr><td>providerContact</td><td>object</td><td>This is holds props of a provider's contact information.</td></tr><tr><td>phoneNumber</td><td>string</td><td>The phone number of either the provider or customer.</td></tr><tr><td>whatsappNumber</td><td>string</td><td>The whatsapp number of either the provider or customer.</td></tr><tr><td>customerContact</td><td>object</td><td>This holds the props of the contact information.</td></tr><tr><td>email</td><td>string</td><td>This is an email address of the customer.</td></tr><tr><td>name</td><td>string</td><td>This is the name of the customer.</td></tr><tr><td>phoneNumber</td><td>string</td><td>The phone number of the customer</td></tr><tr><td>providerPaymentMethods</td><td>object</td><td>This holds the props of the payment methods of the provider.</td></tr><tr><td>paymentMethod</td><td>enum</td><td>This is the method of payment. It could be <code>Bank</code> or <code>Crypto</code></td></tr><tr><td>paymentType</td><td>enum</td><td>This is the type of payment. It could be <code>Bank</code>, <code>Crypto</code>, <code>UserName</code>or <code>MobileMoney</code>.</td></tr><tr><td>paymentData</td><td>object</td><td>This holds the props of the payment method.</td></tr><tr><td>bankName</td><td>string</td><td>The bank name of the the provider or customer.</td></tr><tr><td>accountNumber</td><td>string</td><td>The bank account number of the provider or customer.</td></tr><tr><td>accountName</td><td>string</td><td>The bank account name of the provider or customer.</td></tr><tr><td>currency</td><td>enum</td><td>The currency in which the order was made. It could be <code>BUSD</code> or <code>NGN</code>.</td></tr><tr><td>orderPaymentMethod</td><td>object</td><td>This holds props of the payment method in which the order is to be made to.</td></tr><tr><td>consumerDepositMethod</td><td>object</td><td>This holds the props of the consumer deposit details.</td></tr><tr><td>consumerrReceiptMethod</td><td>object</td><td>This holds the props of the consumer receiving method details.</td></tr><tr><td>walletAddress</td><td>string</td><td>This is the crypto wallet address of the consumer.</td></tr><tr><td>network</td><td>enum</td><td>This is the network currently supported in the system which the wallet address is based on.</td></tr><tr><td>providerTransactionMetadata</td><td>obj</td><td>This holds the props of the transaction metadata of an order.</td></tr></tbody></table>

{% endtab %}
{% endtabs %}


# 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

<mark style="color:green;">`POST`</mark> `https://canary.xendbridge.com/api/peertopeerorder/swap/initiate`

#### Headers

| Name                                        | Type   | Description       |
| ------------------------------------------- | ------ | ----------------- |
| secretKey<mark style="color:red;">\*</mark> | string | {your\_secretKey} |

#### Request Body

| Name                                                        | Type    | Description                                |
| ----------------------------------------------------------- | ------- | ------------------------------------------ |
| email<mark style="color:red;">\*</mark>                     | string  | <annadoe@gmail.com>                        |
| phoneNumber                                                 | string  | 07012345678                                |
| userName                                                    | string  | annadoe                                    |
| payInCurrencyCode<mark style="color:red;">\*</mark>         | string  | BUSD                                       |
| payInCurrencyNetwork<mark style="color:red;">\*</mark>      | string  | BEP20                                      |
| receieveInCurrencyCode<mark style="color:red;">\*</mark>    | string  | USDT                                       |
| receieveInCurrencyNetwork<mark style="color:red;">\*</mark> | string  | POLYGON                                    |
| orderAmount<mark style="color:red;">\*</mark>               | decimal | 50                                         |
| consumerDepositMethod                                       | object  |                                            |
| paymentMethod<mark style="color:red;">\*</mark>             | string  | Crypto                                     |
| paymentData                                                 | object  |                                            |
| consumerReceiptMethod                                       | object  |                                            |
| paymentMethod<mark style="color:red;">\*</mark>             | string  | Crypto                                     |
| paymentData                                                 | object  |                                            |
| walletAddress<mark style="color:red;">\*</mark>             | String  | 0x52434Ac4BE04393e020c9b16C327d04d4367Cbcd |
| network<mark style="color:red;">\*</mark>                   | string  | POLYGON                                    |
| walletAddress                                               | string  | 0x52434Ac4BE04393e020c9b16C327d04d4367Cbcd |
| network                                                     | string  | BEP-20                                     |

{% tabs %}
{% tab title="200: OK Success" %}

```json
{
    "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": ""
}
```

{% endtab %}

{% tab title="400: Bad Request Iniating another buy order while one is not finished is not allowed." %}

```json
{
    "Status": 2,
    "Message": "You Have A Pending Swap Order",
    "Data": null
}
```

{% endtab %}
{% endtabs %}

<details>

<summary>Crypto-Crypto JSON Request Format</summary>

```json
{
  "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"
    }
  }
}
```

</details>

<details>

<summary>Fiat-Fiat JSON Request Format</summary>

```json
{
  "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"
    }
  }
}
```

</details>

{% tabs %}
{% tab title="Request Field" %}

| Parameter             | Type    | Definitions                                                                                                      |
| --------------------- | ------- | ---------------------------------------------------------------------------------------------------------------- |
| 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 `CRYPTO`for 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.                                                                |
| {% endtab %}          |         |                                                                                                                  |

{% tab title="Response Fields" %}

<table><thead><tr><th width="209.94541484716154">Parameter</th><th width="150">Type</th><th>Definitions</th></tr></thead><tbody><tr><td>orderReference</td><td>string</td><td>This the reference to a particular order.</td></tr><tr><td>receiveInCurrencyCode</td><td>enum</td><td>This is the currency code to receive the currency in.</td></tr><tr><td>payInCurrencyCode</td><td>enum</td><td>This is the currency code to pay with.</td></tr><tr><td>receivableAmount</td><td>decimal</td><td>This the receivable amount of the currency.</td></tr><tr><td>payableAmount</td><td>decimal</td><td>This is the payable amount of the currency.</td></tr><tr><td>providerName</td><td>string</td><td>This the provider's name.</td></tr><tr><td>providerFirstName</td><td>string</td><td>This is the provider's first name.</td></tr><tr><td>providerLastName</td><td>string</td><td>This is the provider's last name.</td></tr><tr><td>providerEmail</td><td>string</td><td>This is the provider's email address.</td></tr><tr><td>initiatedAt</td><td>DateTime</td><td>The date time the order was made.</td></tr><tr><td>orderExpiryDate</td><td>DateTime</td><td>The expiry date time of the order.</td></tr><tr><td>initiatedAtTimestamp</td><td>long</td><td>The time in milliseconds an order was made</td></tr><tr><td>orderExpiryTimestamp</td><td>long</td><td>The time in milliseconds of when thee order will expire.</td></tr><tr><td>fundedProviderAtTimeStamp</td><td>long</td><td>The time of when a customer indicates payment for an order in milliseconds.</td></tr><tr><td>fundedCustomerAtTimeStamp</td><td>long</td><td>The time of when a provider indicates payment of order to the customer in milliseconds</td></tr><tr><td>orderCompletedAtTimeStamp</td><td>long</td><td>The time in milliseconds an order was completed.</td></tr><tr><td>p2POrderStatus</td><td>enum</td><td>The status of the order at the curent time. It could be <code>Submitted</code>, <code>Cancelled</code>, <code>Acknowledged</code>, <code>FundedProvider</code>, <code>FundReceivedFromUser</code>, <code>FundedUser</code>, <code>Completed</code>, <code>OrderTimedOut</code></td></tr><tr><td>disputeStatus</td><td>enum</td><td>The status of the dispute on an order. It could either be <code>NoDispute</code>, <code>DisputeRaisedByCustomer</code>, <code>DisputeRaisedByProvider</code>, <code>DisputeRaisedByBothParties</code>, <code>DisputeResolved</code>or <code>CouldNotBeResolved</code>.</td></tr><tr><td>orderType</td><td>enum</td><td>This is the status of the order, whether it's a <code>Buy</code> or <code>Sell</code>.</td></tr><tr><td>providerContact</td><td>object</td><td>This is holds props of a provider's contact information.</td></tr><tr><td>phoneNumber</td><td>string</td><td>The phone number of either the provider or customer.</td></tr><tr><td>whatsappNumber</td><td>string</td><td>The whatsapp number of either the provider or customer.</td></tr><tr><td>customerContact</td><td>object</td><td>This holds the props of the contact information.</td></tr><tr><td>email</td><td>string</td><td>This is an email address of the customer.</td></tr><tr><td>name</td><td>string</td><td>This is the name of the customer.</td></tr><tr><td>phoneNumber</td><td>string</td><td>The phone number of the customer</td></tr><tr><td>providerPaymentMethods</td><td>object</td><td>This holds the props of the payment methods of the provider.</td></tr><tr><td>paymentMethod</td><td>enum</td><td>This is the method of payment. It could be <code>Bank</code> or <code>Crypto</code></td></tr><tr><td>paymentType</td><td>enum</td><td>This is the type of payment. It could be <code>Bank</code>, <code>Crypto</code>, <code>UserName</code>or <code>MobileMoney</code>.</td></tr><tr><td>paymentData</td><td>object</td><td>This holds the props of the payment method.</td></tr><tr><td>bankName</td><td>string</td><td>The bank name of the the provider or customer.</td></tr><tr><td>accountNumber</td><td>string</td><td>The bank account number of the provider or customer.</td></tr><tr><td>accountName</td><td>string</td><td>The bank account name of the provider or customer.</td></tr><tr><td>currency</td><td>enum</td><td>The currency in which the order was made. It could be <code>BUSD</code> or <code>NGN</code>.</td></tr><tr><td>orderPaymentMethod</td><td>object</td><td>This holds props of the payment method in which the order is to be made to.</td></tr><tr><td>consumerDepositMethod</td><td>object</td><td>This holds the props of the consumer deposit details.</td></tr><tr><td>consumerrReceiptMethod</td><td>object</td><td>This holds the props of the consumer receiving method details.</td></tr><tr><td>walletAddress</td><td>string</td><td>This is the crypto wallet address of the consumer.</td></tr><tr><td>network</td><td>enum</td><td>This is the network currently supported in the system which the wallet address is based on.</td></tr><tr><td>providerTransactionMetadata</td><td>o</td><td>This holds the props of the transaction metadata of an order.</td></tr></tbody></table>

{% endtab %}
{% endtabs %}


# Pending Order

Get Pending Order

This `GET` endpoint gets a pending order of a third party customer. The `publicKey` is passed in the header while only an `emailAddress` is passed as a param. See the example below;

## Get pending order

<mark style="color:blue;">`GET`</mark> `https://canary.xendbridge.com/api/PeerToPeerOrder/ThirdParty/PendingOrder?emailAddress=annadoe@gmail.com`

#### Query Parameters

| Name                                           | Type | Description         |
| ---------------------------------------------- | ---- | ------------------- |
| emailAddress<mark style="color:red;">\*</mark> |      | <johndoe@gmail.com> |

#### Headers

| Name                                        | Type | Description |
| ------------------------------------------- | ---- | ----------- |
| secretKey<mark style="color:red;">\*</mark> |      | {secretKey} |

{% tabs %}
{% tab title="200: OK Success" %}

```javascript
{
    "data": {
        "orderStatus": "ProcessingRequest",
        "orderResponse": {
            "orderReference": "XB_91ee6ac1b2204022b07b5c17bddc2a35",
            "receiveInCurrencyCode": "BUSD",
            "payInCurrencyCode": "NGN",
            "receivableAmount": 0.1234347,
            "payableAmount": 69,
            "providerName": "Nnadozie Ohaeri",
            "providerFirstName": "Nnadozie",
            "providerLastName": "Ohaeri",
            "providerEmail": "dozienna4@gmail.com",
            "initiatedAt": "2022-02-07T09:59:03.1476901",
            "orderExpiryDate": "2022-02-07T10:14:03.1476901",
            "initiatedAtTimestamp": 1644227943147,
            "orderExpiryTimestamp": 1644228843147,
            "fundedProviderAtTimeStamp": 1644230393293,
            "fundedCustomerAtTimeStamp": 1644230684456,
            "orderCompletedAtTimeStamp": null,
            "p2POrderStatus": "FundedUser",
            "disputeStatus": "NoDispute",
            "disputeReference": "",
            "orderType": "Buy",
            "providerContact": {
                "phoneNumber": "2348062069869",
                "whatsappNumber": "2348062069869"
            },
            "customerContact": {
                "email": "JOHNDOE@gmail.com",
                "name": "John Doe",
                "phoneNumber": "0706346XXXX"
            },
            "providerPaymentMethods": {
                "paymentMethod": "Bank",
                "paymentType": "Bank",
                "paymentData": [
                    {
                        "bankName": "Access",
                        "accountNumber": "0069888440",
                        "accountName": "Ohaeri Nnadozie",
                        "currency": "NGN"
                    }
                ],
                "orderPaymentMethod": {
                    "bankName": "Access",
                    "accountNumber": "0069888440",
                    "accountName": "Ohaeri Nnadozie",
                    "currency": "NGN"
                }
            },
            "consumerDepositMethod": {
                "paymentMethod": "Bank",
                "paymentType": 0,
                "paymentData": {
                    "bankName": "Access Bank",
                    "accountNumber": "0000187849",
                    "accountName": "Emmanuel Diala",
                    "currency": "NGN"
                }
            },
            "consumerReceiptMethod": {
                "paymentMethod": "Crypto",
                "paymentType": 0,
                "paymentData": {
                    "walletAddress": "QWEVDTWDGVT462E6EFYE9202Y239",
                    "network": "BEP20",
                    "currency": "BUSD"
                }
            },
            "providerTransactionMetadata": {
                "cryptoPaymentNetwork": "BEP20",
                "cryptoTransactionHash": "0xe1577054fcca2dee00081fdd30757aa3c9895da806e26620a62a65cdc2cca375",
                "transactionVerificationUrl": "https://testnet.bscscan.com/tx0xe1577054fcca2dee00081fdd30757aa3c9895da806e26620a62a65cdc2cca375"
            }
        }
    },
    "status": "OK",
    "message": ""
}
```

{% endtab %}
{% endtabs %}

{% tabs %}
{% tab title="Request Fields" %}

<table><thead><tr><th>Parameter</th><th width="150">Type</th><th>Definitions</th></tr></thead><tbody><tr><td>emailAddress</td><td>string</td><td><code>Required</code> This is the consumer's email address.</td></tr></tbody></table>
{% endtab %}

{% tab title="Response Fields" %}

<table><thead><tr><th width="150">Parameters</th><th width="150">Type</th><th>Definitions</th></tr></thead><tbody><tr><td>orderStatus</td><td>enum</td><td>This the current status of an order when being placed. It can either be <code>ProcessingRequest</code> or <code>Available</code>.</td></tr><tr><td>orderResponse</td><td>object</td><td>This holds the <code>orderReference</code> objects and properties.</td></tr><tr><td>orderReference</td><td>string</td><td>This the reference to a particular order.</td></tr><tr><td>recieveInCurrencyCode</td><td>enum</td><td>This is the currency code to receive the currency in.</td></tr><tr><td>payInCurrencyCode</td><td>enum</td><td>This is the currency code to pay with.</td></tr><tr><td>receivableAmount</td><td>decimal</td><td>This the receivable amount of the currency.</td></tr><tr><td>payableAmount</td><td>decimal</td><td>This is the payable amount of the currency.</td></tr><tr><td>providerName</td><td>string</td><td>This the provider's name.</td></tr><tr><td>providerFirstName</td><td>string</td><td>This is the provider's first name.</td></tr><tr><td>providerLastName</td><td>string</td><td>This is the provider's last name.</td></tr><tr><td>providerEmail</td><td>string</td><td>This is the provider's email address.</td></tr><tr><td>initiatedAt</td><td>DateTime</td><td>The date time the order was made.</td></tr><tr><td>orderExpiryDate</td><td>DateTime</td><td>The expiry date time of the order.</td></tr><tr><td>initiatedAtTimestamp</td><td>long</td><td>The time in milliseconds an order was made</td></tr><tr><td>orderExpiryTimestamp</td><td>long</td><td>The time in milliseconds of when thee order will expire.</td></tr><tr><td>fundedProviderAtTimeStamp</td><td>long</td><td>The time of when a customer indicates payment for an order in milliseconds.</td></tr><tr><td>fundedCustomerAtTimeStamp</td><td>long</td><td>The time of when a provider indicates payment of order to the customer in milliseconds</td></tr><tr><td>orderCompletedAtTimeStamp</td><td>long</td><td>The time in milliseconds an order was completed.</td></tr><tr><td>p2POrderStatus</td><td>enum</td><td>The status of the order at the curent time. It could be <code>Submitted</code>, <code>Cancelled</code>, <code>Acknowledged</code>, <code>FundedProvider</code>, <code>FundReceivedFromUser</code>, <code>FundedUser</code>, <code>Completed</code>, <code>OrderTimedOut</code></td></tr><tr><td>disputeStatus</td><td>enum</td><td>The status of the dispute on an order. It could either be <code>NoDispute</code>, <code>DisputeRaisedByCustomer</code>, <code>DisputeRaisedByProvider</code>, <code>DisputeRaisedByBothParties</code>, <code>DisputeResolved</code>or <code>CouldNotBeResolved</code>.</td></tr><tr><td>disputeReference</td><td>string</td><td><code>Required</code> This is the reference value of a dispute on an order.</td></tr><tr><td>orderType</td><td>enum</td><td>This is the status of the order, whether it's a <code>Buy</code> or <code>Sell</code>.</td></tr><tr><td>providerContact</td><td>object</td><td>This is holds properties of a provider's contact information.</td></tr><tr><td>phoneNumber</td><td>string</td><td>The phone number of either the provider or customer.</td></tr><tr><td>whatsappNumber</td><td>string</td><td>The whatsapp number of either the provider or customer.</td></tr><tr><td>customerContact</td><td>object</td><td>This holds the properties of the contact information.</td></tr><tr><td>email</td><td>string</td><td>This is an email address of the customer.</td></tr><tr><td>name</td><td>string</td><td>This is the name of the customer.</td></tr><tr><td>phoneNumber</td><td>string</td><td>The phone number of the customer</td></tr><tr><td>providerPaymentMethods</td><td>object</td><td>This holds the properties of the payment methods of the provider.</td></tr><tr><td>paymentMethod</td><td>enum</td><td>This is the method of payment. It could be <code>Bank</code> or <code>Crypto</code></td></tr><tr><td>paymentType</td><td>enum</td><td>This is the type of payment. It could be <code>Bank</code>, <code>Crypto</code>, <code>UserName</code>or <code>MobileMoney</code>.</td></tr><tr><td>paymentData</td><td>object</td><td>This holds the properties of the payment method.</td></tr><tr><td>bankName</td><td>string</td><td>The bank name of the the provider or customer.</td></tr><tr><td>accountNumber</td><td>string</td><td>The bank account number of the provider or customer.</td></tr><tr><td>accountName</td><td>string</td><td>The bank account name of the provider or customer.</td></tr><tr><td>currency</td><td>enum</td><td>The currency in which the order was made. It could be <code>BUSD</code> or <code>NGN</code>.</td></tr><tr><td>orderPaymentMethod</td><td>object</td><td>This holds properties of the payment method in which the order is to be made to.</td></tr><tr><td>consumerDepositMethod</td><td>object</td><td>This holds the properties of the consumer deposit details.</td></tr><tr><td>consumerrReceiptMethod</td><td>object</td><td>This holds the properties of the consumer receiving method details.</td></tr><tr><td>walletAddress</td><td>string</td><td>This is the crypto wallet address of the consumer.</td></tr><tr><td>network</td><td>enum</td><td>This is the network currently supported in the system which the wallet address is based on.</td></tr><tr><td>providerTransactionMetadata</td><td>o</td><td>This holds the properties of the transaction metadata of an order.</td></tr></tbody></table>
{% endtab %}
{% endtabs %}

### Get Pending Order By Reference

This `GET` endpoint gets a pending order of a third party customer. The `publicKey` is passed in the header while the `orderReference` is passed as a param. See the example below;

## Get pending order by reference

<mark style="color:blue;">`GET`</mark> `https://canary.xendbridge.com/api/PeerToPeerOrder/ThirdParty/Order/Reference`

#### Query Parameters

| Name                                             | Type   | Description                          |
| ------------------------------------------------ | ------ | ------------------------------------ |
| orderReference<mark style="color:red;">\*</mark> | string | XB\_e1315fb1c9fd419998046ab96062361c |

#### Headers

| Name                                        | Type | Description |
| ------------------------------------------- | ---- | ----------- |
| secretKey<mark style="color:red;">\*</mark> |      | {secretKey} |

{% tabs %}
{% tab title="200: OK Success" %}

```json
{
  "data": {
    "appId": "a490997c-a816-40b1-0d4c-08d9667359ad",
    "appName": "Xend Finance",
    "clientContact": {
      "phoneNumber": "07064366723",
      "name": "johnfoe",
      "emailAddress": "johnfoe@gmail.com"
    },
    "orderDetail": {
      "orderReference": "XB_e1315fb1c9fd419998046ab96062361c",
      "thirdPartyAppName": "Xend Finance",
      "disputeReference": null,
      "orderType": "Buy",
      "orderStatus": "Acknowledged",
      "disputeStatus": "NoDispute",
      "receiveInCurrencyCode": "USDC",
      "payInCurrencyCode": "NGN",
      "receiveInCurrencyNetwork": "BEP20",
      "payInCurrencyNetwork": "LOCAL",
      "receivableAmount": 0.11904762,
      "receivableAmountWithoutMarkup": 0.11904762,
      "payableAmount": 50,
      "rate": 420,
      "initiatedAt": "2022-08-24T14:49:51.0699807",
      "orderExpiryDate": "2022-08-24T14:54:51.0699807",
      "initiatedAtTimestamp": 1661352591069,
      "orderExpiryTimestamp": 1661352891069,
      "fundedProviderAtTimeStamp": null,
      "fundedCustomerAtTimeStamp": null,
      "estimatedOrderCompletionTimestamp": null,
      "orderCompletedAtTimeStamp": null,
      "markupDetail": null
    },
    "providerContact": {
      "phoneNumber": "2348181186644",
      "whatsappNumber": "",
      "name": "John Doe",
      "emailAddress": "owolabidamilola98@gmail.com",
      "providerReference": "DFDFE062107A43E88B602DA14607A8A3"
    },
    "clientPaymentMethod": "Bank",
    "liquidityProviderPaymentOption": {
      "paymentMethod": "Bank",
      "paymentType": 0,
      "paymentData": [
        {
          "bankName": "Access",
          "accountNumber": "0709876786",
          "accountName": "John Doe",
          "address": null,
          "swiftCode": null,
          "iban": null,
          "sortCode": null,
          "currency": "NGN",
          "network": "LOCAL"
        }
      ],
      "orderPaymentMethod": {
        "bankName": "Access",
        "accountNumber": "0709876786",
        "accountName": "John Doe",
        "address": null,
        "swiftCode": null,
        "iban": null,
        "sortCode": null,
        "currency": "NGN",
        "network": "LOCAL"
      }
    },
    "clientDepositPaymentOption": {
      "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"
      }
    },
    "clientReceiptPaymentOption": {
      "paymentMethod": "Crypto",
      "paymentType": 0,
      "paymentData": {
        "walletAddress": "0x30b7D85f7CF498D556a9448243a7994bc4660790",
        "network": "BEP20",
        "currency": "USDC"
      }
    },
    "liquidityProviderTransactionMetadata": null,
    "customerTransactionMetadata": null
  },
  "status": "OK",
  "message": ""
}
```

{% endtab %}
{% endtabs %}


# Pay For Order

Confirm Order Payment

This `POST` endpoint confirms a buy or sell order for a third-party customer indicating a successful transfer of funds. Only the `secretkey` is passed in the header while the request to be made would contain only an `emailAddress` and `orderReference`.

If successful returns a "Payment made successfully" `200`message.

## Pay for order

<mark style="color:green;">`POST`</mark> `https://canary.xendbridge.com/api/PeerToPeerOrder/ThirdParty/Order/Confirm`

#### Headers

| Name                                        | Type   | Description |
| ------------------------------------------- | ------ | ----------- |
| secretKey<mark style="color:red;">\*</mark> | String | {secretKey} |

#### Request Body

| Name                                              | Type   | Description                                                        |
| ------------------------------------------------- | ------ | ------------------------------------------------------------------ |
| emailAddress<mark style="color:red;">\*</mark>    | String | <johndoe@gmail.com>                                                |
| orderReference<mark style="color:red;">\*</mark>  | String | XB\_0877e5692ee946f491bafab275d3d522                               |
| transactionHash<mark style="color:red;">\*</mark> | String | 0xcfa4a293e6fd903329e9c035f4f17dafbd0dbd9b76b613be5cd2ba7b7a4baaa7 |

{% tabs %}
{% tab title="200: OK Success" %}

```javascript
{
    "data": true,
    "status": "OK",
    "message": "Payment Updated Successfully"
}
```

{% endtab %}
{% endtabs %}

{% tabs %}
{% tab title="Request Fields" %}

<table><thead><tr><th width="165.66666666666666">Parameters</th><th width="150">Type</th><th>Definitions</th></tr></thead><tbody><tr><td>emailAddress</td><td>string</td><td><code>Required</code> The email address of the third party client.</td></tr><tr><td>orderReference</td><td>string</td><td><code>Required</code> The order reference of an order made.</td></tr><tr><td>transactionHash</td><td>string</td><td><code>Required</code> The unique hash of a transaction on the blockchain network</td></tr></tbody></table>
{% endtab %}

{% tab title="Response Fields" %}

<table><thead><tr><th width="176.66666666666666">Parameters</th><th width="150">Type</th><th>Definitions</th></tr></thead><tbody><tr><td>data</td><td>bool</td><td>This can either be true or false.</td></tr><tr><td>status</td><td>string</td><td>This returns a status message of the request.</td></tr><tr><td>message</td><td>string</td><td>This returns either <code>Payment updated successfully</code> if success, or <code>Failed to update payment status. Please try again later</code> if failed.</td></tr></tbody></table>
{% endtab %}
{% endtabs %}


# Cancel Order

The `POST` endpoint accepts the request of `emailAddress` & `orderReference` of the third-party customer to cancel orders made. The `secretKey` is also needed here in the header.

If successful returns an " " `200`message. See the example below;

## Cancel order

<mark style="color:green;">`POST`</mark> `https://canary.xendbridge.com/api/PeerToPeerOrder/ThirdParty/Order/Cancel`

#### Headers

| Name                                        | Type | Description |
| ------------------------------------------- | ---- | ----------- |
| secretKey<mark style="color:red;">\*</mark> |      | {secretkey} |

#### Request Body

| Name                                             | Type | Description                          |
| ------------------------------------------------ | ---- | ------------------------------------ |
| emailAddress<mark style="color:red;">\*</mark>   |      | <johndoe@gmail.com>                  |
| orderReference<mark style="color:red;">\*</mark> |      | XB\_0877e5692ee946f491bafab275d3d522 |

{% tabs %}
{% tab title="200: OK Success" %}

```javascript
{
    "data": true,
    "status": "OK",
    "message": ""
}
```

{% endtab %}
{% endtabs %}

{% tabs %}
{% tab title="Request Fields" %}

<table><thead><tr><th width="195.66666666666666">Parameters</th><th width="150">Type</th><th>Definitions</th></tr></thead><tbody><tr><td>emailAddress</td><td>string</td><td><code>Required</code> The email address of the third party client.</td></tr><tr><td>orderReference</td><td>string</td><td><code>Required</code> The order reference of an order made.</td></tr></tbody></table>
{% endtab %}

{% tab title="Response Fields" %}

<table><thead><tr><th width="150">Parameters</th><th width="150">Type</th><th>Definitions</th></tr></thead><tbody><tr><td>data</td><td>bool</td><td>This can either be true or false.</td></tr><tr><td>status</td><td>string</td><td>This returns a status message of the request.</td></tr><tr><td>message</td><td>string</td><td>This returns an empty string if successful.</td></tr></tbody></table>
{% endtab %}
{% endtabs %}


# LP Simulation

Liquidity Provider Simulation

The Liquidity Provider Simulation has the Pay For Order `POST` api endpoint to ensure payment is successful between a payment provider and a consumer in a sandboxed or test environment. This validates successful funding from the provider to the customer and completes the order.

There are two endpoints in this section. They are:

* [Pay for order (Buy Order)](broken://pages/ccQGWED2rw8oFAfV7QAI)
* [Pay for order (Sell Order)](broken://pages/hPRe2CnbDnF5RiGr7C3P)


# Pay For Order (Buy Order)

{% hint style="info" %}
This is the endpoint to be called after confirming that a customer has made a payment. This initiates a process of crediting the customer from the liquidity provider for a ***buy order***.
{% endhint %}

## Pay for order (buy order from customer)

<mark style="color:green;">`POST`</mark> `https://canary.xendbridge.com/api/LPSimulation/Order/Receipt`

#### Request Body

| Name                                             | Type   | Description                          |
| ------------------------------------------------ | ------ | ------------------------------------ |
| orderReference<mark style="color:red;">\*</mark> | string | XB\_e8715feef57b4cd4af4b738cf6db8e25 |

{% tabs %}
{% tab title="200: OK Success" %}

```json
{
    "data": true,
    "status": "OK",
    "message": "Customer Payout Initiated Successfully"
}
```

{% endtab %}
{% endtabs %}


# Pay For Order (Sell Order)

{% hint style="info" %}
This is the endpoint to be called after confirming that a customer has made a payment. This initiates a process of crediting the customer from the liquidity provider for a ***sell order***.
{% endhint %}

## Pay for order (sell order)

<mark style="color:green;">`POST`</mark> `https://canary.xendbridge.com/api/LPSimulation/Order/Confirm`

#### Request Body

| Name                                              | Type                                                               | Description |
| ------------------------------------------------- | ------------------------------------------------------------------ | ----------- |
| orderReference<mark style="color:red;">\*</mark>  | XS\_37b9648ea5eb4e28a02858e4753b057d                               |             |
| paymentNetwork<mark style="color:red;">\*</mark>  | BEP-20                                                             |             |
| transactionHash<mark style="color:red;">\*</mark> | 0x9ab06442203745216301f15e83b4abbf2dccc8e15d64d7fd2c281da4b68f0131 |             |

{% tabs %}
{% tab title="200: OK Success" %}
{% code overflow="wrap" %}

```javascript
{
    "data": "Payment Updated Successfully",
    "status": "OK",
    "message": ""
}
```

{% endcode %}
{% endtab %}
{% endtabs %}

{% tabs %}
{% tab title="Request Fields" %}

<table><thead><tr><th width="183.66666666666666">Parameters</th><th width="150">Type</th><th>Definitions</th></tr></thead><tbody><tr><td>orderReference</td><td>string</td><td><code>Required</code> The order reference number made by the consumer.</td></tr><tr><td>paymentNetwork</td><td>string</td><td><code>Required</code> The payment network on which the crypto payment was made on.</td></tr><tr><td>transactionalHash</td><td>string</td><td><code>Required</code> The hash string that validates a particular order in the system.</td></tr></tbody></table>
{% endtab %}

{% tab title="Response Fields" %}

<table><thead><tr><th width="150">Parameters</th><th width="154.42838456507522">Type</th><th>Definitions</th></tr></thead><tbody><tr><td>data</td><td>bool</td><td>This can either be true or false.</td></tr><tr><td>status</td><td>string</td><td>This returns a status message of the request.</td></tr><tr><td>message</td><td>string</td><td>This returns either <code>P2P payment updated successfully</code> if success, or <code>Failed to update payment status. Please try again later</code> if failed.</td></tr></tbody></table>
{% endtab %}
{% endtabs %}


# Dispute

Xendbridge Dispute Chat System

These are issues or disputes raised by a third-party client on a particular order(s). XendBridge ensures accountability and assurance of proposed transactions of orders to be executed swiftly and precisely. It contains two endpoints and a walkthrough implementation of our chat SDK.

* [Raise Third Party Dispute](/api-method-calls/dispute/raise-third-party-dispute)
* [Get All Disputes Raised By Third Party](/api-method-calls/dispute/get-all-disputes)
* [XendBridge Chat SDK](/api-method-calls/dispute/xendbridge-chat-sdk)


# Raise Third Party Dispute

Create third party dispute

This raises a third-party dispute. Disputes can only be raised for orders that has not been completed or that have not been canceled, the email used must be the email of the customer who placed the order. This should direct you to our chat hub implementation.

## Raise a dispute

<mark style="color:green;">`POST`</mark> `https://canary.xendbridge.com/api/Dispute/ThirdParty/RaiseDispute`

#### Headers

| Name                                        | Type | Description |
| ------------------------------------------- | ---- | ----------- |
| publicKey<mark style="color:red;">\*</mark> |      | {publicKey} |

#### Request Body

| Name                                             | Type | Description                                                                                                           |
| ------------------------------------------------ | ---- | --------------------------------------------------------------------------------------------------------------------- |
| orderReference<mark style="color:red;">\*</mark> |      | XB\_60a08393c17142f584563741ee9c834c                                                                                  |
| remark<mark style="color:red;">\*</mark>         |      | I have paid but yet to receive my crypto                                                                              |
| base64Attachment                                 |      | iVBORw0KGgoAAAANSUhEUgAAB9AAAAfQCAYAAACaOMR5AAAACXBIWXMAAAsTAAALEwEAmpwYAAAAGXRFWHRTb2Z0d2FyZQB3d3cuaW5rc2NhcGUub3Jnm |
| emailAddress<mark style="color:red;">\*</mark>   |      | <johndoe@gmail.com>                                                                                                   |

{% tabs %}
{% tab title="200: OK Success" %}

```javascript
{
    "data": {
        "isSuccessful": true,
        "reason": "",
        "disputeReference": "XB_1c69997f72624ed69dc880868dfae93f"
    },
    "status": "OK",
    "message": ""
}
```

{% endtab %}
{% endtabs %}

{% tabs %}
{% tab title="Request Fields" %}

<table><thead><tr><th width="202.66666666666666">Parameters</th><th width="150">Type</th><th>Definitions</th></tr></thead><tbody><tr><td>emailAddress</td><td>string</td><td><code>Required</code> The email address of the third party client.</td></tr><tr><td>orderReference</td><td>string</td><td><code>Required</code> The order reference of an order made.</td></tr><tr><td>remark</td><td>string</td><td><code>Required</code> This is a remark to be left by the consumer.</td></tr><tr><td>base64Attachment</td><td>string</td><td>This is a base64 converted string of an uploaded document.</td></tr></tbody></table>
{% endtab %}

{% tab title="Response Fields" %}

<table><thead><tr><th width="150">Parameters</th><th width="150">Type</th><th>Definitions</th></tr></thead><tbody><tr><td>data</td><td>object</td><td>This holds the properties: <code>IsSuccessful</code> and <code>reason</code>.</td></tr><tr><td>isSuccessful</td><td>bool</td><td>This returns either true or false.</td></tr><tr><td>reason</td><td>string</td><td>This returns empty if successful.</td></tr><tr><td>status</td><td>string</td><td>The status of the request.</td></tr><tr><td>message</td><td>string</td><td>This returns empty if successful.</td></tr><tr><td>disputeReference</td><td>string</td><td>This is a unqiue reference of any dispute raised in the system.</td></tr></tbody></table>
{% endtab %}
{% endtabs %}


# Get All Disputes

Get all disputes raised in a third party application

This `GET` endpoint gets all disputes made by a third party. For the params to be passed, the `startDate` and `endDate` has to be a converted date time in seconds. The `disputeStatus` can be either 'OpenDispute', 'DisputeBeingAttendedTo' or 'DisputeResolved'. The `pagenumber` and `pageSize` are to be included.

The `publicKey` is to be passed in the header as it's required.

## ...\&disputeStatus=DisputeResolved\&page=1\&pageSize=50

<mark style="color:blue;">`GET`</mark> `https://canary.xendbridge.com/api/Dispute/ThirdParty?startDate=1632756987000&endDate=1638027387000...`

Gets all disputes in a third party application.

#### Query Parameters

| Name                                            | Type | Description     |
| ----------------------------------------------- | ---- | --------------- |
| startDate<mark style="color:red;">\*</mark>     |      | 1632756987000   |
| endDate<mark style="color:red;">\*</mark>       |      | 1638027387000   |
| disputeStatus<mark style="color:red;">\*</mark> |      | DisputeResolved |
| page                                            |      | 1               |
| pageSize                                        |      | 50              |

#### Headers

| Name                                        | Type | Description |
| ------------------------------------------- | ---- | ----------- |
| publicKey<mark style="color:red;">\*</mark> |      | {publicKey} |

{% tabs %}
{% tab title="200: OK Success" %}

```javascript
{
    "data": {
        "records": [
            {
                "id": "7a5a3420-f5ec-45d1-7528-08d99a4da05d",
                "attachmentUrl": null,
                "orderReference": "XB_25981ba069034a3da85caf2962228a7d",
                "orderId": "d9d532e8-d674-410f-1d98-08d99a44c420",
                "orderDate": 1635458254445,
                "disputeRaisedAt": 1635458516255,
                "disputeLastUpdated": 1638174491805,
                "disputeStatus": "DisputeResolved",
                "disputeRaisedBy": "Third Party Customer",
                "disputeRemark": "okay",
                "disputeComment": "When the clear button should appear on the right side of the text view. This property is supported only for single-line TextInput component. The default value is never.",
                "payInCurrency": "NGN",
                "rceiveInCurrency": "BUSD",
                "payInAmount": 50000.000000000,
                "receiveInAmount": 100.000000000,
                "clientPaymentMethod": "Bank",
                "thirdPartyAppName": "Xend Finance",
                "providerName": "John Doe",
                "providerEmail": "ediala94@gmail.com",
                "providerPhone": "2348181186644",
                "customerName": "Chidelu",
                "customerEmail": "emekanweke604@gmail.com",
                "customerPhone": "08167828970",
                "disputeChats": [
                    {
                        "id": "754e02a0-2022-41c8-c1ff-08d99a4da060",
                        "receievedAt": "2021-10-28T22:01:56.255244",
                        "receievedAtTimestamp": 1635458516255.244,
                        "sentBy": "ThirdPartyClient",
                        "sentTo": "All",
                        "senderName": "Chidelu",
                        "message": "When the clear button should appear on the right side of the text view. This property is supported only for single-line TextInput component. The default value is never."
                    },
                    {
                        "id": "3c863d48-031a-45fc-c200-08d99a4da060",
                        "receievedAt": "2021-10-28T22:02:06.512169",
                        "receievedAtTimestamp": 1635458526512.169,
                        "sentBy": "ThirdPartyClient",
                        "sentTo": "All",
                        "senderName": "Chidelu",
                        "message": "hello chima"
                    },
                    {
                        "id": "596f8a08-78e4-44b0-3961-08d9b30f8bad",
                        "receievedAt": "2021-11-29T08:27:31.8829569",
                        "receievedAtTimestamp": 1638174451882.9568,
                        "sentBy": "Support",
                        "sentTo": "All",
                        "senderName": "Chukwuemeka Nweke",
                        "message": "hey"
                    },
                    {
                        "id": "73c7ca81-bd50-4a5e-3962-08d9b30f8bad",
                        "receievedAt": "2021-11-29T08:27:44.2995441",
                        "receievedAtTimestamp": 1638174464299.544,
                        "sentBy": "Support",
                        "sentTo": "All",
                        "senderName": "Chukwuemeka Nweke",
                        "message": "hey"
                    },
                    {
                        "id": "e3bc8ced-39c5-4cc2-3963-08d9b30f8bad",
                        "receievedAt": "2021-11-29T08:28:11.8055098",
                        "receievedAtTimestamp": 1638174491805.5098,
                        "sentBy": "Support",
                        "sentTo": "All",
                        "senderName": "Chukwuemeka Nweke",
                        "message": "okay"
                    }
                ]
            },
            {
                "id": "418d660b-49b9-4044-7529-08d99a4da05d",
                "attachmentUrl": null,
                "orderReference": "XB_df46d91b824e41199e602b8035104e2e",
                "orderId": "3e47e5b2-7e70-47ef-1d99-08d99a44c420",
                "orderDate": 1635460013146,
                "disputeRaisedAt": 1635460051177,
                "disputeLastUpdated": 1638174369236,
                "disputeStatus": "DisputeResolved",
                "disputeRaisedBy": "Third Party Customer",
                "disputeRemark": "hey",
                "disputeComment": "this.timer = setInterval(()=> this.getMovies(), 1000)",
                "payInCurrency": "NGN",
                "rceiveInCurrency": "BUSD",
                "payInAmount": 100000.000000000,
                "receiveInAmount": 200.000000000,
                "clientPaymentMethod": "Bank",
                "thirdPartyAppName": "Xend Finance",
                "providerName": "John Doe",
                "providerEmail": "ediala94@gmail.com",
                "providerPhone": "2348181186644",
                "customerName": "Chidelu",
                "customerEmail": "emekanweke604@gmail.com",
                "customerPhone": "08167828970",
                "disputeChats": [
                    {
                        "id": "65cf8519-1182-4a7d-c201-08d99a4da060",
                        "receievedAt": "2021-10-28T22:27:31.1773387",
                        "receievedAtTimestamp": 1635460051177.3389,
                        "sentBy": "ThirdPartyClient",
                        "sentTo": "All",
                        "senderName": "Chidelu",
                        "message": "this.timer = setInterval(()=> this.getMovies(), 1000)"
                    },
                    {
                        "id": "f79527c3-7972-4b33-c202-08d99a4da060",
                        "receievedAt": "2021-10-28T22:32:42.6369408",
                        "receievedAtTimestamp": 1635460362636.941,
                        "sentBy": "ThirdPartyClient",
                        "sentTo": "All",
                        "senderName": "Chidelu",
                        "message": "the native element are .focus() and .blur() that will focus or blur the TextInput programmatically."
                    },
                    {
                        "id": "bf23e917-9d4c-4e77-5c3e-08d9afa44c2e",
                        "receievedAt": "2021-11-26T05:39:12.3901362",
                        "receievedAtTimestamp": 1637905152390.1362,
                        "sentBy": "Support",
                        "sentTo": "All",
                        "senderName": "Chukwuemeka Nweke",
                        "message": "ok"
                    },
                    {
                        "id": "d5b4e8ef-a7b8-4049-5c3f-08d9afa44c2e",
                        "receievedAt": "2021-11-26T05:40:20.2357149",
                        "receievedAtTimestamp": 1637905220235.7148,
                        "sentBy": "Support",
                        "sentTo": "All",
                        "senderName": "Chukwuemeka Nweke",
                        "message": "mm"
                    },
                    {
                        "id": "abc10f39-029e-4cfa-3960-08d9b30f8bad",
                        "receievedAt": "2021-11-29T08:26:09.2365532",
                        "receievedAtTimestamp": 1638174369236.5532,
                        "sentBy": "Support",
                        "sentTo": "All",
                        "senderName": "Chukwuemeka Nweke",
                        "message": "hey"
                    }
                ]
            },
            {
                "id": "2198864a-d787-41df-7cf6-08d9995fa7dc",
                "attachmentUrl": null,
                "orderReference": "XB_efc9586ece82461296be3e68a3281739",
                "orderId": "389567ca-3858-44fb-e71b-08d9995e3c26",
                "orderDate": 1635428798665,
                "disputeRaisedAt": 1635429430665,
                "disputeLastUpdated": 1638173359880,
                "disputeStatus": "DisputeResolved",
                "disputeRaisedBy": "Third Party Customer",
                "disputeRemark": "Okay",
                "disputeComment": "The getStateForAction method of the stack navigator's router can be modified as follows to achieve the expected back behavior.",
                "payInCurrency": "NGN",
                "rceiveInCurrency": "BUSD",
                "payInAmount": 1161000.000000000,
                "receiveInAmount": 2322.000000000,
                "clientPaymentMethod": "Bank",
                "thirdPartyAppName": "Xend Finance",
                "providerName": "John Doe",
                "providerEmail": "ediala94@gmail.com",
                "providerPhone": "2348181186644",
                "customerName": "Chidelu",
                "customerEmail": "emekanweke604@gmail.com",
                "customerPhone": "08167828970",
                "disputeChats": [
                    {
                        "id": "b5bb870b-34b1-43ee-d260-08d9995fa7e0",
                        "receievedAt": "2021-10-28T13:57:10.6656149",
                        "receievedAtTimestamp": 1635429430665.6147,
                        "sentBy": "ThirdPartyClient",
                        "sentTo": "All",
                        "senderName": "Chidelu",
                        "message": "The getStateForAction method of the stack navigator's router can be modified as follows to achieve the expected back behavior."
                    },
                    {
                        "id": "ad2147ff-08e7-4f96-5c4a-08d9afa44c2e",
                        "receievedAt": "2021-11-26T06:06:23.4754561",
                        "receievedAtTimestamp": 1637906783475.456,
                        "sentBy": "Support",
                        "sentTo": "All",
                        "senderName": "Chukwuemeka Nweke",
                        "message": "nmn"
                    },
                    {
                        "id": "a3e0fc11-5294-4321-395f-08d9b30f8bad",
                        "receievedAt": "2021-11-29T08:09:19.8806259",
                        "receievedAtTimestamp": 1638173359880.626,
                        "sentBy": "Support",
                        "sentTo": "All",
                        "senderName": "Chukwuemeka Nweke",
                        "message": "Okay"
                    }
                ]
            },
            {
                "id": "2af51f59-c5f1-4eae-5a34-08d99cbfa641",
                "attachmentUrl": null,
                "orderReference": "XB_fe21a06121894c15ba9a5b79a1f5dfe8",
                "orderId": "372fc51a-6d59-47c6-605b-08d99cbf017f",
                "orderDate": 1635727833495,
                "disputeRaisedAt": 1635727951609,
                "disputeLastUpdated": 1637906877118,
                "disputeStatus": "DisputeResolved",
                "disputeRaisedBy": "Third Party Customer",
                "disputeRemark": "dfghj",
                "disputeComment": "When calling the show method, you can use the following options to suit your needs. Everything is optional, unless specified otherwise.",
                "payInCurrency": "NGN",
                "rceiveInCurrency": "BUSD",
                "payInAmount": 100000.000000000,
                "receiveInAmount": 200.000000000,
                "clientPaymentMethod": "Bank",
                "thirdPartyAppName": "Xend Finance",
                "providerName": "John Doe",
                "providerEmail": "ediala94@gmail.com",
                "providerPhone": "2348181186644",
                "customerName": "Chidelu",
                "customerEmail": "emekanweke604@gmail.com",
                "customerPhone": "08167828970",
                "disputeChats": [
                    {
                        "id": "b5bb2edb-cb62-422e-a046-08d99cbfa644",
                        "receievedAt": "2021-11-01T00:52:31.609691",
                        "receievedAtTimestamp": 1635727951609.691,
                        "sentBy": "ThirdPartyClient",
                        "sentTo": "All",
                        "senderName": "Chidelu",
                        "message": "When calling the show method, you can use the following options to suit your needs. Everything is optional, unless specified otherwise."
                    },
                    {
                        "id": "3cf44836-0d68-4f2d-a047-08d99cbfa644",
                        "receievedAt": "2021-11-01T00:52:55.3496128",
                        "receievedAtTimestamp": 1635727975349.6128,
                        "sentBy": "ThirdPartyClient",
                        "sentTo": "All",
                        "senderName": "Chidelu",
                        "message": "The usage of | below, means that only one of the values show should be used. If only one value is shown, that's the default."
                    },
                    {
                        "id": "ca67df63-334d-4e35-5c4b-08d9afa44c2e",
                        "receievedAt": "2021-11-26T06:07:57.118096",
                        "receievedAtTimestamp": 1637906877118.096,
                        "sentBy": "Support",
                        "sentTo": "All",
                        "senderName": "Chukwuemeka Nweke",
                        "message": "dfghj"
                    }
                ]
            },
            {
                "id": "4accce10-a92a-4735-7525-08d99a4da05d",
                "attachmentUrl": null,
                "orderReference": "XB_34a523ebfbe04e22b396649c6e6e5048",
                "orderId": "f226c1df-be90-4136-1d94-08d99a44c420",
                "orderDate": 1635454082538,
                "disputeRaisedAt": 1635454262892,
                "disputeLastUpdated": 1637906746893,
                "disputeStatus": "DisputeResolved",
                "disputeRaisedBy": "Third Party Customer",
                "disputeRemark": "adjksmf",
                "disputeComment": "navigation.navigate('p2pTransferConfirm');",
                "payInCurrency": "NGN",
                "rceiveInCurrency": "BUSD",
                "payInAmount": 100000.000000000,
                "receiveInAmount": 200.000000000,
                "clientPaymentMethod": "Bank",
                "thirdPartyAppName": "Xend Finance",
                "providerName": "John Doe",
                "providerEmail": "ediala94@gmail.com",
                "providerPhone": "2348181186644",
                "customerName": "Chidelu",
                "customerEmail": "emekanweke604@gmail.com",
                "customerPhone": "08167828970",
                "disputeChats": [
                    {
                        "id": "94e37043-35ea-4f0e-c1fa-08d99a4da060",
                        "receievedAt": "2021-10-28T20:51:02.8923334",
                        "receievedAtTimestamp": 1635454262892.3335,
                        "sentBy": "ThirdPartyClient",
                        "sentTo": "All",
                        "senderName": "Chidelu",
                        "message": "navigation.navigate('p2pTransferConfirm');"
                    },
                    {
                        "id": "217ae0f7-1b79-493b-c1fb-08d99a4da060",
                        "receievedAt": "2021-10-28T21:29:44.2519024",
                        "receievedAtTimestamp": 1635456584251.9023,
                        "sentBy": "ThirdPartyClient",
                        "sentTo": "All",
                        "senderName": "Chidelu",
                        "message": "You can center absolute items by providing the left property with the width of the device divided by two and subtracting out half of the element you'd like to center's width."
                    },
                    {
                        "id": "76df209b-9f89-4d03-c1fc-08d99a4da060",
                        "receievedAt": "2021-10-28T21:30:38.9915914",
                        "receievedAtTimestamp": 1635456638991.5913,
                        "sentBy": "ThirdPartyClient",
                        "sentTo": "All",
                        "senderName": "Chidelu",
                        "message": "Hi"
                    },
                    {
                        "id": "3ef3c0d9-7620-4512-5c47-08d9afa44c2e",
                        "receievedAt": "2021-11-26T06:01:31.9081443",
                        "receievedAtTimestamp": 1637906491908.1443,
                        "sentBy": "Support",
                        "sentTo": "All",
                        "senderName": "Chukwuemeka Nweke",
                        "message": "nm,"
                    },
                    {
                        "id": "4801a7c5-d7a7-4097-5c48-08d9afa44c2e",
                        "receievedAt": "2021-11-26T06:02:02.7087528",
                        "receievedAtTimestamp": 1637906522708.7527,
                        "sentBy": "Support",
                        "sentTo": "All",
                        "senderName": "Chukwuemeka Nweke",
                        "message": "ghbj"
                    },
                    {
                        "id": "f2051303-31f7-4ad8-5c49-08d9afa44c2e",
                        "receievedAt": "2021-11-26T06:05:46.8930619",
                        "receievedAtTimestamp": 1637906746893.062,
                        "sentBy": "Support",
                        "sentTo": "All",
                        "senderName": "Chukwuemeka Nweke",
                        "message": "adjksmf"
                    }
                ]
            },
            {
                "id": "d976f85d-9a60-484c-7cf3-08d9995fa7dc",
                "attachmentUrl": null,
                "orderReference": "XB_a583594e2bdb4b5bae5e4d5a2718ba92",
                "orderId": "3840ee71-8e7b-4389-e719-08d9995e3c26",
                "orderDate": 1635427050524,
                "disputeRaisedAt": 1635427075263,
                "disputeLastUpdated": 1637906457578,
                "disputeStatus": "DisputeResolved",
                "disputeRaisedBy": "Third Party Customer",
                "disputeRemark": "jhkl",
                "disputeComment": "Wrap the child you want centered in a View and make the View absolute",
                "payInCurrency": "NGN",
                "rceiveInCurrency": "BUSD",
                "payInAmount": 171000.000000000,
                "receiveInAmount": 342.000000000,
                "clientPaymentMethod": "Bank",
                "thirdPartyAppName": "Xend Finance",
                "providerName": "John Doe",
                "providerEmail": "ediala94@gmail.com",
                "providerPhone": "2348181186644",
                "customerName": "Chidelu",
                "customerEmail": "emekanweke604@gmail.com",
                "customerPhone": "08167828970",
                "disputeChats": [
                    {
                        "id": "c3425b5f-864f-4b42-d25b-08d9995fa7e0",
                        "receievedAt": "2021-10-28T13:17:55.2639398",
                        "receievedAtTimestamp": 1635427075263.9397,
                        "sentBy": "ThirdPartyClient",
                        "sentTo": "All",
                        "senderName": "Chidelu",
                        "message": "Wrap the child you want centered in a View and make the View absolute"
                    },
                    {
                        "id": "ba837993-00ac-4370-d25c-08d9995fa7e0",
                        "receievedAt": "2021-10-28T13:27:44.0750522",
                        "receievedAtTimestamp": 1635427664075.0522,
                        "sentBy": "ThirdPartyClient",
                        "sentTo": "All",
                        "senderName": "Chidelu",
                        "message": "Wrap the child you want centered in a View and make the View absolute\n"
                    },
                    {
                        "id": "1727a5c4-47d5-4249-d25d-08d9995fa7e0",
                        "receievedAt": "2021-10-28T13:28:54.5105309",
                        "receievedAtTimestamp": 1635427734510.5308,
                        "sentBy": "ThirdPartyClient",
                        "sentTo": "All",
                        "senderName": "Chidelu",
                        "message": "Doesn't this make the View take up ALL clickable space on the screen? E.g if I had a component underneath this absolutely positioned View, I wouldn't be able to register clicks on it"
                    },
                    {
                        "id": "45ea058e-5d5f-4881-5c44-08d9afa44c2e",
                        "receievedAt": "2021-11-26T05:55:57.2923207",
                        "receievedAtTimestamp": 1637906157292.3208,
                        "sentBy": "Support",
                        "sentTo": "All",
                        "senderName": "Chukwuemeka Nweke",
                        "message": "hey"
                    },
                    {
                        "id": "4c7bbd7d-4577-4b33-5c45-08d9afa44c2e",
                        "receievedAt": "2021-11-26T05:57:06.451844",
                        "receievedAtTimestamp": 1637906226451.844,
                        "sentBy": "Support",
                        "sentTo": "All",
                        "senderName": "Chukwuemeka Nweke",
                        "message": "bnm,"
                    },
                    {
                        "id": "39f804fa-ef84-488f-5c46-08d9afa44c2e",
                        "receievedAt": "2021-11-26T06:00:57.5783618",
                        "receievedAtTimestamp": 1637906457578.3618,
                        "sentBy": "Support",
                        "sentTo": "All",
                        "senderName": "Chukwuemeka Nweke",
                        "message": "jhkl"
                    }
                ]
            },
            {
                "id": "bae632e9-cf8f-4343-7523-08d99a4da05d",
                "attachmentUrl": null,
                "orderReference": "XB_4e833c157c9f4faf8d7fff74527755e8",
                "orderId": "3fe87502-b021-4688-1d92-08d99a44c420",
                "orderDate": 1635448375736,
                "disputeRaisedAt": 1635451244322,
                "disputeLastUpdated": 1637905909480,
                "disputeStatus": "DisputeResolved",
                "disputeRaisedBy": "Third Party Customer",
                "disputeRemark": "bnb",
                "disputeComment": "Note that some props are only available with multiline={true/false}. Additionally, border styles that apply to ",
                "payInCurrency": "NGN",
                "rceiveInCurrency": "BUSD",
                "payInAmount": 100000.000000000,
                "receiveInAmount": 200.000000000,
                "clientPaymentMethod": "Bank",
                "thirdPartyAppName": "Xend Finance",
                "providerName": "John Doe",
                "providerEmail": "ediala94@gmail.com",
                "providerPhone": "2348181186644",
                "customerName": "Chidelu",
                "customerEmail": "emekanweke604@gmail.com",
                "customerPhone": "08167828970",
                "disputeChats": [
                    {
                        "id": "b5e75148-b59d-43e8-c1f8-08d99a4da060",
                        "receievedAt": "2021-10-28T20:00:44.3229466",
                        "receievedAtTimestamp": 1635451244322.9465,
                        "sentBy": "ThirdPartyClient",
                        "sentTo": "All",
                        "senderName": "Chidelu",
                        "message": "Note that some props are only available with multiline={true/false}. Additionally, border styles that apply to "
                    },
                    {
                        "id": "f44281cf-ba56-467a-5c42-08d9afa44c2e",
                        "receievedAt": "2021-11-26T05:51:38.1580584",
                        "receievedAtTimestamp": 1637905898158.0583,
                        "sentBy": "Support",
                        "sentTo": "All",
                        "senderName": "Chukwuemeka Nweke",
                        "message": "jhk"
                    },
                    {
                        "id": "aa8e7fd3-14e1-40fc-5c43-08d9afa44c2e",
                        "receievedAt": "2021-11-26T05:51:49.4804844",
                        "receievedAtTimestamp": 1637905909480.4844,
                        "sentBy": "Support",
                        "sentTo": "All",
                        "senderName": "Chukwuemeka Nweke",
                        "message": "bnb"
                    }
                ]
            },
            {
                "id": "e1ced55c-14da-4324-7cf5-08d9995fa7dc",
                "attachmentUrl": null,
                "orderReference": "XB_efc9586ece82461296be3e68a3281739",
                "orderId": "389567ca-3858-44fb-e71b-08d9995e3c26",
                "orderDate": 1635428798665,
                "disputeRaisedAt": 1635429218458,
                "disputeLastUpdated": 1637905455375,
                "disputeStatus": "DisputeResolved",
                "disputeRaisedBy": "Third Party Customer",
                "disputeRemark": "m,,,",
                "disputeComment": "The getStateForAction method of the stack navigator's router can be modified as follows to achieve the expected back behavior.",
                "payInCurrency": "NGN",
                "rceiveInCurrency": "BUSD",
                "payInAmount": 1161000.000000000,
                "receiveInAmount": 2322.000000000,
                "clientPaymentMethod": "Bank",
                "thirdPartyAppName": "Xend Finance",
                "providerName": "John Doe",
                "providerEmail": "ediala94@gmail.com",
                "providerPhone": "2348181186644",
                "customerName": "Chidelu",
                "customerEmail": "emekanweke604@gmail.com",
                "customerPhone": "08167828970",
                "disputeChats": [
                    {
                        "id": "8977de2d-753e-4e57-d25f-08d9995fa7e0",
                        "receievedAt": "2021-10-28T13:53:38.4581802",
                        "receievedAtTimestamp": 1635429218458.1802,
                        "sentBy": "ThirdPartyClient",
                        "sentTo": "All",
                        "senderName": "Chidelu",
                        "message": "The getStateForAction method of the stack navigator's router can be modified as follows to achieve the expected back behavior."
                    },
                    {
                        "id": "e7efbd43-2ba5-434b-5c41-08d9afa44c2e",
                        "receievedAt": "2021-11-26T05:44:15.3755189",
                        "receievedAtTimestamp": 1637905455375.5188,
                        "sentBy": "Support",
                        "sentTo": "All",
                        "senderName": "Chukwuemeka Nweke",
                        "message": "m,,,"
                    }
                ]
            },
            {
                "id": "6d663c09-b769-4e50-7527-08d99a4da05d",
                "attachmentUrl": null,
                "orderReference": "XB_4776da8b3dfc4e24b2f60e41e38ad69c",
                "orderId": "65417645-ea56-419a-1d96-08d99a44c420",
                "orderDate": 1635457796619,
                "disputeRaisedAt": 1635458013465,
                "disputeLastUpdated": 1637905252900,
                "disputeStatus": "DisputeResolved",
                "disputeRaisedBy": "Third Party Customer",
                "disputeRemark": "mmm nm",
                "disputeComment": "When the clear button should appear on the right side of the text view. This property is supported only for single-line TextInput component. The default value is never.",
                "payInCurrency": "NGN",
                "rceiveInCurrency": "BUSD",
                "payInAmount": 1621500.000000000,
                "receiveInAmount": 3243.000000000,
                "clientPaymentMethod": "Bank",
                "thirdPartyAppName": "Xend Finance",
                "providerName": "John Doe",
                "providerEmail": "ediala94@gmail.com",
                "providerPhone": "2348181186644",
                "customerName": "Chidelu",
                "customerEmail": "emekanweke604@gmail.com",
                "customerPhone": "08167828970",
                "disputeChats": [
                    {
                        "id": "65b85a98-787d-4ef7-c1fe-08d99a4da060",
                        "receievedAt": "2021-10-28T21:53:33.4657404",
                        "receievedAtTimestamp": 1635458013465.7405,
                        "sentBy": "ThirdPartyClient",
                        "sentTo": "All",
                        "senderName": "Chidelu",
                        "message": "When the clear button should appear on the right side of the text view. This property is supported only for single-line TextInput component. The default value is never."
                    },
                    {
                        "id": "f4142c38-ea27-4974-5c40-08d9afa44c2e",
                        "receievedAt": "2021-11-26T05:40:52.9009754",
                        "receievedAtTimestamp": 1637905252900.9753,
                        "sentBy": "Support",
                        "sentTo": "All",
                        "senderName": "Chukwuemeka Nweke",
                        "message": "mmm nm"
                    }
                ]
            },
            {
                "id": "1540bc69-7a65-4e1f-5a35-08d99cbfa641",
                "attachmentUrl": null,
                "orderReference": "XB_977d2ff2a5a84f71ae630e372d13f58f",
                "orderId": "3c55b919-9ab6-47fb-605c-08d99cbf017f",
                "orderDate": 1635728202293,
                "disputeRaisedAt": 1635728540009,
                "disputeLastUpdated": 1637905075400,
                "disputeStatus": "DisputeResolved",
                "disputeRaisedBy": "Third Party Customer",
                "disputeRemark": "Hey",
                "disputeComment": "The usage of | below, means that only one of the values show should be used. If only one value is shown, that's the default.\n",
                "payInCurrency": "NGN",
                "rceiveInCurrency": "BUSD",
                "payInAmount": 61500.000000000,
                "receiveInAmount": 123.000000000,
                "clientPaymentMethod": "Bank",
                "thirdPartyAppName": "Xend Finance",
                "providerName": "John Doe",
                "providerEmail": "ediala94@gmail.com",
                "providerPhone": "2348181186644",
                "customerName": "Chidelu",
                "customerEmail": "emekanweke604@gmail.com",
                "customerPhone": "08167828970",
                "disputeChats": [
                    {
                        "id": "8b14a434-cf4f-45d0-a048-08d99cbfa644",
                        "receievedAt": "2021-11-01T01:02:20.0099151",
                        "receievedAtTimestamp": 1635728540009.9153,
                        "sentBy": "ThirdPartyClient",
                        "sentTo": "All",
                        "senderName": "Chidelu",
                        "message": "The usage of | below, means that only one of the values show should be used. If only one value is shown, that's the default.\n"
                    },
                    {
                        "id": "06b6a14d-d894-4129-a049-08d99cbfa644",
                        "receievedAt": "2021-11-01T01:02:56.3788758",
                        "receievedAtTimestamp": 1635728576378.8757,
                        "sentBy": "ThirdPartyClient",
                        "sentTo": "All",
                        "senderName": "Chidelu",
                        "message": "When calling the show method, you can use the following options to suit your needs. Everything is optional, unless specified otherwise."
                    },
                    {
                        "id": "19a80e26-c9bf-472b-5c3b-08d9afa44c2e",
                        "receievedAt": "2021-11-26T05:29:10.2180019",
                        "receievedAtTimestamp": 1637904550218.002,
                        "sentBy": "Support",
                        "sentTo": "All",
                        "senderName": "Chukwuemeka Nweke",
                        "message": "Hey"
                    },
                    {
                        "id": "1f271103-aa7c-46a2-5c3c-08d9afa44c2e",
                        "receievedAt": "2021-11-26T05:34:53.3210266",
                        "receievedAtTimestamp": 1637904893321.0266,
                        "sentBy": "Support",
                        "sentTo": "All",
                        "senderName": "Chukwuemeka Nweke",
                        "message": "Hey"
                    },
                    {
                        "id": "c2833f77-8058-4af9-5c3d-08d9afa44c2e",
                        "receievedAt": "2021-11-26T05:37:55.4007895",
                        "receievedAtTimestamp": 1637905075400.7896,
                        "sentBy": "Support",
                        "sentTo": "All",
                        "senderName": "Chukwuemeka Nweke",
                        "message": "Hey"
                    }
                ]
            },
            {
                "id": "3391de15-8e7b-43e3-79db-08d9a787c3df",
                "attachmentUrl": null,
                "orderReference": "XB_465b756e30ce42c2a37c9f1955a7f992",
                "orderId": "95d3a739-66a5-4a65-8660-08d9a786d06e",
                "orderDate": 1636905171397,
                "disputeRaisedAt": 1636905579820,
                "disputeLastUpdated": 1637891039459,
                "disputeStatus": "DisputeResolved",
                "disputeRaisedBy": "Third Party Customer",
                "disputeRemark": "okay",
                "disputeComment": "Hello",
                "payInCurrency": "NGN",
                "rceiveInCurrency": "BUSD",
                "payInAmount": 3000.000000000,
                "receiveInAmount": 5.405405410,
                "clientPaymentMethod": "Bank",
                "thirdPartyAppName": "Xend Finance",
                "providerName": "Nnadozie Ohaeri",
                "providerEmail": "dozienna4@gmail.com",
                "providerPhone": "2348062069869",
                "customerName": "kasheef",
                "customerEmail": "kasheef@etg.solutions",
                "customerPhone": "08135057971",
                "disputeChats": [
                    {
                        "id": "373e9606-7144-4d5e-87e4-08d9a787c3e3",
                        "receievedAt": "2021-11-14T15:59:39.8206888",
                        "receievedAtTimestamp": 1636905579820.6887,
                        "sentBy": "ThirdPartyClient",
                        "sentTo": "All",
                        "senderName": "kasheef",
                        "message": "Hello"
                    },
                    {
                        "id": "4b1e0bf3-ac7b-44d2-5c35-08d9afa44c2e",
                        "receievedAt": "2021-11-26T01:38:11.5461308",
                        "receievedAtTimestamp": 1637890691546.1309,
                        "sentBy": "Support",
                        "sentTo": "All",
                        "senderName": "Chukwuemeka Nweke",
                        "message": "hey"
                    },
                    {
                        "id": "933cc579-cdec-483d-5c36-08d9afa44c2e",
                        "receievedAt": "2021-11-26T01:40:08.8215939",
                        "receievedAtTimestamp": 1637890808821.594,
                        "sentBy": "Support",
                        "sentTo": "All",
                        "senderName": "Chukwuemeka Nweke",
                        "message": "kljkl"
                    },
                    {
                        "id": "c51d5467-af01-43b0-5c37-08d9afa44c2e",
                        "receievedAt": "2021-11-26T01:40:59.7558694",
                        "receievedAtTimestamp": 1637890859755.8694,
                        "sentBy": "Support",
                        "sentTo": "All",
                        "senderName": "Chukwuemeka Nweke",
                        "message": "fghb m"
                    },
                    {
                        "id": "43df985d-20ee-4966-5c38-08d9afa44c2e",
                        "receievedAt": "2021-11-26T01:42:02.8344537",
                        "receievedAtTimestamp": 1637890922834.4536,
                        "sentBy": "Support",
                        "sentTo": "All",
                        "senderName": "Chukwuemeka Nweke",
                        "message": "bnm "
                    },
                    {
                        "id": "487862d9-1bdd-4b1c-5c39-08d9afa44c2e",
                        "receievedAt": "2021-11-26T01:43:13.611148",
                        "receievedAtTimestamp": 1637890993611.148,
                        "sentBy": "Support",
                        "sentTo": "All",
                        "senderName": "Chukwuemeka Nweke",
                        "message": "okay"
                    },
                    {
                        "id": "32242fe2-cafb-42a7-5c3a-08d9afa44c2e",
                        "receievedAt": "2021-11-26T01:43:59.4590345",
                        "receievedAtTimestamp": 1637891039459.0344,
                        "sentBy": "Support",
                        "sentTo": "All",
                        "senderName": "Chukwuemeka Nweke",
                        "message": "okay"
                    }
                ]
            },
            {
                "id": "c58a496f-6020-4b89-7524-08d99a4da05d",
                "attachmentUrl": null,
                "orderReference": "XB_fdd11983170244a5b191835164bc3b30",
                "orderId": "ad7eaf16-ccd0-4545-1d93-08d99a44c420",
                "orderDate": 1635451826237,
                "disputeRaisedAt": 1635452588985,
                "disputeLastUpdated": 1637859151505,
                "disputeStatus": "DisputeResolved",
                "disputeRaisedBy": "Third Party Customer",
                "disputeRemark": "Hello",
                "disputeComment": "You can center absolute items by providing the left property with the width of the device divided by two and subtracting out half of the element you'd like to center's width.",
                "payInCurrency": "NGN",
                "rceiveInCurrency": "BUSD",
                "payInAmount": 50000.000000000,
                "receiveInAmount": 100.000000000,
                "clientPaymentMethod": "Bank",
                "thirdPartyAppName": "Xend Finance",
                "providerName": "John Doe",
                "providerEmail": "ediala94@gmail.com",
                "providerPhone": "2348181186644",
                "customerName": "Chidelu",
                "customerEmail": "emekanweke604@gmail.com",
                "customerPhone": "08167828970",
                "disputeChats": [
                    {
                        "id": "93fd3800-b0cd-40d4-c1f9-08d99a4da060",
                        "receievedAt": "2021-10-28T20:23:08.9854916",
                        "receievedAtTimestamp": 1635452588985.4917,
                        "sentBy": "ThirdPartyClient",
                        "sentTo": "All",
                        "senderName": "Chidelu",
                        "message": "You can center absolute items by providing the left property with the width of the device divided by two and subtracting out half of the element you'd like to center's width."
                    },
                    {
                        "id": "2a664446-8ae3-4b59-5c1b-08d9afa44c2e",
                        "receievedAt": "2021-11-25T16:46:28.5168883",
                        "receievedAtTimestamp": 1637858788516.8884,
                        "sentBy": "Support",
                        "sentTo": "All",
                        "senderName": "Chukwuemeka Nweke",
                        "message": "hey"
                    },
                    {
                        "id": "4da4d12d-51c1-4317-5c1c-08d9afa44c2e",
                        "receievedAt": "2021-11-25T16:50:17.4042975",
                        "receievedAtTimestamp": 1637859017404.2976,
                        "sentBy": "Support",
                        "sentTo": "All",
                        "senderName": "Chukwuemeka Nweke",
                        "message": "Okay"
                    },
                    {
                        "id": "efc47b02-91dc-4ae2-5c1d-08d9afa44c2e",
                        "receievedAt": "2021-11-25T16:52:31.5057139",
                        "receievedAtTimestamp": 1637859151505.714,
                        "sentBy": "Support",
                        "sentTo": "All",
                        "senderName": "Chukwuemeka Nweke",
                        "message": "Hello"
                    }
                ]
            },
            {
                "id": "15e85254-9a1e-458b-81a6-08d9a949e50f",
                "attachmentUrl": null,
                "orderReference": "XS_b01598e21dc54276ae6f83a0fe6b5768",
                "orderId": "32b4f7c0-a735-4a19-6797-08d9a9499f58",
                "orderDate": 1637098792069,
                "disputeRaisedAt": 1637098909021,
                "disputeLastUpdated": 1637797919148,
                "disputeStatus": "DisputeResolved",
                "disputeRaisedBy": "Third Party Customer",
                "disputeRemark": "vx cm",
                "disputeComment": "I didn’t get my money \n\n",
                "payInCurrency": "BUSD",
                "rceiveInCurrency": "NGN",
                "payInAmount": 20.000000000,
                "receiveInAmount": 11200.000000000,
                "clientPaymentMethod": "Crypto",
                "thirdPartyAppName": "Xend Finance",
                "providerName": "Nnadozie Ohaeri",
                "providerEmail": "dozienna4@gmail.com",
                "providerPhone": "2348062069869",
                "customerName": "Genny",
                "customerEmail": "ogbueneogechukwu2@gmail.com",
                "customerPhone": "08165018668",
                "disputeChats": [
                    {
                        "id": "b3e1e028-7ccf-45a2-62fa-08d9a910d433",
                        "receievedAt": "2021-11-16T21:41:49.0215881",
                        "receievedAtTimestamp": 1637098909021.588,
                        "sentBy": "ThirdPartyClient",
                        "sentTo": "All",
                        "senderName": "Genny",
                        "message": "I didn’t get my money \n\n"
                    },
                    {
                        "id": "84fac72c-3edb-47f9-62fb-08d9a910d433",
                        "receievedAt": "2021-11-16T21:41:57.1884264",
                        "receievedAtTimestamp": 1637098917188.4265,
                        "sentBy": "ThirdPartyClient",
                        "sentTo": "All",
                        "senderName": "Genny",
                        "message": "Yes"
                    },
                    {
                        "id": "47c351e0-e466-427b-5c15-08d9afa44c2e",
                        "receievedAt": "2021-11-24T23:44:03.6811316",
                        "receievedAtTimestamp": 1637797443681.1316,
                        "sentBy": "Support",
                        "sentTo": "All",
                        "senderName": "Chukwuemeka Nweke",
                        "message": "hey"
                    },
                    {
                        "id": "f9e46143-ecff-46b4-5c16-08d9afa44c2e",
                        "receievedAt": "2021-11-24T23:46:43.7963393",
                        "receievedAtTimestamp": 1637797603796.339,
                        "sentBy": "Support",
                        "sentTo": "All",
                        "senderName": "Chukwuemeka Nweke",
                        "message": "hi"
                    },
                    {
                        "id": "79059e22-edaa-4895-5c17-08d9afa44c2e",
                        "receievedAt": "2021-11-24T23:48:14.7879068",
                        "receievedAtTimestamp": 1637797694787.9067,
                        "sentBy": "Support",
                        "sentTo": "All",
                        "senderName": "Chukwuemeka Nweke",
                        "message": "Hello"
                    },
                    {
                        "id": "430cf3b6-39a3-421d-5c18-08d9afa44c2e",
                        "receievedAt": "2021-11-24T23:49:16.9079087",
                        "receievedAtTimestamp": 1637797756907.9087,
                        "sentBy": "Support",
                        "sentTo": "All",
                        "senderName": "Chukwuemeka Nweke",
                        "message": "m"
                    },
                    {
                        "id": "d6e73efe-574d-47a3-5c19-08d9afa44c2e",
                        "receievedAt": "2021-11-24T23:50:45.1585362",
                        "receievedAtTimestamp": 1637797845158.5361,
                        "sentBy": "Support",
                        "sentTo": "All",
                        "senderName": "Chukwuemeka Nweke",
                        "message": "ddvf"
                    },
                    {
                        "id": "89ea4aad-0e2a-43e0-5c1a-08d9afa44c2e",
                        "receievedAt": "2021-11-24T23:51:59.1484093",
                        "receievedAtTimestamp": 1637797919148.4092,
                        "sentBy": "Support",
                        "sentTo": "All",
                        "senderName": "Chukwuemeka Nweke",
                        "message": "vx cm"
                    }
                ]
            },
            {
                "id": "8525c455-551a-4b16-5a32-08d99cbfa641",
                "attachmentUrl": "https://res.cloudinary.com/chukwuemekanweke/image/upload/v1635720118/xend_cashlink_dispute_claims/1e976be2-64f2-44fb-9f77-46ab4d4fd667.jpg",
                "orderReference": "XB_a3dab302053a43768dbf39df381afb5d",
                "orderId": "f83e74d5-dea2-4b7f-6058-08d99cbf017f",
                "orderDate": 1635719842743,
                "disputeRaisedAt": 1635720118432,
                "disputeLastUpdated": 1637706728829,
                "disputeStatus": "DisputeResolved",
                "disputeRaisedBy": "Third Party Customer",
                "disputeRemark": "Hey",
                "disputeComment": "Manchester United bounced back in the Premier League with an impressive 3-0 win over Tottenham Hotspur away from home. Still, they remain 8 points behind league leaders Chelsea.\n\n",
                "payInCurrency": "NGN",
                "rceiveInCurrency": "BUSD",
                "payInAmount": 100000.000000000,
                "receiveInAmount": 200.000000000,
                "clientPaymentMethod": "Bank",
                "thirdPartyAppName": "Xend Finance",
                "providerName": "John Doe",
                "providerEmail": "ediala94@gmail.com",
                "providerPhone": "2348181186644",
                "customerName": "Chidelu",
                "customerEmail": "emekanweke604@gmail.com",
                "customerPhone": "08167828970",
                "disputeChats": [
                    {
                        "id": "ccc6be97-d16e-46f1-a040-08d99cbfa644",
                        "receievedAt": "2021-10-31T22:41:58.4324387",
                        "receievedAtTimestamp": 1635720118432.4387,
                        "sentBy": "ThirdPartyClient",
                        "sentTo": "All",
                        "senderName": "Chidelu",
                        "message": "Manchester United bounced back in the Premier League with an impressive 3-0 win over Tottenham Hotspur away from home. Still, they remain 8 points behind league leaders Chelsea.\n\n"
                    },
                    {
                        "id": "9246dcf8-e659-4af8-a041-08d99cbfa644",
                        "receievedAt": "2021-10-31T22:45:36.1106464",
                        "receievedAtTimestamp": 1635720336110.6465,
                        "sentBy": "ThirdPartyClient",
                        "sentTo": "All",
                        "senderName": "Chidelu",
                        "message": "You can’t just say it was Mourinho, you can’t just say it was Pochettino because it’s happened under Nuno too."
                    },
                    {
                        "id": "8d5fc9f8-4ae2-455b-622d-08d9aed115e5",
                        "receievedAt": "2021-11-23T22:32:08.829095",
                        "receievedAtTimestamp": 1637706728829.095,
                        "sentBy": "Support",
                        "sentTo": "All",
                        "senderName": "Chukwuemeka Nweke",
                        "message": "Hey"
                    }
                ]
            },
            {
                "id": "345b51ee-718e-4980-5a36-08d99cbfa641",
                "attachmentUrl": "https://res.cloudinary.com/chukwuemekanweke/image/upload/v1635730627/xend_cashlink_dispute_claims/916352c6-96cc-4325-9083-0beeae8d6f90.jpg",
                "orderReference": "XB_51c20ff06504498ab1a9d510c8c7be2f",
                "orderId": "242ab98b-2497-4f2b-605e-08d99cbf017f",
                "orderDate": 1635730527793,
                "disputeRaisedAt": 1635730627418,
                "disputeLastUpdated": 1637242344935,
                "disputeStatus": "DisputeResolved",
                "disputeRaisedBy": "Third Party Customer",
                "disputeRemark": "okay",
                "disputeComment": "iOS/Android image picker with support for camera, video, configurable compression, multiple images and cropping",
                "payInCurrency": "NGN",
                "rceiveInCurrency": "BUSD",
                "payInAmount": 1166000.000000000,
                "receiveInAmount": 2332.000000000,
                "clientPaymentMethod": "Bank",
                "thirdPartyAppName": "Xend Finance",
                "providerName": "John Doe",
                "providerEmail": "ediala94@gmail.com",
                "providerPhone": "2348181186644",
                "customerName": "Chidelu",
                "customerEmail": "emekanweke604@gmail.com",
                "customerPhone": "08167828970",
                "disputeChats": [
                    {
                        "id": "13aa56d4-0b9c-4ecd-a04a-08d99cbfa644",
                        "receievedAt": "2021-11-01T01:37:07.4181269",
                        "receievedAtTimestamp": 1635730627418.1267,
                        "sentBy": "ThirdPartyClient",
                        "sentTo": "All",
                        "senderName": "Chidelu",
                        "message": "iOS/Android image picker with support for camera, video, configurable compression, multiple images and cropping"
                    },
                    {
                        "id": "64ebd908-72a2-4a8b-e8f7-08d99fc77c44",
                        "receievedAt": "2021-11-04T19:17:35.5617976",
                        "receievedAtTimestamp": 1636053455561.7976,
                        "sentBy": "Support",
                        "sentTo": "All",
                        "senderName": "Chukwuemeka Nweke",
                        "message": "Hello"
                    },
                    {
                        "id": "94e1d871-aba0-4d7e-e8f8-08d99fc77c44",
                        "receievedAt": "2021-11-04T19:30:04.9695595",
                        "receievedAtTimestamp": 1636054204969.5596,
                        "sentBy": "Support",
                        "sentTo": "All",
                        "senderName": "Chukwuemeka Nweke",
                        "message": "Hey"
                    },
                    {
                        "id": "1dd6d403-1578-4524-e8f9-08d99fc77c44",
                        "receievedAt": "2021-11-04T19:32:57.3825831",
                        "receievedAtTimestamp": 1636054377382.5833,
                        "sentBy": "Support",
                        "sentTo": "All",
                        "senderName": "Chukwuemeka Nweke",
                        "message": "Hi"
                    },
                    {
                        "id": "cd6aaca8-7e21-453d-e8fa-08d99fc77c44",
                        "receievedAt": "2021-11-04T19:35:53.8404905",
                        "receievedAtTimestamp": 1636054553840.4905,
                        "sentBy": "Support",
                        "sentTo": "All",
                        "senderName": "Chukwuemeka Nweke",
                        "message": "Okay"
                    },
                    {
                        "id": "1b56b03c-0433-4094-5d71-08d9aa935438",
                        "receievedAt": "2021-11-18T13:32:24.9350751",
                        "receievedAtTimestamp": 1637242344935.0752,
                        "sentBy": "Support",
                        "sentTo": "All",
                        "senderName": "Chukwuemeka Nweke",
                        "message": "okay"
                    }
                ]
            },
            {
                "id": "4d86a013-55d3-47cf-5a37-08d99cbfa641",
                "attachmentUrl": null,
                "orderReference": "XS_7a683536b6c345d4ad0f1e8abc3a475c",
                "orderId": "44ad0ab6-acf6-4fee-605f-08d99cbf017f",
                "orderDate": 1635730837750,
                "disputeRaisedAt": 1635730946913,
                "disputeLastUpdated": 1636489335101,
                "disputeStatus": "DisputeResolved",
                "disputeRaisedBy": "Third Party Customer",
                "disputeRemark": "Hello",
                "disputeComment": "There is a transaction limit of minimum $20 and $10,000 per single transaction for users. This means that a user cannot purchase more than $10,000 in a single transaction but it can be done with multiple transactions.",
                "payInCurrency": "BUSD",
                "rceiveInCurrency": "NGN",
                "payInAmount": 10000.000000000,
                "receiveInAmount": 20000000.000000000,
                "clientPaymentMethod": "Crypto",
                "thirdPartyAppName": "Xend Finance",
                "providerName": "John Doe",
                "providerEmail": "ediala94@gmail.com",
                "providerPhone": "2348181186644",
                "customerName": "Chidelu",
                "customerEmail": "emekanweke604@gmail.com",
                "customerPhone": "08167828970",
                "disputeChats": [
                    {
                        "id": "4ca8260c-8fa4-4a92-a04b-08d99cbfa644",
                        "receievedAt": "2021-11-01T01:42:26.9136322",
                        "receievedAtTimestamp": 1635730946913.632,
                        "sentBy": "ThirdPartyClient",
                        "sentTo": "All",
                        "senderName": "Chidelu",
                        "message": "There is a transaction limit of minimum $20 and $10,000 per single transaction for users. This means that a user cannot purchase more than $10,000 in a single transaction but it can be done with multiple transactions."
                    },
                    {
                        "id": "d687cbda-bbf8-486f-a04c-08d99cbfa644",
                        "receievedAt": "2021-11-01T01:42:34.1738227",
                        "receievedAtTimestamp": 1635730954173.8228,
                        "sentBy": "ThirdPartyClient",
                        "sentTo": "All",
                        "senderName": "Chidelu",
                        "message": "There is a transaction limit of minimum $20 and $10,000 per single transaction for users. This means that a user cannot purchase more than $10,000 in a single transaction but it can be done with multiple transactions."
                    },
                    {
                        "id": "f57d43e2-83f0-4995-c5a9-08d9a3be9eb4",
                        "receievedAt": "2021-11-09T20:22:15.1017563",
                        "receievedAtTimestamp": 1636489335101.7563,
                        "sentBy": "Support",
                        "sentTo": "All",
                        "senderName": "Chukwuemeka Nweke",
                        "message": "Hello"
                    }
                ]
            }
        ],
        "pageSize": 50,
        "currentPage": 1,
        "totalPages": 1,
        "totalRecords": 16
    },
    "status": "OK",
    "message": ""
}
```

{% endtab %}

{% tab title="400: Bad Request " %}

```javascript
{
    "data": {
        "records": [],
        "pageSize": 50,
        "currentPage": 1,
        "totalPages": 0,
        "totalRecords": 0
    },
    "status": "OK",
    "message": ""
}
```

{% endtab %}
{% endtabs %}

{% tabs %}
{% tab title="Request Fields" %}

<table><thead><tr><th width="150">Parameters</th><th width="150">Type</th><th>Definitions</th></tr></thead><tbody><tr><td>startDate</td><td>double</td><td><code>Required</code> The date and time of the start of a dispute in milliseconds.</td></tr><tr><td>endDate</td><td>double</td><td><code>Required</code> The end date and time of the end of dispute in milliseconds.</td></tr><tr><td>disputeStatus</td><td>enum</td><td><code>Required</code>The status of the dispute on an order. It could either be <code>OpenDispute</code>, <code>DisputeBeingAttendedTo</code> or <code>DisputeResolved</code>.</td></tr><tr><td>page</td><td>int</td><td><code>Required</code> This is the number of a page with a specific page size of disputes.</td></tr><tr><td>pageSize</td><td>int</td><td><code>Required</code> This is the number of the size of disputes on a page.</td></tr></tbody></table>
{% endtab %}

{% tab title="Response Fields" %}

<table><thead><tr><th width="150">Parameters</th><th width="150">Type</th><th>Definitions</th></tr></thead><tbody><tr><td>data</td><td>object</td><td>This holds the properties; <code>records</code>, <code>pageSize</code>, <code>currentPage</code>, <code>totalPages</code> &#x26; <code>totalRecords</code>.</td></tr><tr><td>id</td><td>guid</td><td>This is the id of the record in the database.</td></tr><tr><td>attachmentUrl</td><td>string</td><td>This is any media url attachment posted in a dispute.</td></tr><tr><td>orderReference</td><td>string</td><td>The order reference of an order made.</td></tr><tr><td>orderId</td><td>guid</td><td>The guid of an order record in the database.</td></tr><tr><td>orderDate</td><td>long</td><td>The date and time when that order was made in milliseconds.</td></tr><tr><td>disputeRaisedAt</td><td>long</td><td>The date and time the dispute was raised at in milliseconds.</td></tr><tr><td>disputeLastUpdatedAt</td><td>long</td><td>The last date and time update on a dispute in milliseconds</td></tr><tr><td>disputeStatus</td><td>enum</td><td>The status of the dispute on an order. It could either be <code>OpenDispute</code>, <code>DisputeBeingAttendedTo</code> or <code>DisputeResolved</code>.</td></tr><tr><td>disputeRaisedBy</td><td>enum</td><td>This is the entity who raised the dispute.</td></tr><tr><td>disputeRemark</td><td>string</td><td>This is the remark on a dispute by any participant.</td></tr><tr><td>disputeComment</td><td>string</td><td>This is the comment by the consumer of the dispute.</td></tr><tr><td>payinCurrency</td><td>enum</td><td>This is the currency in which the order is paid in.</td></tr><tr><td>recieveInCurrency</td><td>enum</td><td>This is the currency in which the order is received in.</td></tr><tr><td>payInAmount</td><td>decimal</td><td>This is the amount of the order to be paid to.</td></tr><tr><td>receiveInAmount</td><td>decimal</td><td>This is the amount of the order to be received in.</td></tr><tr><td>clientPaymentMethod</td><td>enum</td><td>This is the customer's payment method.</td></tr><tr><td>thirdPartyAppName</td><td>string</td><td>This is the Third party app integrated with XendBridge.</td></tr><tr><td>providerName</td><td>string</td><td>This is the name of the provider.</td></tr><tr><td>providerEmail</td><td>string</td><td>This is the email address of the provider.</td></tr><tr><td>providerPhone</td><td>string</td><td>This is the provider's phone number.</td></tr><tr><td>customerName</td><td>string</td><td>This is the customer's name.</td></tr><tr><td>customerEmail</td><td>string</td><td>This is the customer's email.</td></tr><tr><td>customerPhone</td><td>string</td><td>This is the customer's phone number.</td></tr><tr><td>disputeChats</td><td>array</td><td>This is holds the objects of the different chats in a dispute</td></tr><tr><td>id</td><td>guid</td><td>The id of the chat record in the database.</td></tr><tr><td>receivedAt</td><td>DateTime</td><td>This is the date the chat message was received.</td></tr><tr><td>receivedAtTimeStamp</td><td>double</td><td>This is the time date the chat message was received at in milliseconds.</td></tr><tr><td>sentBy</td><td>enum</td><td>This is the participant who sent the message.</td></tr><tr><td>sentTo</td><td>enum</td><td>This is the participant who the message is being sent to.</td></tr><tr><td>senderName</td><td>string</td><td>This is the participant's name who sent the message.</td></tr><tr><td>message</td><td>string</td><td>This the content of the message sent.</td></tr><tr><td>pageSize</td><td>int</td><td>This is the number of disputes chats in a page.</td></tr><tr><td>currentPage</td><td>int</td><td>This is the current page number.</td></tr><tr><td>totalPages</td><td>int</td><td>This is the total number of pages of the disputes for a third party app.</td></tr><tr><td>totalRecords</td><td>int</td><td>This is the total number of records of the disputes in third party app.</td></tr><tr><td>status</td><td>string</td><td>This is the status of the request.</td></tr><tr><td>message</td><td>string</td><td>This returns empty if no errors occurs.</td></tr></tbody></table>
{% endtab %}
{% endtabs %}


# XendBridge Chat SDK

For a third-party application to be able to get the history of messages and also send one, this SDK has to be implemented. Here are the steps to follow;

### Installation

Using npm :

```shell
$ npm install xendbridgechat-sdk
```

Using yarn :

```shell
$ yarn add xendbridgechat-sdk
```

{% embed url="<https://www.npmjs.com/package/xendbridgechat-sdk>" %}
XendBridge Chat SDK
{% endembed %}

### Usage

```javascript
# using require
const { getMessageHistory, sendMessage } = require('xendbridgechat-sdk');

# using import
import { getMessageHistory, sendMessage } from 'xendbridgechat-sdk';
```

### Examples

XendBridge Chat SDK provides only two distinct functions. GetMessageHistory and SendMessage.

The **getMessageHistory** takes the three arguments which are a public key(string), dispute reference(string), and a function called **getAllChats**.

**getAllChats** is a function that must be called as an argument in both **getMessageHistory** and **sendMessage**. It automatically fetches the history for you after a message is being sent or when an initial connection to the hub is made.

```javascript
//implement a better and safer way for getting the following values
const disputeRef = "AdhdfoGjfo8jorp";
const publicKey = "XP_34984hfhsdksofhs";

const getHistory = async () => {
    await getMessageHistory(disputeRef, publicKey, getAllChats);
};

//call when connected to application
getHistory();
```

The **sendMessage** takes three arguments as well, being an object called ChatHubAddCommentModel which has props of email address, comment, sent by, recipient, base64Attachment, dispute reference, and sent at. The other arguments are the public key and the function **getAllChats**.

```javascript
//implement a better and safer way for getting the following values
const disputeRef = "AdhdfoGjfo8jorp";
const publicKey = "XP_34984hfhsdksofhs";

let ChatHubAddCommentModel = {
    EmailAddress: "youruseremailaddress@domain.com",
    Comment: comment, //the user's message from the client side
    SentBy: 2, //this is always 2 representing the third party user
    Recipient: 1, //this is always 1 representing all entities involved
    Base64Attachment: "", //this is the image in base64 format
    DisputeReference: disputeRef, //the unique dispute reference
    SentAt: new Date().toISOString() //this is the time in timestamp
}

//call when user hits the send button on the UI
sendMessage(ChatHubAddCommentModel, publicKey, getAllChats);
```


# Payment Inquiry

Payment Inquiry Webhook

To confirm orders have been processed on the third party's customers' end, we implemented a payment inquiry feature that allows xendbridge to inquire about the status of the crypto payments from the third party.&#x20;

For this, we require the third party to provide a webhook endpoint and response data that meets the following specifications and share this url with us to proceed with transactions on the live environment.

## Payment Inquiry

<mark style="color:blue;">`GET`</mark> `https://{YOUR BASE URL}/api/order/inquiry?reference=XS_460ed3181a9b48a0`

#### Query Parameters

| Name                                        | Type   | Description                |
| ------------------------------------------- | ------ | -------------------------- |
| reference<mark style="color:red;">\*</mark> | string | XS\_435tfe4rf3rf4d33rf4rde |

{% tabs %}
{% tab title="200: OK Success" %}

```json
{
    "data": {
      "hashVerificationUrl": "https://bscscan.com/tx/0x7af63d512a3a6fcbfd23b41b1f77b9125a5d86524432fc01b7560edf2eb3ba03",
      "isProcessed": true,
      "transactionHash": "0x5169bb5e7ff0f3502ba818120f2eebaad512bc2816c7f9399e60cc42033a672c"
    },
    "status": "OK",
    "message": ""
}
```

{% endtab %}
{% endtabs %}


# WebHooks

We provide webhooks when specific events happen in our system such as

* [Order Payment Confirmation](/api-method-calls/webhooks/order-payment-confirmation)
* [Order Matched Notification](/api-method-calls/webhooks/order-matched-notification)
* [Order Cancellation Notification](/api-method-calls/webhooks/order-canceled-notification)

Below are guides as to what each action does and what payload and request to expect. You can use this [link](https://webhook.site) to test these hooks and see the payloads.


# Order Payment Confirmation

This sends a notification to the third-party application with a payload of the details of an acknowledged receipt of funds either from the third-party user to the provider or vice-versa using the `POST` endpoint you provide. See an example and its payload properties meanings below.

```json
{
  "CheckSum": "E94077842C4080E431CAFCF8D213DE333D604B1032772647C17F56692ECB165DF4C0F72A0E098137C7188D0723483380757FB1F8E16280E7F02B88CF4354F112",
  "Data": {
    "CustomerEmailAddress": "JOHNDOEE@gmail.com",
    "LiquidityProviderName": "Nnadozie Ohaeri",
    "OrderDetails": {
      "PayInCurrency": 1,
      "ReceiveInCurrency": 6,
      "AmountPaidByCustomer": 6969,
      "AmountPaidToCustomer": 12.46690519,
      "OrderReference": "XB_f303e68cf02d4683bb281671796f9fb4",
      "OrderType": 1,
      "OrderStatus": 6,
      "DisputeStatus": 1
    },
    "PaidBy": 2,
    "PaymentMethod": 2,
    "PaymentDate": 1644321238268.8464,
    "RecepientAccountDetails": {
      "WalletAddress": "0x30b7D85f7CF498D556a9448243a7994bc4660790",
      "Network": "BEP20",
      "Currency": "BUSD"
    },
    "TransactionMetaData": {
      "CryptoPaymentNetwork": "BEP20",
      "CryptoTransactionHash": "0x875bc17de7f0c46b593e1c414d579f8e95ddb278f82df0c43392a7f445808a6e",
      "TransactionVerificationUrl": null
    }
  }
}
```

<table><thead><tr><th width="271.3333333333333">Key</th><th width="150">Type</th><th>Description</th></tr></thead><tbody><tr><td><code>CheckSum</code></td><td>string</td><td>This is a hash property signed with the merchant <code>secretkey</code>.</td></tr><tr><td><code>Data</code></td><td>object</td><td>This holds the properties of the payload data details.</td></tr><tr><td><code>CustomerEmailAddress</code></td><td>string</td><td>This is the customer's email address.</td></tr><tr><td><code>LiquidityProviderName</code></td><td>string</td><td>This is the name of the liquidity provider.</td></tr><tr><td><code>OrderDetails</code></td><td>object</td><td>This is an object that holds the properties of the order details.</td></tr><tr><td><code>PayInCurrency</code></td><td>enum</td><td>This is the symbol of a particular currency used in paying for an order. Values range from <code>NGN = 1</code>, <code>USD = 2</code>, <code>BUSD = 6</code>&#x26; <code>XEND = 9</code>.</td></tr><tr><td><code>RecieveInCurrency</code></td><td>enum</td><td>This is the symbol of a particular currency used in receiving. Values range from <code>NGN = 1</code>, <code>USD = 2</code>, <code>BUSD = 6</code>&#x26; <code>XEND = 9</code>.</td></tr><tr><td><code>AmountPaidByCustomer</code></td><td>decimal</td><td>This is the amount paid by the customer.</td></tr><tr><td><code>AmountPaidToCustomer</code></td><td>decimal</td><td>This is the amount paid to the customer.</td></tr><tr><td><code>OrderReference</code></td><td>string</td><td>This is the reference value of an order.</td></tr><tr><td><code>OrderType</code></td><td>enum</td><td>This is the type of order made. It can either be a <code>Buy</code> or <code>Sell</code>.</td></tr><tr><td><code>OrderStatus</code></td><td>enum</td><td>This is the status of an order at a particular time. It can either be <code>Submitted = 1</code>, <code>Canceled = 2</code>, <code>Acknowledge = 3</code>, <code>FundedProvider = 4</code>, <code>FundRecievedFromUser = 5</code>, <code>FundedUser = 6</code>, <code>Completed = 7</code> or <code>OrderTimeOut = 8</code>.</td></tr><tr><td><code>OrderDisputeStatus</code></td><td>enum</td><td>This is the dispute status of an order. It can either be <code>NoDispute, DisputeRaisedbyCustomer</code>, <code>DisputeRaisedByProvider</code>, <code>DisputeRaisedByBothParties</code> , <code>DisputeResolved</code> or <code>CouldNotResolve</code>.</td></tr><tr><td><code>PaidBy</code></td><td>enum</td><td>This is the entity by which the order is paid by. It could be the <code>Customer = 1</code> or <code>Provider = 2</code>.</td></tr><tr><td><code>PaymentMethod</code></td><td>enum</td><td>This is the payment method which is used in transacting. It can be <code>Bank = 1</code> or <code>Crypto = 2</code>.</td></tr><tr><td><code>PaymentDate</code></td><td>double</td><td>This is the date by which the payment was made in milliseconds.</td></tr><tr><td><code>RecepientAccountDetails</code></td><td>object</td><td>This holds the properties of the recepient's account details.</td></tr><tr><td><code>WalletAddress</code></td><td>string</td><td>This is the wallet address of the customer.</td></tr><tr><td><code>Network</code></td><td>string</td><td>This is the cryptocurrency network name.</td></tr><tr><td><code>Currency</code></td><td>string</td><td>This is the currency the order was transacted with.</td></tr><tr><td><code>TransactionMetaData</code></td><td>object</td><td>This is an object that holds the metadata of the transaction.</td></tr><tr><td><code>CryptoPaymentNetwork</code></td><td>string</td><td>This is the cryptocurrency network which was paid with.</td></tr><tr><td><code>CryptoTransactionHash</code></td><td>string</td><td>This is the security hash of a particular transaction in the network.</td></tr><tr><td><code>TransactionVerificationUrl</code></td><td>string</td><td>is is the url of the transaction. It's nullable.</td></tr></tbody></table>


# Order Matched Notification

This sends a notification to the third-party application when an order is placed to be sold or bought by a customer. This is done using the `POST` method. See examples and descriptions below;

```json
{
  "CheckSum": "E8A935C3BDE4E47938A01CA3C2166A6B256733CF2E91E1FDE0473F693999BADCCA5C30E9F0D8A7CF61CFEEC2FC58CFB3EAEFD2754D16BA0EB5314ACFF01A67CA",
  "Data": {
    "OrderReference": "XB_37a483f890dc4c1bb9f48524c41ad47b",
    "ReceiveInCurrencyCode": 6,
    "PayInCurrencyCode": 1,
    "ReceivableAmount": 0.44364937,
    "PayableAmount": 248,
    "ProviderName": "Nnadozie Ohaeri",
    "ProviderFirstName": "Nnadozie",
    "ProviderLastName": "Ohaeri",
    "ProviderEmail": "dozienna4@gmail.com",
    "InitiatedAt": "2022-02-08T13:02:42.1580578Z",
    "OrderExpiryDate": "2022-02-08T13:16:40.1541528Z",
    "InitiatedAtTimestamp": 1644325300154,
    "OrderExpiryTimestamp": 1644326200154,
    "FundedProviderAtTimeStamp": null,
    "FundedCustomerAtTimeStamp": null,
    "OrderCompletedAtTimeStamp": null,
    "P2POrderStatus": 3,
    "DisputeStatus": 1,
    "OrderType": 1,
    "ProviderContact": {
      "PhoneNumber": "2348062069869",
      "WhatsappNumber": "2348062069869"
    },
    "CustomerContact": {
      "Email": "JOHNDOEE@gmail.com",
      "Name": "John Doe",
      "PhoneNumber": "0706346XXXX"
    },
    "ProviderPaymentMethods": {
      "PaymentMethod": 1,
      "PaymentType": 1,
      "PaymentData": [
        {
          "BankName": "Access",
          "AccountNumber": "0069888440",
          "AccountName": "Ohaeri Nnadozie",
          "Currency": "NGN"
        }
      ],
      "OrderPaymentMethod": {
        "BankName": "Access",
        "AccountNumber": "0069888440",
        "AccountName": "Ohaeri Nnadozie",
        "Currency": "NGN"
      }
    },
    "ConsumerDepositMethod": {
      "PaymentMethod": 1,
      "PaymentType": 0,
      "PaymentData": {
        "BankName": "Access Bank",
        "AccountNumber": "0000187849",
        "AccountName": "Emmanuel Diala",
        "Currency": "NGN"
      }
    },
    "ConsumerReceiptMethod": {
      "PaymentMethod": 2,
      "PaymentType": 0,
      "PaymentData": {
        "WalletAddress": "QWEVDTWDGVT462E6EFYE9202Y239",
        "Network": "BEP20",
        "Currency": "BUSD"
      }
    },
    "ProviderTransactionMetadata": null
  }
}
```

<table><thead><tr><th width="270.3333333333333">Key</th><th width="150">Type</th><th>Description</th></tr></thead><tbody><tr><td><code>Checksum</code></td><td>string</td><td>This is a hash property signed with the merchant <code>secretkey</code>.</td></tr><tr><td><code>Data</code></td><td>object</td><td>This holds the properties of the payload data details.</td></tr><tr><td><code>OrderReference</code></td><td>string</td><td>This the reference to a particular order.</td></tr><tr><td><code>RecieveInCurrencyCode</code></td><td>enum</td><td>This is the currency code to receive the currency in.</td></tr><tr><td><code>PayInCurrencyCode</code></td><td>enum</td><td>This is the currency code to pay with.</td></tr><tr><td><code>ReceivableAmount</code></td><td>decimal</td><td>This the receivable amount of the currency.</td></tr><tr><td><code>PayableAmount</code></td><td>decimal</td><td>This is the payable amount of the currency.</td></tr><tr><td><code>ProviderName</code></td><td>string</td><td>This the provider's name.</td></tr><tr><td><code>ProviderFirstName</code></td><td>string</td><td>This is the provider's first name.</td></tr><tr><td><code>ProviderLastName</code></td><td>string</td><td>This is the provider's last name.</td></tr><tr><td><code>ProviderEmail</code></td><td>string</td><td>This is the provider's email address.</td></tr><tr><td><code>InitiatedAt</code></td><td>DateTime</td><td>The date time the order was made.</td></tr><tr><td><code>OrderExpiryDate</code></td><td>DateTime</td><td>The expiry date time of the order.</td></tr><tr><td><code>InitiatedAtTimestamp</code></td><td>long</td><td>The time in milliseconds an order was made</td></tr><tr><td><code>OrderExpiryTimestamp</code></td><td>long</td><td>The time in milliseconds of when thee order will expire.</td></tr><tr><td><code>FundedProviderAtTimeStamp</code></td><td>long</td><td>The time of when a customer indicates payment for an order in milliseconds.</td></tr><tr><td><code>FundedCustomerAtTimeStamp</code></td><td>long</td><td>The time of when a provider indicates payment of order to the customer in milliseconds</td></tr><tr><td><code>OrderCompletedAtTimeStamp</code></td><td>long</td><td>The time in milliseconds an order was completed.</td></tr><tr><td><code>P2POrderStatus</code></td><td>enum</td><td>The status of the order at the curent time. It could be <code>Submitted</code>, <code>Cancelled</code>, <code>Acknowledged</code>, <code>FundedProvider</code>, <code>FundReceivedFromUser</code>, <code>FundedUser</code>, <code>Completed</code>, <code>OrderTimedOut</code></td></tr><tr><td><code>DisputeStatus</code></td><td>enum</td><td>The status of the dispute on an order. It could either be <code>NoDispute</code>, <code>DisputeRaisedByCustomer</code>, <code>DisputeRaisedByProvider</code>, <code>DisputeRaisedByBothParties</code>, <code>DisputeResolved</code>or <code>CouldNotBeResolved</code>.</td></tr><tr><td><code>OrderType</code></td><td>enum</td><td>This is the status of the order, whether it's a <code>Buy</code> or <code>Sell</code>.</td></tr><tr><td><code>ProviderContact</code></td><td>object</td><td>This is holds properties of a provider's contact information.</td></tr><tr><td><code>PhoneNumber</code></td><td>string</td><td>The phone number of either the provider or customer.</td></tr><tr><td><code>WhatsappNumber</code></td><td>string</td><td>The whatsapp number of either the provider or customer.</td></tr><tr><td><code>CustomerContact</code></td><td>object</td><td>This holds the props of the contact information.</td></tr><tr><td><code>Email</code></td><td>string</td><td>This is an email address of the customer.</td></tr><tr><td><code>Name</code></td><td>string</td><td>This is the name of the customer.</td></tr><tr><td><code>PhoneNumber</code></td><td>string</td><td>The phone number of the customer</td></tr><tr><td><code>ProviderPaymentMethods</code></td><td>object</td><td>This holds the properties of the payment methods of the provider.</td></tr><tr><td><code>PaymentMethod</code></td><td>enum</td><td>This is the method of payment. It could be <code>Bank</code> or <code>Crypto</code></td></tr><tr><td><code>PaymentType</code></td><td>enum</td><td>This is the type of payment. It could be <code>Bank</code>, <code>Crypto</code>, <code>UserName</code>or <code>MobileMoney</code>.</td></tr><tr><td><code>PaymentData</code></td><td>object</td><td>This holds the properties of the payment method.</td></tr><tr><td><code>BankName</code></td><td>string</td><td>The bank name of the the provider or customer.</td></tr><tr><td><code>AccountNumber</code></td><td>string</td><td>The bank account number of the provider or customer.</td></tr><tr><td><code>AccountName</code></td><td>string</td><td>The bank account name of the provider or customer.</td></tr><tr><td><code>Currency</code></td><td>enum</td><td>The currency in which the order was made. It could be <code>BUSD</code> or <code>NGN</code>.</td></tr><tr><td><code>OrderPaymentMethod</code></td><td>object</td><td>This holds properties of the payment method in which the order is to be made to.</td></tr><tr><td><code>ConsumerDepositMethod</code></td><td>object</td><td>This holds the props of the consumer deposit details.</td></tr><tr><td><code>ConsumerrReceiptMethod</code></td><td>object</td><td>This holds the properties of the consumer receiving method details.</td></tr><tr><td><code>WalletAddress</code></td><td>string</td><td>This is the crypto wallet address of the consumer.</td></tr><tr><td><code>Network</code></td><td>enum</td><td>This is the network currently supported in the system which the wallet address is based on.</td></tr><tr><td><code>ProviderTransactionMetadata</code></td><td>object</td><td>This holds the properties of the transaction metadata of an order. It can be null.</td></tr></tbody></table>


# Order Canceled Notification

This sends a notification to the third-party application that an order is being canceled by either the consumer or the provider. See example and descriptions below;

```json
{
  "CheckSum": "7423ACC55801F2EDB1E756725CB61182D40988620EEF40BA2C3CCEB25E479423DA656F62CBEC1DFEF1EA0FBF09311F9FF689DF47DE9517D79E137CE165114FF3",
  "Data": {
    "OrderId": "844059b7-88ea-4b73-daca-08d9eb0f6c4a",
    "OrderReference": "XB_0cb80c382cd343ae9600cf6b177be55a",
    "OrderStatus": 2,
    "InitiatedBy": 0
  }
}
```

<table><thead><tr><th width="262.82520636977705">Key</th><th width="150">Type</th><th>Description</th></tr></thead><tbody><tr><td><code>Checksum</code></td><td>string</td><td>This is a hash property signed with the merchant <code>secretkey</code>.</td></tr><tr><td><code>Data</code></td><td>object</td><td>This holds the properties of the payload data details.</td></tr><tr><td><code>OrderId</code></td><td>guid</td><td>This is the order id in the database.</td></tr><tr><td><code>OrderReference</code></td><td>string</td><td>This is the reference of the order in the database.</td></tr><tr><td><code>OrderStatus</code></td><td>enum</td><td>This is the status of an order at a particular time. It can be <code>Submitted = 1</code>, <code>Cancelled = 2</code>, <code>Acknowledged = 3</code>, <code>FundedProvider = 4</code>, <code>FundReceivedFromUser = 5</code>, <code>FundedUser = 6</code> or <code>Completed = 7</code>.</td></tr></tbody></table>


# Checksum Verification

This `POST` endpoint is created for verification of checksums of the payload received by the third-party application. The body should contain `orderReference` and `webHookType` which should vary from what type of event was triggered. The `secretKey` is also passed into the headers.

## Verifies the checksum gotten in the webhook

<mark style="color:blue;">`GET`</mark> `https://canary.xendbridge.com/api/PeerToPeerOrder/ThirdParty/Order/WebhookConfirmation`

#### Headers

| Name                                        | Type | Description |
| ------------------------------------------- | ---- | ----------- |
| secretKey<mark style="color:red;">\*</mark> |      | {secretKey} |

#### Request Body

| Name                                             | Type | Description                          |
| ------------------------------------------------ | ---- | ------------------------------------ |
| orderReference<mark style="color:red;">\*</mark> |      | XS\_7377dc6f1b674f989766b53971ce6285 |
| webHookType<mark style="color:red;">\*</mark>    |      | OrderMatched                         |

{% tabs %}
{% tab title="200: OK Success" %}

```javascript
{
    // Response
}
```

{% endtab %}
{% endtabs %}

{% tabs %}
{% tab title="Request Fields" %}

<table><thead><tr><th width="159.8181818181818">Key</th><th width="150">Type</th><th>Description</th></tr></thead><tbody><tr><td>orderReference</td><td>string</td><td><code>Required</code> The order reference number made by the consumer.</td></tr><tr><td>webHookType</td><td>string</td><td><code>Required</code> The type of event triggered of the order. It can be <code>orderMatched</code> , <code>LPPayment</code> &#x26; <code>orderCanceled</code>.</td></tr></tbody></table>
{% endtab %}

{% tab title="Response Fields" %}

<table><thead><tr><th width="150">Key</th><th width="150">Type</th><th>Description</th></tr></thead><tbody><tr><td><code>checkSum</code></td><td>string</td><td>The algorithmic validation of our system to the third party application about an order.</td></tr></tbody></table>
{% endtab %}
{% endtabs %}


# Checkout URL

XendBridge Checkout Portal

Xendbridge provides a checkout portal feature that individuals and businesses can use to quickly integrate into their applications with minimum api calls.&#x20;

<figure><img src="/files/qD0dHpZ9h7hZe0hFJRox" alt=""><figcaption></figcaption></figure>

<figure><img src="/files/FxgmrDsmjl8SXigQG4jm" alt=""><figcaption></figcaption></figure>

#### How it works

First, you would need to sign up on the [website](https://xendbridge.com) and get access to the sandbox environment. On your new dashboard, create an app and provide a logo.

Next, provide your app with supported currencies and payment methods of your choosing.

Then, enable access to the checkout portal on your dashboard.

Below are the endpoints that are necessary for implementing

* [Buy](/xendbridge-portal/checkout-url/buy-order)
* [Sell](/xendbridge-portal/checkout-url/sell-order)
* [Swap](/xendbridge-portal/checkout-url/swap-order)
* [Rate](/xendbridge-portal/checkout-url/rate) (optional)
* [RateBounds](/xendbridge-portal/checkout-url/rate-bounds) (optional)
* [Supported Currencies](/xendbridge-portal/checkout-url/supported-currencies) (optional)
* [Payment Methods](/xendbridge-portal/checkout-url/payment-methods) (optional)

### Authorization

Once a Buy, Sell, or Swap order is initiated successfully, a ***checkout*** url is returned and can be used to redirect your customer to complete the order. In order to proceed with the payment two ways have been provided for the customer to be authorized to continue payment.

<figure><img src="/files/q0ehXlXdyQjrDex8Ah72" alt=""><figcaption></figcaption></figure>

#### Email OTP

Once redirected the customer would need to provide an OTP which we'll send to the customer's email when this option is clicked before getting access to the order details.

OR

**Order Access Code**

This is the code returned in the response as `accessToken` after a successful order initiation. The third party can decide whether to show the token to its customers or not, to proceed with the order completion when this option is selected.

### LP Simulation (Liquidity Provider)

In order to test the integration end-to-end, please make use of the LP simulation endpoints to process payments and complete orders.

{% content-ref url="/pages/6T90b6nWaeWy5PEMIYtn" %}
[LP Simulation](/api-method-calls/lp-simulation)
{% endcontent-ref %}

## Environments

We have two base urls available to third parties, namely **sandbox** and **live** urls.

**Sandbox Base Url**

```uri
https://checkout-api-sandbox.xendbridge.com
```

**Live Base Url**

```uri
https://checkout.xendbridge.com
```


# Buy Order

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

The buy order `POST` api takes your `publicKey` as a required parameter in the header and a body containing properties like the customer's email, phone number, customer deposit, receipt methods, etc. Unlike the standard buy endpoint, this will return additional properties like `checkoutUrl`, and `accessToken` which can be used to redirect your users and continue the order flow.&#x20;

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.

{% hint style="info" %}
When `deferPaymentMethod` is set to true, a call to [Initiate Order Created With Deferred Payment Method](/xendbridge-portal/checkout-url/initiate-order-created-with-deferred-payment-method) should be made to complete the order initiation.
{% endhint %}

See the example below

## Initiates a buy order

<mark style="color:green;">`POST`</mark> `https://checkout-api-sandbox.xendbridge.com/api/ThirdPartyUI/Buy/Initiate`

#### Headers

| Name                                        | Type | Description |
| ------------------------------------------- | ---- | ----------- |
| publicKey<mark style="color:red;">\*</mark> |      | {publicKey} |

#### Request Body

| Name                                                       | Type   | Description                                |
| ---------------------------------------------------------- | ------ | ------------------------------------------ |
| emailAddress<mark style="color:red;">\*</mark>             |        | <annadoe@gmail.com>                        |
| phoneNumber<mark style="color:red;">\*</mark>              |        | 07064366723                                |
| userName<mark style="color:red;">\*</mark>                 |        | annadoe                                    |
| payInCurrencyCode<mark style="color:red;">\*</mark>        |        | NGN                                        |
| payInCurrencyNetwork<mark style="color:red;">\*</mark>     |        | LOCAL                                      |
| receiveInCurrencyCode<mark style="color:red;">\*</mark>    |        | BUSD                                       |
| receiveInCurrencyNetwork<mark style="color:red;">\*</mark> |        | BEP20                                      |
| orderAmount<mark style="color:red;">\*</mark>              |        | 50                                         |
| consumerDepositMethod<mark style="color:red;">\*</mark>    | Object |                                            |
| paymentMethod<mark style="color:red;">\*</mark>            |        | Bank                                       |
| paymentData<mark style="color:red;">\*</mark>              | Object |                                            |
| accountName<mark style="color:red;">\*</mark>              |        | John Doe                                   |
| accountNumber<mark style="color:red;">\*</mark>            |        | 0000187849                                 |
| bankName<mark style="color:red;">\*</mark>                 |        | Access Bank                                |
| consumerReceiptMethod<mark style="color:red;">\*</mark>    | Object |                                            |
| paymentMethod<mark style="color:red;">\*</mark>            |        | Crypto                                     |
| paymentData<mark style="color:red;">\*</mark>              | Object |                                            |
| walletAddress<mark style="color:red;">\*</mark>            |        | 0x52434Ac4BE04393e020c9b16C327d04d4367Cbcd |
| network<mark style="color:red;">\*</mark>                  |        | BEP-20                                     |
| deferPaymentMethod<mark style="color:red;">\*</mark>       | bool   | false                                      |

{% tabs %}
{% tab title="400: Bad Request Initiating another buy order while one is not finished is not allowed." %}

```javascript
{
    "Status": 2,
    "Message": "You Have A Pending Buy Order",
    "Data": null
}
```

{% endtab %}

{% tab title="200: OK Success" %}

```json
{
    "data": {
        "checkoutReference": "XCHKB_cfbb41a03e62402f875b40664c606df6fe526d10efda4e779585431fbb6ba583",
        "orderReference": "XB_8986d97efdfb402298f0aa009cf9c998",
        "checkoutUrl": "https://checkout-sandbox.xendbridge.com/order?ref=XCHKB_cfbb41a03e62402f875b40664c606df6fe526d10efda4e779585431fbb6ba583",
        "accessToken": "622654",
        "receiveInCurrencyCode": "BUSD",
        "payInCurrencyCode": "NGN",
        "customerPayInCurrencyNetwork": "LOCAL",
        "customerReceieveInCurrencyNetwork": "BEP20",
        "receivableAmount": 0.06597263,
        "payableAmount": 50.0,
        "receivableAmountWithoutMarkup": 0,
        "providerName": "John Doe",
        "providerFirstName": "John",
        "providerLastName": "Doe",
        "providerEmail": "owolabidamilola98@gmail.com",
        "initiatedAt": "2023-02-13T11:32:19.3426901Z",
        "orderExpiryDate": "2023-02-13T11:37:19.30397Z",
        "initiatedAtTimestamp": 1676287939303,
        "orderExpiryTimestamp": 1676288239303,
        "estimatedOrderCompletionTimestamp": null,
        "fundedProviderAtTimeStamp": null,
        "fundedCustomerAtTimeStamp": null,
        "orderCompletedAtTimeStamp": null,
        "p2POrderStatus": "Acknowledged",
        "disputeStatus": "NoDispute",
        "disputeReference": null,
        "orderType": "Buy",
        "providerContact": {
            "phoneNumber": "2348181186644",
            "whatsappNumber": ""
        },
        "customerContact": {
            "email": null,
            "name": null,
            "phoneNumber": null
        },
        "providerPaymentMethods": {
            "paymentMethod": "Bank",
            "paymentType": "Bank",
            "paymentData": [
                {
                    "bankName": "Access",
                    "accountNumber": "0709876786",
                    "accountName": "John Doe",
                    "address": null,
                    "swiftCode": null,
                    "iban": null,
                    "sortCode": null,
                    "currency": "NGN",
                    "network": "LOCAL"
                }
            ],
            "orderPaymentMethod": {
                "bankName": "Access",
                "accountNumber": "0709876786",
                "accountName": "John Doe",
                "address": null,
                "swiftCode": null,
                "iban": null,
                "sortCode": null,
                "currency": "NGN",
                "network": "LOCAL"
            }
        },
        "consumerDepositMethod": {
            "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"
            }
        },
        "consumerReceiptMethod": {
            "paymentMethod": "Crypto",
            "paymentType": 0,
            "paymentData": {
                "walletAddress": "0x52434Ac4BE04393e020c9b16C327d04d4367Cbcd",
                "network": "BEP20",
                "currency": "BUSD"
            }
        },
        "providerTransactionMetadata": null,
        "customerTransactionMetadata": null
    },
    "status": "OK",
    "message": ""
}
```

{% endtab %}
{% endtabs %}

<details>

<summary>JSON Request Format</summary>

```json
{
  "emailAddress": "annadoe@gmail.com",
  "phoneNumber": "07064366723",
  "userName": "annadoe",
  "payInCurrencyCode": "NGN",
  "payInCurrencyNetwork": "LOCAL",
  "receiveInCurrencyCode": "BUSD",
  "receiveInCurrencyNetwork": "BEP20",
  "orderAmount": 50,
  "deferPaymentMethod": false,
  "consumerDepositMethod": {
    "paymentMethod": "Bank",
    "paymentData": {
      "accountName": "Emmanuel Diala",
      "accountNumber": "0000187849",
      "bankName": "Access Bank"
    }
  },
  "consumerReceiptMethod": {
    "paymentMethod": "Crypto",
    "paymentData": {
      "walletAddress": "0x52434Ac4BE04393e020c9b16C327d04d4367Cbcd",
      "network": "BEP20"
    }
  }
}
```

</details>

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

<details>

<summary>JSON Request Format</summary>

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

</details>

{% tabs %}
{% tab title="Request Fields" %}

<table><thead><tr><th width="198.11337367685582">Parameters</th><th width="150">Type</th><th width="167">Definitions</th></tr></thead><tbody><tr><td>emailAddress</td><td>string</td><td><code>Required</code> This is the consumer's email address.</td></tr><tr><td>phoneNumber</td><td>string</td><td><code>Required</code> This is the consumer's phone number.</td></tr><tr><td>userName</td><td>string</td><td><code>Required</code> This is the consumer's username</td></tr><tr><td>payInCurrencyCode</td><td>enum</td><td><code>Required</code> This is the currency code to pay with. Must be <code>NGN</code> for buy order.</td></tr><tr><td>receiveInCurrencyCode</td><td>enum</td><td><code>Required</code> This is the currency code to receive the currency in. Must be <code>BUSD</code> for buy order.</td></tr><tr><td>orderAmount</td><td>decimal</td><td><code>Required</code> The order amount by the consumer.</td></tr><tr><td>consumerDepositMethod</td><td>object</td><td><code>Required</code> This holds the properties of the deposit method of the consumer which is are the bank details.</td></tr><tr><td>paymentMethod</td><td>enum</td><td><code>Required</code> The payment method by which transactions are made. It should be <code>BANK</code>for buy order.</td></tr><tr><td>paymentData</td><td>object</td><td><code>Required</code> This holds the properties of the bank details of the consumer.</td></tr><tr><td>accountName</td><td>string</td><td><code>Required</code> This is the account name of the consumer.</td></tr><tr><td>accountNumber</td><td>string</td><td><code>Required</code> The local account number of the consumer</td></tr><tr><td>bankName</td><td>string</td><td><code>Required</code> This is the bank name of the consumer.</td></tr><tr><td>consumerReceiptMethod</td><td>object</td><td><code>Required</code> This holds the properties of the consumer receiving method. The <code>paymentMethod</code> prop must be <code>Crypto</code> .</td></tr><tr><td>paymentData</td><td>object</td><td><code>Required</code> This holds the properties of the consumer receiving account details.</td></tr><tr><td>walletAddress</td><td>string</td><td><code>Required</code> The crypto wallet address of the consumer.</td></tr><tr><td>network</td><td>string</td><td><code>Required</code> This is the network on which the address is on.</td></tr></tbody></table>
{% endtab %}

{% tab title="Response Fields" %}

<table><thead><tr><th width="289.9265033407573">Parameters</th><th width="150">Type</th><th>Definitions</th></tr></thead><tbody><tr><td>checkoutReference</td><td>string</td><td>This is the reference to the checkout order.</td></tr><tr><td>orderReference</td><td>string</td><td>This the reference to a particular order.</td></tr><tr><td>checkoutUrl</td><td>string</td><td>This is the url created from the request and can be used to contiue</td></tr><tr><td>accessToken</td><td>string</td><td></td></tr><tr><td>receiveInCurrencyCode</td><td>enum</td><td>This is the currency code to receive the currency in.</td></tr><tr><td>payInCurrencyCode</td><td>enum</td><td>This is the currency code to pay with.</td></tr><tr><td>receivableAmount</td><td>decimal</td><td>This the receivable amount of the currency.</td></tr><tr><td>payableAmount</td><td>decimal</td><td>This is the payable amount of the currency.</td></tr><tr><td>providerName</td><td>string</td><td>This the provider's name.</td></tr><tr><td>providerFirstName</td><td>string</td><td>This is the provider's first name.</td></tr><tr><td>providerLastName</td><td>string</td><td>This is the provider's last name.</td></tr><tr><td>providerEmail</td><td>string</td><td>This is the provider's email address.</td></tr><tr><td>initiatedAt</td><td>DateTime</td><td>The date time the order was made.</td></tr><tr><td>orderExpiryDate</td><td>DateTime</td><td>The expiry date time of the order.</td></tr><tr><td>initiatedAtTimestamp</td><td>long</td><td>The time in milliseconds an order was made</td></tr><tr><td>orderExpiryTimestamp</td><td>long</td><td>The time in milliseconds of when thee order will expire.</td></tr><tr><td>fundedProviderAtTimeStamp</td><td>long</td><td>The time of when a customer indicates payment for an order in milliseconds.</td></tr><tr><td>fundedCustomerAtTimeStamp</td><td>long</td><td>The time of when a provider indicates payment of order to the customer in milliseconds</td></tr><tr><td>orderCompletedAtTimeStamp</td><td>long</td><td>The time in milliseconds an order was completed.</td></tr><tr><td>p2POrderStatus</td><td>enum</td><td>The status of the order at the curent time. It could be <code>Submitted</code>, <code>Cancelled</code>, <code>Acknowledged</code>, <code>FundedProvider</code>, <code>FundReceivedFromUser</code>, <code>FundedUser</code>, <code>Completed</code>, <code>OrderTimedOut</code></td></tr><tr><td>disputeStatus</td><td>enum</td><td>The status of the dispute on an order. It could either be <code>NoDispute</code>, <code>DisputeRaisedByCustomer</code>, <code>DisputeRaisedByProvider</code>, <code>DisputeRaisedByBothParties</code>, <code>DisputeResolved</code>or <code>CouldNotBeResolved</code>.</td></tr><tr><td>orderType</td><td>enum</td><td>This is the status of the order, whether it's a <code>Buy</code> or <code>Sell</code>.</td></tr><tr><td>providerContact</td><td>object</td><td>This is holds properties of a provider's contact information.</td></tr><tr><td>phoneNumber</td><td>string</td><td>The phone number of either the provider or customer.</td></tr><tr><td>whatsappNumber</td><td>string</td><td>The whatsapp number of either the provider or customer.</td></tr><tr><td>customerContact</td><td>object</td><td>This holds the props of the contact information.</td></tr><tr><td>email</td><td>string</td><td>This is an email address of the customer.</td></tr><tr><td>name</td><td>string</td><td>This is the name of the customer.</td></tr><tr><td>phoneNumber</td><td>string</td><td>The phone number of the customer</td></tr><tr><td>providerPaymentMethods</td><td>object</td><td>This holds the properties of the payment methods of the provider.</td></tr><tr><td>paymentMethod</td><td>enum</td><td>This is the method of payment. It could be <code>Bank</code> or <code>Crypto</code></td></tr><tr><td>paymentType</td><td>enum</td><td>This is the type of payment. It could be <code>Bank</code>, <code>Crypto</code>, <code>UserName</code>or <code>MobileMoney</code>.</td></tr><tr><td>paymentData</td><td>object</td><td>This holds the properties of the payment method.</td></tr><tr><td>bankName</td><td>string</td><td>The bank name of the the provider or customer.</td></tr><tr><td>accountNumber</td><td>string</td><td>The bank account number of the provider or customer.</td></tr><tr><td>accountName</td><td>string</td><td>The bank account name of the provider or customer.</td></tr><tr><td>currency</td><td>enum</td><td>The currency in which the order was made. It could be <code>BUSD</code> or <code>NGN</code>.</td></tr><tr><td>orderPaymentMethod</td><td>object</td><td>This holds properties of the payment method in which the order is to be made to.</td></tr><tr><td>consumerDepositMethod</td><td>object</td><td>This holds the properties of the consumer deposit details.</td></tr><tr><td>consumerrReceiptMethod</td><td>object</td><td>This holds the properties of the consumer receiving method details.</td></tr><tr><td>walletAddress</td><td>string</td><td>This is the crypto wallet address of the consumer.</td></tr><tr><td>network</td><td>enum</td><td>This is the network currently supported in the system which the wallet address is based on.</td></tr><tr><td>providerTransactionMetadata</td><td>object</td><td>This holds the properties of the transaction metadata of an order.</td></tr></tbody></table>
{% endtab %}
{% endtabs %}


# Sell Order

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

The sell order `POST`api 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.&#x20;

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.

{% hint style="info" %}
When `deferPaymentMethod` is set to true, a call to [Initiate Order Created With Deferred Payment Method](/xendbridge-portal/checkout-url/initiate-order-created-with-deferred-payment-method) should be made to complete the order initiation.
{% endhint %}

See the example below;

## Initiates a sell order

<mark style="color:green;">`POST`</mark> `https://checkout-api-sandbox.xendbridge.com/api/ThirdPartyUI/Sell/Initiate`

#### Headers

| Name                                        | Type   | Description |
| ------------------------------------------- | ------ | ----------- |
| publicKey<mark style="color:red;">\*</mark> | string | {publicKey} |

#### Request Body

| Name                                                       | Type   | Description                                |
| ---------------------------------------------------------- | ------ | ------------------------------------------ |
| emailAddress<mark style="color:red;">\*</mark>             | string | <annadoe@gmail.com>                        |
| phoneNumber<mark style="color:red;">\*</mark>              | string | 07064366723                                |
| userName<mark style="color:red;">\*</mark>                 | string | annadoe                                    |
| payInCurrencyCode<mark style="color:red;">\*</mark>        | string | BUSD                                       |
| payInCurrencyNetwork<mark style="color:red;">\*</mark>     | string | BEP-20                                     |
| receiveInCurrencyCode<mark style="color:red;">\*</mark>    | string | NGN                                        |
| receiveInCurrencyNetwork<mark style="color:red;">\*</mark> | string | LOCAL                                      |
| orderAmount<mark style="color:red;">\*</mark>              | double | 50                                         |
| consumerDepositMethod<mark style="color:red;">\*</mark>    | Object |                                            |
| paymentMethod<mark style="color:red;">\*</mark>            | string | Crypto                                     |
| paymentData<mark style="color:red;">\*</mark>              | Object |                                            |
| walletAddress<mark style="color:red;">\*</mark>            | string | 0x52434Ac4BE04393e020c9b16C327d04d4367Cbcd |
| network<mark style="color:red;">\*</mark>                  | string | BEP-20                                     |
| bankName<mark style="color:red;">\*</mark>                 | string | Access Bank                                |
| consumerReceiptMethod<mark style="color:red;">\*</mark>    | Object |                                            |
| paymentMethod<mark style="color:red;">\*</mark>            | string | Bank                                       |
| paymentData<mark style="color:red;">\*</mark>              | Object |                                            |
| accountName<mark style="color:red;">\*</mark>              | string | Anna Doe                                   |
| accountNumber<mark style="color:red;">\*</mark>            | string | 0123456789                                 |
| deferPaymentMethod<mark style="color:red;">\*</mark>       | bool   | false                                      |

{% tabs %}
{% tab title="200: OK Success" %}

```json
{
    "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": ""
}
```

{% endtab %}

{% tab title="400: Bad Request Initiating another buy order while one is not finished is not allowed." %}

```javascript
{
    "Status": 2,
    "Message": "You Have A Pending Sell Order",
    "Data": null
}
```

{% endtab %}
{% endtabs %}

<details>

<summary>JSON Request Format</summary>

```json
{
  "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"
    }
  }
}
```

</details>

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

<details>

<summary>JSON Request Format</summary>

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

</details>

{% tabs %}
{% tab title="Request Field" %}

| Parameter             | Type    | Definitions                                                                                                      |
| --------------------- | ------- | ---------------------------------------------------------------------------------------------------------------- |
| 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 `CRYPTO`for 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.                                                                |
| {% endtab %}          |         |                                                                                                                  |

{% tab title="Response Field" %}

<table><thead><tr><th width="209.94541484716154">Parameter</th><th width="150">Type</th><th>Definitions</th></tr></thead><tbody><tr><td>checkoutReference</td><td>string</td><td>This is the reference to the checkout order.</td></tr><tr><td>orderReference</td><td>string</td><td>This is the reference to a particular order.</td></tr><tr><td>checkoutUrl</td><td>string</td><td>This is the url link used to access and complete an order</td></tr><tr><td>accessToken</td><td>string</td><td>This is the token generated for the order to be used to access the portal</td></tr><tr><td>receiveInCurrencyCode</td><td>enum</td><td>This is the currency code to receive the currency in.</td></tr><tr><td>payInCurrencyCode</td><td>enum</td><td>This is the currency code to pay with.</td></tr><tr><td>receivableAmount</td><td>decimal</td><td>This the receivable amount of the currency.</td></tr><tr><td>payableAmount</td><td>decimal</td><td>This is the payable amount of the currency.</td></tr><tr><td>providerName</td><td>string</td><td>This the provider's name.</td></tr><tr><td>providerFirstName</td><td>string</td><td>This is the provider's first name.</td></tr><tr><td>providerLastName</td><td>string</td><td>This is the provider's last name.</td></tr><tr><td>providerEmail</td><td>string</td><td>This is the provider's email address.</td></tr><tr><td>initiatedAt</td><td>DateTime</td><td>The date time the order was made.</td></tr><tr><td>orderExpiryDate</td><td>DateTime</td><td>The expiry date time of the order.</td></tr><tr><td>initiatedAtTimestamp</td><td>long</td><td>The time in milliseconds an order was made</td></tr><tr><td>orderExpiryTimestamp</td><td>long</td><td>The time in milliseconds of when thee order will expire.</td></tr><tr><td>fundedProviderAtTimeStamp</td><td>long</td><td>The time of when a customer indicates payment for an order in milliseconds.</td></tr><tr><td>fundedCustomerAtTimeStamp</td><td>long</td><td>The time of when a provider indicates payment of order to the customer in milliseconds</td></tr><tr><td>orderCompletedAtTimeStamp</td><td>long</td><td>The time in milliseconds an order was completed.</td></tr><tr><td>p2POrderStatus</td><td>enum</td><td>The status of the order at the curent time. It could be <code>Submitted</code>, <code>Cancelled</code>, <code>Acknowledged</code>, <code>FundedProvider</code>, <code>FundReceivedFromUser</code>, <code>FundedUser</code>, <code>Completed</code>, <code>OrderTimedOut</code></td></tr><tr><td>disputeStatus</td><td>enum</td><td>The status of the dispute on an order. It could either be <code>NoDispute</code>, <code>DisputeRaisedByCustomer</code>, <code>DisputeRaisedByProvider</code>, <code>DisputeRaisedByBothParties</code>, <code>DisputeResolved</code>or <code>CouldNotBeResolved</code>.</td></tr><tr><td>orderType</td><td>enum</td><td>This is the status of the order, whether it's a <code>Buy</code> or <code>Sell</code>.</td></tr><tr><td>providerContact</td><td>object</td><td>This is holds props of a provider's contact information.</td></tr><tr><td>phoneNumber</td><td>string</td><td>The phone number of either the provider or customer.</td></tr><tr><td>whatsappNumber</td><td>string</td><td>The whatsapp number of either the provider or customer.</td></tr><tr><td>customerContact</td><td>object</td><td>This holds the props of the contact information.</td></tr><tr><td>email</td><td>string</td><td>This is an email address of the customer.</td></tr><tr><td>name</td><td>string</td><td>This is the name of the customer.</td></tr><tr><td>phoneNumber</td><td>string</td><td>The phone number of the customer</td></tr><tr><td>providerPaymentMethods</td><td>object</td><td>This holds the props of the payment methods of the provider.</td></tr><tr><td>paymentMethod</td><td>enum</td><td>This is the method of payment. It could be <code>Bank</code> or <code>Crypto</code></td></tr><tr><td>paymentType</td><td>enum</td><td>This is the type of payment. It could be <code>Bank</code>, <code>Crypto</code>, <code>UserName</code>or <code>MobileMoney</code>.</td></tr><tr><td>paymentData</td><td>object</td><td>This holds the props of the payment method.</td></tr><tr><td>bankName</td><td>string</td><td>The bank name of the the provider or customer.</td></tr><tr><td>accountNumber</td><td>string</td><td>The bank account number of the provider or customer.</td></tr><tr><td>accountName</td><td>string</td><td>The bank account name of the provider or customer.</td></tr><tr><td>currency</td><td>enum</td><td>The currency in which the order was made. It could be <code>BUSD</code> or <code>NGN</code>.</td></tr><tr><td>orderPaymentMethod</td><td>object</td><td>This holds props of the payment method in which the order is to be made to.</td></tr><tr><td>consumerDepositMethod</td><td>object</td><td>This holds the props of the consumer deposit details.</td></tr><tr><td>consumerrReceiptMethod</td><td>object</td><td>This holds the props of the consumer receiving method details.</td></tr><tr><td>walletAddress</td><td>string</td><td>This is the crypto wallet address of the consumer.</td></tr><tr><td>network</td><td>enum</td><td>This is the network currently supported in the system which the wallet address is based on.</td></tr><tr><td>providerTransactionMetadata</td><td>object</td><td>This holds the props of the transaction metadata of an order.</td></tr></tbody></table>
{% endtab %}
{% endtabs %}


# 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.&#x20;

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.

{% hint style="info" %}
When `deferPaymentMethod` is set to true, a call to [Initiate Order Created With Deferred Payment Method](/xendbridge-portal/checkout-url/initiate-order-created-with-deferred-payment-method) should be made to complete the order initiation.
{% endhint %}

See the example below;

## Initiates a swap order

<mark style="color:green;">`POST`</mark> `https://checkout-api-sandbox.xendbridge.com/api/ThirdPartyUI/Swap/Initiate`

#### Headers

| Name                                        | Type   | Description |
| ------------------------------------------- | ------ | ----------- |
| publicKey<mark style="color:red;">\*</mark> | string | {publicKey} |

#### Request Body

| Name                                                       | Type   | Description                                |
| ---------------------------------------------------------- | ------ | ------------------------------------------ |
| emailAddress<mark style="color:red;">\*</mark>             | string | <annadoe@gmail.com>                        |
| phoneNumber<mark style="color:red;">\*</mark>              | string | 07064366723                                |
| userName<mark style="color:red;">\*</mark>                 | string | annadoe                                    |
| payInCurrencyCode<mark style="color:red;">\*</mark>        | string | BUSD                                       |
| payInCurrencyNetwork<mark style="color:red;">\*</mark>     | string | BEP-20                                     |
| receiveInCurrencyCode<mark style="color:red;">\*</mark>    | string | NGN                                        |
| receiveInCurrencyNetwork<mark style="color:red;">\*</mark> | string | LOCAL                                      |
| orderAmount<mark style="color:red;">\*</mark>              | double | 50                                         |
| consumerDepositMethod<mark style="color:red;">\*</mark>    | Object |                                            |
| paymentMethod<mark style="color:red;">\*</mark>            | string | Crypto                                     |
| paymentData<mark style="color:red;">\*</mark>              | Object |                                            |
| walletAddress<mark style="color:red;">\*</mark>            | string | 0x52434Ac4BE04393e020c9b16C327d04d4367Cbcd |
| network<mark style="color:red;">\*</mark>                  | string | BEP-20                                     |
| consumerReceiptMethod<mark style="color:red;">\*</mark>    | Object |                                            |
| paymentMethod<mark style="color:red;">\*</mark>            | string | Crypto                                     |
| paymentData<mark style="color:red;">\*</mark>              | Object |                                            |
| walletAddress<mark style="color:red;">\*</mark>            | string | 0x52434Ac4BE04393e020c9b16C327d04d4367Cbcd |
| network<mark style="color:red;">\*</mark>                  | string | POLYGON                                    |
| deferPaymentMethod<mark style="color:red;">\*</mark>       | bool   | false                                      |

{% tabs %}
{% tab title="200: OK Success" %}

```json
{
    "data": {
        "checkoutReference": "XCHKC_b73aa1ab3e9b40ba97acce190ae6295c7b2b5e18f8c444b28f8ad9c39d8a26a1",
        "orderReference": "XC_acdcadd7c35d48afba8d203d5481ea85",
        "checkoutUrl": "https://checkout-sandbox.xendbridge.com/order?ref=XCHKC_b73aa1ab3e9b40ba97acce190ae6295c7b2b5e18f8c444b28f8ad9c39d8a26a1",
        "accessToken": "362479",
        "receiveInCurrencyCode": "WNT",
        "payInCurrencyCode": "BUSD",
        "customerPayInCurrencyNetwork": "BEP20",
        "customerReceieveInCurrencyNetwork": "POLYGON",
        "receivableAmount": 4.5208000,
        "payableAmount": 50.0,
        "receivableAmountWithoutMarkup": 0,
        "providerName": "John Doe",
        "providerFirstName": "John",
        "providerLastName": "Doe",
        "providerEmail": "owolabidamilola98@gmail.com",
        "initiatedAt": "2023-02-13T11:50:14.7794655Z",
        "orderExpiryDate": "2023-02-13T11:57:14.7015987Z",
        "initiatedAtTimestamp": 1676289014701,
        "orderExpiryTimestamp": 1676289434701,
        "estimatedOrderCompletionTimestamp": null,
        "fundedProviderAtTimeStamp": null,
        "fundedCustomerAtTimeStamp": null,
        "orderCompletedAtTimeStamp": null,
        "p2POrderStatus": "Acknowledged",
        "disputeStatus": "NoDispute",
        "disputeReference": null,
        "orderType": "Swap",
        "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": "0x30b7D85f7CF498D556a9448243a7994bc4660790",
                "network": "BEP20",
                "currency": "BUSD"
            }
        },
        "consumerReceiptMethod": {
            "paymentMethod": "Crypto",
            "paymentType": 0,
            "paymentData": {
                "walletAddress": "0x30b7D85f7CF498D556a9448243a7994bc4660790",
                "network": "POLYGON",
                "currency": "WNT"
            }
        },
        "providerTransactionMetadata": null,
        "customerTransactionMetadata": null
    },
    "status": "OK",
    "message": ""
}
```

{% endtab %}

{% tab title="400: Bad Request Initiating another swap order while one is not finished is not allowed." %}

```javascript
{
    "Status": 2,
    "Message": "You Have A Pending Swap Order",
    "Data": null
}
```

{% endtab %}
{% endtabs %}

<details>

<summary>Crypto-Crypto JSON Request Format</summary>

```json
{
  "emailAddress": "annadoe@gmail.com",
  "phoneNumber": "07064366723",
  "userName": "annadoe",
  "payInCurrencyCode": "BUSD",
  "payInCurrencyNetwork": "BEP20",
  "receiveInCurrencyCode": "WNT",
  "receiveInCurrencyNetwork": "POLYGON",
  "orderAmount": 50,
  "deferePaymentMethod": false,
  "consumerDepositMethod": {
    "paymentMethod": "Crypto",
    "paymentData": {
      "walletAddress": "0x30b7D85f7CF498D556a9448243a7994bc4660790",
      "network": "BEP20"
    }
  },
  "consumerReceiptMethod": {
    "paymentMethod": "Crypto",
    "paymentData": {
      "walletAddress": "0x30b7D85f7CF498D556a9448243a7994bc4660790",
      "network": "POLYGON"
    }
  }
}
```

</details>

<details>

<summary>Fiat-Fiat JSON Request Format</summary>

```json
{
  "emailAddress": "annadoe@gmail.com",
  "phoneNumber": "07064366723",
  "userName": "annadoe",
  "payInCurrencyCode": "BUSD",
  "payInCurrencyNetwork": "BEP20",
  "receiveInCurrencyCode": "WNT",
  "receiveInCurrencyNetwork": "POLYGON",
  "orderAmount": 50,
  "deferPaymentMethod": false,
  "consumerDepositMethod": {
    "paymentMethod": "Bank",
    "paymentData": {
      "accountName": "Anna Doe",
      "accountNumber": "0000187849",
      "bankName": "Access Bank"
    }
  },
  "consumerReceiptMethod": {
    "paymentMethod": "Bank",
    "paymentData": {
      "accountName": "Anna Doe",
      "accountNumber": "0000187849",
      "bankName": "Access Bank"
    }
  }
}
```

</details>

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

<details>

<summary>JSON Request Format</summary>

```json
{
  "emailAddress": "johndoe@gmail.com",
  "phoneNumber": null,
  "userName": null,
  "payInCurrencyCode": "XEND",
  "payInCurrencyNetwork": "BEP20",
  "receiveInCurrencyCode": "BUSD",
  "receiveInCurrencyNetwork": "BEP20",
  "orderAmount": 1,
  "deferPaymentMethod": true
}
```

</details>

{% tabs %}
{% tab title="Request Field" %}

| Parameter             | Type    | Definitions                                                                                                      |
| --------------------- | ------- | ---------------------------------------------------------------------------------------------------------------- |
| 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 `CRYPTO`for 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.                                                                |
| {% endtab %}          |         |                                                                                                                  |

{% tab title="Response Field" %}

<table><thead><tr><th width="209.94541484716154">Parameter</th><th width="150">Type</th><th>Definitions</th></tr></thead><tbody><tr><td>checkoutReference</td><td>string</td><td>This is the refernce to the checkout order.</td></tr><tr><td>orderReference</td><td>string</td><td>This the reference to a particular order.</td></tr><tr><td>receiveInCurrencyCode</td><td>enum</td><td>This is the currency code to receive the currency in.</td></tr><tr><td>payInCurrencyCode</td><td>enum</td><td>This is the currency code to pay with.</td></tr><tr><td>receivableAmount</td><td>decimal</td><td>This the receivable amount of the currency.</td></tr><tr><td>payableAmount</td><td>decimal</td><td>This is the payable amount of the currency.</td></tr><tr><td>providerName</td><td>string</td><td>This the provider's name.</td></tr><tr><td>providerFirstName</td><td>string</td><td>This is the provider's first name.</td></tr><tr><td>providerLastName</td><td>string</td><td>This is the provider's last name.</td></tr><tr><td>providerEmail</td><td>string</td><td>This is the provider's email address.</td></tr><tr><td>initiatedAt</td><td>DateTime</td><td>The date time the order was made.</td></tr><tr><td>orderExpiryDate</td><td>DateTime</td><td>The expiry date time of the order.</td></tr><tr><td>initiatedAtTimestamp</td><td>long</td><td>The time in milliseconds an order was made</td></tr><tr><td>orderExpiryTimestamp</td><td>long</td><td>The time in milliseconds of when thee order will expire.</td></tr><tr><td>fundedProviderAtTimeStamp</td><td>long</td><td>The time of when a customer indicates payment for an order in milliseconds.</td></tr><tr><td>fundedCustomerAtTimeStamp</td><td>long</td><td>The time of when a provider indicates payment of order to the customer in milliseconds</td></tr><tr><td>orderCompletedAtTimeStamp</td><td>long</td><td>The time in milliseconds an order was completed.</td></tr><tr><td>p2POrderStatus</td><td>enum</td><td>The status of the order at the curent time. It could be <code>Submitted</code>, <code>Cancelled</code>, <code>Acknowledged</code>, <code>FundedProvider</code>, <code>FundReceivedFromUser</code>, <code>FundedUser</code>, <code>Completed</code>, <code>OrderTimedOut</code></td></tr><tr><td>disputeStatus</td><td>enum</td><td>The status of the dispute on an order. It could either be <code>NoDispute</code>, <code>DisputeRaisedByCustomer</code>, <code>DisputeRaisedByProvider</code>, <code>DisputeRaisedByBothParties</code>, <code>DisputeResolved</code>or <code>CouldNotBeResolved</code>.</td></tr><tr><td>orderType</td><td>enum</td><td>This is the status of the order, whether it's a <code>Buy</code> or <code>Sell</code>.</td></tr><tr><td>providerContact</td><td>object</td><td>This is holds props of a provider's contact information.</td></tr><tr><td>phoneNumber</td><td>string</td><td>The phone number of either the provider or customer.</td></tr><tr><td>whatsappNumber</td><td>string</td><td>The whatsapp number of either the provider or customer.</td></tr><tr><td>customerContact</td><td>object</td><td>This holds the props of the contact information.</td></tr><tr><td>email</td><td>string</td><td>This is an email address of the customer.</td></tr><tr><td>name</td><td>string</td><td>This is the name of the customer.</td></tr><tr><td>phoneNumber</td><td>string</td><td>The phone number of the customer</td></tr><tr><td>providerPaymentMethods</td><td>object</td><td>This holds the props of the payment methods of the provider.</td></tr><tr><td>paymentMethod</td><td>enum</td><td>This is the method of payment. It could be <code>Bank</code> or <code>Crypto</code></td></tr><tr><td>paymentType</td><td>enum</td><td>This is the type of payment. It could be <code>Bank</code>, <code>Crypto</code>, <code>UserName</code>or <code>MobileMoney</code>.</td></tr><tr><td>paymentData</td><td>object</td><td>This holds the props of the payment method.</td></tr><tr><td>bankName</td><td>string</td><td>The bank name of the the provider or customer.</td></tr><tr><td>accountNumber</td><td>string</td><td>The bank account number of the provider or customer.</td></tr><tr><td>accountName</td><td>string</td><td>The bank account name of the provider or customer.</td></tr><tr><td>currency</td><td>enum</td><td>The currency in which the order was made. It could be <code>BUSD</code> or <code>NGN</code>.</td></tr><tr><td>orderPaymentMethod</td><td>object</td><td>This holds props of the payment method in which the order is to be made to.</td></tr><tr><td>consumerDepositMethod</td><td>object</td><td>This holds the props of the consumer deposit details.</td></tr><tr><td>consumerrReceiptMethod</td><td>object</td><td>This holds the props of the consumer receiving method details.</td></tr><tr><td>walletAddress</td><td>string</td><td>This is the crypto wallet address of the consumer.</td></tr><tr><td>network</td><td>enum</td><td>This is the network currently supported in the system which the wallet address is based on.</td></tr><tr><td>providerTransactionMetadata</td><td>object</td><td>This holds the props of the transaction metadata of an order.</td></tr></tbody></table>
{% endtab %}
{% endtabs %}


# Rate

Get Order Rate

The Get Order Rate `GET`endpoint gets the lowest possible exchange rate for an order placed by a consumer from a provider. This requires your `publickey` in the environment variables while the query params passed will be the `payInCurrencyCode` , `recieveInCurrencyCode` & `orderAmount`.

The returned result will have a `rateValidityInSeconds`, `providerRateAmount`& `providerRateReference`. To get a response for a sell or swap order, switch to desired networks and currency inputs on request and make the call. See the example below;

## ?payInCurrencyCode=NGN\&payInCurrencyNetwork=LOCAL\&receiveInCurrencyCode=BUSD\&receiveInCurrencyNetwork=BEP20\&orderAmount=500

<mark style="color:blue;">`GET`</mark> `https://checkout-api-sandbox.xendbridge.com/api/ThirdPartyUI/Rate`

#### Query Parameters

| Name                                                       | Type   | Description |
| ---------------------------------------------------------- | ------ | ----------- |
| payInCurrencyCode<mark style="color:red;">\*</mark>        |        | NGN         |
| payInCurrencyNetwork<mark style="color:red;">\*</mark>     | string | LOCAL       |
| receiveInCurrencyCode<mark style="color:red;">\*</mark>    | string | BUSD        |
| receiveInCurrencyNetwork<mark style="color:red;">\*</mark> | string | BEP-20      |
| orderAmount<mark style="color:red;">\*</mark>              | double | 500         |

#### Headers

| Name                                        | Type   | Description |
| ------------------------------------------- | ------ | ----------- |
| publicKey<mark style="color:red;">\*</mark> | string | {publicKey} |

{% tabs %}
{% tab title="200: OK Successful" %}

```javascript
{
    "data": {
        "exchangeRate": 559.00,
        "maximumAmount": 10000.000000000,
        "minimumAmount": 5.000000000,
        "providerRateReference": "1382CB3D300346E6A183B720181E0D2B",
        "rateValidityInSeconds": 20
    },
    "status": "OK",
    "message": ""
}
```

{% endtab %}
{% endtabs %}

{% tabs %}
{% tab title="Request Fields" %}

<table><thead><tr><th>Parameters</th><th width="150">Type</th><th>Definitions</th></tr></thead><tbody><tr><td>payInCurrencyCode</td><td>string</td><td><code>Required</code> The currency to be paid in.</td></tr><tr><td>payInCurrencyNetwork</td><td>string</td><td><code>Required</code> The network of the currency to be paid in</td></tr><tr><td>receiveInCurrencyCode</td><td>string</td><td><code>Required</code> The currency to be received in.</td></tr><tr><td>receiveInCurrencyNetwork</td><td>string</td><td><code>Required</code> The network of the currency to be received in</td></tr><tr><td>orderAmount</td><td>double</td><td><code>Required</code> The amount of the order.</td></tr></tbody></table>
{% endtab %}

{% tab title="Response Fields" %}

<table><thead><tr><th>Parameters</th><th width="151.66666666666666">Type</th><th>Definitions</th></tr></thead><tbody><tr><td>exchangeRate</td><td>decimal</td><td>This is the exchange rate at which an order could be exchanged for</td></tr><tr><td>maximumAmount</td><td>decimal</td><td>This is the maximum amount a customer can order.</td></tr><tr><td>minimumAmount</td><td>decimal</td><td>This is the minimum amount a customer can order.</td></tr><tr><td>providerRateReference</td><td>string</td><td>This is the reference of the rates of a provider.</td></tr><tr><td>rateValidityInSeconds</td><td>int</td><td>This is the validity of an order rate of a provider in seconds.</td></tr></tbody></table>
{% endtab %}
{% endtabs %}


# Rate Bounds

Get the best and worst rates

Unlike the Rate endpoint, this `GET` endpoint is responsible for getting the best and worst rates for a supplied currency pair. This requires your app's `publickey` in the header while the query params passed will be the `payInCurrencyCode` , `recieveInCurrencyCode` & `orderAmount`.

The returned result will have `bestRate` and `worstRate` objects containing different rates. To get a response for a sell or swap order, switch to desired networks and currency inputs on request and make the call. See the example below;

## Get the best and worst rates

<mark style="color:blue;">`GET`</mark> `https://checkout-api-sandbox.xendbridge.com/api/ThirdPartyUI/RateBounds`

#### Query Parameters

| Name                                                       | Type   | Description |
| ---------------------------------------------------------- | ------ | ----------- |
| payInCurrencyCode<mark style="color:red;">\*</mark>        | string | NGN         |
| payInCurrencyNetwork<mark style="color:red;">\*</mark>     | string | LOCAL       |
| receiveInCurrencyCode<mark style="color:red;">\*</mark>    | string | BUSD        |
| receiveInCurrencyNetwork<mark style="color:red;">\*</mark> | string | BEP20       |
| orderAmount<mark style="color:red;">\*</mark>              | double | 500         |

#### Headers

| Name                                        | Type   | Description |
| ------------------------------------------- | ------ | ----------- |
| publicKey<mark style="color:red;">\*</mark> | string | {publicKey} |

{% tabs %}
{% tab title="200: OK Success" %}

```javascript
{
    "data": {
        "fiatCurrency": "NGN",
        "fiatCurrencyNetwork": "LOCAL",
        "cryptoCurrency": "BUSD",
        "cryptoCurrencyNetwork": "BEP20",
        "bestRate": {
            "exchangeRate": 757.89,
            "maximumAmount": 100000.000000000,
            "minimumAmount": 5.000000000,
            "providerRateReference": "E69A5099089F4231882C5A98B294B50F",
            "rateValidityInSeconds": 20
        },
        "worstRate": {
            "exchangeRate": 763.59,
            "maximumAmount": 100000.000000000,
            "minimumAmount": 5.000000000,
            "providerRateReference": "E69A5099089F4231882C5A98B294B50F",
            "rateValidityInSeconds": 20
        }
    },
    "status": "OK",
    "message": ""
}
```

{% endtab %}
{% endtabs %}

{% tabs %}
{% tab title="Request Fields" %}

<table><thead><tr><th>Parameters</th><th width="150">Type</th><th>Definitions</th></tr></thead><tbody><tr><td>payInCurrencyCode</td><td>string</td><td><code>Required</code> The currency to be paid in.</td></tr><tr><td>payInCurrencyNetwork</td><td>string</td><td><code>Required</code> The network of the currency to be paid in</td></tr><tr><td>receiveInCurrencyCode</td><td>string</td><td><code>Required</code> The currency to be received in.</td></tr><tr><td>receiveInCurrencyNetwork</td><td>string</td><td><code>Required</code> The network of the currency to be received in</td></tr><tr><td>orderAmount</td><td>double</td><td><code>Required</code> The amount of the order.</td></tr></tbody></table>
{% endtab %}

{% tab title="Response Fields" %}

<table><thead><tr><th>Parameters</th><th width="151.66666666666666">Type</th><th>Definitions</th></tr></thead><tbody><tr><td>exchangeRate</td><td>decimal</td><td>This is the exchange rate at which an order could be exchanged for</td></tr><tr><td>maximumAmount</td><td>decimal</td><td>This is the maximum amount a customer can order.</td></tr><tr><td>minimumAmount</td><td>decimal</td><td>This is the minimum amount a customer can order.</td></tr><tr><td>providerRateReference</td><td>string</td><td>This is the reference of the rates of a provider.</td></tr><tr><td>rateValidityInSeconds</td><td>int</td><td>This is the validity of an order rate of a provider in seconds.Rate Bounds</td></tr></tbody></table>
{% endtab %}
{% endtabs %}


# Initiate Order Created With Deferred Payment Method

When `deferPaymentMethod` is set to true, a call must be made to this endpoint whether it's a buy, sell, or swap request to complete the order initiations.

See example below;

<mark style="color:green;">`POST`</mark> `https://checkout-api-sandbox.xendbridge.com/api/Order/InitiateOrderCreatedWithDeferedPaymentMethod`

#### Request Body

| Name                                                    | Type   | Description                                |
| ------------------------------------------------------- | ------ | ------------------------------------------ |
| checkoutReference<mark style="color:red;">\*</mark>     | string | XCHKB\_2945da2a8428404fb7fa7c              |
| consumerDepositMethod<mark style="color:red;">\*</mark> | object |                                            |
| paymentMethod<mark style="color:red;">\*</mark>         | string | Bank                                       |
| paymentData<mark style="color:red;">\*</mark>           | Object |                                            |
| accountName<mark style="color:red;">\*</mark>           | string | Anna Doe                                   |
| accountNumber<mark style="color:red;">\*</mark>         | string | 0000187849                                 |
| bankName<mark style="color:red;">\*</mark>              | string | Access Bank                                |
| consumerReceiptMethod<mark style="color:red;">\*</mark> | Object |                                            |
| paymentMethod<mark style="color:red;">\*</mark>         | string | Crypto                                     |
| paymentData<mark style="color:red;">\*</mark>           | Object |                                            |
| walletAddress<mark style="color:red;">\*</mark>         | string | 0x52434Ac4BE04393e020c9b16C327d04d4367Cbcd |
| network                                                 | string | BEP-20                                     |

{% tabs %}
{% tab title="200: OK Success" %}

```json
{
  "data": {
    "checkoutReference": "XCHKB_2945da2a8428404fb7fa7c1ae1b0b8e825abe19a1d46433f95e2eef380de73f6",
    "orderReference": "XB_3eaa5a476b9648bd894f238403427fa4",
    "checkoutUrl": "https://checkout-sandbox.xendbridge.com/order?ref=XCHKB_2945da2a8428404fb7fa7c1ae1b0b8e825abe19a1d46433f95e2eef380de73f6",
    "accessToken": "591945",
    "receiveInCurrencyCode": "BUSD",
    "payInCurrencyCode": "NGN",
    "customerPayInCurrencyNetwork": "LOCAL",
    "customerReceieveInCurrencyNetwork": "BEP20",
    "receivableAmount": 0.06597263,
    "payableAmount": 50,
    "receivableAmountWithoutMarkup": 0,
    "providerName": "John Doe",
    "providerFirstName": "John",
    "providerLastName": "Doe",
    "providerEmail": "owolabidamilola98@gmail.com",
    "initiatedAt": "2023-02-13T11:13:43.778927Z",
    "orderExpiryDate": "2023-02-13T11:18:43.6292138Z",
    "initiatedAtTimestamp": 1676286823629,
    "orderExpiryTimestamp": 1676287123629,
    "estimatedOrderCompletionTimestamp": null,
    "fundedProviderAtTimeStamp": null,
    "fundedCustomerAtTimeStamp": null,
    "orderCompletedAtTimeStamp": null,
    "p2POrderStatus": "Acknowledged",
    "disputeStatus": "NoDispute",
    "disputeReference": null,
    "orderType": "Buy",
    "providerContact": {
      "phoneNumber": "2348181186644",
      "whatsappNumber": ""
    },
    "customerContact": {
      "email": null,
      "name": null,
      "phoneNumber": null
    },
    "providerPaymentMethods": {
      "paymentMethod": "Bank",
      "paymentType": "Bank",
      "paymentData": [
        {
          "bankName": "Access",
          "accountNumber": "0709876786",
          "accountName": "John Doe",
          "address": null,
          "swiftCode": null,
          "iban": null,
          "sortCode": null,
          "currency": "NGN",
          "network": "LOCAL"
        }
      ],
      "orderPaymentMethod": {
        "bankName": "Access",
        "accountNumber": "0709876786",
        "accountName": "John Doe",
        "address": null,
        "swiftCode": null,
        "iban": null,
        "sortCode": null,
        "currency": "NGN",
        "network": "LOCAL"
      }
    },
    "consumerDepositMethod": {
      "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"
      }
    },
    "consumerReceiptMethod": {
      "paymentMethod": "Crypto",
      "paymentType": 0,
      "paymentData": {
        "walletAddress": "0x52434Ac4BE04393e020c9b16C327d04d4367Cbcd",
        "network": "BEP20",
        "currency": "BUSD"
      }
    },
    "providerTransactionMetadata": null,
    "customerTransactionMetadata": null
  },
  "status": "OK",
  "message": ""
}
```

{% endtab %}

{% tab title="401: Unauthorized Unauthorized" %}

```javascript
{
    // Response
}
```

{% endtab %}
{% endtabs %}

<details>

<summary>JSON Request Body</summary>

```json
{
  "checkoutReference": "XCHKB_2945da2a8428404fb7fa7c1ae1b0b8e825abe19a1d46433f95e2eef380de73f6",
  "consumerDepositMethod": {
    "paymentMethod": "Bank",
    "paymentData": {
      "accountName": "Emmanuel Diala",
      "accountNumber": "0000187849",
      "bankName": "Access Bank"
    }
  },
  "consumerReceiptMethod": {
    "paymentMethod": "Crypto",
    "paymentData": {
      "walletAddress": "0x52434Ac4BE04393e020c9b16C327d04d4367Cbcd",
      "network": "BEP20"
    }
  }
}
```

</details>


# Supported Currencies

This `GET` endpoint gets the supported currencies enabled on your application.

The `publicKey` is passed in the header and returns the response bearing the `name`, `currencyType`,`currencySymbol`, `network`, `symbolUrl` etc. See example below;

## Gets Supported Currencies

<mark style="color:blue;">`GET`</mark> `https://checkout-api-sandbox.xendbridge.com/api/ThirdPartyUI/SupportedCurrencies`

#### Headers

| Name                                        | Type   | Description |
| ------------------------------------------- | ------ | ----------- |
| publicKey<mark style="color:red;">\*</mark> | string | {publicKey} |

{% tabs %}
{% tab title="200: OK " %}

```json
{
    "data": [
        {
            "id": "95080438-3599-42fe-af4d-f8fc590327e6",
            "name": "USD Tether",
            "currencyType": "CRYPTO",
            "currencySymbol": "USDT",
            "network": "ERC20",
            "symbolUrl": "https://res.cloudinary.com/chukwuemekanweke/image/upload/v1621375342/currency_logos/USD_Tether.png",
            "countryFlagUrl": null,
            "currencySymbolText": "USDT",
            "isActive": true
        },
        {
            "id": "456cf86a-358b-4048-a905-c03e1c07dc18",
            "name": "Kenyan Shilling",
            "currencyType": "FIAT",
            "currencySymbol": "KES",
            "network": "LOCAL",
            "symbolUrl": "https://res.cloudinary.com/chukwuemekanweke/image/upload/v1621375299/currency_logos/Kenyan_Shilling.png",
            "countryFlagUrl": "https://res.cloudinary.com/chukwuemekanweke/image/upload/v1656575523/xendcashlink_countries_flag/kenya.jpg",
            "currencySymbolText": "KES",
            "isActive": true
        },
        {
            "id": "32c67c0e-ed8f-40fb-ac0d-cb3cd238b710",
            "name": "Ghanaian Cedi",
            "currencyType": "FIAT",
            "currencySymbol": "GHC",
            "network": "LOCAL",
            "symbolUrl": "https://res.cloudinary.com/chukwuemekanweke/image/upload/v1621375299/currency_logos/Ghana_Cedi.png",
            "countryFlagUrl": "https://res.cloudinary.com/chukwuemekanweke/image/upload/v1656575522/xendcashlink_countries_flag/ghana.jpg",
            "currencySymbolText": "GHC",
            "isActive": true
        },
        {
            "id": "a0f5f367-977c-4166-8107-620a1b15c40a",
            "name": "Wicrypt Network Token",
            "currencyType": "CRYPTO",
            "currencySymbol": "WNT",
            "network": "POLYGON",
            "symbolUrl": "https://assets.coingecko.com/coins/images/21223/small/wicrypt.PNG?1638740788",
            "countryFlagUrl": null,
            "currencySymbolText": "WNT",
            "isActive": true
        },
        {
            "id": "69245b4c-bed8-4935-b9af-14a31c4f9eda",
            "name": "US Dollar",
            "currencyType": "FIAT",
            "currencySymbol": "USD",
            "network": "LOCAL",
            "symbolUrl": "https://res.cloudinary.com/chukwuemekanweke/image/upload/v1621375300/currency_logos/US_Dollar.png",
            "countryFlagUrl": "https://res.cloudinary.com/chukwuemekanweke/image/upload/v1656575523/xendcashlink_countries_flag/usa.jpg",
            "currencySymbolText": "USD",
            "isActive": true
        },
        {
            "id": "7b7698bf-199e-4d2a-af30-23a19ac2d75e",
            "name": "USD Coin",
            "currencyType": "CRYPTO",
            "currencySymbol": "USDC",
            "network": "POLYGON",
            "symbolUrl": "https://res.cloudinary.com/oneassets/image/upload/v1660759353/assets/images/qkyd5vf6rjbl0d3tabxo.png",
            "countryFlagUrl": null,
            "currencySymbolText": "USDC",
            "isActive": true
        },
        {
            "id": "a9bbcc81-90bf-46a2-8bb7-ec254a782a06",
            "name": "USD Coin",
            "currencyType": "CRYPTO",
            "currencySymbol": "USDC",
            "network": "BEP20",
            "symbolUrl": "https://res.cloudinary.com/oneassets/image/upload/v1660759353/assets/images/qkyd5vf6rjbl0d3tabxo.png",
            "countryFlagUrl": null,
            "currencySymbolText": "USDC",
            "isActive": true
        },
        {
            "id": "b5bebc8a-61e4-4074-902c-326c5416179a",
            "name": "BUSD",
            "currencyType": "CRYPTO",
            "currencySymbol": "BUSD",
            "network": "ERC20",
            "symbolUrl": "https://d2ey3ce1wbjugu.cloudfront.net/currencies/binance-usd-busd-logo.png",
            "countryFlagUrl": null,
            "currencySymbolText": "BUSD",
            "isActive": true
        },
        {
            "id": "619f1cc1-dba5-4a56-8781-47ba8203ab70",
            "name": "TRX",
            "currencyType": "CRYPTO",
            "currencySymbol": "TRX",
            "network": "TRON",
            "symbolUrl": "https://d20owwgrrz4drp.cloudfront.net/currencies/tron.png",
            "countryFlagUrl": null,
            "currencySymbolText": "TRX",
            "isActive": true
        },
        {
            "id": "73df4776-65d1-443e-a7b6-9fa090a5eb99",
            "name": "USD Tether",
            "currencyType": "CRYPTO",
            "currencySymbol": "USDT",
            "network": "TRON",
            "symbolUrl": "https://d2ey3ce1wbjugu.cloudfront.net/currencies/USD_Tether.png",
            "countryFlagUrl": null,
            "currencySymbolText": "USDT",
            "isActive": true
        },
        {
            "id": "6a5cbade-592b-42b4-a35f-a6cacd2e0a46",
            "name": "Xend",
            "currencyType": "CRYPTO",
            "currencySymbol": "XEND",
            "network": "BEP20",
            "symbolUrl": "https://res.cloudinary.com/chukwuemekanweke/image/upload/v1621375343/currency_logos/Xend.png",
            "countryFlagUrl": null,
            "currencySymbolText": "XEND",
            "isActive": true
        },
        {
            "id": "261c3f81-0dd5-4a3f-b9f2-2fc4f37464c9",
            "name": "Nigerian Naira",
            "currencyType": "FIAT",
            "currencySymbol": "NGN",
            "network": "LOCAL",
            "symbolUrl": "https://res.cloudinary.com/chukwuemekanweke/image/upload/v1621375343/currency_logos/Naira.png",
            "countryFlagUrl": "https://res.cloudinary.com/chukwuemekanweke/image/upload/v1656575524/xendcashlink_countries_flag/nigeria.jpg",
            "currencySymbolText": "NGN",
            "isActive": true
        },
        {
            "id": "22f4f68b-e988-4e7f-9cd2-fc4171492b55",
            "name": "BUSD",
            "currencyType": "CRYPTO",
            "currencySymbol": "BUSD",
            "network": "BEP20",
            "symbolUrl": "https://res.cloudinary.com/chukwuemekanweke/image/upload/c_scale,w_480/v1638458463/currency_logos/binance-usd-busd-logo.png",
            "countryFlagUrl": null,
            "currencySymbolText": "BUSD",
            "isActive": true
        }
    ],
    "status": "OK",
    "message": ""
}
```

{% endtab %}
{% endtabs %}

{% tabs %}
{% tab title="Request Fields" %}

| Parameters   | Type   | Definitions                                                             |
| ------------ | ------ | ----------------------------------------------------------------------- |
| `publicKey`  | string | `Required` This is the key   generated upon creation of an application. |
| {% endtab %} |        |                                                                         |

{% tab title="Response Fields" %}

| Parameters           | Type   | Definition                                            |
| -------------------- | ------ | ----------------------------------------------------- |
| `name`               | string | The name of the currency                              |
| `currencyType`       | string | The type of currency. It can be either CRYPTO or FIAT |
| `currencySymbol`     | enum   | The symbol of the currency                            |
| `network`            | string | The network of the currency                           |
| `symbolUrl`          | string | The currency image url                                |
| `countryFlagUrl`     | string | The country flag image url                            |
| `currencySymbolText` | string | The currency symbol text                              |
| `isActive`           | bool   | The status of the currency                            |
| {% endtab %}         |        |                                                       |
| {% endtabs %}        |        |                                                       |


# Payment Methods

This `GET` endpoint gets the payment methods activated in your application.

The `publicKey` is passed in the header and `currencyType` can either be `FIAT` or `CRYPTO` which is passed as a query and this returns `name`, `isEnabled`, `methodReference`, `paymentType` and `currencyType`. See below for an example;

## Gets the available payment methods.

<mark style="color:blue;">`GET`</mark> `https://checkout-api-sandbox.xendbridge.com/api/ThirdPartyUI/PaymentMethods`

#### Query Parameters

| Name                                           | Type   | Description    |
| ---------------------------------------------- | ------ | -------------- |
| currencyType<mark style="color:red;">\*</mark> | string | {FIAT, CRYPTO} |

#### Headers

| Name                                        | Type   | Description |
| ------------------------------------------- | ------ | ----------- |
| publicKey<mark style="color:red;">\*</mark> | string | {publicKey} |

{% tabs %}
{% tab title="200: OK Success - FIAT" %}

```json
{
    "data": [
        {
            "name": "Mpesa",
            "isEnabled": true,
            "methodReference": "438C732A4353481DA61963C0F25C0235",
            "method": "Mpesa",
            "paymentType": "MobileMoney",
            "currencyType": "FIAT"
        },
        {
            "name": "Momo",
            "isEnabled": true,
            "methodReference": "96668EDB4617427EB58C0D51F5144AA6",
            "method": "Momo",
            "paymentType": "MobileMoney",
            "currencyType": "FIAT"
        },
        {
            "name": "Chipper Cash",
            "isEnabled": true,
            "methodReference": "AA1AF5E3A3904BE69D12FDEAB11B03C5",
            "method": "ChipperCash",
            "paymentType": "Fintech",
            "currencyType": "FIAT"
        },
        {
            "name": "Bank Transfer",
            "isEnabled": true,
            "methodReference": "DC5305D4EBB34719A503AB4DA689B216",
            "method": "Bank",
            "paymentType": "Bank",
            "currencyType": "FIAT"
        }
    ],
    "status": "OK",
    "message": ""
}
```

{% endtab %}

{% tab title="200: OK Success - CRYPTO" %}

```json
{
    "data": [
        {
            "name": "Cryptocurrency",
            "isEnabled": true,
            "methodReference": "D38B6A22292C4DB596FF9615DF432779",
            "method": "Crypto",
            "paymentType": "Crypto",
            "currencyType": "CRYPTO"
        }
    ],
    "status": "OK",
    "message": ""
}
```

{% endtab %}
{% endtabs %}

{% tabs %}
{% tab title="Request Fields" %}

| Parameters     | Type   | Definitions                                                             |
| -------------- | ------ | ----------------------------------------------------------------------- |
| `publicKey`    | string | `Required` This is the key   generated upon creation of an application. |
| `currencyType` | string | `Required` This is the currency type being either FIAT or CRYPTO        |
| {% endtab %}   |        |                                                                         |

{% tab title="Response Fields" %}

|                   |        |                                                     |
| ----------------- | ------ | --------------------------------------------------- |
| `name`            | string | This is the name of the payment method.             |
| `isEnabled`       | bool   | This is status of the payment method.               |
| `methodReference` | string | This is the reference number of the payment method. |
| `method`          | enum   | This is the method type.                            |
| `paymentType`     | enum   | This is the payment type.                           |
| `currencyType`    | enum   | This is the currency type.                          |
| {% endtab %}      |        |                                                     |
| {% endtabs %}     |        |                                                     |


# Inline Html Snippet

In addition to the [Checkout URL](/xendbridge-portal/checkout-url) feature, we have provided an even quicker way of integration, using a sample piece of HTML, CSS, and Js snippet.

See the snippet below;

```html
<!DOCTYPE html>
<html lang="en">
  <head>
    <meta charset="UTF-8" />
    <meta http-equiv="X-UA-Compatible" content="IE=edge" />
    <meta name="viewport" content="width=device-width, initial-scale=1.0" />
    <title>XendBridge</title>
    <link rel="preconnect" href="https://fonts.googleapis.com" />
    <link rel="preconnect" href="https://fonts.gstatic.com" crossorigin />
    <link
      href="https://fonts.googleapis.com/css2?family=DM+Sans&display=swap"
      rel="stylesheet"
    />
    <link rel="stylesheet" href="https://inline.xendbridge.com/style.css" />
  </head>
  <!--  The onload event is used to call the onLoadFunctions() function when the page is loaded -->
  <body onload="onLoadFunctions()">
    <div class="wrapper">
      <div class="card-box">
        <div id="logo"></div>
        <div id="toast"></div>

        <div id="pageloaderbackdrop"><div id="pageloader"></div></div>

        <div id="orderTypes"></div>

        <div id="buyOrderForm"></div>
        <div id="sellOrderForm"></div>
        <div id="swapOrderForm"></div>

        <div id="buyFiatPaymentMethod"></div>
        <div id="buyCryptoPaymentMethod"></div>
        <div id="buyConfirmPurchase"></div>
        <div id="buyAccessCode"></div>

        <div id="sellFiatPaymentMethod"></div>
        <div id="sellCryptoPaymentMethod"></div>
        <div id="sellConfirmPurchase"></div>
        <div id="sellAccessCode"></div>

        <div id="payinFiatPaymentMethod"></div>
        <div id="receiveinFiatPaymentMethod"></div>
        <div id="swapFiatConfirmPurchase"></div>

        <div id="payinCryptoPaymentMethod"></div>
        <div id="receiveinCryptoPaymentMethod"></div>
        <div id="swapCryptoConfirmPurchase"></div>

        <div id="trademark"></div>
      </div>
    </div>

    <!-- Ensure to add your public key and BASEURL(sandbox / production) to the enclosed script tag below. -->
    <script>
      let publicKey = "XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX";
      let BASEURL = "https://checkout-api-sandbox.xendbridge.com";
    </script>
    <script src="https://inline.xendbridge.com/script.js"></script>
  </body>
</html>
```

The only parameters needed to be provided by the third party are the ***publicKey*** which can be gotten from the application created on the third party's dashboard and the ***baseUrl*** which can be any of the available environments below;

**Sandbox Url**

```url
https://checkout-api-sandbox.xendbridge.com
```

**Live Url**

```url
https://checkout.xendbridge.com
```


# DeFi Checkout

XendBridge also provides a quicker way to integrate using our Defi Checkout where you get to make an order request only by sending the parameters via URL.

In order to make the request, you must already have an [account](/) and [setup](/#dashboard-walkthrough). Below is the web page url and parameters that contain required and optional ones needed to redirect your users.

## \&payIn=NGN\&payInNetwork=LOCAL\&receiveIn=BUSD\&receiveInNetwork=BEP20\&amt=50\&sign=signature

<mark style="color:blue;">`GET`</mark> `https://checkout-staging.xendbridge.com/transaction?pk={yourPK}&wallet={walletAddress}&allowEdit=false&id={newUuid}&orderType=buy`

#### Query Parameters

| Name                                        | Type   | Description                                                                              |
| ------------------------------------------- | ------ | ---------------------------------------------------------------------------------------- |
| pk<mark style="color:red;">\*</mark>        | string | {publicKey}                                                                              |
| id<mark style="color:red;">\*</mark>        | uuid   | 3fa85f64-5717-4562-b3fc-2c963f66afa6                                                     |
| payIn                                       | string | NGN                                                                                      |
| payInNetwork                                | string | LOCAL                                                                                    |
| receiveIn                                   | string | BUSD                                                                                     |
| receiveInNetwork                            | string | BEP-20                                                                                   |
| amt                                         | int    | 50                                                                                       |
| wallet<mark style="color:red;">\*</mark>    | string | 0x52434Ac4BE04393e020c9b16C327d04d4367Cbcd                                               |
| sign<mark style="color:red;">\*</mark>      | uuid   | 2JI8dgtm3ZiynG6rige5z0JErd7JVadbgZzY2CvVu1/T1iAZEEDIjQbQ9k2SjomlMcnuGVadS1/fx7NCvPw91Q== |
| allowEdit<mark style="color:red;">\*</mark> | bool   | false                                                                                    |
| orderType<mark style="color:red;">\*</mark> | string | Buy                                                                                      |

<details>

<summary>Example Web URL Order</summary>

```url
https://checkout-staging.xendbridge.com/transaction?pk=XLPUK_95BAFDA4E7874C7CB9A3A0CBFF08CB90
&wallet=0x52434Ac4BE04393e020c9b16C327d04d4367Cbcd
&allowEdit=false&id=1fa85f62-5717-4562-b3fc-2c963f66afa6
&orderType=buy&payIn=NGN&payInNetwork=LOCAL
&receiveIn=BUSD&receiveInNetwork=BEP20&amt=1500
&sign=signature
```

</details>

#### Generating Signature

In order to generate the signature needed to verify the order being made, you'd have to generate a signature hash using the following data:

```csharp
string data = $"{yourApp.SecretKey}{yourApp.PublicKey}
{model.WalletAddress}{model.AllowEdit}{model.RequestId}";
```

The Hash Algorithm is ***sha512*** and the output should be in hexadecimal;

```csharp
byte[] hashBytes = sha512Hash(data);

string hashInHexFormat = ConvertByteToHexString(hashBytes);
```

{% hint style="info" %}
`{model.AllowEdit}` is a bool property which indicates whether the user can edit the order after being redirected by the web url order.
{% endhint %}

Use any library or implementations to your liking to achieve the above before passing the value as the **sign** on the URL.

After this is done, your users are redirected to our portal to continue with registration/login and finish the order request.

See [Checkout URL](/xendbridge-portal/checkout-url#environments) for the base urls of the different environments.


# XendBridge NodeJs SDK

Xendbridge provides a NodeJs SDK which can be integrated by installing directly from the Node Package Manager. This library abstracts the necessary API endpoints required to interact with the XendBridge P2P application into javascript functions. The package details can be found at <https://www.npmjs.com/package/@xendbridge/nodejssdk>

#### Setup

The steps below can be used to integrate the sdk to your NodeJs application

1. npm install @xendbridge/nodejssdk
2. Create a config folder on your application's root directory
3. Create an {environment}.json file (eg. Sandbox.json)  in the config folder and add the json object below

```json
{ 
    "baseUrl": "xendbridge base url", 
    "publicKey": "Your xendbridge public key", 
    "secretKey": "Your xendbridge secret key" 
} 
```

Please note that the {environment}.json file should correspond to your app's deployment environment (eg. development, sandbox, production).&#x20;

4. Replace the property values with the appropriate xendbridge base URL and keys. See [Get Started](/#environments) and [Get Started](/#keys) to get your keys and urls.
5. Import the XendBridge library into your javascript file using the code below and you'd be able to interract with the XendBridge api

```javascript
const xendbridgeSDK = require('@xendbridge/nodejssdk')
```


# XendBridge .NET SDK

Xendbridge provides a .NET SDK which can be integrated by downloading from the Nugget Package Manager on [Visual Studio](https://visualstudio.microsoft.com/downloads/) or from the [website](https://www.nuget.org/).

#### Installation

The .NET SDK can be integrated by downloading from the Nugget Package Manager on [Visual Studio](https://visualstudio.microsoft.com/downloads/) or from the [website](https://www.nuget.org/).

#### Setup

Firstly, in your ***appsettings.json*** file, you'd need to add the following JSON object and properties and populate them with the necessary values considering the environments of your choice. See [Get Started](/#keys) and [Get Started](/#environments) to get your keys and urls.

<pre class="language-json"><code class="lang-json"><strong>"XendBridgeSDKConfig": {
</strong>    "BaseUrl": "https://canary.xendbridge.com",
    "PublicKey": "XXXXXXXXXXXXXXXXXXXXXXXXXXX",
    "SecretKey": "XXXXXXXXXXXXXXXXXXXXXXXXXXX"
  }
</code></pre>

Secondly, add or bind the config settings to your project by injecting it into your **services** using the following code snippet;

```csharp
public static IServiceCollection ConfigureAppSettingsBinding(this IServiceCollection services, IConfiguration Configuration)
{
  //Your other registered services can be here
  services.RegisterXendBridgeSDKConfig(Configuration);
  
  return services;
}
```

Lastly, you'd need to register the SDK as a service in the **services** using the code snippet below;

```csharp
public static IServiceCollection RegisterServices(this IServiceCollection services)
{
  services.AddXendBridgeSDK();
}
```

#### Method Calls <a href="#method-calls" id="method-calls"></a>

After adding the [setup](#setup) above, the following functions, objects, and params are provided for the following method calls below.&#x20;

* [**Rate**](/xendbridge-sdks/xendbridge-.net-sdk/rate)
* [**Buy Order**](/xendbridge-sdks/xendbridge-.net-sdk/buy-order)
* [**Sell Order**](/xendbridge-sdks/xendbridge-.net-sdk/sell-order)
* [**Swap Order**](/xendbridge-sdks/xendbridge-.net-sdk/swap-order)
* [**Pending Order**](/xendbridge-sdks/xendbridge-.net-sdk/pending-order)
* [**Pay For Order Confirmation**](/xendbridge-sdks/xendbridge-.net-sdk/pay-for-order-confirmation)
* [**Cancel Order**](/xendbridge-sdks/xendbridge-.net-sdk/cancel-order)
* [**Raise Dispute**](/xendbridge-sdks/xendbridge-.net-sdk/raise-a-dispute)


# Rate

An interface called `IThirdPartyOrderOperations` from the namespace `XendBridgeSDK.Services.Interfaces` is provided, in which the method `GetRate` would be called from. An object argument is passed called `GetRateRequestModel` fetch the order rate.

{% hint style="info" %}
A generic **`BaseResponse<T>`** class is returned on all the [**method calls**.](https://app.gitbook.com/o/rP7OOp58pRxYLbmVLat3/s/EJfjUFckB6ClQLv1UxYC/~/changes/1/xendbridge-sdks/xendbridge-.net-sdk#method-calls)
{% endhint %}

The response returned from fetching the rate is `BaseResponse<LPRateModel>` finally, get your response using the example snippet below;

```csharp
// Populate the model with necessary values
GetRateRequestModel model = new GetRateRequestModel(){};

// Make the call by passing the model
BaseResponse<LPRateModel> response = thirdPartyOrderOperations.GetRate(model);
```

Please see the function from your IDE or visit [here](https://www.fuget.org/packages/XendBridgeSDK/1.2.0) to see the request and response models in detail.


# Buy Order

An interface called `IThirdPartyOrderOperations` from the namespace `XendBridgeSDK.Services.Interfaces` is provided, in which the method `InitiateBuyOrderRequest` would be called from. An object argument is passed called `InitiateOrderRequestModel` which would return the response of the initiated buy order call.

{% hint style="info" %}
A generic **`BaseResponse<T>`** class is returned on all the [**method calls**.](https://app.gitbook.com/o/rP7OOp58pRxYLbmVLat3/s/EJfjUFckB6ClQLv1UxYC/~/changes/1/xendbridge-sdks/xendbridge-.net-sdk#method-calls)
{% endhint %}

The response returned from initiating the buy order is `BaseResponse<PeerToPeerOrderResponseModel>` , which the following properties are as follows;

Finally, get your response using the snippet below;

```csharp
// Populate the model with necessary values
InitiateOrderRequestModel model = new InitiateOrderRequestModel(){};

// Make the call by passing the model
BaseResponse<PeerToPeerOrderResponseModel> response = thirdPartyOrderOperations.InitiateBuyOrderRequest(model);
```

Please see the function from your IDE or visit [here](https://www.fuget.org/packages/XendBridgeSDK/1.2.0) to see the request and response models in detail.


# Sell Order

An interface called `IThirdPartyOrderOperations` from the namespace `XendBridgeSDK.Services.Interfaces` is provided, in which the method `InitiateSellOrderRequest` would be called from. An object argument is passed called `InitiateOrderRequestModel` which would return the response of the initiated sell order call.

{% hint style="info" %}
A generic **`BaseResponse<T>`** class is returned on all the [**method calls**.](https://app.gitbook.com/o/rP7OOp58pRxYLbmVLat3/s/EJfjUFckB6ClQLv1UxYC/~/changes/1/xendbridge-sdks/xendbridge-.net-sdk#method-calls)
{% endhint %}

The response returned from initiating the sell order is `BaseResponse<PeerToPeerOrderResponseModel>` , which the following properties are as follows;

Finally, get your response using the snippet below;

```csharp
// Populate the model with necessary values
InitiateOrderRequestModel model = new InitiateOrderRequestModel(){};

// Make the call by passing the model
BaseResponse<PeerToPeerOrderResponseModel> response = thirdPartyOrderOperations.InitiateSellOrder(model);
```

Please see the function from your IDE or visit [here](https://www.fuget.org/packages/XendBridgeSDK/1.2.0) to see the request and response models in detail.


# Swap Order

An interface called `IThirdPartyOrderOperations` from the namespace `XendBridgeSDK.Services.Interfaces` is provided, in which the method `InitiateSwapOrderRequest` would be called from. An object argument is passed called `InitiateOrderRequestModel` which would return the response of the initiated swap order method call.

{% hint style="info" %}
A generic **`BaseResponse<T>`** class is returned on all the [**method calls**.](https://app.gitbook.com/o/rP7OOp58pRxYLbmVLat3/s/EJfjUFckB6ClQLv1UxYC/~/changes/1/xendbridge-sdks/xendbridge-.net-sdk#method-calls)
{% endhint %}

The response returned from initiating the swap order is `BaseResponse<PeerToPeerOrderResponseModel>` , which the following properties are as follows;

Finally, get your response using the snippet below;

```csharp
// Populate the model with necessary values
InitiateOrderRequestModel model = new InitiateOrderRequestModel(){};

// Make the call by passing the model
BaseResponse<PeerToPeerOrderResponseModel> response = thirdPartyOrderOperations.InitiateSwapOrder(model);
```

Please see the function from your IDE or visit [here](https://www.fuget.org/packages/XendBridgeSDK/1.2.0) to see the request and response models in detail.


# Pending Order

An interface called `IThirdPartyOrderOperations` from the namespace `XendBridgeSDK.Services.Interfaces` is provided, in which the method `GetPendingOrderRequest` would be called from. A string argument called `emailAddress` should be passed, being the email address of the customer.&#x20;

{% hint style="info" %}
A generic **`BaseResponse<T>`** class is returned on all the [**method calls**.](https://app.gitbook.com/o/rP7OOp58pRxYLbmVLat3/s/EJfjUFckB6ClQLv1UxYC/~/changes/1/xendbridge-sdks/xendbridge-.net-sdk#method-calls)
{% endhint %}

The response returned from getting the pending order is `BaseResponse<PendingOrderResponse>` , which the following properties are as follows;

For `PeerToPeerOrderResponseModel` property, please see [Buy Order](/api-method-calls/third-party-order-operations/buy-order)

```csharp
// Provide the customer's email address
string emailAddress = "johndoe@gmail.com";

// Make the call by passing the model
BaseResponse<PendingOrderResponseModel> response = thirdPartyOrderOperations.GetPendingOrderRequest(emailAddress);
```

Please see the function from your IDE or visit [here](https://www.fuget.org/packages/XendBridgeSDK/1.2.0) to see the request and response models in detail.


# Pay For Order Confirmation

An interface called `IThirdPartyOrderOperations` from the namespace `XendBridgeSDK.Services.Interfaces` is provided, in which the method `PayForOrderConfirmation` would be called. An object argument is passed called `IndicateFundedRequestModel` which would return the response of the payment confirmation call.

{% hint style="info" %}
A generic **`BaseResponse<T>`** class is returned on all the [**method calls**.](https://app.gitbook.com/o/rP7OOp58pRxYLbmVLat3/s/EJfjUFckB6ClQLv1UxYC/~/changes/1/xendbridge-sdks/xendbridge-.net-sdk#method-calls)
{% endhint %}

The response returned confirming the order is **`BaseResponse<bool>`** , which confirms either ***true*** or ***false*** that the order has been confirmed.

Please see the function from your IDE or visit [here](https://www.fuget.org/packages/XendBridgeSDK/1.2.0) to see the request and response models in detail.


# Cancel Order

An interface called `IThirdPartyOrderOperations` from the namespace `XendBridgeSDK.Services.Interfaces` is provided, in which the method `CancelOrder` would be called from. An object argument is passed called `CancelOrderRequestModel` which would return the response of the cancel order method call.

{% hint style="info" %}
A generic **`BaseResponse<T>`** class is returned on all the [**method calls**.](https://app.gitbook.com/o/rP7OOp58pRxYLbmVLat3/s/EJfjUFckB6ClQLv1UxYC/~/changes/1/xendbridge-sdks/xendbridge-.net-sdk#method-calls)
{% endhint %}

The response returned from canceling an order is `BaseResponse<bool>` , which either is ***true*** or ***false*** that an order is canceled.

Please see the function from your IDE or visit [here](https://www.fuget.org/packages/XendBridgeSDK/1.2.0) to see the request and response models in detail.


# Raise A Dispute

An interface called `IThirdPartyOrderOperations` from the namespace `XendBridgeSDK.Services.Interfaces` is provided, in which the method `RaiseThirdPartyDispute` would be called. An object argument is passed called `OrderDisputeRequest` which would return the response for raising a dispute method call.

{% hint style="info" %}
A generic **`BaseResponse<T>`** class is returned on all the [**method calls**.](https://app.gitbook.com/o/rP7OOp58pRxYLbmVLat3/s/EJfjUFckB6ClQLv1UxYC/~/changes/1/xendbridge-sdks/xendbridge-.net-sdk#method-calls)
{% endhint %}

The response returned from raising the dispute is `BaseResponse<DisputeResponse>` , which the following properties are as follows;

After the response is returned, the property `DisputeReference` is used to integrate the [XendBridge Chat SDK](/api-method-calls/dispute/xendbridge-chat-sdk) into your application.

Please see the function from your IDE or visit [here](https://www.fuget.org/packages/XendBridgeSDK/1.2.0) to see the request and response models in detail.


# Errors

XendBridge is a REST API product and as such we religiously follow conventional HTTP response codes to indicate the status of an API call - success or failure.

> 👍2XX Status code\
> Everything went well.

> 🚧4XX Status code\
> A required piece of information/data was not found in the API request thus we cannot process it

> ❗5XX Status code\
> Something is wrong with XendBridge. This range of errors are extremely rare

<table><thead><tr><th width="150">Status Code</th><th>Meaning</th></tr></thead><tbody><tr><td>200, 201, 204</td><td>Everything works as expected. API request was successful</td></tr><tr><td>400</td><td>Bad request. Review the data sent in the request. Usually, this means a required piece of information is missing</td></tr><tr><td>401</td><td>Unauthorized. This happens when you provide an invalid or non-existent API key</td></tr><tr><td>404</td><td>Resource not found. This could happen when you try to retrieve an item with a non-existent ID</td></tr><tr><td>403</td><td>Not enough permission to perform this operation</td></tr><tr><td>5XX</td><td>Something went wrong on XendBridge end. Doesn't happen often :)</td></tr></tbody></table>


# API Reference

Dive into the specifics of each API endpoint by checking out our complete documentation.

## Orders

All the methods associated with `CRUD`ing orders. Which isn't as weird as it sounds:

{% content-ref url="/pages/zij8pudkgQAnIdcvnTUu" %}
[Buy Order](/api-method-calls/third-party-order-operations/buy-order)
{% endcontent-ref %}

{% content-ref url="/pages/Y0P6PGNW8v3hMnbDIn8a" %}
[Sell Order](/api-method-calls/third-party-order-operations/sell-order)
{% endcontent-ref %}

{% content-ref url="/pages/tx681KKPrrcDxymdcTkW" %}
[Swap Order](/api-method-calls/third-party-order-operations/swap-order)
{% endcontent-ref %}

{% content-ref url="/pages/8obH6taZe4WUzX1Ay6fu" %}
[Rate](/api-method-calls/third-party-order-operations/rate)
{% endcontent-ref %}

{% content-ref url="/pages/ACAkSPRzMBHEP5arYndc" %}
[Pending Order](/api-method-calls/third-party-order-operations/pending-order)
{% endcontent-ref %}

{% content-ref url="/pages/bRWAHmwl6q6dSoALgOc9" %}
[Pay For Order](/api-method-calls/third-party-order-operations/pay-for-order)
{% endcontent-ref %}

{% content-ref url="/pages/PSnIEOhFvmY94eLDktsa" %}
[Cancel Order](/api-method-calls/third-party-order-operations/cancel-order)
{% endcontent-ref %}

## LP Simulation

All the methods associated with simulating as a liquidity provider.

{% content-ref url="/pages/b40XFU0yJVlOj5FHvFsk" %}
[Pay For Order (Buy Order)](/api-method-calls/lp-simulation/pay-for-order-buy-order)
{% endcontent-ref %}

{% content-ref url="/pages/kkzKRLfykGdjOWDQIyQv" %}
[Pay For Order (Sell Order)](/api-method-calls/lp-simulation/pay-for-order-sell-order)
{% endcontent-ref %}

### Disputes

All the methods associated with `CRUD`ing disputes on orders and also connecting users to a chat hub.

{% content-ref url="/pages/NeanuJfTHkP4mejgp3UX" %}
[Raise Third Party Dispute](/api-method-calls/dispute/raise-third-party-dispute)
{% endcontent-ref %}

{% content-ref url="/pages/fFeAh4wabW7MUnqLQjGn" %}
[Get All Disputes](/api-method-calls/dispute/get-all-disputes)
{% endcontent-ref %}

{% content-ref url="/pages/07lFRYym4bgR737exswV" %}
[XendBridge Chat SDK](/api-method-calls/dispute/xendbridge-chat-sdk)
{% endcontent-ref %}

### Webhook

All the methods associated with `CRUD`ing webhooks.

{% content-ref url="/pages/YMeaiPUx3afkBpL4IA6y" %}
[Order Payment Confirmation](/api-method-calls/webhooks/order-payment-confirmation)
{% endcontent-ref %}

{% content-ref url="/pages/XkLSTVxX8UtOuysf0cht" %}
[Order Matched Notification](/api-method-calls/webhooks/order-matched-notification)
{% endcontent-ref %}

{% content-ref url="/pages/VfyljgnT9R75Z61tjeFc" %}
[Order Canceled Notification](/api-method-calls/webhooks/order-canceled-notification)
{% endcontent-ref %}

{% content-ref url="/pages/Swm6m1KwOIesoD3EP9na" %}
[Checksum Verification](/api-method-calls/webhooks/checksum-verification)
{% endcontent-ref %}


