> ## Documentation Index
> Fetch the complete documentation index at: https://exchanger-api.iexexchanger.com/llms.txt
> Use this file to discover all available pages before exploring further.

# Создать заявку на обмен

> Создаёт заявку с теми же данными, что и preflight. Задайте уникальный Idempotency-Key для этой заявки. Если результат неизвестен, повторите запрос с прежними ключом и данными, новыми timestamp, nonce и подписью.

[English version](https://exchanger-api.iexexchanger.com/en/api-reference/exchange/post-private-exchange-orders.md)

[Подпишите запрос HMAC v2](https://exchanger-api.iexexchanger.com/start/authentication.md). Требуется право `public-api:exchange:orders:create`. Принимает заголовок `Idempotency-Key`.

Успешная проверка входа в preflight позволяет перейти к созданию. При `409 idempotency_in_progress` дождитесь `Retry-After`, когда он есть, и повторите запрос с теми же данными и ключом. При `422` исправьте указанные поля.

### Связанные методы

* [Проверить создание заявки на обмен без сохранения](https://exchanger-api.iexexchanger.com/api-reference/песочница/post-private-sandbox-exchange-orders-simulate.md)
* [Получить свою заявку на обмен](https://exchanger-api.iexexchanger.com/api-reference/обмен/get-private-exchange-orders-by-order.md)
* [Проверить заявку на обмен перед созданием](https://exchanger-api.iexexchanger.com/api-reference/обмен/post-private-exchange-orders-preflight.md)

```http Шаблон HTTP-запроса
POST /api/v3/private/exchange/orders HTTP/1.1
Host: your-exchange
Accept: application/json
Authorization: Bearer <token>
X-Api-Signature-Version: v2
X-Api-Timestamp: <unix_timestamp>
X-Api-Nonce: <nonce>
X-Api-Signature: sha256=<hex_digest>
Idempotency-Key: <idempotency_key>
Content-Type: application/json

{
    "route_id": 2,
    "amount": "10",
    "from_requisite": "SANDBOX-DEMO-SOURCE",
    "to_requisite": "SANDBOX-DEMO-DESTINATION",
    "snapshot": {
        "version": "route-snapshot-v1",
        "route_id": 2,
        "hash": "626062a83e6f6a4b902a8cc5a216b7749c2e4df2f1ef42ebf71383dd4697c340",
        "generated_at": "2026-11-21T18:40:40.772775Z",
        "expires_at": "2026-11-21T18:50:40.772775Z",
        "expiry_signature": "a1a1a1a1a1a1a1a1a1a1a1a1a1a1a1a1a1a1a1a1a1a1a1a1a1a1a1a1a1a1a1a1",
        "fingerprint": {
            "route_updated_at": "2026-11-21T18:39:37.000000Z",
            "from_currency_updated_at": "2026-11-21T18:39:37.000000Z",
            "to_currency_updated_at": "2026-11-21T18:39:37.000000Z"
        }
    }
}
```


## OpenAPI

````yaml /openapi/openapi.ru.yaml post /private/exchange/orders
openapi: 3.1.0
info:
  title: Публичный API iEXExchanger
  version: 4.0.0
  description: >-
    API для работы с данными клиента, направлениями обмена, заявками, вебхуками
    и партнёрскими выплатами.


    Начните с GET /ping для проверки доступности и GET /private/scopes для

    просмотра каталога прав API. Для приватных операций нужны токен Sanctum в

    Authorization: Bearer <token> и подпись HMAC v2. Передавайте

    X-Api-Signature-Version со значением v2 вместе с X-Api-Timestamp,

    X-Api-Nonce и X-Api-Signature. Для создания партнёрской выплаты также нужен

    Idempotency-Key. Если операция перечисляет права в x-required-scopes,

    достаточно одного из этих прав.


    Непустое тело HMAC-запроса передавайте как application/json или
    application/*+json. Multipart поддерживается операциями загрузки файлов
    верификации, файлов полей заявки и чеков. Передавайте ровно одно поле-файл
    file. Лимит JSON по умолчанию составляет 1 MiB. При превышении лимита
    установки API возвращает HTTP 413. URL-encoded тела подписанного запроса и
    неоднозначные типы содержимого возвращают invalid_signature.


    Все ответы JSON имеют общую оболочку: state=0 означает успех, state=1 —
    ошибку. Поле error.code содержит стабильный код ошибки для программы. Списки
    поддерживают постраничную навигацию, а некоторые — курсор для больших
    выборок. При повторе изменяющего запроса с тем же телом используйте прежний
    Idempotency-Key.

    Повтор операции управления вебхуком с сохранённым результатом снятого

    протокола возвращает HTTP 409 с protocol_retired в error.details.reason.

    Запрос с неподдерживаемой версией тела вебхука возвращает HTTP 422.


    Английский контракт находится в openapi.yaml, русская версия в
    openapi.ru.yaml.

    Пути, имена полей, значения enum и коды ошибок одинаковы в обоих файлах.

    Тела примеров используют одни и те же данные песочницы. Сервер переводит
    текст сообщений по локали запроса.

    Код 401 указывает на отсутствие или недействительность проверки токена или
    подписи. Код 403 указывает на запрет доступа. Код 429 сообщает о частотном
    лимите или квоте. Код 503 сообщает о недоступности API или сайта.
servers:
  - url: /api/v3
security:
  - sanctumBearer: []
    apiTimestamp: []
    apiNonce: []
    apiSignature: []
tags:
  - name: Система
    description: Проверка доступности.
  - name: Клиент
    description: Профиль и заявки авторизованного клиента.
  - name: Заявки
    description: Списки заявок, статусы, доступные действия и подтверждение оплаты.
  - name: Обмен
    description: Платёжные системы, направления, расчёты и заявки на обмен.
  - name: Файлы
    description: Одноразовые разрешения на загрузку файлов для проверки.
  - name: Проверки
    description: Требования и отправка данных для проверки личности и карты.
  - name: Песочница
    description: Проверка сценария создания заявки без её сохранения.
  - name: Отзывы
    description: Просмотр опубликованных отзывов и отправка отзыва по своей заявке.
  - name: Партнёр
    description: Партнёрская статистика, привлечённые клиенты, обмены и выплаты.
  - name: Платформа
    description: Версии контрактов, JSON-схемы и использование API.
  - name: Вебхуки
    description: Регистрация адресов вебхуков, просмотр событий и попыток доставки.
  - name: Безопасность
    description: Права ключей и требования безопасности запросов.
paths:
  /private/exchange/orders:
    post:
      tags:
        - Обмен
      summary: Создать заявку на обмен
      description: >-
        Создаёт заявку с теми же данными, что и preflight. Задайте уникальный
        Idempotency-Key для этой заявки. Если результат неизвестен, повторите
        запрос с прежними ключом и данными, новыми timestamp, nonce и подписью.
      operationId: postPrivateExchangeOrders
      parameters:
        - $ref: '#/components/parameters/SignatureVersion'
        - $ref: '#/components/parameters/IdempotencyKey'
        - $ref: '#/components/parameters/CorrelationId'
      requestBody:
        required: true
        content:
          application/json:
            examples:
              orderInput:
                $ref: '#/components/examples/QuickstartOrderInput'
            schema:
              $ref: '#/components/schemas/ExchangeOrderCreateRequest'
      responses:
        '201':
          description: >-
            Созданная заявка или повтор её выдачи. Повтор возвращает тот же
            result со свежими метаданными запроса и заголовком
            Idempotency-Replayed со значением true.
          headers:
            Idempotency-Key:
              description: Ключ из запроса при его наличии.
              schema:
                type: string
                example: quickstart-order-0001
            Idempotency-Replayed:
              description: Присутствует только при повторной выдаче.
              schema:
                type: string
                const: 'true'
          content:
            application/json:
              examples:
                created:
                  $ref: '#/components/examples/QuickstartOrderCreated'
                replayed:
                  $ref: '#/components/examples/QuickstartOrderReplayed'
              schema:
                allOf:
                  - $ref: '#/components/schemas/SuccessEnvelope'
                  - type: object
                    properties:
                      result:
                        type: object
                        properties:
                          order:
                            $ref: '#/components/schemas/Order'
        '401':
          $ref: '#/components/responses/Unauthorized'
        '403':
          $ref: '#/components/responses/Error'
        '409':
          description: >-
            При idempotency_in_progress дождитесь Retry-After и повторите запрос
            с теми же ключом и данными. При idempotency_conflict сверьте
            исходную операцию перед созданием новой заявки.
          headers:
            Retry-After:
              description: >-
                Секунды до повтора выполняющейся операции. Также доступны в
                error.details.retry_after.
              schema:
                type: string
                example: '2'
          content:
            application/json:
              examples:
                inProgress:
                  $ref: '#/components/examples/QuickstartOrderInProgress'
                conflict:
                  $ref: '#/components/examples/QuickstartOrderConflict'
              schema:
                $ref: '#/components/schemas/ErrorEnvelope'
        '422':
          $ref: '#/components/responses/InvalidExchangeInput'
        '429':
          $ref: '#/components/responses/RateLimited'
        default:
          $ref: '#/components/responses/Error'
      security:
        - sanctumBearer: []
          apiTimestamp: []
          apiNonce: []
          apiSignature: []
components:
  parameters:
    SignatureVersion:
      name: X-Api-Signature-Version
      in: header
      required: true
      description: >-
        Обязательная версия подписи запроса. Укажите v2 первой строкой
        канонического представления. Восьмой строкой добавьте Idempotency-Key
        без крайних пробелов или пустую строку при отсутствии ключа.
        Подписывайте исходные значения разобранного query.
      schema:
        type: string
        const: v2
    IdempotencyKey:
      name: Idempotency-Key
      in: header
      required: false
      schema:
        type: string
        minLength: 8
        maxLength: 191
        pattern: ^[A-Za-z0-9._:-]{8,191}$
      description: >-
        Обычное окно повторов по умолчанию составляет 24 часа. Для успешного
        создания заявки, загрузки чека и партнёрской выплаты сохраняется
        долговечная квитанция.
    CorrelationId:
      name: X-Correlation-Id
      in: header
      required: false
      schema:
        type: string
        maxLength: 128
      description: Идентификатор клиента для связи API-запроса с событиями вебхуков.
  examples:
    QuickstartOrderInput:
      summary: Данные для preflight и создания заявки
      description: Замените весь снимок из примера на снимок из вашего расчёта.
      value:
        route_id: 2
        amount: '10'
        from_requisite: SANDBOX-DEMO-SOURCE
        to_requisite: SANDBOX-DEMO-DESTINATION
        snapshot:
          version: route-snapshot-v1
          route_id: 2
          hash: 626062a83e6f6a4b902a8cc5a216b7749c2e4df2f1ef42ebf71383dd4697c340
          generated_at: '2026-11-21T18:40:40.772775Z'
          expires_at: '2026-11-21T18:50:40.772775Z'
          expiry_signature: a1a1a1a1a1a1a1a1a1a1a1a1a1a1a1a1a1a1a1a1a1a1a1a1a1a1a1a1a1a1a1a1
          fingerprint:
            route_updated_at: '2026-11-21T18:39:37.000000Z'
            from_currency_updated_at: '2026-11-21T18:39:37.000000Z'
            to_currency_updated_at: '2026-11-21T18:39:37.000000Z'
    QuickstartOrderCreated:
      summary: Заявка создана и ожидает оплаты
      value:
        state: 0
        message: Order has been created.
        meta:
          request_id: a7d0a4dd-75da-4547-9644-a23e8d194821
          correlation_id: a7d0a4dd-75da-4547-9644-a23e8d194821
          timestamp: '2026-11-21T18:40:41.268085Z'
        result:
          order:
            id: 5
            public_id: '2696843857965'
            tracking_id: 01a1ff69-1d03-7c35-aa9e-784a66d64f88
            cash_handover: null
            status:
              id: 2
              key: pending_payment
              name: PENDING_PAYMENT
              reason: null
              is_final: false
              is_payment_flow: true
              is_problem: false
            amounts:
              give: '10'
              receive: '12.5'
              rate: 1 RFTHDDNAALAOP60 = 1.25 RFTWN6MSUG0SAFV
              give_with_commission: '0'
              receive_with_commission: '0'
            currencies:
              from:
                id: 3
                payment: Rates fixture give
                code: RFTHDDNAALAOP60
                designation: null
                network: null
                network_out: null
                decimal: 4
              to:
                id: 4
                payment: Rates fixture receive
                code: RFTWN6MSUG0SAFV
                designation: null
                network: null
                network_out: null
                decimal: 4
            direction:
              id: 2
              name: rates-fixture-4b15f06d-43c4-43d4-b5fb-de0981f88c1a
            customer:
              email: partner@example.test
              phone: null
              from_requisite: SANDBOX-DEMO-SOURCE
              to_requisite: SANDBOX-DEMO-DESTINATION
            payment:
              merchant_provider: null
              merchant_status: '0'
              payment_address: null
              is_wallet_issued: false
              timing:
                duration_seconds: 3600
                started_at: '2026-11-21T21:40:41+03:00'
                expires_at: '2026-11-21T22:40:41+03:00'
                remaining_seconds: 3600
                active: true
                overdue: false
                action: expire
                changes_status_on_expiry: true
                processed_at: null
                source: global
                version: 0
                is_snapshot: true
                server_time: '2026-11-21T21:40:41+03:00'
              request_timing: null
            flags:
              is_archive: false
              is_frozen: false
              is_new_user: false
              is_auto_check_payment: false
            timestamps:
              created_at: '2026-11-21T21:40:41+03:00'
              updated_at: '2026-11-21T21:40:41+03:00'
              started_at: null
              completed_at: null
              archived_at: null
    QuickstartOrderReplayed:
      summary: 'Сохранённая заявка, возвращённая с Idempotency-Replayed: true'
      value:
        state: 0
        message: Order has been created.
        meta:
          request_id: 4a6d7dc7-c346-44e5-8b7a-f346e5af9891
          correlation_id: 4a6d7dc7-c346-44e5-8b7a-f346e5af9891
          timestamp: '2026-11-21T18:40:41.362093Z'
        result:
          order:
            id: 5
            public_id: '2696843857965'
            tracking_id: 01a1ff69-1d03-7c35-aa9e-784a66d64f88
            cash_handover: null
            status:
              id: 2
              key: pending_payment
              name: PENDING_PAYMENT
              reason: null
              is_final: false
              is_payment_flow: true
              is_problem: false
            amounts:
              give: '10'
              receive: '12.5'
              rate: 1 RFTHDDNAALAOP60 = 1.25 RFTWN6MSUG0SAFV
              give_with_commission: '0'
              receive_with_commission: '0'
            currencies:
              from:
                id: 3
                payment: Rates fixture give
                code: RFTHDDNAALAOP60
                designation: null
                network: null
                network_out: null
                decimal: 4
              to:
                id: 4
                payment: Rates fixture receive
                code: RFTWN6MSUG0SAFV
                designation: null
                network: null
                network_out: null
                decimal: 4
            direction:
              id: 2
              name: rates-fixture-4b15f06d-43c4-43d4-b5fb-de0981f88c1a
            customer:
              email: partner@example.test
              phone: null
              from_requisite: SANDBOX-DEMO-SOURCE
              to_requisite: SANDBOX-DEMO-DESTINATION
            payment:
              merchant_provider: null
              merchant_status: '0'
              payment_address: null
              is_wallet_issued: false
              timing:
                duration_seconds: 3600
                started_at: '2026-11-21T21:40:41+03:00'
                expires_at: '2026-11-21T22:40:41+03:00'
                remaining_seconds: 3600
                active: true
                overdue: false
                action: expire
                changes_status_on_expiry: true
                processed_at: null
                source: global
                version: 0
                is_snapshot: true
                server_time: '2026-11-21T21:40:41+03:00'
              request_timing: null
            flags:
              is_archive: false
              is_frozen: false
              is_new_user: false
              is_auto_check_payment: false
            timestamps:
              created_at: '2026-11-21T21:40:41+03:00'
              updated_at: '2026-11-21T21:40:41+03:00'
              started_at: null
              completed_at: null
              archived_at: null
    QuickstartOrderInProgress:
      summary: Такой же запрос ещё выполняется
      value:
        state: 1
        message: A request with this Idempotency-Key is already in progress.
        code: 409
        meta:
          request_id: quickstart-order-in-progress
          correlation_id: quickstart-order-in-progress
          timestamp: '2026-11-21T18:40:00.000000Z'
        error:
          code: idempotency_in_progress
          type: idempotency_in_progress
          details:
            retry_after: 2
    QuickstartOrderConflict:
      summary: Ключ уже связан с другим запросом
      value:
        state: 1
        message: The Idempotency-Key was already used with a different request.
        code: 409
        meta:
          request_id: 52dcb1dc-e78c-4256-891a-388b7f0cb9f3
          correlation_id: 52dcb1dc-e78c-4256-891a-388b7f0cb9f3
          timestamp: '2026-11-21T18:40:41.450282Z'
        error:
          code: idempotency_conflict
          type: idempotency_conflict
          details: null
    QuickstartSignatureRequired:
      summary: Действительный Bearer-токен без обязательных заголовков HMAC
      value:
        state: 1
        message: HMAC signature is required for this API token.
        code: 401
        meta:
          request_id: 1b2e3571-013b-4305-bdcf-1d53bb1cdaee
          correlation_id: 1b2e3571-013b-4305-bdcf-1d53bb1cdaee
          timestamp: '2026-11-21T18:40:40.675585Z'
        error:
          code: signature_required
          type: signature_required
          details:
            headers:
              - X-Api-Timestamp
              - X-Api-Nonce
              - X-Api-Signature
              - X-Api-Signature-Version
            algorithm: hmac-sha256-v2
    QuickstartInvalidAmount:
      summary: В поле amount передано не число
      value:
        state: 1
        message: The submitted data is invalid.
        code: 422
        meta:
          request_id: bf1bb5c8-8c96-4196-89d1-c5482058a985
          correlation_id: bf1bb5c8-8c96-4196-89d1-c5482058a985
          timestamp: '2026-11-21T18:40:40.883808Z'
        error:
          code: validation_failed
          type: validation_failed
          details:
            fields:
              amount:
                - The amount field must be a number.
            issues:
              - field: amount
                code: validation_failed
                message: The amount field must be a number.
    QuickstartRateLimited:
      summary: Достигнут лимит частоты запросов
      value:
        state: 1
        message: Too many API requests. Try again later.
        code: 429
        meta:
          request_id: quickstart-request-rate
          correlation_id: quickstart-request-rate
          timestamp: '2026-11-21T18:40:00.000000Z'
        error:
          code: rate_limit_exceeded
          type: rate_limit_exceeded
          details:
            limit: 60
            retry_after: 12
    QuickstartQuotaExceeded:
      summary: Дневная квота исчерпана
      value:
        state: 1
        message: The API quota for the current period has been exhausted.
        code: 429
        meta:
          request_id: quickstart-request-quota
          correlation_id: quickstart-request-quota
          timestamp: '2026-11-21T18:40:00.000000Z'
        error:
          code: quota_exceeded
          type: quota_exceeded
          details:
            exceeded: true
            period: day
            limit: 1000
            used: 1000
            remaining: 0
            resets_at: '2026-11-22T00:00:00.000000Z'
  schemas:
    ExchangeOrderCreateRequest:
      type: object
      properties:
        country:
          type:
            - string
            - 'null'
          minLength: 2
          maxLength: 2
        handover:
          anyOf:
            - $ref: '#/components/schemas/CityHandoverSelection'
            - type: 'null'
        outcome_amount:
          anyOf:
            - $ref: '#/components/schemas/ExchangeAmountInput'
            - type: 'null'
        receive_amount:
          anyOf:
            - $ref: '#/components/schemas/ExchangeAmountInput'
            - type: 'null'
          description: Псевдоним поля outcome_amount.
        email:
          type:
            - string
            - 'null'
          format: email
          deprecated: true
          description: >-
            Принимается для совместимости. В заявке используется email владельца
            ключа.
        income_account:
          type:
            - string
            - 'null'
        outcome_account:
          type:
            - string
            - 'null'
        from_requisite:
          type:
            - string
            - 'null'
          description: Псевдоним поля income_account.
        to_requisite:
          type:
            - string
            - 'null'
          description: Псевдоним поля outcome_account.
        fields_in:
          type:
            - object
            - 'null'
          additionalProperties: true
        fields_out:
          type:
            - object
            - 'null'
          additionalProperties: true
        direction_fields:
          type:
            - object
            - 'null'
          additionalProperties: true
        user_fields:
          type:
            - object
            - 'null'
          additionalProperties: true
          description: >-
            Для файловых полей укажите массив одноразовых токенов из группы
            `user` выбранного направления. Для остальных полей действуют обычные
            скалярные значения.
        extra_out:
          type:
            - object
            - 'null'
          additionalProperties: true
        device_type:
          type:
            - string
            - 'null'
          maxLength: 32
        snapshot:
          anyOf:
            - $ref: '#/components/schemas/RouteSnapshot'
            - type: 'null'
      allOf:
        - $ref: '#/components/schemas/ExchangeQuoteRequest'
    SuccessEnvelope:
      type: object
      required:
        - state
        - message
        - result
        - meta
      properties:
        state:
          type: integer
          enum:
            - 0
        message:
          type: string
        result: {}
        meta:
          $ref: '#/components/schemas/Meta'
    Order:
      type: object
      required:
        - id
        - public_id
        - tracking_id
        - cash_handover
        - status
        - amounts
        - currencies
        - direction
        - customer
        - payment
        - flags
        - timestamps
      properties:
        id:
          type: integer
        public_id:
          type: string
        tracking_id:
          type:
            - string
            - 'null'
        cash_handover:
          $ref: '#/components/schemas/CashHandoverSnapshot'
        status:
          $ref: '#/components/schemas/OrderState'
        amounts:
          type: object
          required:
            - give
            - receive
            - rate
            - give_with_commission
            - receive_with_commission
          properties:
            give:
              type: string
            receive:
              type: string
            rate:
              type:
                - string
                - 'null'
            give_with_commission:
              type:
                - string
                - 'null'
            receive_with_commission:
              type:
                - string
                - 'null'
        currencies:
          type: object
          required:
            - from
            - to
          properties:
            from:
              anyOf:
                - $ref: '#/components/schemas/CurrencySummary'
                - type: 'null'
            to:
              anyOf:
                - $ref: '#/components/schemas/CurrencySummary'
                - type: 'null'
        direction:
          type: object
          required:
            - id
            - name
          properties:
            id:
              type:
                - integer
                - 'null'
            name:
              type:
                - string
                - 'null'
        customer:
          type: object
          required:
            - email
            - phone
            - from_requisite
            - to_requisite
          properties:
            email:
              type:
                - string
                - 'null'
            phone:
              type:
                - string
                - 'null'
            from_requisite:
              type:
                - string
                - 'null'
            to_requisite:
              type:
                - string
                - 'null'
        payment:
          type: object
          required:
            - merchant_provider
            - merchant_status
            - payment_address
            - is_wallet_issued
            - timing
            - request_timing
          properties:
            merchant_provider:
              type:
                - string
                - 'null'
            merchant_status:
              type:
                - string
                - 'null'
            payment_address:
              type:
                - string
                - 'null'
            is_wallet_issued:
              type: boolean
            timing:
              $ref: '#/components/schemas/OrderPaymentTiming'
            request_timing:
              anyOf:
                - $ref: '#/components/schemas/OrderRequestPaymentTiming'
                - type: 'null'
        flags:
          type: object
          required:
            - is_archive
            - is_frozen
            - is_new_user
            - is_auto_check_payment
          properties:
            is_archive:
              type: boolean
            is_frozen:
              type: boolean
            is_new_user:
              type: boolean
            is_auto_check_payment:
              type: boolean
        timestamps:
          type: object
          required:
            - created_at
            - updated_at
            - started_at
            - completed_at
            - archived_at
          properties:
            created_at:
              type:
                - string
                - 'null'
              format: date-time
            updated_at:
              type:
                - string
                - 'null'
              format: date-time
            started_at:
              type:
                - string
                - 'null'
              format: date-time
            completed_at:
              type:
                - string
                - 'null'
              format: date-time
            archived_at:
              type:
                - string
                - 'null'
              format: date-time
    ErrorEnvelope:
      type: object
      required:
        - state
        - message
        - code
        - error
        - meta
      properties:
        state:
          type: integer
          enum:
            - 1
        message:
          type: string
        code:
          type: integer
          description: Код состояния HTTP.
        error:
          type: object
          required:
            - code
            - type
            - details
          properties:
            code:
              $ref: '#/components/schemas/ApiErrorCode'
              description: Стабильный машинный код ошибки API.
            type:
              $ref: '#/components/schemas/ApiErrorCode'
              deprecated: true
              description: Совместимый псевдоним поля `error.code`.
            details:
              $ref: '#/components/schemas/ApiErrorDetails'
        meta:
          $ref: '#/components/schemas/Meta'
    CityHandoverSelection:
      type: object
      description: >-
        Обязателен только при включённой передаче в выбранном городе
        направления. Не меняет курс и не добавляет комиссию доставки.
      oneOf:
        - type: object
          required:
            - method
            - office_id
          additionalProperties: false
          properties:
            method:
              type: string
              enum:
                - office
            office_id:
              type: integer
              minimum: 1
        - type: object
          required:
            - method
            - address
          additionalProperties: false
          properties:
            method:
              type: string
              enum:
                - courier
            address:
              type: string
              minLength: 1
              maxLength: 1000
        - type: object
          required:
            - method
          additionalProperties: false
          properties:
            method:
              type: string
              enum:
                - agreement
    ExchangeAmountInput:
      description: >-
        Положительная десятичная сумма без экспоненциальной записи. Для
        сохранения точности передавайте её строкой.
      anyOf:
        - type: string
          pattern: ^[0-9]+(?:[.][0-9]+)?$
        - type: number
          exclusiveMinimum: 0
    RouteSnapshot:
      type: object
      required:
        - version
        - route_id
        - hash
        - expiry_signature
        - generated_at
        - expires_at
      properties:
        version:
          type: string
          example: route-snapshot-v1
        route_id:
          type: integer
        hash:
          type: string
        expiry_signature:
          type: string
          pattern: ^[a-f0-9]{64}$
          description: >-
            Непрозрачное подтверждение срока действия. Передайте снимок целиком.
            Если поля нет, запросите свежий расчёт, детали направления или
            preflight.
        generated_at:
          type: string
          format: date-time
        expires_at:
          type: string
          format: date-time
        fingerprint:
          type: object
          additionalProperties: true
    ExchangeQuoteRequest:
      type: object
      properties:
        route_id:
          type:
            - integer
            - 'null'
        direction_id:
          type:
            - integer
            - 'null'
        income_payment_system:
          type:
            - integer
            - 'null'
        outcome_payment_system:
          type:
            - integer
            - 'null'
        from_currency_id:
          type:
            - integer
            - 'null'
        to_currency_id:
          type:
            - integer
            - 'null'
        from:
          type:
            - string
            - 'null'
        to:
          type:
            - string
            - 'null'
        from_code:
          type:
            - string
            - 'null'
        to_code:
          type:
            - string
            - 'null'
        amount:
          anyOf:
            - $ref: '#/components/schemas/ExchangeAmountInput'
            - type: 'null'
          example: '100'
        income_amount:
          anyOf:
            - $ref: '#/components/schemas/ExchangeAmountInput'
            - type: 'null'
          description: Псевдоним поля amount.
        city_id:
          type:
            - integer
            - 'null'
        type_rate:
          description: 0/fixed — фиксированный курс; 1/floating — плавающий курс.
          oneOf:
            - type: integer
              enum:
                - 0
                - 1
            - type: string
              enum:
                - '0'
                - '1'
                - fixed
                - floating
            - type: 'null'
        selected_fee_type:
          type:
            - string
            - 'null'
          maxLength: 50
          deprecated: true
          description: Принимается для совместимости. Для выбора передавайте selected_fees.
        selected_fees:
          description: >-
            Список выбранных селекторов комиссии из контракта направления.
            Объекты-карты поддерживаются для совместимости.
          anyOf:
            - type: array
              items:
                $ref: '#/components/schemas/ExchangeSelectedFeeInput'
            - type: object
              additionalProperties: true
            - type: 'null'
        selector_fees:
          type:
            - object
            - array
            - 'null'
          deprecated: true
          description: Принимается для совместимости. Для выбора передавайте selected_fees.
        checkbox_agreements:
          type: object
          additionalProperties: true
          description: >-
            Ключи соглашений и состояния выбора из контракта направления.
            Комиссии определяются по активным серверным соглашениям, доступным
            этому направлению.
          example:
            discount: true
            commission: false
        checkbox_fees:
          type: object
          additionalProperties: true
          deprecated: true
          description: >-
            Принимается для совместимости и игнорируется. Передавайте
            checkbox_agreements; значения комиссий определяет сервер.
        card_verification_required:
          type:
            - boolean
            - 'null'
        promo_code:
          type:
            - string
            - 'null'
          maxLength: 64
      allOf:
        - $ref: '#/components/schemas/ExchangeRouteSelector'
        - anyOf:
            - required:
                - amount
              properties:
                amount:
                  $ref: '#/components/schemas/ExchangeAmountInput'
            - required:
                - income_amount
              properties:
                income_amount:
                  $ref: '#/components/schemas/ExchangeAmountInput'
    Meta:
      type: object
      required:
        - request_id
        - correlation_id
        - timestamp
      properties:
        request_id:
          type: string
        correlation_id:
          type: string
        timestamp:
          type: string
          format: date-time
        pagination:
          $ref: '#/components/schemas/Pagination'
        filters:
          oneOf:
            - type: object
            - type: array
              maxItems: 0
              items: {}
        sort:
          type: array
          items:
            type: string
        summary:
          anyOf:
            - $ref: '#/components/schemas/PartnerExchangeListSummary'
            - $ref: '#/components/schemas/PartnerPayoutListSummary'
    CashHandoverSnapshot:
      type:
        - object
        - 'null'
      description: >-
        Исторические условия заявки доступны только в приватном ответе
        владельцу. Адрес курьера является персональными данными.
      required:
        - version
        - method
        - direction_city_id
        - city_id
        - office_id
        - office_name
        - address
      properties:
        version:
          type: integer
          enum:
            - 1
        method:
          type: string
          enum:
            - office
            - courier
            - agreement
        direction_city_id:
          type: integer
          minimum: 1
        city_id:
          type: integer
          minimum: 1
        office_id:
          type:
            - integer
            - 'null'
        office_name:
          type:
            - string
            - 'null'
        address:
          type:
            - string
            - 'null'
    OrderState:
      type: object
      required:
        - id
        - key
        - name
        - is_final
        - is_payment_flow
        - is_problem
      properties:
        id:
          type: integer
        key:
          type: string
        name:
          type: string
        reason:
          type:
            - string
            - 'null'
        is_final:
          type: boolean
        is_payment_flow:
          type: boolean
        is_problem:
          type: boolean
    CurrencySummary:
      type: object
      properties:
        id:
          type: integer
        payment:
          type:
            - string
            - 'null'
        code:
          type:
            - string
            - 'null'
        designation:
          type:
            - string
            - 'null'
        small_code:
          type:
            - string
            - 'null'
        network:
          type:
            - string
            - 'null'
        network_out:
          type:
            - string
            - 'null'
        decimal:
          type: integer
    OrderPaymentTiming:
      type: object
      required:
        - duration_seconds
        - started_at
        - expires_at
        - remaining_seconds
        - active
        - overdue
        - action
        - changes_status_on_expiry
        - processed_at
        - source
        - version
        - is_snapshot
        - server_time
      properties:
        duration_seconds:
          type: integer
        started_at:
          type:
            - string
            - 'null'
          format: date-time
        expires_at:
          type:
            - string
            - 'null'
          format: date-time
        remaining_seconds:
          type:
            - integer
            - 'null'
        active:
          type: boolean
        overdue:
          type: boolean
        action:
          type: string
        changes_status_on_expiry:
          type: boolean
        processed_at:
          type:
            - string
            - 'null'
          format: date-time
        source:
          type: string
        version:
          type: integer
        is_snapshot:
          type: boolean
        server_time:
          type: string
          format: date-time
    OrderRequestPaymentTiming:
      type: object
      required:
        - mode
        - is_planned
        - requires_operator_plan
        - timer_start
        - wait_minutes
        - wait_total_seconds
        - wait_started_at
        - wait_expires_at
        - wait_remaining_seconds
        - wait_overdue
        - payment_minutes
        - payment_total_seconds
        - payment_started_at
        - payment_expires_at
        - payment_remaining_seconds
        - payment_active
        - payment_overdue
        - payment_deadline_action
        - payment_status_changes_on_expiry
        - payment_deadline_processed_at
        - payment_deadline_version
        - server_time
      properties:
        mode:
          type: string
        is_planned:
          type: boolean
        requires_operator_plan:
          type: boolean
        timer_start:
          type: string
        wait_minutes:
          type: integer
        wait_total_seconds:
          type: integer
        wait_started_at:
          type:
            - string
            - 'null'
          format: date-time
        wait_expires_at:
          type:
            - string
            - 'null'
          format: date-time
        wait_remaining_seconds:
          type:
            - integer
            - 'null'
        wait_overdue:
          type: boolean
        payment_minutes:
          type: integer
        payment_total_seconds:
          type: integer
        payment_started_at:
          type:
            - string
            - 'null'
          format: date-time
        payment_expires_at:
          type:
            - string
            - 'null'
          format: date-time
        payment_remaining_seconds:
          type:
            - integer
            - 'null'
        payment_active:
          type: boolean
        payment_overdue:
          type: boolean
        payment_deadline_action:
          type: string
        payment_status_changes_on_expiry:
          type: boolean
        payment_deadline_processed_at:
          type:
            - string
            - 'null'
          format: date-time
        payment_deadline_version:
          type: integer
        server_time:
          type: string
          format: date-time
    ApiErrorCode:
      type: string
      enum:
        - authentication_required
        - api_token_required
        - api_disabled
        - site_maintenance
        - api_user_disabled
        - account_banned
        - verification_protection
        - api_admin_account_denied
        - ip_not_allowed
        - scope_denied
        - rate_limit_exceeded
        - signature_required
        - invalid_signature
        - signature_expired
        - signature_replay
        - not_found
        - method_not_allowed
        - validation_failed
        - invalid_filter
        - invalid_cursor
        - invalid_scope
        - token_not_found
        - token_inactive
        - quota_exceeded
        - idempotency_conflict
        - idempotency_in_progress
        - invalid_idempotency_key
        - webhook_endpoint_limit_exceeded
        - webhook_endpoint_not_found
        - http_error
        - server_error
    ApiErrorDetails:
      type:
        - object
        - array
        - 'null'
      maxItems: 0
      items: {}
      properties:
        fields:
          type: object
          additionalProperties:
            type: array
            items:
              type: string
        issues:
          type: array
          items:
            $ref: '#/components/schemas/ApiIssue'
        required_scopes:
          type: array
          items:
            type: string
        retry_after:
          type:
            - integer
            - 'null'
          minimum: 0
        period:
          enum:
            - day
            - month
        limit:
          type:
            - integer
            - 'null'
        used:
          type: integer
        remaining:
          type:
            - integer
            - 'null'
        resets_at:
          type:
            - string
            - 'null'
          format: date-time
        reason:
          type:
            - string
            - 'null'
        is_banned:
          type: boolean
        ends_at:
          type:
            - string
            - 'null'
          format: date-time
        idempotency_key:
          type: string
        message:
          type: string
        cost:
          type:
            - object
            - 'null'
        headers:
          type: array
          items:
            type: string
          description: >-
            Заголовки, нужные для проверки подписи. При ошибке подписи v2 список
            включает X-Api-Signature-Version.
        algorithm:
          type: string
        ip:
          type:
            - string
            - 'null'
        max:
          type: integer
        locked_until:
          type:
            - string
            - 'null'
          format: date-time
        exceeded:
          type: boolean
    ExchangeSelectedFeeInput:
      type: object
      required:
        - id
      properties:
        id:
          type: integer
          minimum: 1
        scope:
          type: string
          enum:
            - common
            - individual
    ExchangeRouteSelector:
      type: object
      anyOf:
        - required:
            - route_id
          properties:
            route_id:
              type: integer
        - required:
            - direction_id
          properties:
            direction_id:
              type: integer
        - allOf:
            - anyOf:
                - required:
                    - income_payment_system
                  properties:
                    income_payment_system:
                      type: integer
                - required:
                    - from_currency_id
                  properties:
                    from_currency_id:
                      type: integer
                - required:
                    - from
                  properties:
                    from:
                      type: string
                - required:
                    - from_code
                  properties:
                    from_code:
                      type: string
            - anyOf:
                - required:
                    - outcome_payment_system
                  properties:
                    outcome_payment_system:
                      type: integer
                - required:
                    - to_currency_id
                  properties:
                    to_currency_id:
                      type: integer
                - required:
                    - to
                  properties:
                    to:
                      type: string
                - required:
                    - to_code
                  properties:
                    to_code:
                      type: string
    Pagination:
      oneOf:
        - $ref: '#/components/schemas/PagePagination'
        - $ref: '#/components/schemas/CursorPagination'
      discriminator:
        propertyName: mode
        mapping:
          page: '#/components/schemas/PagePagination'
          cursor: '#/components/schemas/CursorPagination'
    PartnerExchangeListSummary:
      type: object
      required:
        - total
        - bonus_sum
        - currency
        - confirmed_accruals
        - by_currency
      properties:
        total:
          type: integer
        bonus_sum:
          type: string
        currency:
          type:
            - string
            - 'null'
        confirmed_accruals:
          type: integer
        by_currency:
          type: array
          items:
            $ref: '#/components/schemas/PartnerBonusCurrencySummary'
    PartnerPayoutListSummary:
      type: object
      required:
        - total
        - paid
        - pending
        - rejected
      properties:
        total:
          type: integer
        paid:
          type: integer
        pending:
          type: integer
        rejected:
          type: integer
    ApiIssue:
      type: object
      required:
        - field
        - code
        - message
      properties:
        field:
          type:
            - string
            - 'null'
        code:
          type: string
        message:
          type: string
        severity:
          enum:
            - error
            - warning
            - info
        meta:
          type:
            - object
            - array
    PagePagination:
      type: object
      required:
        - mode
        - current_page
        - per_page
        - total
        - last_page
        - from
        - to
        - has_more
      properties:
        mode:
          const: page
        current_page:
          type: integer
          minimum: 1
        per_page:
          type: integer
          minimum: 1
        total:
          type: integer
          minimum: 0
        last_page:
          type: integer
          minimum: 1
        from:
          type:
            - integer
            - 'null'
        to:
          type:
            - integer
            - 'null'
        has_more:
          type: boolean
    CursorPagination:
      type: object
      required:
        - mode
        - per_page
        - cursor
        - next_cursor
        - has_more
        - sort
      properties:
        mode:
          const: cursor
        per_page:
          type: integer
          minimum: 1
        cursor:
          type:
            - string
            - 'null'
        next_cursor:
          type:
            - string
            - 'null'
        has_more:
          type: boolean
        sort:
          type: array
          items:
            enum:
              - id
              - '-id'
    PartnerBonusCurrencySummary:
      type: object
      required:
        - currency
        - bonus_sum
        - confirmed_accruals
      properties:
        currency:
          type:
            - string
            - 'null'
        bonus_sum:
          type: string
        confirmed_accruals:
          type: integer
  responses:
    Unauthorized:
      description: >-
        Требуется действительная авторизация для API. Если токен действителен,
        пропуск версии подписи возвращает signature_required, а недопустимая
        версия возвращает invalid_signature.
      headers:
        WWW-Authenticate:
          required: true
          schema:
            type: string
            example: Bearer realm="exchanger-api"
      content:
        application/json:
          examples:
            signatureRequired:
              $ref: '#/components/examples/QuickstartSignatureRequired'
          schema:
            $ref: '#/components/schemas/ErrorEnvelope'
    Error:
      description: Стандартная оболочка ошибки.
      headers:
        Retry-After:
          schema:
            type: string
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/ErrorEnvelope'
    InvalidExchangeInput:
      description: >-
        Не удалось проверить данные запроса. Найдите ошибки полей в
        error.details.issues и отправьте исправленные данные.
      content:
        application/json:
          examples:
            invalidAmount:
              $ref: '#/components/examples/QuickstartInvalidAmount'
          schema:
            $ref: '#/components/schemas/ErrorEnvelope'
    RateLimited:
      description: >-
        При rate_limit_exceeded выдержите паузу Retry-After перед следующим
        запросом. При quota_exceeded время окончания периода доступно в
        error.details.resets_at.
      headers:
        Retry-After:
          description: >-
            Оставшиеся секунды текущего окна ограничения запросов, если
            заголовок передан.
          schema:
            type: string
            example: '12'
      content:
        application/json:
          examples:
            rateLimited:
              $ref: '#/components/examples/QuickstartRateLimited'
            quotaExceeded:
              $ref: '#/components/examples/QuickstartQuotaExceeded'
          schema:
            $ref: '#/components/schemas/ErrorEnvelope'
  securitySchemes:
    sanctumBearer:
      type: http
      scheme: bearer
      bearerFormat: Sanctum
      description: 'Токен Sanctum в заголовке `Authorization: Bearer <token>`.'
    apiTimestamp:
      type: apiKey
      in: header
      name: X-Api-Timestamp
      description: >-
        Положительное число секунд Unix или абсолютное время ISO 8601 с
        секундами, смещением или Z. Допустимо до шести знаков дробной части
        секунды.
    apiNonce:
      type: apiKey
      in: header
      name: X-Api-Nonce
      description: >-
        Одноразовое значение для каждого ключа в пределах окна подписи.
        Используйте от 8 до 128 символов A–Z, a–z, 0–9, точки, подчёркивания,
        двоеточия и дефиса.
    apiSignature:
      type: apiKey
      in: header
      name: X-Api-Signature
      description: >-
        Подпись HMAC-SHA256 в шестнадцатеричном виде; допустим префикс
        `sha256=`.

````

This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.