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


---

# Agent Instructions
This documentation is published with GitBook. GitBook is the documentation platform designed so that both humans and AI agents can read, navigate, and reason over technical content effectively. Learn more at gitbook.com.

## Querying This Documentation
If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter, and the optional `goal` query parameter:

```
GET https://docs.latam-payments.depay.us/reference/api-reference/exchange-rates.md?ask=<question>&goal=<endgoal>
```

`ask` is the immediate question: it should be specific, self-contained, and written in natural language.
`goal` is optional and describes the broader end goal you are ultimately trying to accomplish on behalf of the user. GitBook uses it to tailor the answer towards what is most useful for that goal.

The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
