# Получение актуального курса конвертации

Запрос на получение актуального курса конвертации. Возможно указание значений: TRX и USDT. Для осуществления запроса параметр currency необходимо передать в URL-эндпойнте.

<mark style="color:blue;">GET</mark> [<mark style="color:$primary;">https://app.goodpayments.io/v1/api/rates?currency=TRX</mark>](https://app.goodpayments.io/v1/api/rates?currency=TRX) &#x20;

### Заголовки

| Имя             | Тип    | Описание                     | Пример                                                           |
| --------------- | ------ | ---------------------------- | ---------------------------------------------------------------- |
| Authorization\* | string | Уникальный API-ключ мерчанта | 94a48138b1f41b9cdb3e12c2ff0c7cbe1c7a5f50a311a5054b903cad84215662 |

### Тело запроса

Данный запрос не предполагает передачу параметров в теле. Все необходимые параметры указываются в URL-эндпойнте.

### Пример запроса

```yaml
curl -X 'GET' \
  'https://app.goodpayments.io/v1/api/rates?currency=TRX' \
  -H 'accept: application/json' \
  -H 'Authorization: 94a48138b1f41b9cdb3e12c2ff0c7cbe1c7a5f50a311a5054b903cad84215662'
```

### Ответ

| Имя      | Тип    | Описание                                                                                       | Пример     |
| -------- | ------ | ---------------------------------------------------------------------------------------------- | ---------- |
| currency | string | <p>Валюта. Возможные значения:</p><ul><li><code>TRX</code></li><li><code>USDT</code></li></ul> | TRX        |
| rate     | number | Актуальный курс конвертации                                                                    | 0.27700958 |
| fee      | number | Размер комиссии сервиса, взимаемой при пополнении баланса мерчанта в USDT                      | 0.06       |

### Пример ответа

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

```json
{
  "currency": "TRX",
  "rate": 0.27700958,
  "fee": 0
}
```

{% endtab %}

{% tab title="403 Authentication credentials were not provided" %}

```json
{
  "detail": "Authentication credentials were not provided."
}
```

{% endtab %}

{% tab title="404 Currency not found" %}

```json
{
  "detail": "Currency not found"
}
```

{% endtab %}
{% endtabs %}

### Возможные ошибки

Если заголовок с корректным API-ключом отсутствует, ключ недействителен или IP-адрес не в белом списке, сервер возвращает ответ с кодом **403**.

Если в запросе указана некорректная валюта, сервер возвращает ответ с кодом **404**.<br>


---

# Agent Instructions: 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:

```
GET https://goodpayments.gitbook.io/docs/documentation/ru/api-dokumentaciya/opisanie-metodov-vzaimodeistviya-struktura-zaprosa-otveta/poluchenie-aktualnogo-kursa-konvertacii.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
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.
