> For the complete documentation index, see [llms.txt](https://docs.iexexchanger.com/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://docs.iexexchanger.com/get-started/exchanger-api/poluchenie-dostupa-i-klyuchei/production-settings.md).

# Безопасные production-настройки

Перед запуском в production API должен быть настроен так, чтобы интеграция работала стабильно и не создавала лишние риски.

## Рекомендуемая схема

| Настройка                             | Рекомендация                    |
| ------------------------------------- | ------------------------------- |
| Отдельный ключ для production         | Да                              |
| Отдельный ключ для staging            | Да                              |
| HMAC для write-запросов               | Обязательно                     |
| `Idempotency-Key` для создания заявки | Обязательно                     |
| IP allow-list                         | Желательно для server-to-server |
| Webhooks для статусов                 | Желательно                      |
| Polling статуса                       | Только как fallback             |
| Минимальные scopes                    | Обязательно                     |

## Production и staging

Не используйте один ключ для всех окружений.

Правильно:

```
production-crm
staging-crm
production-telegram
staging-telegram
```

Так проще отключить тестовый доступ, не ломая production.

## HMAC

В production HMAC должен быть включен минимум для:

* создания заявки;
* подтверждения оплаты;
* отмены заявки;
* загрузки файлов;
* создания и изменения webhooks.

Если интеграция крупная, включите HMAC для всех приватных запросов.

## IP allow-list

Если API вызывается с backend-сервера клиента, добавьте публичные IP этого сервера в allow-list.

Проверьте:

* production IP;
* staging IP;
* NAT gateway;
* load balancer;
* fallback server, если он есть.

## Лимиты

API может ограничивать частоту и общий объем запросов.

| Лимит         | Что значит                                       |
| ------------- | ------------------------------------------------ |
| Rate limit    | Сколько запросов можно делать за короткое время. |
| Daily quota   | Сколько запросов можно сделать за день.          |
| Monthly quota | Сколько запросов можно сделать за месяц.         |

Если интеграция получает `429`, она должна ждать `Retry-After`, а не повторять запрос бесконечно.

## Webhooks вместо частого polling

Не проверяйте статус заявки каждую секунду. Лучше:

1. Подключить webhook `order.status_changed`.
2. Сохранять события у себя.
3. Использовать status endpoint только когда пользователь открыл страницу заявки или webhook временно недоступен.


---

# 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.iexexchanger.com/get-started/exchanger-api/poluchenie-dostupa-i-klyuchei/production-settings.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.
