> For the complete documentation index, see [llms.txt](https://docs.latam-payments.depay.us/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://docs.latam-payments.depay.us/reference/api-reference/exchange-rates.md).

# Exchange Rates

In the context of our API, exchange rates refer to the conversion values between different currency pairs. This feature allows users to retrieve real-time exchange rates to facilitate cross-border transactions.

Our API provides an endpoint to fetch the latest exchange rates, ensuring accurate and up-to-date currency conversion. The available currency pairs at the moment are:

* USD/ARS
* ARS/USD
* USD/BRL
* BRL/USD
* ARS/BRL
* BRL/ARS

These rates are periodically updated based on market conditions.

### Retrieve exchange rate

This endpoint allows you to retrieve the latest exchange rate between two supported currencies. It returns both conversion directions for the requested currency pair.

<mark style="color:blue;">`GET`</mark> `https://stage.api.payments.depay.us/v2/exchange-rates/rates/payins-fiat/{base}/{target}`

#### Headers

| Name            | Type   | Description   |
| --------------- | ------ | ------------- |
| Authorization\* | String | Bearer Token. |

#### **Query Parameters**

| Name      | Type   | Description                                                             |
| --------- | ------ | ----------------------------------------------------------------------- |
| precision | String | Number of decimal places used in the exchange rate returned by the API. |

#### **Path Parameters**

| Name     | Type   | Description                                               |
| -------- | ------ | --------------------------------------------------------- |
| base\*   | String | The currency code you want to convert from (e.g., `USD`). |
| target\* | String | The currency code you want to convert to (e.g., `BRL`).   |

#### **Response**

| Name               | Type   | Description                                                      |
| ------------------ | ------ | ---------------------------------------------------------------- |
| exchangeRate\_1    | String | Conversion rate from **target\_currency** to **base\_currency.** |
| description\_xr\_1 | String | Description of the exchange rate.                                |
| exchangeRate\_2    | String | Conversion rate from **base\_currency** to **target\_currency.** |
| description\_xr\_2 | String | Description of the exchange rate.                                |

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

```json
{
    "exchangeRate_1": "0.17",
    "description_xr_1": "1 BRL = 0.17 USD",
    "exchangeRate_2": "5.86",
    "description_xr_2": "1 USD = 5.86 BRL"
}
```

{% endtab %}

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

```json
{
    "eventId": "BadRequest",
    "detail": "One or more validation errors occurred.",
    "correlationId": "e9119b1b-07ee-4734-8fb4-ceac60ecabc4",
    "errores": [{
        "code": "400",
        "title": "",
        "detail": "The X field is required."
    }]
}
```

{% endtab %}

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

```json
{
    "statusCode": 401,
    "message": "Unauthorized"
}
```

{% endtab %}

{% tab title="409: Conflict Error" %}

```json
{
   "statusCode": 409,
    "message": "Conflict error"
}
```

{% endtab %}
{% endtabs %}
