# 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 %}
