# Rate Bounds

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