openapi: 3.1.0
info:
  title: iEXExchanger Public API
  version: 4.0.0
  description: |
    Use this API to read client and exchange data, create orders, receive
    webhooks, and manage partner payouts. Start with GET /ping to check
    availability and GET /private/scopes to inspect the API scope catalog.

    Private operations require both a Sanctum token in Authorization: Bearer
    <token> and HMAC v2. Send X-Api-Signature-Version with the value v2 together
    with X-Api-Timestamp, X-Api-Nonce and X-Api-Signature. Partner payout creation
    also requires an Idempotency-Key. When a private operation lists accepted
    token permissions in x-required-scopes, any one of these scopes is sufficient.

    Nonempty HMAC-signed bodies must use application/json or application/*+json.
    Multipart is supported by the upload, order field file and receipt operations
    listed below. Send exactly one file part named file. The default JSON body limit is 1 MiB. A body
    over the installation's limit returns HTTP 413.
    URL-encoded signed bodies and ambiguous content types return invalid_signature.

    JSON responses use one envelope: state=0 means success; state=1 means an
    error. Read error.code for a stable machine-readable reason. List endpoints
    support page pagination, and some support cursor pagination for large lists.
    Reuse an Idempotency-Key when retrying a write request with the same body.
    A replay of webhook management using a saved result from a retired protocol
    returns HTTP 409 with protocol_retired in error.details.reason. A request
    selecting an unsupported webhook payload version returns HTTP 422.

    The English contract is in openapi.yaml and the Russian translation is in
    openapi.ru.yaml. Paths, field names, enum values and error codes are
    identical in both files. The example bodies use the same sandbox data in
    both languages. The server localizes message text according to the request locale.
    HTTP 401 indicates missing or invalid authentication or signature. HTTP 403 indicates an access restriction. HTTP 429 indicates rate or quota limits. HTTP 503 indicates the API or site is unavailable.
servers:
  - url: /api/v3
security:
  - sanctumBearer: []
    apiTimestamp: []
    apiNonce: []
    apiSignature: []
tags:
  - name: System
    description: Availability checks.
  - name: Client
    description: The authenticated client's profile and orders.
  - name: Orders
    description: Order lists, status, actions and payment confirmation.
  - name: Exchange
    description: Payment systems, routes, quotes and exchange orders.
  - name: Files
    description: One-time upload intents for verification files.
  - name: Verifications
    description: Identity and card verification requirements and submissions.
  - name: Sandbox
    description: Simulate an exchange order without creating it.
  - name: Reviews
    description: Read published reviews and submit a review for your order.
  - name: Partner
    description: Partner statistics, referrals, exchanges and payouts.
  - name: Platform
    description: Contract versions, JSON schemas and API usage.
  - name: Webhooks
    description: Register destinations and inspect events and delivery attempts.
  - name: Security
    description: Token permissions and request security details.
paths:
  /ping:
    get:
      operationId: getPing
      tags: [System]
      security: []
      summary: Public health ping
      responses:
        "200":
          $ref: "#/components/responses/PrivatePing"
        default:
          $ref: "#/components/responses/Error"
  /public/contracts:
    get:
      operationId: getPublicContracts
      tags: [Platform]
      security: []
      summary: Public contract version registry
      responses:
        "200":
          description: Current contract versions.
          content:
            application/json:
              schema:
                allOf:
                  - $ref: "#/components/schemas/SuccessEnvelope"
                  - type: object
                    properties:
                      result:
                        type: object
                        properties:
                          contracts:
                            type: array
                            items:
                              $ref: "#/components/schemas/ContractVersion"
        default:
          $ref: "#/components/responses/Error"
  /public/contracts/{contract}:
    get:
      operationId: getPublicContractsByContract
      tags: [Platform]
      security: []
      summary: Show one public contract version
      parameters:
        - name: contract
          in: path
          required: true
          schema:
            type: string
            example: operation-contract
      responses:
        "200":
          description: Contract version.
          content:
            application/json:
              schema:
                allOf:
                  - $ref: "#/components/schemas/SuccessEnvelope"
                  - type: object
                    properties:
                      result:
                        type: object
                        properties:
                          contract:
                            $ref: "#/components/schemas/ContractVersion"
        "404":
          $ref: "#/components/responses/Error"
        default:
          $ref: "#/components/responses/Error"
  /public/schemas:
    get:
      operationId: getPublicSchemas
      tags: [Platform]
      security: []
      summary: Public JSON Schema registry
      responses:
        "200":
          description: JSON Schema catalog.
          content:
            application/json:
              schema:
                allOf:
                  - $ref: "#/components/schemas/SuccessEnvelope"
                  - type: object
                    properties:
                      result:
                        type: object
                        properties:
                          schemas:
                            type: array
                            items:
                              $ref: "#/components/schemas/SchemaRegistryItem"
        default:
          $ref: "#/components/responses/Error"
  /public/schemas/{schema}:
    get:
      operationId: getPublicSchemasBySchema
      tags: [Platform]
      security: []
      summary: Show one JSON Schema
      parameters:
        - name: schema
          in: path
          required: true
          schema:
            type: string
            example: success-envelope.v1
      responses:
        "200":
          description: JSON Schema payload.
          content:
            application/json:
              schema:
                allOf:
                  - $ref: "#/components/schemas/SuccessEnvelope"
                  - type: object
                    properties:
                      result:
                        type: object
                        properties:
                          schema:
                            type: object
                            additionalProperties: true
        "404":
          $ref: "#/components/responses/Error"
        default:
          $ref: "#/components/responses/Error"
  /private/ping:
    get:
      operationId: getPrivatePing
      tags: [System]
      summary: Authenticated health ping
      description: >-
        Check your Bearer token and request signature before calling exchange operations.
      security:
        - sanctumBearer: []
          apiTimestamp: []
          apiNonce: []
          apiSignature: []
      parameters:
        - $ref: "#/components/parameters/SignatureVersion"
      responses:
        "200":
          $ref: "#/components/responses/PrivatePing"
        "401":
          $ref: "#/components/responses/Unauthorized"
        "429":
          $ref: "#/components/responses/RateLimited"
        default:
          $ref: "#/components/responses/Error"
  /private/health/client:
    get:
      operationId: getPrivateHealthClient
      tags: [Platform]
      summary: Current client API health
      x-required-scopes: ["public-api:client:health:read", "public-api:client:read"]
      security:
        - sanctumBearer: []
          apiTimestamp: []
          apiNonce: []
          apiSignature: []
      parameters:
        - $ref: "#/components/parameters/SignatureVersion"
      responses:
        "401":
          $ref: "#/components/responses/Unauthorized"
        "200":
          description: Client API diagnostics.
          content:
            application/json:
              schema:
                allOf:
                  - $ref: "#/components/schemas/SuccessEnvelope"
                  - type: object
                    properties:
                      result:
                        type: object
                        properties:
                          health:
                            $ref: "#/components/schemas/ClientApiHealth"
        "403":
          $ref: "#/components/responses/Error"
        default:
          $ref: "#/components/responses/Error"
  /private/contracts:
    get:
      operationId: getPrivateContracts
      tags: [Platform]
      summary: Authenticated contract version registry
      x-required-scopes: ["public-api:contracts:read", "public-api:scopes:read"]
      security:
        - sanctumBearer: []
          apiTimestamp: []
          apiNonce: []
          apiSignature: []
      parameters:
        - $ref: "#/components/parameters/SignatureVersion"
      responses:
        "401":
          $ref: "#/components/responses/Unauthorized"
        "200":
          $ref: "#/paths/~1public~1contracts/get/responses/200"
        "403":
          $ref: "#/components/responses/Error"
        default:
          $ref: "#/components/responses/Error"
  /private/contracts/{contract}:
    get:
      operationId: getPrivateContractsByContract
      tags: [Platform]
      summary: Show authenticated contract version
      x-required-scopes: ["public-api:contracts:read", "public-api:scopes:read"]
      security:
        - sanctumBearer: []
          apiTimestamp: []
          apiNonce: []
          apiSignature: []
      parameters:
        - name: contract
          in: path
          required: true
          schema:
            type: string
        - $ref: "#/components/parameters/SignatureVersion"
      responses:
        "401":
          $ref: "#/components/responses/Unauthorized"
        "200":
          $ref: "#/paths/~1public~1contracts~1%7Bcontract%7D/get/responses/200"
        "404":
          $ref: "#/components/responses/Error"
        default:
          $ref: "#/components/responses/Error"
  /private/schemas:
    get:
      operationId: getPrivateSchemas
      tags: [Platform]
      summary: Authenticated JSON Schema registry
      x-required-scopes: ["public-api:schemas:read", "public-api:contracts:read"]
      security:
        - sanctumBearer: []
          apiTimestamp: []
          apiNonce: []
          apiSignature: []
      parameters:
        - $ref: "#/components/parameters/SignatureVersion"
      responses:
        "401":
          $ref: "#/components/responses/Unauthorized"
        "200":
          $ref: "#/paths/~1public~1schemas/get/responses/200"
        "403":
          $ref: "#/components/responses/Error"
        default:
          $ref: "#/components/responses/Error"
  /private/schemas/{schema}:
    get:
      operationId: getPrivateSchemasBySchema
      tags: [Platform]
      summary: Show authenticated JSON Schema
      x-required-scopes: ["public-api:schemas:read", "public-api:contracts:read"]
      security:
        - sanctumBearer: []
          apiTimestamp: []
          apiNonce: []
          apiSignature: []
      parameters:
        - name: schema
          in: path
          required: true
          schema:
            type: string
        - $ref: "#/components/parameters/SignatureVersion"
      responses:
        "401":
          $ref: "#/components/responses/Unauthorized"
        "200":
          $ref: "#/paths/~1public~1schemas~1%7Bschema%7D/get/responses/200"
        "404":
          $ref: "#/components/responses/Error"
        default:
          $ref: "#/components/responses/Error"
  /public/orders/statuses:
    get:
      operationId: getPublicOrdersStatuses
      tags: [Orders]
      security: []
      summary: Public order status dictionary
      responses:
        "200":
          $ref: "#/components/responses/OrderStatuses"
        default:
          $ref: "#/components/responses/Error"
  /private/scopes:
    get:
      operationId: getPrivateScopes
      tags: [Security]
      summary: List public API scopes
      x-required-scopes: ["public-api:scopes:read"]
      security:
        - sanctumBearer: []
          apiTimestamp: []
          apiNonce: []
          apiSignature: []
      parameters:
        - $ref: "#/components/parameters/SignatureVersion"
      responses:
        "401":
          $ref: "#/components/responses/Unauthorized"
        "200":
          description: Scope catalog.
          content:
            application/json:
              schema:
                allOf:
                  - $ref: "#/components/schemas/SuccessEnvelope"
                  - type: object
                    properties:
                      result:
                        type: object
                        properties:
                          scopes:
                            type: array
                            items:
                              $ref: "#/components/schemas/ApiScope"
        "403":
          $ref: "#/components/responses/Error"
        default:
          $ref: "#/components/responses/Error"
  /private/usage:
    get:
      operationId: getPrivateUsage
      tags: [Platform]
      summary: API usage, quota and billing summary
      x-required-scopes: ["public-api:usage:read"]
      security:
        - sanctumBearer: []
          apiTimestamp: []
          apiNonce: []
          apiSignature: []
      parameters:
        - $ref: "#/components/parameters/SignatureVersion"
      responses:
        "401":
          $ref: "#/components/responses/Unauthorized"
        "200":
          description: Current token usage summary.
          content:
            application/json:
              schema:
                allOf:
                  - $ref: "#/components/schemas/SuccessEnvelope"
                  - type: object
                    properties:
                      result:
                        $ref: "#/components/schemas/UsageSummary"
        "403":
          $ref: "#/components/responses/Error"
        "429":
          $ref: "#/components/responses/Error"
        default:
          $ref: "#/components/responses/Error"
  /private/webhooks:
    get:
      operationId: getPrivateWebhooks
      tags: [Webhooks]
      summary: List webhook endpoints
      x-required-scopes: ["public-api:webhooks:read"]
      security:
        - sanctumBearer: []
          apiTimestamp: []
          apiNonce: []
          apiSignature: []
      parameters:
        - $ref: "#/components/parameters/SignatureVersion"
      responses:
        "401":
          $ref: "#/components/responses/Unauthorized"
        "200":
          description: Webhook endpoint list and event catalog.
          content:
            application/json:
              schema:
                allOf:
                  - $ref: "#/components/schemas/SuccessEnvelope"
                  - type: object
                    properties:
                      result:
                        type: object
                        properties:
                          endpoints:
                            type: array
                            items:
                              $ref: "#/components/schemas/WebhookEndpoint"
                          events:
                            type: array
                            items:
                              $ref: "#/components/schemas/WebhookEventCatalogItem"
                          limits:
                            type: object
        "403":
          $ref: "#/components/responses/Error"
        default:
          $ref: "#/components/responses/Error"
    post:
      operationId: postPrivateWebhooks
      tags: [Webhooks]
      summary: Create webhook endpoint
      description: >-
        Subscriptions deliver compact payload v2. If payload_version is
        provided, use v2. Receivers verify delivery signatures with HMAC v2.

        With Idempotency-Key, the subscription and its encrypted 201 response commit
        together. Repeating the request with the same key and body within the TTL
        returns the original subscription and secret. If the response is lost and
        the key is missing or the TTL has expired, check the existing subscriptions first.
      x-required-scopes: ["public-api:webhooks:write"]
      security:
        - sanctumBearer: []
          apiTimestamp: []
          apiNonce: []
          apiSignature: []
      parameters:
        - $ref: "#/components/parameters/SignatureVersion"
        - $ref: "#/components/parameters/IdempotencyKey"
        - $ref: "#/components/parameters/CorrelationId"
      requestBody:
        required: true
        content:
          application/json:
            schema:
              $ref: "#/components/schemas/WebhookEndpointCreate"
      responses:
        "401":
          $ref: "#/components/responses/Unauthorized"
        "201":
          description: Webhook endpoint with one-time secret.
          headers:
            Idempotency-Replayed:
              schema: { type: string, const: "true" }
          content:
            application/json:
              schema:
                allOf:
                  - $ref: "#/components/schemas/SuccessEnvelope"
                  - type: object
                    properties:
                      result:
                        type: object
                        properties:
                          endpoint:
                            allOf:
                              - $ref: "#/components/schemas/WebhookEndpoint"
                              - type: object
                                properties:
                                  secret:
                                    type: string
                                    description: One-time webhook signing secret.
        "409":
          $ref: "#/components/responses/Error"
        "422":
          $ref: "#/components/responses/Error"
        default:
          $ref: "#/components/responses/Error"
  /private/webhooks/test:
    post:
      operationId: postPrivateWebhooksTest
      tags: [Webhooks]
      summary: Create a test webhook event
      description: >-
        Queue a test event for matching subscriptions. You may choose a sample event type in the request.
        Deliveries have type api.test. HTTP 201 reports the event and its scheduled deliveries.
        The deliveries list can be empty when no subscription matches.
      x-required-scopes: ["public-api:webhooks:write"]
      security:
        - sanctumBearer: []
          apiTimestamp: []
          apiNonce: []
          apiSignature: []
      parameters:
        - $ref: "#/components/parameters/SignatureVersion"
        - $ref: "#/components/parameters/IdempotencyKey"
        - $ref: "#/components/parameters/CorrelationId"
      requestBody:
        required: false
        content:
          application/json:
            examples:
              testEvent:
                $ref: "#/components/examples/QuickstartWebhookTestInput"
            schema:
              $ref: "#/components/schemas/WebhookTestRequest"
      responses:
        "401":
          $ref: "#/components/responses/Unauthorized"
        "201":
          description: Created webhook event and delivery ids.
          content:
            application/json:
              examples:
                queued:
                  $ref: "#/components/examples/QuickstartWebhookTest"
              schema:
                allOf:
                  - $ref: "#/components/schemas/SuccessEnvelope"
                  - type: object
                    properties:
                      result:
                        $ref: "#/components/schemas/WebhookTestResult"
        "409":
          $ref: "#/components/responses/Error"
        "422":
          $ref: "#/components/responses/InvalidWebhookTestInput"
        "429":
          $ref: "#/components/responses/RateLimited"
        default:
          $ref: "#/components/responses/Error"
  /private/webhooks/events:
    get:
      operationId: getPrivateWebhooksEvents
      tags: [Webhooks]
      summary: List webhook events
      x-required-scopes: ["public-api:webhooks:deliveries:read", "public-api:webhooks:read"]
      security:
        - sanctumBearer: []
          apiTimestamp: []
          apiNonce: []
          apiSignature: []
      parameters:
        - $ref: "#/components/parameters/SignatureVersion"
        - $ref: "#/components/parameters/Page"
        - $ref: "#/components/parameters/PerPage"
        - $ref: "#/components/parameters/PaginationMode"
        - $ref: "#/components/parameters/Cursor"
        - name: filter[status]
          in: query
          schema:
            type: string
        - name: filter[event_type]
          in: query
          schema:
            type: string
        - name: filter[resource_type]
          in: query
          schema:
            type: string
        - name: filter[resource_id]
          in: query
          schema:
            type: string
        - name: filter[correlation_id]
          in: query
          schema:
            type: string
        - name: filter[created_from]
          in: query
          schema:
            type: string
            format: date-time
        - name: filter[created_to]
          in: query
          schema:
            type: string
            format: date-time
      responses:
        "401":
          $ref: "#/components/responses/Unauthorized"
        "200":
          description: Webhook event list.
          content:
            application/json:
              schema:
                allOf:
                  - $ref: "#/components/schemas/SuccessEnvelope"
                  - type: object
                    properties:
                      result:
                        type: object
                        properties:
                          events:
                            type: array
                            items:
                              $ref: "#/components/schemas/WebhookEvent"
        "403":
          $ref: "#/components/responses/Error"
        "422":
          $ref: "#/components/responses/Error"
        default:
          $ref: "#/components/responses/Error"
  /private/webhooks/events/{event}:
    get:
      operationId: getPrivateWebhooksEventsByEvent
      tags: [Webhooks]
      summary: Show webhook event
      x-required-scopes: ["public-api:webhooks:deliveries:read", "public-api:webhooks:read"]
      security:
        - sanctumBearer: []
          apiTimestamp: []
          apiNonce: []
          apiSignature: []
      parameters:
        - $ref: "#/components/parameters/SignatureVersion"
        - name: event
          in: path
          required: true
          schema:
            type: string
            format: uuid
      responses:
        "401":
          $ref: "#/components/responses/Unauthorized"
        "200":
          description: Webhook event with deliveries.
          content:
            application/json:
              schema:
                allOf:
                  - $ref: "#/components/schemas/SuccessEnvelope"
                  - type: object
                    properties:
                      result:
                        type: object
                        properties:
                          event:
                            $ref: "#/components/schemas/WebhookEvent"
        "404":
          $ref: "#/components/responses/Error"
        default:
          $ref: "#/components/responses/Error"
  /private/webhooks/deliveries:
    get:
      operationId: getPrivateWebhooksDeliveries
      tags: [Webhooks]
      summary: List webhook delivery attempts
      x-required-scopes: ["public-api:webhooks:deliveries:read", "public-api:webhooks:read"]
      security:
        - sanctumBearer: []
          apiTimestamp: []
          apiNonce: []
          apiSignature: []
      parameters:
        - $ref: "#/components/parameters/SignatureVersion"
        - $ref: "#/components/parameters/Page"
        - $ref: "#/components/parameters/PerPage"
        - $ref: "#/components/parameters/PaginationMode"
        - $ref: "#/components/parameters/Cursor"
        - name: filter[status]
          in: query
          schema:
            type: string
        - name: filter[endpoint_id]
          in: query
          schema:
            type: string
            format: uuid
        - name: filter[event_id]
          in: query
          schema:
            type: string
            format: uuid
        - name: filter[event_type]
          in: query
          schema:
            type: string
        - name: filter[correlation_id]
          in: query
          schema:
            type: string
        - name: filter[created_from]
          in: query
          schema:
            type: string
            format: date-time
        - name: filter[created_to]
          in: query
          schema:
            type: string
            format: date-time
      responses:
        "401":
          $ref: "#/components/responses/Unauthorized"
        "200":
          description: Webhook delivery list.
          content:
            application/json:
              schema:
                allOf:
                  - $ref: "#/components/schemas/SuccessEnvelope"
                  - type: object
                    properties:
                      result:
                        type: object
                        properties:
                          deliveries:
                            type: array
                            items:
                              $ref: "#/components/schemas/WebhookDelivery"
        "403":
          $ref: "#/components/responses/Error"
        "422":
          $ref: "#/components/responses/Error"
        default:
          $ref: "#/components/responses/Error"
  /private/webhooks/deliveries/{delivery}:
    get:
      operationId: getPrivateWebhooksDeliveriesByDelivery
      tags: [Webhooks]
      summary: Show webhook delivery attempt
      x-required-scopes: ["public-api:webhooks:deliveries:read", "public-api:webhooks:read"]
      security:
        - sanctumBearer: []
          apiTimestamp: []
          apiNonce: []
          apiSignature: []
      parameters:
        - $ref: "#/components/parameters/SignatureVersion"
        - name: delivery
          in: path
          required: true
          schema:
            type: string
            format: uuid
      responses:
        "401":
          $ref: "#/components/responses/Unauthorized"
        "200":
          description: Webhook delivery.
          content:
            application/json:
              schema:
                allOf:
                  - $ref: "#/components/schemas/SuccessEnvelope"
                  - type: object
                    properties:
                      result:
                        type: object
                        properties:
                          delivery:
                            $ref: "#/components/schemas/WebhookDelivery"
        "404":
          $ref: "#/components/responses/Error"
        default:
          $ref: "#/components/responses/Error"
  /private/webhooks/deliveries/{delivery}/retry:
    post:
      operationId: postPrivateWebhooksDeliveriesByDeliveryRetry
      tags: [Webhooks]
      summary: Retry webhook delivery attempt
      description: Archived deliveries return HTTP 409 with error.code http_error and error.details.reason protocol_retired.
      x-required-scopes: ["public-api:webhooks:deliveries:retry", "public-api:webhooks:write"]
      security:
        - sanctumBearer: []
          apiTimestamp: []
          apiNonce: []
          apiSignature: []
      parameters:
        - $ref: "#/components/parameters/SignatureVersion"
        - name: delivery
          in: path
          required: true
          schema:
            type: string
            format: uuid
        - $ref: "#/components/parameters/IdempotencyKey"
        - $ref: "#/components/parameters/CorrelationId"
      responses:
        "401":
          $ref: "#/components/responses/Unauthorized"
        "200":
          description: Delivery queued for retry.
          content:
            application/json:
              schema:
                allOf:
                  - $ref: "#/components/schemas/SuccessEnvelope"
                  - type: object
                    properties:
                      result:
                        type: object
                        properties:
                          delivery:
                            $ref: "#/components/schemas/WebhookDelivery"
        "404":
          $ref: "#/components/responses/Error"
        "409":
          $ref: "#/components/responses/Error"
        default:
          $ref: "#/components/responses/Error"
  /private/webhooks/{webhook}:
    get:
      operationId: getPrivateWebhooksByWebhook
      tags: [Webhooks]
      summary: Show webhook endpoint
      x-required-scopes: ["public-api:webhooks:read"]
      security:
        - sanctumBearer: []
          apiTimestamp: []
          apiNonce: []
          apiSignature: []
      parameters:
        - $ref: "#/components/parameters/SignatureVersion"
        - $ref: "#/components/parameters/WebhookId"
      responses:
        "401":
          $ref: "#/components/responses/Unauthorized"
        "200":
          $ref: "#/components/responses/WebhookEndpointResult"
        "404":
          $ref: "#/components/responses/Error"
        default:
          $ref: "#/components/responses/Error"
    patch:
      operationId: patchPrivateWebhooksByWebhook
      tags: [Webhooks]
      summary: Update webhook endpoint
      x-required-scopes: ["public-api:webhooks:write"]
      security:
        - sanctumBearer: []
          apiTimestamp: []
          apiNonce: []
          apiSignature: []
      parameters:
        - $ref: "#/components/parameters/SignatureVersion"
        - $ref: "#/components/parameters/WebhookId"
        - $ref: "#/components/parameters/IdempotencyKey"
        - $ref: "#/components/parameters/CorrelationId"
      requestBody:
        required: true
        content:
          application/json:
            schema:
              $ref: "#/components/schemas/WebhookEndpointUpdate"
      responses:
        "401":
          $ref: "#/components/responses/Unauthorized"
        "200":
          $ref: "#/components/responses/WebhookEndpointResult"
        "404":
          $ref: "#/components/responses/Error"
        "409":
          $ref: "#/components/responses/Error"
        "422":
          $ref: "#/components/responses/Error"
        default:
          $ref: "#/components/responses/Error"
    delete:
      operationId: deletePrivateWebhooksByWebhook
      tags: [Webhooks]
      summary: Delete webhook endpoint
      x-required-scopes: ["public-api:webhooks:write"]
      security:
        - sanctumBearer: []
          apiTimestamp: []
          apiNonce: []
          apiSignature: []
      parameters:
        - $ref: "#/components/parameters/SignatureVersion"
        - $ref: "#/components/parameters/WebhookId"
        - $ref: "#/components/parameters/IdempotencyKey"
        - $ref: "#/components/parameters/CorrelationId"
      responses:
        "401":
          $ref: "#/components/responses/Unauthorized"
        "200":
          $ref: "#/components/responses/WebhookDeleteResult"
        "404":
          $ref: "#/components/responses/Error"
        "409":
          $ref: "#/components/responses/Error"
        default:
          $ref: "#/components/responses/Error"
  /private/webhooks/{webhook}/rotate-secret:
    post:
      operationId: postPrivateWebhooksByWebhookRotateSecret
      tags: [Webhooks]
      summary: Rotate webhook signing secret
      x-required-scopes: ["public-api:webhooks:write"]
      security:
        - sanctumBearer: []
          apiTimestamp: []
          apiNonce: []
          apiSignature: []
      parameters:
        - $ref: "#/components/parameters/SignatureVersion"
        - $ref: "#/components/parameters/WebhookId"
        - $ref: "#/components/parameters/IdempotencyKey"
        - $ref: "#/components/parameters/CorrelationId"
      responses:
        "401":
          $ref: "#/components/responses/Unauthorized"
        "200":
          description: Webhook endpoint with one-time new secret.
          content:
            application/json:
              schema:
                allOf:
                  - $ref: "#/components/schemas/SuccessEnvelope"
                  - type: object
                    properties:
                      result:
                        type: object
                        properties:
                          endpoint:
                            allOf:
                              - $ref: "#/components/schemas/WebhookEndpoint"
                              - type: object
                                properties:
                                  secret:
                                    type: string
        "404":
          $ref: "#/components/responses/Error"
        "409":
          $ref: "#/components/responses/Error"
        default:
          $ref: "#/components/responses/Error"
  /private/client:
    get:
      operationId: getPrivateClient
      tags: [Client]
      summary: Current client profile
      x-required-scopes: ["public-api:client:read"]
      security:
        - sanctumBearer: []
          apiTimestamp: []
          apiNonce: []
          apiSignature: []
      parameters:
        - $ref: "#/components/parameters/SignatureVersion"
      responses:
        "401":
          $ref: "#/components/responses/Unauthorized"
        "200":
          description: Client profile.
          content:
            application/json:
              schema:
                allOf:
                  - $ref: "#/components/schemas/SuccessEnvelope"
                  - type: object
                    properties:
                      result:
                        $ref: "#/components/schemas/Client"
        default:
          $ref: "#/components/responses/Error"
  /private/exchange/payment-systems:
    get:
      operationId: getPrivateExchangePaymentSystems
      tags: [Exchange]
      summary: List active payment systems
      x-required-scopes: ["public-api:exchange:routes:read"]
      security:
        - sanctumBearer: []
          apiTimestamp: []
          apiNonce: []
          apiSignature: []
      parameters:
        - $ref: "#/components/parameters/SignatureVersion"
        - $ref: "#/components/parameters/Page"
        - $ref: "#/components/parameters/PerPage"
        - $ref: "#/components/parameters/PaginationMode"
        - $ref: "#/components/parameters/Cursor"
        - name: sort
          in: query
          schema:
            type: string
            example: sorting,id
        - name: filter[id]
          in: query
          schema:
            type: integer
        - name: filter[payment_id]
          in: query
          schema:
            type: integer
        - name: filter[code_currency_id]
          in: query
          schema:
            type: integer
        - name: filter[side]
          in: query
          schema:
            type: string
            enum: [give, receive, both]
        - name: filter[from_currency_id]
          in: query
          schema:
            type: integer
        - name: filter[to_currency_id]
          in: query
          schema:
            type: integer
        - name: filter[currency_code]
          in: query
          schema:
            type: string
            example: USDT
        - name: filter[letter_code]
          in: query
          schema:
            type: string
            example: USDTTRC20
        - name: filter[short_code]
          in: query
          schema:
            type: string
            example: USDT
        - name: filter[network]
          in: query
          schema:
            type: string
            example: TRON
      responses:
        "401":
          $ref: "#/components/responses/Unauthorized"
        "200":
          description: Active payment systems.
          content:
            application/json:
              schema:
                allOf:
                  - $ref: "#/components/schemas/SuccessEnvelope"
                  - type: object
                    properties:
                      result:
                        type: array
                        items:
                          $ref: "#/components/schemas/PaymentSystem"
        "403":
          $ref: "#/components/responses/Error"
        "422":
          $ref: "#/components/responses/Error"
        default:
          $ref: "#/components/responses/Error"
  /private/exchange/routes:
    get:
      operationId: getPrivateExchangeRoutes
      tags: [Exchange]
      summary: List active exchange routes
      x-required-scopes: ["public-api:exchange:routes:read"]
      security:
        - sanctumBearer: []
          apiTimestamp: []
          apiNonce: []
          apiSignature: []
      parameters:
        - $ref: "#/components/parameters/SignatureVersion"
        - $ref: "#/components/parameters/Page"
        - $ref: "#/components/parameters/PerPage"
        - $ref: "#/components/parameters/PaginationMode"
        - $ref: "#/components/parameters/Cursor"
        - name: sort
          in: query
          schema:
            type: string
            example: sorting,id
        - name: filter[id]
          in: query
          schema:
            type: integer
        - name: filter[from_currency_id]
          in: query
          schema:
            type: integer
        - name: filter[to_currency_id]
          in: query
          schema:
            type: integer
        - name: filter[from]
          in: query
          schema:
            type: string
            example: USDT
        - name: filter[to]
          in: query
          schema:
            type: string
            example: USD
      responses:
        "401":
          $ref: "#/components/responses/Unauthorized"
        "200":
          description: Active exchange routes.
          content:
            application/json:
              schema:
                allOf:
                  - $ref: "#/components/schemas/SuccessEnvelope"
                  - type: object
                    properties:
                      result:
                        type: array
                        items:
                          $ref: "#/components/schemas/ExchangeRoute"
        "403":
          $ref: "#/components/responses/Error"
        "422":
          $ref: "#/components/responses/Error"
        default:
          $ref: "#/components/responses/Error"
  /private/exchange/routes/{route}:
    get:
      operationId: getPrivateExchangeRoutesByRoute
      tags: [Exchange]
      summary: Show active exchange route
      x-required-scopes: ["public-api:exchange:routes:read"]
      security:
        - sanctumBearer: []
          apiTimestamp: []
          apiNonce: []
          apiSignature: []
      parameters:
        - $ref: "#/components/parameters/SignatureVersion"
        - name: route
          in: path
          required: true
          schema:
            type: integer
      responses:
        "401":
          $ref: "#/components/responses/Unauthorized"
        "200":
          description: Exchange route.
          content:
            application/json:
              schema:
                allOf:
                  - $ref: "#/components/schemas/SuccessEnvelope"
                  - type: object
                    properties:
                      result:
                        $ref: "#/components/schemas/ExchangeRoute"
        "404":
          $ref: "#/components/responses/Error"
        default:
          $ref: "#/components/responses/Error"
  /private/exchange/routes/details:
    get:
      operationId: getPrivateExchangeRoutesDetails
      tags: [Exchange]
      summary: Show exchange route details by currency pair
      x-required-scopes: ["public-api:exchange:routes:read"]
      security:
        - sanctumBearer: []
          apiTimestamp: []
          apiNonce: []
          apiSignature: []
      parameters:
        - $ref: '#/components/parameters/SignatureVersion'
        - name: route_id
          in: query
          schema:
            type: integer
            minimum: 1
        - name: direction_id
          in: query
          schema:
            type: integer
            minimum: 1
        - name: from_currency_id
          in: query
          schema:
            type: integer
            minimum: 1
        - name: to_currency_id
          in: query
          schema:
            type: integer
            minimum: 1
        - name: from
          in: query
          schema:
            type: string
            example: USDT
            maxLength: 64
        - name: to
          in: query
          schema:
            type: string
            example: USD
            maxLength: 64
        - name: income_payment_system
          in: query
          schema:
            type: integer
            minimum: 1
          description: Alias for from_currency_id.
        - name: outcome_payment_system
          in: query
          schema:
            type: integer
            minimum: 1
          description: Alias for to_currency_id.
        - name: from_code
          in: query
          schema:
            type: string
            maxLength: 64
          description: Identifier of the send currency, accepted as an alias of from.
        - name: to_code
          in: query
          schema:
            type: string
            maxLength: 64
          description: Identifier of the receive currency, accepted as an alias of to.
      responses:
        "401":
          $ref: "#/components/responses/Unauthorized"
        "200":
          description: Exchange route details compatible with client operation payload.
          content:
            application/json:
              schema:
                allOf:
                  - $ref: "#/components/schemas/SuccessEnvelope"
                  - type: object
                    properties:
                      result:
                        $ref: "#/components/schemas/ExchangeRouteDetail"
        "404":
          $ref: "#/components/responses/Error"
        "422":
          $ref: "#/components/responses/Error"
        default:
          $ref: "#/components/responses/Error"
  /private/exchange/routes/{route}/details:
    get:
      operationId: getPrivateExchangeRoutesByRouteDetails
      tags: [Exchange]
      summary: Show exchange route details by id
      x-required-scopes: ["public-api:exchange:routes:read"]
      security:
        - sanctumBearer: []
          apiTimestamp: []
          apiNonce: []
          apiSignature: []
      parameters:
        - $ref: "#/components/parameters/SignatureVersion"
        - name: route
          in: path
          required: true
          schema:
            type: integer
      responses:
        "401":
          $ref: "#/components/responses/Unauthorized"
        "200":
          description: Exchange route details compatible with client operation payload.
          content:
            application/json:
              schema:
                allOf:
                  - $ref: "#/components/schemas/SuccessEnvelope"
                  - type: object
                    properties:
                      result:
                        $ref: "#/components/schemas/ExchangeRouteDetail"
        "404":
          $ref: "#/components/responses/Error"
        default:
          $ref: "#/components/responses/Error"
  /private/exchange/routes/{route}/capabilities:
    get:
      operationId: getPrivateExchangeRoutesByRouteCapabilities
      tags: [Exchange]
      summary: Show route capability matrix by id
      x-required-scopes: ["public-api:exchange:capabilities:read", "public-api:exchange:routes:read"]
      security:
        - sanctumBearer: []
          apiTimestamp: []
          apiNonce: []
          apiSignature: []
      parameters:
        - $ref: "#/components/parameters/SignatureVersion"
        - name: route
          in: path
          required: true
          schema:
            type: integer
      responses:
        "401":
          $ref: "#/components/responses/Unauthorized"
        "200":
          description: Route capability matrix.
          content:
            application/json:
              schema:
                allOf:
                  - $ref: "#/components/schemas/SuccessEnvelope"
                  - type: object
                    properties:
                      result:
                        type: object
                        properties:
                          capabilities:
                            $ref: "#/components/schemas/RouteCapabilities"
        "404":
          $ref: "#/components/responses/Error"
        default:
          $ref: "#/components/responses/Error"
  /private/exchange/routes/{from}/{to}/details:
    get:
      operationId: getPrivateExchangeRoutesByFromByToDetails
      tags: [Exchange]
      summary: Show exchange route details by selected currency pair ids
      x-required-scopes: ["public-api:exchange:routes:read"]
      security:
        - sanctumBearer: []
          apiTimestamp: []
          apiNonce: []
          apiSignature: []
      parameters:
        - $ref: "#/components/parameters/SignatureVersion"
        - name: from
          in: path
          required: true
          description: Currency/payment-system id selected as give side.
          schema:
            type: integer
        - name: to
          in: path
          required: true
          description: Currency/payment-system id selected as receive side.
          schema:
            type: integer
      responses:
        "401":
          $ref: "#/components/responses/Unauthorized"
        "200":
          description: Exchange route details compatible with client operation payload.
          content:
            application/json:
              schema:
                allOf:
                  - $ref: "#/components/schemas/SuccessEnvelope"
                  - type: object
                    properties:
                      result:
                        $ref: "#/components/schemas/ExchangeRouteDetail"
        "404":
          $ref: "#/components/responses/Error"
        default:
          $ref: "#/components/responses/Error"
  /private/exchange/routes/{from}/{to}/capabilities:
    get:
      operationId: getPrivateExchangeRoutesByFromByToCapabilities
      tags: [Exchange]
      summary: Show route capability matrix by selected currency pair ids
      x-required-scopes: ["public-api:exchange:capabilities:read", "public-api:exchange:routes:read"]
      security:
        - sanctumBearer: []
          apiTimestamp: []
          apiNonce: []
          apiSignature: []
      parameters:
        - $ref: "#/components/parameters/SignatureVersion"
        - name: from
          in: path
          required: true
          description: Currency/payment-system id selected as give side.
          schema:
            type: integer
        - name: to
          in: path
          required: true
          description: Currency/payment-system id selected as receive side.
          schema:
            type: integer
      responses:
        "401":
          $ref: "#/components/responses/Unauthorized"
        "200":
          description: Route capability matrix.
          content:
            application/json:
              schema:
                allOf:
                  - $ref: "#/components/schemas/SuccessEnvelope"
                  - type: object
                    properties:
                      result:
                        type: object
                        properties:
                          capabilities:
                            $ref: "#/components/schemas/RouteCapabilities"
        "404":
          $ref: "#/components/responses/Error"
        default:
          $ref: "#/components/responses/Error"
  /private/exchange/quotes:
    post:
      operationId: postPrivateExchangeQuotes
      tags: [Exchange]
      summary: Preview exchange calculation
      description: >-
        Calculate an exchange without creating an order or reserving funds.
        Copy the complete result.snapshot into preflight and order creation while it is still valid.
      x-required-scopes: ["public-api:exchange:quotes:read"]
      security:
        - sanctumBearer: []
          apiTimestamp: []
          apiNonce: []
          apiSignature: []
      parameters:
        - $ref: "#/components/parameters/SignatureVersion"
        - $ref: "#/components/parameters/CorrelationId"
      requestBody:
        required: true
        content:
          application/json:
            examples:
              quote:
                $ref: "#/components/examples/QuickstartQuoteInput"
            schema:
              $ref: "#/components/schemas/ExchangeQuoteRequest"
      responses:
        "401":
          $ref: "#/components/responses/Unauthorized"
        "200":
          description: Quote without order creation.
          content:
            application/json:
              examples:
                quote:
                  $ref: "#/components/examples/QuickstartQuote"
              schema:
                allOf:
                  - $ref: "#/components/schemas/SuccessEnvelope"
                  - type: object
                    properties:
                      result:
                        type: object
                        properties:
                          quote:
                            $ref: "#/components/schemas/ExchangeQuote"
                          snapshot:
                            $ref: "#/components/schemas/RouteSnapshot"
        "422":
          $ref: "#/components/responses/InvalidExchangeInput"
        "429":
          $ref: "#/components/responses/RateLimited"
        default:
          $ref: "#/components/responses/Error"
  /private/exchange/orders/preflight:
    post:
      operationId: postPrivateExchangeOrdersPreflight
      tags: [Exchange]
      summary: Validate an exchange order before creation
      description: >-
        Check the same input you intend to submit. HTTP 200 means the check ran.
        Read result.preflight.can_create_order and result.preflight.validation_issues to decide whether to proceed.
        External checks are deferred until creation.
      x-required-scopes: ["public-api:exchange:preflight:read", "public-api:exchange:quotes:read"]
      security:
        - sanctumBearer: []
          apiTimestamp: []
          apiNonce: []
          apiSignature: []
      parameters:
        - $ref: "#/components/parameters/SignatureVersion"
        - $ref: "#/components/parameters/CorrelationId"
      requestBody:
        required: true
        content:
          application/json:
            examples:
              orderInput:
                $ref: "#/components/examples/QuickstartOrderInput"
            schema:
              $ref: "#/components/schemas/ExchangeOrderPreflightRequest"
      responses:
        "401":
          $ref: "#/components/responses/Unauthorized"
        "200":
          description: Preflight result with quote, operation contract, requirements and route snapshot.
          content:
            application/json:
              examples:
                allowed:
                  $ref: "#/components/examples/QuickstartPreflight"
              schema:
                allOf:
                  - $ref: "#/components/schemas/SuccessEnvelope"
                  - type: object
                    properties:
                      result:
                        type: object
                        properties:
                          preflight:
                            $ref: "#/components/schemas/ExchangeOrderPreflight"
        "422":
          $ref: "#/components/responses/InvalidExchangeInput"
        "429":
          $ref: "#/components/responses/RateLimited"
        default:
          $ref: "#/components/responses/Error"
  /private/exchange/orders:
    post:
      operationId: postPrivateExchangeOrders
      tags: [Exchange]
      summary: Create exchange order
      description: >-
        Create an order using the same input as preflight. Set a unique Idempotency-Key for this order.
        If the outcome is unknown, reuse the key and input with a fresh timestamp, nonce and signature.
      x-required-scopes: ["public-api:exchange:orders:create"]
      security:
        - sanctumBearer: []
          apiTimestamp: []
          apiNonce: []
          apiSignature: []
      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:
        "401":
          $ref: "#/components/responses/Unauthorized"
        "201":
          description: >-
            Order created or previously created order replayed.
            A replay returns the same result with fresh request metadata and Idempotency-Replayed set to true.
          headers:
            Idempotency-Key:
              description: The key sent on the request, when supplied.
              schema:
                type: string
                example: quickstart-order-0001
            Idempotency-Replayed:
              description: Included only for a replay.
              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"
        "403":
          $ref: "#/components/responses/Error"
        "409":
          description: >-
            For idempotency_in_progress, wait for Retry-After and retry with the same key and input.
            For idempotency_conflict, reconcile the original operation before submitting any new order.
          headers:
            Retry-After:
              description: Seconds before retrying an in-progress operation. See 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"
  /private/exchange/orders/{order}:
    get:
      operationId: getPrivateExchangeOrdersByOrder
      tags: [Exchange]
      summary: Show current client exchange order
      x-required-scopes: ["public-api:orders:detail:read", "public-api:orders:read"]
      security:
        - sanctumBearer: []
          apiTimestamp: []
          apiNonce: []
          apiSignature: []
      parameters:
        - $ref: "#/components/parameters/SignatureVersion"
        - name: order
          in: path
          required: true
          schema:
            type: string
          description: Database id, public_id or tracking_id.
      responses:
        '401':
          $ref: '#/components/responses/Unauthorized'
        '200':
          description: Current client order.
          content:
            application/json:
              schema:
                allOf:
                  - $ref: '#/components/schemas/SuccessEnvelope'
                  - type: object
                    properties:
                      result:
                        $ref: '#/components/schemas/Order'
        '404':
          $ref: '#/components/responses/Error'
        default:
          $ref: '#/components/responses/Error'
        '422':
          $ref: '#/components/responses/Error'
    delete:
      operationId: deletePrivateExchangeOrdersByOrder
      tags: [Exchange]
      summary: Cancel current client exchange order
      x-required-scopes: ["public-api:exchange:orders:cancel"]
      security:
        - sanctumBearer: []
          apiTimestamp: []
          apiNonce: []
          apiSignature: []
      parameters:
        - $ref: "#/components/parameters/SignatureVersion"
        - name: order
          in: path
          required: true
          schema:
            type: string
          description: Database id, public_id or tracking_id.
        - $ref: "#/components/parameters/IdempotencyKey"
        - $ref: "#/components/parameters/CorrelationId"
      responses:
        "401":
          $ref: "#/components/responses/Unauthorized"
        "200":
          $ref: "#/components/responses/OrderResult"
        "404":
          $ref: "#/components/responses/Error"
        "422":
          $ref: "#/components/responses/Error"
        default:
          $ref: "#/components/responses/Error"
  /private/exchange/orders/{order}/status:
    get:
      operationId: getPrivateExchangeOrdersByOrderStatus
      tags: [Exchange]
      summary: Get order status and details
      x-required-scopes: ["public-api:orders:detail:read", "public-api:orders:read"]
      security:
        - sanctumBearer: []
          apiTimestamp: []
          apiNonce: []
          apiSignature: []
      parameters:
        - $ref: "#/components/parameters/SignatureVersion"
        - name: order
          in: path
          required: true
          schema:
            type: string
          description: Database id, public_id or tracking_id.
      responses:
        '401':
          $ref: '#/components/responses/Unauthorized'
        '200':
          $ref: '#/components/responses/OrderStatusResult'
        '404':
          $ref: '#/components/responses/Error'
        default:
          $ref: '#/components/responses/Error'
        '422':
          $ref: '#/components/responses/Error'
  /private/exchange/orders/{order}/actions:
    get:
      operationId: getPrivateExchangeOrdersByOrderActions
      tags: [Exchange]
      summary: Show order state machine and allowed actions
      x-required-scopes: ["public-api:exchange:orders:actions:read", "public-api:orders:detail:read", "public-api:orders:read"]
      security:
        - sanctumBearer: []
          apiTimestamp: []
          apiNonce: []
          apiSignature: []
      parameters:
        - $ref: "#/components/parameters/SignatureVersion"
        - name: order
          in: path
          required: true
          schema:
            type: string
          description: Database id, public_id or tracking_id.
      responses:
        '401':
          $ref: '#/components/responses/Unauthorized'
        '200':
          description: Order state machine.
          content:
            application/json:
              schema:
                allOf:
                  - $ref: '#/components/schemas/SuccessEnvelope'
                  - type: object
                    properties:
                      result:
                        type: object
                        properties:
                          actions:
                            $ref: '#/components/schemas/OrderActions'
        '404':
          $ref: '#/components/responses/Error'
        default:
          $ref: '#/components/responses/Error'
        '422':
          $ref: '#/components/responses/Error'
  /private/exchange/orders/{order}/confirm:
    post:
      operationId: postPrivateExchangeOrdersByOrderConfirm
      tags: [Exchange]
      summary: Confirm payment or mark order unpaid
      x-required-scopes: ["public-api:exchange:orders:confirm"]
      security:
        - sanctumBearer: []
          apiTimestamp: []
          apiNonce: []
          apiSignature: []
      parameters:
        - $ref: "#/components/parameters/SignatureVersion"
        - name: order
          in: path
          required: true
          schema:
            type: string
          description: Database id, public_id or tracking_id.
        - $ref: "#/components/parameters/IdempotencyKey"
        - $ref: "#/components/parameters/CorrelationId"
      requestBody:
        required: true
        content:
          application/json:
            schema:
              $ref: "#/components/schemas/ExchangeOrderConfirmRequest"
      responses:
        "401":
          $ref: "#/components/responses/Unauthorized"
        "200":
          $ref: "#/components/responses/OrderResult"
        "404":
          $ref: "#/components/responses/Error"
        "422":
          $ref: "#/components/responses/Error"
        default:
          $ref: "#/components/responses/Error"
  /private/exchange/orders/{order}/cancel:
    post:
      operationId: postPrivateExchangeOrdersByOrderCancel
      tags: [Exchange]
      summary: Cancel current client exchange order
      x-required-scopes: ["public-api:exchange:orders:cancel"]
      security:
        - sanctumBearer: []
          apiTimestamp: []
          apiNonce: []
          apiSignature: []
      parameters:
        - $ref: "#/components/parameters/SignatureVersion"
        - name: order
          in: path
          required: true
          schema:
            type: string
        - $ref: "#/components/parameters/IdempotencyKey"
        - $ref: "#/components/parameters/CorrelationId"
      responses:
        "401":
          $ref: "#/components/responses/Unauthorized"
        "200":
          $ref: "#/components/responses/OrderResult"
        "404":
          $ref: "#/components/responses/Error"
        "422":
          $ref: "#/components/responses/Error"
        default:
          $ref: "#/components/responses/Error"
  '/private/exchange/orders/{order}/payment-instructions':
    get:
      operationId: getPrivateExchangeOrdersByOrderPaymentInstructions
      tags: [Exchange]
      summary: "Read current payment instructions"
      description: "Reads the current state without creating a provider invoice. Requisites or a checkout URL are returned only when the order is ready to accept payment."
      x-required-scopes: ["public-api:exchange:payment-instructions:read"]
      security:
        - sanctumBearer: []
          apiTimestamp: []
          apiNonce: []
          apiSignature: []
      parameters:
        - $ref: "#/components/parameters/SignatureVersion"
        - $ref: "#/components/parameters/ExchangeOrderIdentifier"
        - $ref: "#/components/parameters/CorrelationId"
      responses:
        "200":
          $ref: "#/components/responses/PaymentInstructions"
        "401":
          $ref: "#/components/responses/Unauthorized"
        "403":
          $ref: "#/components/responses/Error"
        "404":
          $ref: "#/components/responses/Error"
        default:
          $ref: "#/components/responses/Error"
    post:
      operationId: postPrivateExchangeOrdersByOrderPaymentInstructions
      tags: [Exchange]
      summary: "Prepare payment instructions"
      description: "Requests preparation without a request body. Poll GET for current state and payment details. The preparation response never includes requisites or checkout URLs."
      x-required-scopes: ["public-api:exchange:payment-instructions:write"]
      security:
        - sanctumBearer: []
          apiTimestamp: []
          apiNonce: []
          apiSignature: []
      parameters:
        - $ref: "#/components/parameters/SignatureVersion"
        - $ref: "#/components/parameters/ExchangeOrderIdentifier"
        - $ref: "#/components/parameters/IdempotencyKey"
        - $ref: "#/components/parameters/CorrelationId"
      responses:
        "200":
          $ref: "#/components/responses/PaymentInstructionsPreparation"
        "401":
          $ref: "#/components/responses/Unauthorized"
        "403":
          $ref: "#/components/responses/Error"
        "404":
          $ref: "#/components/responses/Error"
        "409":
          $ref: "#/components/responses/Error"
        "422":
          $ref: "#/components/responses/Error"
        "503":
          description: "The operator notification is temporarily unavailable. Retry the same preparation request."
          headers:
            Retry-After:
              schema:
                type: integer
                example: 3
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/ErrorEnvelope"
        default:
          $ref: "#/components/responses/Error"
  /private/exchange/orders/{order}/verifications:
    get:
      operationId: getPrivateExchangeOrdersByOrderVerifications
      tags: [Verifications]
      summary: Show verification requirements for an order
      x-required-scopes: ["public-api:verifications:read", "public-api:orders:detail:read"]
      security:
        - sanctumBearer: []
          apiTimestamp: []
          apiNonce: []
          apiSignature: []
      parameters:
        - $ref: "#/components/parameters/SignatureVersion"
        - name: order
          in: path
          required: true
          schema:
            type: string
          description: Database id, public_id or tracking_id.
      responses:
        "401":
          $ref: "#/components/responses/Unauthorized"
        "200":
          description: Order verification requirements.
          content:
            application/json:
              schema:
                allOf:
                  - $ref: "#/components/schemas/SuccessEnvelope"
                  - type: object
                    properties:
                      result:
                        type: object
                        properties:
                          requirements:
                            $ref: "#/components/schemas/VerificationRequirements"
        "404":
          $ref: "#/components/responses/Error"
        default:
          $ref: "#/components/responses/Error"
  /private/exchange/orders/{order}/verifications/submit:
    post:
      operationId: postPrivateExchangeOrdersByOrderVerificationsSubmit
      tags: [Verifications]
      summary: Submit verification data for an order
      x-required-scopes: ["public-api:verifications:write"]
      security:
        - sanctumBearer: []
          apiTimestamp: []
          apiNonce: []
          apiSignature: []
      parameters:
        - $ref: "#/components/parameters/SignatureVersion"
        - name: order
          in: path
          required: true
          schema:
            type: string
        - $ref: "#/components/parameters/IdempotencyKey"
        - $ref: "#/components/parameters/CorrelationId"
      requestBody:
        required: true
        content:
          application/json:
            schema:
              $ref: "#/components/schemas/OrderVerificationSubmitRequest"
      responses:
        '401':
          $ref: '#/components/responses/Unauthorized'
        '200':
          $ref: '#/components/responses/OrderVerificationSubmitResult'
        '422':
          $ref: '#/components/responses/Error'
        default:
          $ref: '#/components/responses/Error'
        '404':
          $ref: '#/components/responses/Error'
  /private/files/upload-intents:
    post:
      operationId: postPrivateFilesUploadIntents
      tags: [Files]
      summary: Create a one-time upload intent
      x-required-scopes: ["public-api:files:write"]
      security:
        - sanctumBearer: []
          apiTimestamp: []
          apiNonce: []
          apiSignature: []
      parameters:
        - $ref: "#/components/parameters/SignatureVersion"
        - $ref: "#/components/parameters/IdempotencyKey"
        - $ref: "#/components/parameters/CorrelationId"
      requestBody:
        required: true
        content:
          application/json:
            schema:
              $ref: "#/components/schemas/UploadIntentCreateRequest"
      responses:
        '401':
          $ref: '#/components/responses/Unauthorized'
        '201':
          description: Upload intent.
          content:
            application/json:
              schema:
                allOf:
                  - $ref: '#/components/schemas/SuccessEnvelope'
                  - type: object
                    properties:
                      result:
                        type: object
                        properties:
                          upload_intent:
                            $ref: '#/components/schemas/UploadIntent'
        '422':
          $ref: '#/components/responses/Error'
        default:
          $ref: '#/components/responses/Error'
        '404':
          $ref: '#/components/responses/Error'
  /private/files/upload-intents/{intent}:
    get:
      operationId: getPrivateFilesUploadIntentsByIntent
      tags: [Files]
      summary: Show upload intent status
      x-required-scopes: ["public-api:files:read", "public-api:files:write"]
      security:
        - sanctumBearer: []
          apiTimestamp: []
          apiNonce: []
          apiSignature: []
      parameters:
        - $ref: '#/components/parameters/SignatureVersion'
        - name: intent
          in: path
          required: true
          schema:
            type: string
            anyOf:
              - format: uuid
              - pattern: ^[0-9]*[1-9][0-9]*$
          description: Upload intent UUID or positive numeric ID. Use the UUID from the creation response.
      responses:
        "401":
          $ref: "#/components/responses/Unauthorized"
        "200":
          description: Upload intent.
          content:
            application/json:
              schema:
                allOf:
                  - $ref: "#/components/schemas/SuccessEnvelope"
                  - type: object
                    properties:
                      result:
                        type: object
                        properties:
                          upload_intent:
                            $ref: "#/components/schemas/UploadIntent"
        "404":
          $ref: "#/components/responses/Error"
        default:
          $ref: "#/components/responses/Error"
  /private/files/upload-intents/{intent}/commit:
    post:
      operationId: postPrivateFilesUploadIntentsByIntentCommit
      tags: [Files]
      summary: Upload file into an intent
      x-required-scopes: ["public-api:files:write"]
      security:
        - sanctumBearer: []
          apiTimestamp: []
          apiNonce: []
          apiSignature: []
      parameters:
        - name: intent
          in: path
          required: true
          schema:
            type: string
            anyOf:
              - format: uuid
              - pattern: ^[0-9]*[1-9][0-9]*$
          description: Upload intent UUID or positive numeric ID. Use the UUID from the creation response.
        - $ref: '#/components/parameters/IdempotencyKey'
        - $ref: '#/components/parameters/CorrelationId'
        - $ref: '#/components/parameters/SignatureVersion'
      requestBody:
        required: true
        content:
          multipart/form-data:
            schema:
              type: object
              required: [file]
              properties:
                file:
                  type: string
                  format: binary
      responses:
        "401":
          $ref: "#/components/responses/Unauthorized"
        "200":
          $ref: "#/components/responses/UploadIntentResult"
        "422":
          $ref: "#/components/responses/Error"
        default:
          $ref: "#/components/responses/Error"
  /private/verifications/requirements:
    get:
      operationId: getPrivateVerificationsRequirements
      tags: [Verifications]
      summary: Show verification requirements for route or order
      description: "Looking up requirements by order additionally requires the verification-read scope."
      x-required-scopes: ["public-api:verifications:read", "public-api:exchange:routes:read"]
      security:
        - sanctumBearer: []
          apiTimestamp: []
          apiNonce: []
          apiSignature: []
      parameters:
        - $ref: '#/components/parameters/SignatureVersion'
        - name: order
          in: query
          required: false
          schema:
            type: string
            maxLength: 128
        - name: route_id
          in: query
          required: false
          schema:
            type: integer
            minimum: 1
        - name: income_payment_system
          in: query
          required: false
          schema:
            type: integer
            minimum: 1
        - name: outcome_payment_system
          in: query
          required: false
          schema:
            type: integer
            minimum: 1
        - name: direction_id
          in: query
          schema:
            type: integer
            minimum: 1
          description: Alias for route_id. Pass matching values if you use both names.
        - name: from_currency_id
          in: query
          schema:
            type: integer
            minimum: 1
          description: ID of the currency the customer sends.
        - name: to_currency_id
          in: query
          schema:
            type: integer
            minimum: 1
          description: ID of the currency the customer receives.
        - name: from
          in: query
          schema:
            type: string
            maxLength: 64
          description: Identifier of the currency the customer sends.
        - name: to
          in: query
          schema:
            type: string
            maxLength: 64
          description: Identifier of the currency the customer receives.
        - name: from_code
          in: query
          schema:
            type: string
            maxLength: 64
          description: Identifier of the send currency, accepted as an alias of from.
        - name: to_code
          in: query
          schema:
            type: string
            maxLength: 64
          description: Identifier of the receive currency, accepted as an alias of to.
      responses:
        '401':
          $ref: '#/components/responses/Unauthorized'
        '200':
          $ref: '#/components/responses/VerificationRequirementsResult'
        '422':
          $ref: '#/components/responses/Error'
        default:
          $ref: '#/components/responses/Error'
        '403':
          $ref: '#/components/responses/Error'
        '404':
          $ref: '#/components/responses/Error'
  /private/verifications/identity:
    get:
      operationId: getPrivateVerificationsIdentity
      tags: [Verifications]
      summary: "Read identity verification requirements"
      description: "Returns the published manual form or an authenticated account-page handoff when an external provider is selected. The response includes current verification state."
      x-required-scopes: ["public-api:verifications:read"]
      security:
        - sanctumBearer: []
          apiTimestamp: []
          apiNonce: []
          apiSignature: []
      parameters:
        - $ref: "#/components/parameters/SignatureVersion"
      responses:
        "200":
          $ref: "#/components/responses/IdentityVerificationRequirements"
        "401":
          $ref: "#/components/responses/Unauthorized"
        "403":
          $ref: "#/components/responses/Error"
        default:
          $ref: "#/components/responses/Error"
    post:
      operationId: postPrivateVerificationsIdentity
      tags: [Verifications]
      summary: Create identity verification
      x-required-scopes: ["public-api:verifications:write"]
      security:
        - sanctumBearer: []
          apiTimestamp: []
          apiNonce: []
          apiSignature: []
      parameters:
        - $ref: "#/components/parameters/SignatureVersion"
        - $ref: "#/components/parameters/IdempotencyKey"
        - $ref: "#/components/parameters/CorrelationId"
      requestBody:
        required: true
        content:
          application/json:
            schema:
              $ref: "#/components/schemas/IdentityVerificationCreateRequest"
      responses:
        "401":
          $ref: "#/components/responses/Unauthorized"
        "201":
          $ref: "#/components/responses/IdentityVerificationResult"
        "422":
          $ref: "#/components/responses/Error"
        default:
          $ref: "#/components/responses/Error"
  /private/verifications/identity/{verification}:
    get:
      operationId: getPrivateVerificationsIdentityByVerification
      tags: [Verifications]
      summary: Show identity verification
      x-required-scopes: ["public-api:verifications:read"]
      security:
        - sanctumBearer: []
          apiTimestamp: []
          apiNonce: []
          apiSignature: []
      parameters:
        - $ref: "#/components/parameters/SignatureVersion"
        - name: verification
          in: path
          required: true
          description: "Use the exact uuid from the verification response. Numeric identifiers are supported for legacy records."
          schema:
            type: string
      responses:
        "401":
          $ref: "#/components/responses/Unauthorized"
        "200":
          $ref: "#/components/responses/IdentityVerificationResult"
        "404":
          $ref: "#/components/responses/Error"
        default:
          $ref: "#/components/responses/Error"
  /private/verifications/identity/{verification}/actions:
    get:
      operationId: getPrivateVerificationsIdentityByVerificationActions
      tags: [Verifications]
      summary: Show identity verification actions
      x-required-scopes: ["public-api:verifications:read"]
      security:
        - sanctumBearer: []
          apiTimestamp: []
          apiNonce: []
          apiSignature: []
      parameters:
        - $ref: "#/components/parameters/SignatureVersion"
        - name: verification
          in: path
          required: true
          description: "Use the exact uuid from the verification response. Numeric identifiers are supported for legacy records."
          schema:
            type: string
      responses:
        "401":
          $ref: "#/components/responses/Unauthorized"
        "200":
          $ref: "#/components/responses/VerificationActions"
        default:
          $ref: "#/components/responses/Error"
  /private/verifications/cards:
    post:
      operationId: postPrivateVerificationsCards
      tags: [Verifications]
      summary: Create card/account verification
      x-required-scopes: ["public-api:verifications:write"]
      security:
        - sanctumBearer: []
          apiTimestamp: []
          apiNonce: []
          apiSignature: []
      parameters:
        - $ref: "#/components/parameters/SignatureVersion"
        - $ref: "#/components/parameters/IdempotencyKey"
        - $ref: "#/components/parameters/CorrelationId"
      requestBody:
        required: true
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/CardVerificationCreateRequest'
              anyOf:
                - required:
                    - order
                  properties:
                    order:
                      type: string
                      pattern: \S
                - required:
                    - order_id
                  properties:
                    order_id:
                      type: string
                      pattern: \S
                - required:
                    - currency_id
                  properties:
                    currency_id:
                      type: integer
                      minimum: 1
              description: Pass currency_id for verification outside an order. When the verification is tied to an order, the exchanger uses
                that order’s send currency.
      responses:
        '401':
          $ref: '#/components/responses/Unauthorized'
        '201':
          description: Card verification created.
          content:
            application/json:
              schema:
                allOf:
                  - $ref: '#/components/schemas/SuccessEnvelope'
                  - type: object
                    properties:
                      result:
                        type: object
                        properties:
                          verification:
                            $ref: '#/components/schemas/CardVerification'
        '422':
          $ref: '#/components/responses/Error'
        default:
          $ref: '#/components/responses/Error'
        '404':
          $ref: '#/components/responses/Error'
  /private/verifications/cards/{verification}:
    get:
      operationId: getPrivateVerificationsCardsByVerification
      tags: [Verifications]
      summary: Show card/account verification
      x-required-scopes: ["public-api:verifications:read"]
      security:
        - sanctumBearer: []
          apiTimestamp: []
          apiNonce: []
          apiSignature: []
      parameters:
        - $ref: "#/components/parameters/SignatureVersion"
        - name: verification
          in: path
          required: true
          schema:
            type: string
      responses:
        "401":
          $ref: "#/components/responses/Unauthorized"
        "200":
          description: Card verification details.
          content:
            application/json:
              schema:
                allOf:
                  - $ref: "#/components/schemas/SuccessEnvelope"
                  - type: object
                    properties:
                      result:
                        type: object
                        properties:
                          verification:
                            $ref: "#/components/schemas/CardVerification"
        "404":
          $ref: "#/components/responses/Error"
        default:
          $ref: "#/components/responses/Error"
  /private/verifications/cards/{verification}/actions:
    get:
      operationId: getPrivateVerificationsCardsByVerificationActions
      tags: [Verifications]
      summary: Show card/account verification actions
      x-required-scopes: ["public-api:verifications:read"]
      security:
        - sanctumBearer: []
          apiTimestamp: []
          apiNonce: []
          apiSignature: []
      parameters:
        - $ref: "#/components/parameters/SignatureVersion"
        - name: verification
          in: path
          required: true
          schema:
            type: string
      responses:
        "401":
          $ref: "#/components/responses/Unauthorized"
        "200":
          $ref: "#/components/responses/VerificationActions"
        default:
          $ref: "#/components/responses/Error"
  /private/sandbox/exchange/orders/simulate:
    post:
      operationId: postPrivateSandboxExchangeOrdersSimulate
      tags: [Sandbox]
      summary: Simulate exchange order creation without writing tasks
      description: >-
        Runs the same preflight checks as order creation without creating a task.
        When the selected city's handover configuration is enabled, include
        handover.method and the selected office_id or courier address as required
        by that method. Legacy cities without handover configuration need no
        handover object. Invalid or unavailable selections return 422.
      x-required-scopes: ["public-api:sandbox:run"]
      security:
        - sanctumBearer: []
          apiTimestamp: []
          apiNonce: []
          apiSignature: []
      parameters:
        - $ref: "#/components/parameters/SignatureVersion"
        - $ref: "#/components/parameters/IdempotencyKey"
        - $ref: "#/components/parameters/CorrelationId"
      requestBody:
        required: true
        content:
          application/json:
            schema:
              $ref: "#/components/schemas/ExchangeOrderPreflightRequest"
      responses:
        "401":
          $ref: "#/components/responses/Unauthorized"
        "200":
          $ref: "#/components/responses/SandboxSimulation"
        "422":
          $ref: "#/components/responses/Error"
        default:
          $ref: "#/components/responses/Error"
  /private/reviews:
    get:
      operationId: getPrivateReviews
      tags: [Reviews]
      summary: List published reviews
      x-required-scopes: ["public-api:reviews:read"]
      security:
        - sanctumBearer: []
          apiTimestamp: []
          apiNonce: []
          apiSignature: []
      parameters:
        - $ref: '#/components/parameters/SignatureVersion'
        - $ref: '#/components/parameters/Page'
        - $ref: '#/components/parameters/PerPage'
        - $ref: '#/components/parameters/PaginationMode'
        - $ref: '#/components/parameters/Cursor'
        - name: filter[rating]
          in: query
          schema:
            type: integer
            format: int32
          description: Stored rating. Use 0 for reviews submitted without a rating.
        - name: filter[order_id]
          in: query
          schema:
            type: integer
          description: Internal numeric order ID, distinct from the public or tracking ID accepted in review creation.
        - name: filter[created_from]
          in: query
          schema:
            type: string
            format: date
        - name: filter[created_to]
          in: query
          schema:
            type: string
            format: date
        - name: filter[id]
          in: query
          schema:
            type: integer
            format: int64
          description: Review record ID.
        - name: filter[direction_id]
          in: query
          schema:
            type: integer
            format: int32
          description: Exchange route ID associated with the review.
        - name: filter[user_id]
          in: query
          schema:
            type: integer
            format: int32
          description: ID of the user who wrote the review.
        - name: filter[status]
          in: query
          schema:
            type: integer
            format: int32
          description: Review status filter. The feed contains published reviews with status 1.
        - name: sort
          in: query
          schema:
            type: string
            pattern: ^-?(id|rating|status|created_at)(,-?(id|rating|status|created_at))*$
          description: Comma-separated sort fields. A minus sign means descending. Cursor pagination accepts only id or -id.
      responses:
        "401":
          $ref: "#/components/responses/Unauthorized"
        "200":
          description: Published reviews.
          content:
            application/json:
              schema:
                allOf:
                  - $ref: "#/components/schemas/SuccessEnvelope"
                  - type: object
                    properties:
                      result:
                        type: array
                        items:
                          $ref: "#/components/schemas/Review"
        "422":
          $ref: "#/components/responses/Error"
        default:
          $ref: "#/components/responses/Error"
    post:
      operationId: postPrivateReviews
      tags: [Reviews]
      summary: Create review for own order
      x-required-scopes: ["public-api:reviews:write"]
      security:
        - sanctumBearer: []
          apiTimestamp: []
          apiNonce: []
          apiSignature: []
      parameters:
        - $ref: "#/components/parameters/SignatureVersion"
        - $ref: "#/components/parameters/IdempotencyKey"
        - $ref: "#/components/parameters/CorrelationId"
      requestBody:
        required: true
        content:
          application/json:
            schema:
              $ref: "#/components/schemas/ReviewCreateRequest"
      responses:
        "401":
          $ref: "#/components/responses/Unauthorized"
        "201":
          description: Review sent to moderation.
          content:
            application/json:
              schema:
                allOf:
                  - $ref: "#/components/schemas/SuccessEnvelope"
                  - type: object
                    properties:
                      result:
                        type: object
                        properties:
                          review:
                            $ref: "#/components/schemas/Review"
        "404":
          $ref: "#/components/responses/Error"
        "409":
          $ref: "#/components/responses/Error"
        "422":
          $ref: "#/components/responses/Error"
        default:
          $ref: "#/components/responses/Error"
  /private/orders/statuses:
    get:
      operationId: getPrivateOrdersStatuses
      tags: [Orders]
      summary: Order status dictionary
      x-required-scopes: ["public-api:orders:statuses:read", "public-api:orders:read"]
      security:
        - sanctumBearer: []
          apiTimestamp: []
          apiNonce: []
          apiSignature: []
      parameters:
        - $ref: "#/components/parameters/SignatureVersion"
      responses:
        "401":
          $ref: "#/components/responses/Unauthorized"
        "200":
          $ref: "#/components/responses/OrderStatuses"
        default:
          $ref: "#/components/responses/Error"
  /private/orders:
    get:
      operationId: getPrivateOrders
      tags: [Orders]
      summary: List current client orders
      x-required-scopes: ["public-api:orders:read"]
      security:
        - sanctumBearer: []
          apiTimestamp: []
          apiNonce: []
          apiSignature: []
      parameters:
        - $ref: "#/components/parameters/SignatureVersion"
        - $ref: "#/components/parameters/Page"
        - $ref: "#/components/parameters/PerPage"
        - $ref: "#/components/parameters/PaginationMode"
        - $ref: "#/components/parameters/Cursor"
        - name: sort
          in: query
          schema:
            type: string
            example: -created_at
          description: "Comma-separated sort fields. Allowed: id, created_at, updated_at, completed_at, amount_in, amount_out, status."
        - name: filter[status]
          in: query
          schema:
            type: string
            enum:
              - active
              - final
              - expired
              - pending_payment
              - waiting_handle
              - completed
              - rejected
              - canceled_by_user
              - paid
              - frozen
              - processing_payment
              - invalid
              - deleted
              - check_payment
              - merchant_confirmation
              - auto_payout_error
              - payout_in_progress
              - payout_queue
            example: paid
          description: >-
            One public status key. Pass multiple values as
            `filter[status][]=paid&filter[status][]=completed`. A CSV string is
            not an array and is rejected as an unknown status.
        - name: filter[status_id]
          in: query
          schema:
            type: integer
            minimum: 1
            example: 7
          description: Numeric status ID; do not combine it with `filter[status]`.
        - name: filter[id]
          in: query
          schema:
            type: integer
        - name: filter[public_id]
          in: query
          schema:
            type: string
        - name: filter[tracking_id]
          in: query
          schema:
            type: string
        - name: filter[email]
          in: query
          schema:
            type: string
        - name: filter[from_requisite]
          in: query
          schema:
            type: string
        - name: filter[to_requisite]
          in: query
          schema:
            type: string
        - name: filter[created_from]
          in: query
          schema:
            type: string
            format: date
        - name: filter[created_to]
          in: query
          schema:
            type: string
            format: date
        - name: filter[currency]
          in: query
          schema:
            type: string
            example: USDT
        - name: filter[amount_min]
          in: query
          schema:
            type: string
        - name: filter[amount_max]
          in: query
          schema:
            type: string
      responses:
        "401":
          $ref: "#/components/responses/Unauthorized"
        "200":
          $ref: "#/components/responses/OrdersResult"
        "403":
          $ref: "#/components/responses/Error"
        "422":
          $ref: "#/components/responses/Error"
        default:
          $ref: "#/components/responses/Error"
  /private/orders/{order}:
    get:
      operationId: getPrivateOrdersByOrder
      tags: [Orders]
      summary: Show one current client order
      x-required-scopes: ["public-api:orders:detail:read", "public-api:orders:read"]
      security:
        - sanctumBearer: []
          apiTimestamp: []
          apiNonce: []
          apiSignature: []
      parameters:
        - $ref: "#/components/parameters/SignatureVersion"
        - name: order
          in: path
          required: true
          schema:
            type: string
          description: Database id, public_id or tracking_id.
      responses:
        '401':
          $ref: '#/components/responses/Unauthorized'
        '200':
          $ref: '#/components/responses/OwnedOrderResult'
        '404':
          $ref: '#/components/responses/Error'
        default:
          $ref: '#/components/responses/Error'
        '422':
          $ref: '#/components/responses/Error'
  /private/partner:
    get:
      operationId: getPrivatePartner
      tags: [Partner]
      summary: Partner profile and summary
      x-required-scopes: ["public-api:partner:read"]
      security:
        - sanctumBearer: []
          apiTimestamp: []
          apiNonce: []
          apiSignature: []
      parameters:
        - $ref: "#/components/parameters/SignatureVersion"
      responses:
        "401":
          $ref: "#/components/responses/Unauthorized"
        "200":
          $ref: "#/components/responses/PartnerResult"
        default:
          $ref: "#/components/responses/Error"
  /private/partner/statistics:
    get:
      operationId: getPrivatePartnerStatistics
      tags: [Partner]
      summary: Partner aggregated statistics
      x-required-scopes: ["public-api:partner:statistics:read"]
      security:
        - sanctumBearer: []
          apiTimestamp: []
          apiNonce: []
          apiSignature: []
      parameters:
        - $ref: "#/components/parameters/SignatureVersion"
      responses:
        "401":
          $ref: "#/components/responses/Unauthorized"
        "200":
          $ref: "#/components/responses/PartnerStatisticsResult"
        default:
          $ref: "#/components/responses/Error"
  /private/partner/referrals:
    get:
      operationId: getPrivatePartnerReferrals
      tags: [Partner]
      summary: Attracted clients list
      x-required-scopes: ["public-api:partner:referrals:read"]
      security:
        - sanctumBearer: []
          apiTimestamp: []
          apiNonce: []
          apiSignature: []
      parameters:
        - $ref: '#/components/parameters/SignatureVersion'
        - $ref: '#/components/parameters/Page'
        - $ref: '#/components/parameters/PerPage'
        - $ref: '#/components/parameters/PaginationMode'
        - $ref: '#/components/parameters/Cursor'
        - name: filter[id]
          in: query
          schema:
            type: integer
        - name: filter[client_id]
          in: query
          schema:
            type: integer
        - name: filter[client_email]
          in: query
          schema:
            type: string
        - name: filter[client_name]
          in: query
          schema:
            type: string
        - name: filter[created_from]
          in: query
          schema:
            type: string
            format: date
        - name: filter[created_to]
          in: query
          schema:
            type: string
            format: date
        - name: sort
          in: query
          schema:
            type: string
            pattern: ^-?(id|created_at)(,-?(id|created_at))*$
          description: Comma-separated fields (id, created_at). Prefix a field with a minus sign for descending order. Cursor pagination
            accepts only id or -id.
      responses:
        "401":
          $ref: "#/components/responses/Unauthorized"
        "200":
          $ref: "#/components/responses/PartnerReferralsResult"
        "422":
          $ref: "#/components/responses/Error"
        default:
          $ref: "#/components/responses/Error"
  /private/partner/exchanges:
    get:
      operationId: getPrivatePartnerExchanges
      tags: [Partner]
      summary: Referral bonus exchanges
      x-required-scopes: ["public-api:partner:exchanges:read"]
      security:
        - sanctumBearer: []
          apiTimestamp: []
          apiNonce: []
          apiSignature: []
      parameters:
        - $ref: '#/components/parameters/SignatureVersion'
        - $ref: '#/components/parameters/Page'
        - $ref: '#/components/parameters/PerPage'
        - $ref: '#/components/parameters/PaginationMode'
        - $ref: '#/components/parameters/Cursor'
        - name: filter[id]
          in: query
          schema:
            type: integer
        - name: filter[order_id]
          in: query
          schema:
            type: integer
        - name: filter[client_id]
          in: query
          schema:
            type: integer
        - name: filter[status]
          in: query
          schema:
            type: string
        - name: filter[order_public_id]
          in: query
          schema:
            type: string
        - name: filter[order_tracking_id]
          in: query
          schema:
            type: string
        - name: filter[client_email]
          in: query
          schema:
            type: string
        - name: filter[bonus_min]
          in: query
          schema:
            type: string
        - name: filter[bonus_max]
          in: query
          schema:
            type: string
        - name: filter[created_from]
          in: query
          schema:
            type: string
            format: date
        - name: filter[created_to]
          in: query
          schema:
            type: string
            format: date
        - name: sort
          in: query
          schema:
            type: string
            pattern: ^-?(id|order_id|status|created_at|bonus)(,-?(id|order_id|status|created_at|bonus))*$
          description: Comma-separated fields (id, order_id, status, created_at, bonus). Prefix a field with a minus sign for descending
            order. Cursor pagination accepts only id or -id.
        - name: filter[client_name]
          in: query
          schema:
            type: string
          description: Exact name of the referred customer.
      responses:
        "401":
          $ref: "#/components/responses/Unauthorized"
        "200":
          $ref: "#/components/responses/PartnerExchangesResult"
        "422":
          $ref: "#/components/responses/Error"
        default:
          $ref: "#/components/responses/Error"
  /private/partner/payout-methods:
    get:
      operationId: getPrivatePartnerPayoutMethods
      tags: [Partner]
      summary: Available partner payout methods and balance
      description: Returns only payout currencies available to this account, current base balance, minimum and confirmation policy.
      x-required-scopes: ["public-api:partner:payouts:read"]
      security:
        - sanctumBearer: []
          apiTimestamp: []
          apiNonce: []
          apiSignature: []
      parameters:
        - $ref: "#/components/parameters/SignatureVersion"
      responses:
        "401":
          $ref: "#/components/responses/Unauthorized"
        "200":
          $ref: "#/components/responses/PartnerPayoutMethods"
        default:
          $ref: "#/components/responses/Error"
  /private/partner/payouts:
    get:
      operationId: getPrivatePartnerPayouts
      tags: [Partner]
      summary: Partner payout requests
      x-required-scopes: ["public-api:partner:payouts:read"]
      security:
        - sanctumBearer: []
          apiTimestamp: []
          apiNonce: []
          apiSignature: []
      parameters:
        - $ref: '#/components/parameters/SignatureVersion'
        - $ref: '#/components/parameters/Page'
        - $ref: '#/components/parameters/PerPage'
        - $ref: '#/components/parameters/PaginationMode'
        - $ref: '#/components/parameters/Cursor'
        - name: filter[id]
          in: query
          schema:
            type: integer
        - name: filter[public_id]
          in: query
          schema:
            type: string
        - name: filter[wallet]
          in: query
          schema:
            type: string
        - name: filter[status]
          in: query
          schema:
            type: string
            enum:
              - pending
              - paid
              - rejected
        - name: filter[currency]
          in: query
          schema:
            type: string
        - name: filter[amount_min]
          in: query
          schema:
            type: string
        - name: filter[amount_max]
          in: query
          schema:
            type: string
        - name: filter[created_from]
          in: query
          schema:
            type: string
            format: date
        - name: filter[created_to]
          in: query
          schema:
            type: string
            format: date
        - name: sort
          in: query
          schema:
            type: string
            pattern: ^-?(id|status|created_at|amount)(,-?(id|status|created_at|amount))*$
          description: Comma-separated fields (id, status, created_at, amount). Prefix a field with a minus sign for descending order.
            Cursor pagination accepts only id or -id.
      responses:
        "401":
          $ref: "#/components/responses/Unauthorized"
        "200":
          $ref: "#/components/responses/PartnerPayouts"
        "422":
          $ref: "#/components/responses/Error"
        default:
          $ref: "#/components/responses/Error"
    post:
      operationId: postPrivatePartnerPayouts
      tags: [Partner]
      summary: Request a partner payout
      description: >-
        Creates a pending payout request and debits the requested base amount from
        available partner balance exactly once. Omit amount to request the entire
        available balance. An enabled email confirmation policy still applies;
        actual transfer remains subject to the existing payout processing flow.
        Reusing the same Idempotency-Key with the same payload returns the
        existing request, including after the HTTP idempotency cache expires.
      x-required-scopes: ["public-api:partner:payouts:create"]
      security:
        - sanctumBearer: []
          apiTimestamp: []
          apiNonce: []
          apiSignature: []
      parameters:
        - name: Idempotency-Key
          in: header
          required: true
          schema:
            type: string
            minLength: 8
            maxLength: 191
            pattern: "^[A-Za-z0-9._:-]{8,191}$"
          description: Stable unique key for this payout intent, even across retries.
        - $ref: "#/components/parameters/CorrelationId"
        - $ref: "#/components/parameters/SignatureVersion"
      requestBody:
        required: true
        content:
          application/json:
            schema:
              $ref: "#/components/schemas/PartnerPayoutCreateRequest"
      responses:
        "401":
          $ref: "#/components/responses/Unauthorized"
        '201':
          description: Created pending payout request.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/PartnerPayoutCreateResponse'
          headers:
            Idempotency-Replayed:
              description: May be present when the API returns an existing result for the same idempotency key.
              schema:
                type: string
                const: 'true'
        '200':
          description: Existing payout returned after a durable idempotency replay.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/PartnerPayoutCreateResponse'
          headers:
            Idempotency-Replayed:
              description: May be present when the API returns an existing result for the same idempotency key.
              schema:
                type: string
                const: 'true'
        "403":
          $ref: "#/components/responses/Error"
        "409":
          $ref: "#/components/responses/Error"
        "422":
          $ref: "#/components/responses/Error"
        default:
          $ref: "#/components/responses/Error"
  /private/partner/payouts/preview:
    post:
      operationId: postPrivatePartnerPayoutsPreview
      tags: [Partner]
      summary: "Preview a partner payout"
      description: "Calculates the payout and fees using current conditions. The preview creates no payout request, reserves no balance and does not lock the quote."
      x-required-scopes:
        - "public-api:partner:payouts:read"
      security:
        - sanctumBearer: []
          apiTimestamp: []
          apiNonce: []
          apiSignature: []
      parameters:
        - $ref: "#/components/parameters/CorrelationId"
        - $ref: "#/components/parameters/SignatureVersion"
      requestBody:
        required: true
        content:
          application/json:
            schema:
              $ref: "#/components/schemas/PartnerPayoutCreateRequest"
      responses:
        "401":
          $ref: "#/components/responses/Unauthorized"
        "200":
          description: "Calculated amount and fees."
          content:
            application/json:
              schema:
                allOf:
                  - $ref: "#/components/schemas/SuccessEnvelope"
                  - type: object
                    properties:
                      result:
                        type: object
                        required: [preview]
                        properties:
                          preview:
                            $ref: "#/components/schemas/PartnerPayoutPreview"
        "422":
          $ref: "#/components/responses/Error"
        default:
          $ref: "#/components/responses/Error"
  /private/partner/payouts/{payout}:
    get:
      operationId: getPrivatePartnerPayoutsByPayout
      tags: [Partner]
      summary: Show an owned partner payout request
      x-required-scopes: ["public-api:partner:payouts:read"]
      security:
        - sanctumBearer: []
          apiTimestamp: []
          apiNonce: []
          apiSignature: []
      parameters:
        - $ref: "#/components/parameters/SignatureVersion"
        - name: payout
          in: path
          required: true
          schema:
            type: integer
      responses:
        "401":
          $ref: "#/components/responses/Unauthorized"
        "200":
          $ref: "#/components/responses/PartnerPayoutDetail"
        "404":
          $ref: "#/components/responses/Error"
        default:
          $ref: "#/components/responses/Error"
  /private/exchange/orders/{order}/status-summary:
    get:
      operationId: getPrivateExchangeOrdersByOrderStatusSummary
      tags: [Exchange]
      summary: "Read a compact order status"
      description: "Returns the current stored state for polling. The older status operation still returns the full order."
      x-required-scopes: ["public-api:orders:detail:read", "public-api:orders:read"]
      security:
        - sanctumBearer: []
          apiTimestamp: []
          apiNonce: []
          apiSignature: []
      parameters:
        - $ref: "#/components/parameters/SignatureVersion"
        - $ref: "#/components/parameters/ExchangeOrderIdentifier"
        - $ref: "#/components/parameters/CorrelationId"
      responses:
        "200":
          $ref: "#/components/responses/ExchangeOrderStatusSummary"
        "401":
          $ref: "#/components/responses/Unauthorized"
        "403":
          $ref: "#/components/responses/Error"
        "404":
          $ref: "#/components/responses/Error"
        "422":
          $ref: "#/components/responses/Error"
        default:
          $ref: "#/components/responses/Error"
  /private/exchange/orders/{order}/payment-status:
    get:
      operationId: getPrivateExchangeOrdersByOrderPaymentStatus
      tags: [Exchange]
      summary: "Read payment progress"
      description: "Returns the current payment state and up to 50 recorded transitions. Missing durable provider confirmation can occur on legacy orders and does not establish that funds were not received."
      x-required-scopes: ["public-api:exchange:payment-instructions:read"]
      security:
        - sanctumBearer: []
          apiTimestamp: []
          apiNonce: []
          apiSignature: []
      parameters:
        - $ref: "#/components/parameters/SignatureVersion"
        - $ref: "#/components/parameters/ExchangeOrderIdentifier"
        - $ref: "#/components/parameters/CorrelationId"
      responses:
        "200":
          $ref: "#/components/responses/ExchangeOrderPaymentStatus"
        "401":
          $ref: "#/components/responses/Unauthorized"
        "403":
          $ref: "#/components/responses/Error"
        "404":
          $ref: "#/components/responses/Error"
        "422":
          $ref: "#/components/responses/Error"
        default:
          $ref: "#/components/responses/Error"
  /private/exchange/orders/{order}/receipts:
    get:
      operationId: getPrivateExchangeOrdersByOrderReceipts
      tags: [Files]
      summary: "List payment receipt metadata"
      description: "Start without after_id, then pass next_after_id to continue in ascending ID order."
      x-required-scopes: ["public-api:files:read"]
      security:
        - sanctumBearer: []
          apiTimestamp: []
          apiNonce: []
          apiSignature: []
      parameters:
        - $ref: "#/components/parameters/SignatureVersion"
        - $ref: "#/components/parameters/ExchangeOrderIdentifier"
        - name: after_id
          in: query
          schema: { type: integer, minimum: 1 }
        - name: limit
          in: query
          schema: { type: integer, minimum: 1, maximum: 100, default: 25 }
        - $ref: "#/components/parameters/CorrelationId"
      responses:
        "200":
          $ref: "#/components/responses/ExchangeOrderReceipts"
        "401":
          $ref: "#/components/responses/Unauthorized"
        "403":
          $ref: "#/components/responses/Error"
        "404":
          $ref: "#/components/responses/Error"
        "422":
          $ref: "#/components/responses/Error"
        default:
          $ref: "#/components/responses/Error"
    post:
      operationId: postPrivateExchangeOrdersByOrderReceipts
      tags: [Files]
      summary: "Attach payment receipt"
      description: "Attaches one receipt file to an order owned by the authenticated client. Use the separate confirmation operation to confirm payment. Reusing the same key and file returns the original receipt after the ordinary reply TTL. Receipt deletion or ownership change returns 404 while keeping the key occupied."
      x-required-scopes: ["public-api:files:write"]
      security:
        - sanctumBearer: []
          apiTimestamp: []
          apiNonce: []
          apiSignature: []
      parameters:
        - $ref: "#/components/parameters/ExchangeOrderIdentifier"
        - $ref: "#/components/parameters/CorrelationId"
        - $ref: "#/components/parameters/SignatureVersion"
        - $ref: "#/components/parameters/IdempotencyKey"
      requestBody:
        required: true
        content:
          multipart/form-data:
            schema:
              type: object
              required: [file]
              additionalProperties: false
              properties:
                file:
                  type: string
                  format: binary
      responses:
        "201":
          $ref: "#/components/responses/ExchangeOrderReceipt"
        "401":
          $ref: "#/components/responses/Unauthorized"
        "403":
          $ref: "#/components/responses/Error"
        "404":
          $ref: "#/components/responses/Error"
        "409":
          $ref: "#/components/responses/Error"
        "422":
          $ref: "#/components/responses/Error"
        default:
          $ref: "#/components/responses/Error"
  /private/exchange/routes/{route}/fields/{group}/{field}/files:
    post:
      operationId: postPrivateExchangeRouteFieldFiles
      tags: [Files]
      summary: "Upload an exchange field file"
      description: "Returns a one-time token bound to the authenticated integration, route and field. For group `user`, submit the tokens as an array under `user_fields[field_key]` before expiry."
      x-required-scopes: ["public-api:files:write"]
      security:
        - sanctumBearer: []
          apiTimestamp: []
          apiNonce: []
          apiSignature: []
      parameters:
        - name: route
          in: path
          required: true
          schema: { type: integer, minimum: 1 }
        - name: group
          in: path
          required: true
          schema: { type: string, enum: [in, out, direction, user] }
        - name: field
          in: path
          required: true
          schema: { type: integer, minimum: 1 }
        - $ref: "#/components/parameters/CorrelationId"
        - $ref: "#/components/parameters/SignatureVersion"
        - $ref: "#/components/parameters/IdempotencyKey"
      requestBody:
        required: true
        content:
          multipart/form-data:
            schema:
              type: object
              required: [file]
              additionalProperties: false
              properties:
                file:
                  type: string
                  format: binary
      responses:
        "201":
          $ref: "#/components/responses/OrderFieldUpload"
        "401":
          $ref: "#/components/responses/Unauthorized"
        "403":
          $ref: "#/components/responses/Error"
        "404":
          $ref: "#/components/responses/Error"
        "422":
          $ref: "#/components/responses/Error"
        default:
          $ref: "#/components/responses/Error"
webhooks:
  delivery:
    post:
      operationId: receivePublicApiWebhook
      tags: [Webhooks]
      summary: "Receive an outbound webhook"
      description: >-
        Verify HMAC v2 with the endpoint secret and the exact JSON bytes.
        Join the string webhook-v2, event ID, event type, Unix timestamp,
        positive attempt number, nonce and lowercase SHA-256 of the body with
        LF characters, without a trailing LF. Verify the event ID and type
        against the signed body. Handle repeated event IDs idempotently.
        Test events have type api.test and may include sample_of.
      security: []
      parameters:
        - name: X-Webhook-Signature-Version
          in: header
          required: true
          schema: { type: string, const: v2 }
        - name: X-Webhook-Event-Id
          in: header
          required: true
          schema:
            type: string
            format: uuid
        - name: X-Webhook-Event-Type
          in: header
          required: true
          schema:
            type: string
        - name: X-Webhook-Timestamp
          in: header
          required: true
          schema:
            type: string
            pattern: "^[0-9]+$"
        - name: X-Webhook-Attempt
          in: header
          required: true
          schema: { type: integer, minimum: 1 }
        - name: X-Webhook-Nonce
          in: header
          required: true
          schema:
            type: string
            format: uuid
        - name: X-Webhook-Signature
          in: header
          required: true
          schema:
            type: string
            pattern: "^sha256=[a-f0-9]{64}$"
        - name: X-Request-Id
          in: header
          schema:
            type: string
        - $ref: "#/components/parameters/CorrelationId"
      requestBody:
        required: true
        content:
          application/json:
            examples:
              statusChanged:
                $ref: "#/components/examples/QuickstartStatusChangedNotification"
              testEvent:
                $ref: "#/components/examples/QuickstartTestNotification"
            schema:
              $ref: "#/components/schemas/WebhookNotification"
      responses:
        "2XX":
          description: "Delivery accepted and recorded durably."
        "429":
          description: "Try again later. The receiver may send Retry-After."
          headers:
            Retry-After:
              schema:
                type: string
        default:
          description: "Delivery failed. Retrying depends on the API delivery policy."
components:
  securitySchemes:
    sanctumBearer:
      type: http
      scheme: bearer
      bearerFormat: Sanctum
      description: "Sanctum token in `Authorization: Bearer <token>` format."
    apiTimestamp:
      type: apiKey
      in: header
      name: X-Api-Timestamp
      description: Positive Unix seconds or an absolute ISO 8601 timestamp with seconds and a numeric offset or Z. A fractional second may contain up to six digits.
    apiNonce:
      type: apiKey
      in: header
      name: X-Api-Nonce
      description: Unique nonce per token within the signing window. Use 8 to 128 characters from A–Z, a–z, 0–9, period, underscore, colon and hyphen.
    apiSignature:
      type: apiKey
      in: header
      name: X-Api-Signature
      description: Hex HMAC-SHA256 signature, optionally prefixed with `sha256=`.
  parameters:
    Page:
      name: page
      in: query
      schema:
        type: integer
        minimum: 1
        default: 1
    PerPage:
      name: per_page
      in: query
      schema:
        type: integer
        minimum: 1
        maximum: 100
        default: 25
    PaginationMode:
      name: pagination
      in: query
      schema:
        type: string
        enum: [page, cursor]
        default: page
      description: >-
        Use `cursor` for large datasets. Cursor pagination supports only
        `sort=id` or `sort=-id`; omitted sort defaults to `-id`. The first page
        uses `pagination=cursor`; continuation requests send the returned
        `cursor` and may omit both `pagination` and `sort`. If sort is repeated,
        its direction must match the cursor.
    Cursor:
      name: cursor
      in: query
      schema:
        type: [string, "null"]
      description: >-
        Opaque cursor returned in `meta.pagination.next_cursor`. Do not modify
        or combine it with the opposite `id` sort direction.
    SignatureVersion:
      name: X-Api-Signature-Version
      in: header
      required: true
      description: >-
        Required version of the request signature. Use v2 on the first line of
        the canonical string. The eighth line is the trimmed Idempotency-Key
        or an empty line when there is no key. Sign the originally parsed
        query values.
      schema:
        type: string
        const: v2
    ExchangeOrderIdentifier:
      name: order
      in: path
      required: true
      description: "Order ID, public number or tracking identifier."
      schema:
        type: string
    IdempotencyKey:
      name: Idempotency-Key
      in: header
      required: false
      schema:
        type: string
        minLength: 8
        maxLength: 191
        pattern: "^[A-Za-z0-9._:-]{8,191}$"
      description: The usual replay window defaults to 24 hours. Successful order creation, payment receipt uploads and partner payouts use durable receipts.
    CorrelationId:
      name: X-Correlation-Id
      in: header
      required: false
      schema:
        type: string
        maxLength: 128
      description: Client-defined id used to correlate API request and webhook events.
    WebhookId:
      name: webhook
      in: path
      required: true
      schema:
        type: string
        format: uuid
  responses:
    IdentityVerificationRequirements:
      description: "Current identity verification requirements."
      headers:
        Cache-Control:
          schema:
            type: string
            example: "private, no-store"
      content:
        application/json:
          schema:
            allOf:
              - $ref: "#/components/schemas/SuccessEnvelope"
              - type: object
                properties:
                  result:
                    type: object
                    required: [requirements]
                    properties:
                      requirements:
                        $ref: "#/components/schemas/IdentityVerificationRequirements"
    ExchangeOrderStatusSummary:
      description: "Current compact order state."
      headers:
        Cache-Control:
          schema:
            type: string
            example: "private, no-store"
      content:
        application/json:
          schema:
            allOf:
              - $ref: "#/components/schemas/SuccessEnvelope"
              - type: object
                properties:
                  result:
                    $ref: "#/components/schemas/ExchangeOrderStatusSummary"
    ExchangeOrderPaymentStatus:
      description: "Current payment state and recorded transitions."
      headers:
        Cache-Control:
          schema:
            type: string
            example: "private, no-store"
      content:
        application/json:
          schema:
            allOf:
              - $ref: "#/components/schemas/SuccessEnvelope"
              - type: object
                properties:
                  result:
                    $ref: "#/components/schemas/ExchangeOrderPaymentStatus"
    ExchangeOrderReceipts:
      description: "A page of receipt metadata."
      headers:
        Cache-Control:
          schema:
            type: string
            example: "private, no-store"
      content:
        application/json:
          schema:
            allOf:
              - $ref: "#/components/schemas/SuccessEnvelope"
              - type: object
                properties:
                  result:
                    $ref: "#/components/schemas/ExchangeOrderReceipts"
    ExchangeOrderReceipt:
      description: "Uploaded payment receipt metadata."
      headers:
        Cache-Control:
          schema:
            type: string
            example: "private, no-store"
      content:
        application/json:
          schema:
            allOf:
              - $ref: "#/components/schemas/SuccessEnvelope"
              - type: object
                properties:
                  result:
                    type: object
                    required: [receipt]
                    properties:
                      receipt:
                        $ref: "#/components/schemas/ExchangeOrderReceipt"
    OrderFieldUpload:
      description: "Uploaded order field file and token."
      headers:
        Cache-Control:
          schema:
            type: string
            example: "private, no-store"
      content:
        application/json:
          schema:
            allOf:
              - $ref: "#/components/schemas/SuccessEnvelope"
              - type: object
                properties:
                  result:
                    type: object
                    required: [file]
                    properties:
                      file:
                        $ref: "#/components/schemas/OrderFieldUpload"
    Unauthorized:
      description: "Valid API authentication is required. With a valid bearer token, a missing signature version returns signature_required and an unsupported version returns 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"
    PrivatePing:
      description: "API availability."
      content:
        application/json:
          examples:
            ready:
              $ref: "#/components/examples/QuickstartPing"
          schema:
            allOf:
              - $ref: "#/components/schemas/SuccessEnvelope"
              - type: object
                properties:
                  result:
                    type: object
                    required: [status, site_name, time]
                    properties:
                      status:
                        type: string
                      site_name:
                        type: string
                      time:
                        type: string
                        format: date-time
    OrderStatuses:
      description: "Order status dictionary."
      content:
        application/json:
          schema:
            allOf:
              - $ref: "#/components/schemas/SuccessEnvelope"
              - type: object
                properties:
                  result:
                    type: object
                    required: [statuses]
                    properties:
                      statuses:
                        type: array
                        items:
                          $ref: "#/components/schemas/OrderStatusDictionaryItem"
    WebhookEndpointResult:
      description: "Registered webhook endpoint."
      content:
        application/json:
          schema:
            allOf:
              - $ref: "#/components/schemas/SuccessEnvelope"
              - type: object
                properties:
                  result:
                    type: object
                    required: [endpoint]
                    properties:
                      endpoint:
                        $ref: "#/components/schemas/WebhookEndpoint"
    WebhookDeleteResult:
      description: "Deleted webhook endpoint."
      content:
        application/json:
          schema:
            allOf:
              - $ref: "#/components/schemas/SuccessEnvelope"
              - type: object
                properties:
                  result:
                    type: object
                    required: [id, deleted]
                    properties:
                      id:
                        type: string
                      deleted:
                        const: true
    OrderResult:
      description: "Current order after the operation."
      content:
        application/json:
          schema:
            allOf:
              - $ref: "#/components/schemas/SuccessEnvelope"
              - type: object
                properties:
                  result:
                    type: object
                    required: [order]
                    properties:
                      order:
                        $ref: "#/components/schemas/Order"
    OrderStatusResult:
      description: "Current order and status."
      content:
        application/json:
          schema:
            allOf:
              - $ref: "#/components/schemas/SuccessEnvelope"
              - type: object
                properties:
                  result:
                    type: object
                    required: [status, order]
                    properties:
                      status:
                        $ref: "#/components/schemas/OrderState"
                      order:
                        $ref: "#/components/schemas/Order"
    OrderVerificationSubmitResult:
      description: "Submitted verifications and current requirements."
      content:
        application/json:
          schema:
            allOf:
              - $ref: "#/components/schemas/SuccessEnvelope"
              - type: object
                properties:
                  result:
                    type: object
                    required: [submitted, requirements]
                    properties:
                      submitted:
                        type: [object, array]
                        properties:
                          identity:
                            $ref: "#/components/schemas/IdentityVerification"
                          card:
                            $ref: "#/components/schemas/CardVerification"
                      requirements:
                        $ref: "#/components/schemas/VerificationRequirements"
    UploadIntentResult:
      description: "Updated upload intent."
      content:
        application/json:
          schema:
            allOf:
              - $ref: "#/components/schemas/SuccessEnvelope"
              - type: object
                properties:
                  result:
                    type: object
                    required: [upload_intent]
                    properties:
                      upload_intent:
                        $ref: "#/components/schemas/UploadIntent"
    VerificationRequirementsResult:
      description: "Current verification requirements."
      content:
        application/json:
          schema:
            allOf:
              - $ref: "#/components/schemas/SuccessEnvelope"
              - type: object
                properties:
                  result:
                    type: object
                    required: [requirements]
                    properties:
                      requirements:
                        $ref: "#/components/schemas/VerificationRequirements"
    IdentityVerificationResult:
      description: "Identity verification owned by the client."
      content:
        application/json:
          schema:
            allOf:
              - $ref: "#/components/schemas/SuccessEnvelope"
              - type: object
                properties:
                  result:
                    type: object
                    required: [verification]
                    properties:
                      verification:
                        $ref: "#/components/schemas/IdentityVerification"
    VerificationActions:
      description: "Available verification actions."
      content:
        application/json:
          schema:
            allOf:
              - $ref: "#/components/schemas/SuccessEnvelope"
              - type: object
                properties:
                  result:
                    type: object
                    required: [actions]
                    properties:
                      actions: { $ref: "#/components/schemas/VerificationActionState" }
    SandboxSimulation:
      description: "Simulation data and associated webhook event ID."
      content:
        application/json:
          schema:
            allOf:
              - $ref: "#/components/schemas/SuccessEnvelope"
              - type: object
                properties:
                  result:
                    type: object
                    required: [simulation]
                    properties:
                      simulation:
                        type: object
                        required: [id, will_create_order, created_task_id, preflight, event_id]
                        properties:
                          id:
                            type: string
                            format: uuid
                          will_create_order:
                            const: false
                          created_task_id:
                            type: "null"
                          preflight:
                            $ref: "#/components/schemas/ExchangeOrderPreflight"
                          event_id:
                            type: string
                            format: uuid
    OrdersResult:
      description: "Client orders."
      content:
        application/json:
          schema:
            allOf:
              - $ref: "#/components/schemas/SuccessEnvelope"
              - type: object
                properties:
                  result:
                    type: array
                    items:
                      $ref: "#/components/schemas/Order"
    OwnedOrderResult:
      description: "Client order."
      content:
        application/json:
          schema:
            allOf:
              - $ref: "#/components/schemas/SuccessEnvelope"
              - type: object
                properties:
                  result:
                    $ref: "#/components/schemas/Order"
    PartnerResult:
      description: "Partner profile, balance and statistics."
      content:
        application/json:
          schema:
            allOf:
              - $ref: "#/components/schemas/SuccessEnvelope"
              - type: object
                properties:
                  result:
                    type: object
                    required: [partner, referral_link, program, balance, statistics]
                    properties:
                      partner: { $ref: "#/components/schemas/PartnerProfile" }
                      referral_link: { $ref: "#/components/schemas/PartnerReferralLink" }
                      program: { anyOf: [{ $ref: "#/components/schemas/PartnerProgram" }, { type: "null" }] }
                      balance: { $ref: "#/components/schemas/PartnerBalance" }
                      statistics:
                        $ref: "#/components/schemas/PartnerStatistics"
    PartnerStatisticsResult:
      description: "Partner balance and statistics."
      content:
        application/json:
          schema:
            allOf:
              - $ref: "#/components/schemas/SuccessEnvelope"
              - type: object
                properties:
                  result:
                    type: object
                    required: [balance, statistics]
                    properties:
                      balance: { $ref: "#/components/schemas/PartnerBalance" }
                      statistics:
                        $ref: "#/components/schemas/PartnerStatistics"
    PartnerReferralsResult:
      description: "Referred clients."
      content:
        application/json:
          schema:
            allOf:
              - $ref: "#/components/schemas/SuccessEnvelope"
              - type: object
                properties:
                  result:
                    type: array
                    items:
                      $ref: "#/components/schemas/PartnerReferral"
    PartnerExchangesResult:
      description: "Partner exchange accruals."
      content:
        application/json:
          schema:
            allOf:
              - $ref: "#/components/schemas/SuccessEnvelope"
              - type: object
                properties:
                  result:
                    type: array
                    items:
                      $ref: "#/components/schemas/PartnerExchange"
    PartnerPayoutMethods:
      description: "Available balance and payout methods."
      content:
        application/json:
          schema:
            allOf:
              - $ref: "#/components/schemas/SuccessEnvelope"
              - type: object
                properties:
                  result:
                    type: object
                    required: [balance, confirmation_required, methods]
                    properties:
                      balance:
                        type: object
                        required: [available, currency, minimum_payout, can_request, precision]
                        properties:
                          available:
                            type: string
                          currency:
                            type: string
                          minimum_payout:
                            type: string
                          can_request:
                            type: boolean
                          precision:
                            type: integer
                      confirmation_required:
                        type: boolean
                      methods:
                        type: array
                        items:
                          $ref: "#/components/schemas/PartnerPayoutMethod"
    PartnerPayouts:
      description: "Partner payout requests."
      content:
        application/json:
          schema:
            allOf:
              - $ref: "#/components/schemas/SuccessEnvelope"
              - type: object
                properties:
                  result:
                    type: array
                    items:
                      $ref: "#/components/schemas/PartnerPayout"
    PartnerPayoutDetail:
      description: "Partner payout request and confirmation status."
      content:
        application/json:
          schema:
            allOf:
              - $ref: "#/components/schemas/SuccessEnvelope"
              - type: object
                properties:
                  result:
                    type: object
                    required: [payout, confirmation_required]
                    properties:
                      payout:
                        $ref: "#/components/schemas/PartnerPayout"
                      confirmation_required:
                        type: boolean
    PaymentInstructions:
      description: "Current payment instructions."
      headers:
        Cache-Control:
          schema:
            type: string
            example: "private, no-store"
      content:
        application/json:
          schema:
            allOf:
              - $ref: "#/components/schemas/SuccessEnvelope"
              - type: object
                properties:
                  result:
                    type: object
                    required: [payment_instructions]
                    properties:
                      payment_instructions:
                        $ref: "#/components/schemas/ExchangePaymentInstructions"
    PaymentInstructionsPreparation:
      description: "Preparation state without payment details."
      headers:
        Cache-Control:
          schema:
            type: string
            example: "private, no-store"
      content:
        application/json:
          schema:
            allOf:
              - $ref: "#/components/schemas/SuccessEnvelope"
              - type: object
                properties:
                  result:
                    type: object
                    required: [payment_instructions]
                    properties:
                      payment_instructions:
                        $ref: "#/components/schemas/ExchangePaymentInstructionsPreparation"
    Success:
      description: Standard success envelope.
      content:
        application/json:
          schema:
            $ref: "#/components/schemas/SuccessEnvelope"
    Error:
      description: Standard error envelope.
      headers:
        Retry-After:
          schema:
            type: string
      content:
        application/json:
          schema:
            $ref: "#/components/schemas/ErrorEnvelope"
    RateLimited:
      description: >-
        For rate_limit_exceeded, wait for Retry-After before sending another request.
        For quota_exceeded, check error.details.resets_at for the current quota window.
      headers:
        Retry-After:
          description: Seconds remaining in the rate limit window, when supplied.
          schema:
            type: string
            example: "12"
      content:
        application/json:
          examples:
            rateLimited:
              $ref: "#/components/examples/QuickstartRateLimited"
            quotaExceeded:
              $ref: "#/components/examples/QuickstartQuotaExceeded"
          schema:
            $ref: "#/components/schemas/ErrorEnvelope"
    InvalidExchangeInput:
      description: >-
        The request could not be validated. Check error.details.issues for field errors, then submit corrected input.
      content:
        application/json:
          examples:
            invalidAmount:
              $ref: "#/components/examples/QuickstartInvalidAmount"
          schema:
            $ref: "#/components/schemas/ErrorEnvelope"
    InvalidWebhookTestInput:
      description: >-
        The test request could not be validated. An unrecognized sample event is reported on event_type.
      content:
        application/json:
          examples:
            unsupportedEvent:
              $ref: "#/components/examples/QuickstartUnsupportedWebhookEvent"
          schema:
            $ref: "#/components/schemas/ErrorEnvelope"
  examples:
    QuickstartPing:
      summary: 'Bearer token and HMAC v2 accepted'
      value:
        state: 0
        message: OK
        meta:
          request_id: ccdd84f4-2195-410f-96fe-6faff1e73a46
          correlation_id: ccdd84f4-2195-410f-96fe-6faff1e73a46
          timestamp: '2026-11-21T18:40:40.613566Z'
        result:
          status: ok
          site_name: iEXExchanger
          time: '2026-11-21T21:40:40+03:00'
    QuickstartSignatureRequired:
      summary: 'Valid Bearer token with missing HMAC headers'
      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
    QuickstartQuoteInput:
      summary: 'Calculate the amount to receive'
      value:
        route_id: 2
        amount: '10'
    QuickstartQuote:
      summary: 'Quote and fresh route snapshot'
      value:
        state: 0
        message: OK
        meta:
          request_id: b5bf257b-373f-4d1b-8842-b61331206933
          correlation_id: b5bf257b-373f-4d1b-8842-b61331206933
          timestamp: '2026-11-21T18:40:40.773602Z'
        result:
          quote:
            route:
              id: 2
              status: 1
              is_enabled: true
              name: rates-fixture-4b15f06d-43c4-43d4-b5fb-de0981f88c1a
              from:
                id: 3
                payment: 'Rates fixture give'
                code: RFTHDDNAALAOP60
                designation: null
                small_code: null
                network: null
                network_out: null
                decimal: 4
              to:
                id: 4
                payment: 'Rates fixture receive'
                code: RFTWN6MSUG0SAFV
                designation: null
                small_code: null
                network: null
                network_out: null
                decimal: 4
              limits:
                min_give: '0'
                max_give: '0'
                min_receive: '0'
                max_receive: '0'
              rate:
                type: fixed
                course: '0'
                is_type_rate: false
                default_type_rate: 0
                modes: []
              features:
                requires_payment_request: false
                is_hidden_order_pay: false
                allow_export: false
              sorting:
                from: 0
                to: 0
              timestamps:
                created_at: '2026-11-21T21:39:37+03:00'
                updated_at: '2026-11-21T21:39:37+03:00'
            amounts:
              give: '10'
              receive: '12.5'
            components: []
            rate:
              display: '1 RFTHDDNAALAOP60 = 1.25 RFTWN6MSUG0SAFV'
              value: '1.25'
              source: calculation
              selected: null
              modes: []
            base_rate:
              display: '1 RFTHDDNAALAOP60 = 1.25 RFTWN6MSUG0SAFV'
              value: '1.25'
              selected: null
              modes: []
              source: direction
              note: 'Base direction rate without the selected city, selector fees, checkbox fees or card verification surcharges. Personal client discounts are already included.'
            adjustments:
              city_id: null
              selected_fee_type: null
              selected_fees: []
              selector_fees: []
              checkbox_fees: []
              card_verification_required: false
            selector_fees:
              mode: single
              options: []
            promo:
              applied: false
              base_receive_amount: '12.5'
            task_payload:
              course_float: '1.25'
              course_display: '1 RFTHDDNAALAOP60 = 1.25 RFTWN6MSUG0SAFV'
              course_float_fixed: '1.25'
              course_display_fixed: '1 RFTHDDNAALAOP60 = 1.25 RFTWN6MSUG0SAFV'
              give_price: '10'
              receiving_price: '12.5'
              amounts_payload:
                version: v1
                components: []
                meta:
                  source: calculation_result
                  components_count: 0
                  commission_mode: apply_to_base
                  market_rate: '1.25'
                  rate_source: 'Manual rate'
          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'
    QuickstartInvalidAmount:
      summary: 'The amount is not a number'
      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.'
    QuickstartOrderInput:
      summary: 'Send the same input to preflight and creation'
      description: 'Replace the entire illustrative snapshot with the one returned by your quote.'
      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'
    QuickstartPreflight:
      summary: 'Local checks passed and creation is allowed'
      value:
        state: 0
        message: OK
        meta:
          request_id: 41819aaa-fdd6-477a-942d-d71d5a8281f4
          correlation_id: 41819aaa-fdd6-477a-942d-d71d5a8281f4
          timestamp: '2026-11-21T18:40:41.057286Z'
        result:
          preflight:
            allowed: true
            can_create_order: true
            missing_fields: []
            validation_errors: {}
            validation_issues: []
            checks:
              local: passed
              external: deferred
            quote:
              route:
                id: 2
                status: 1
                is_enabled: true
                name: rates-fixture-4b15f06d-43c4-43d4-b5fb-de0981f88c1a
                from:
                  id: 3
                  payment: 'Rates fixture give'
                  code: RFTHDDNAALAOP60
                  designation: null
                  small_code: null
                  network: null
                  network_out: null
                  decimal: 4
                to:
                  id: 4
                  payment: 'Rates fixture receive'
                  code: RFTWN6MSUG0SAFV
                  designation: null
                  small_code: null
                  network: null
                  network_out: null
                  decimal: 4
                limits:
                  min_give: '0'
                  max_give: '0'
                  min_receive: '0'
                  max_receive: '0'
                rate:
                  type: fixed
                  course: '0'
                  is_type_rate: false
                  default_type_rate: 0
                  modes: []
                features:
                  requires_payment_request: false
                  is_hidden_order_pay: false
                  allow_export: false
                sorting:
                  from: 0
                  to: 0
                timestamps:
                  created_at: '2026-11-21T21:39:37+03:00'
                  updated_at: '2026-11-21T21:39:37+03:00'
              amounts:
                give: '10'
                receive: '12.5'
              components: []
              rate:
                display: '1 RFTHDDNAALAOP60 = 1.25 RFTWN6MSUG0SAFV'
                value: '1.25'
                source: calculation
                selected: null
                modes: []
              base_rate:
                display: '1 RFTHDDNAALAOP60 = 1.25 RFTWN6MSUG0SAFV'
                value: '1.25'
                selected: null
                modes: []
                source: direction
                note: 'Base direction rate without the selected city, selector fees, checkbox fees or card verification surcharges. Personal client discounts are already included.'
              adjustments:
                city_id: null
                selected_fee_type: null
                selected_fees: []
                selector_fees: []
                checkbox_fees: []
                card_verification_required: false
              selector_fees:
                mode: single
                options: []
              promo:
                applied: false
                base_receive_amount: '12.5'
              task_payload:
                course_float: '1.25'
                course_display: '1 RFTHDDNAALAOP60 = 1.25 RFTWN6MSUG0SAFV'
                course_float_fixed: '1.25'
                course_display_fixed: '1 RFTHDDNAALAOP60 = 1.25 RFTWN6MSUG0SAFV'
                give_price: '10'
                receiving_price: '12.5'
                amounts_payload:
                  version: v1
                  components: []
                  meta:
                    source: calculation_result
                    components_count: 0
                    commission_mode: apply_to_base
                    market_rate: '1.25'
                    rate_source: 'Manual rate'
            operation_contract:
              version: operation-contract-v1
              route:
                id: 2
                status: 1
                is_enabled: true
                name: rates-fixture-4b15f06d-43c4-43d4-b5fb-de0981f88c1a
                from:
                  id: 3
                  payment: 'Rates fixture give'
                  code: RFTHDDNAALAOP60
                  designation: null
                  small_code: null
                  network: null
                  network_out: null
                  decimal: 4
                to:
                  id: 4
                  payment: 'Rates fixture receive'
                  code: RFTWN6MSUG0SAFV
                  designation: null
                  small_code: null
                  network: null
                  network_out: null
                  decimal: 4
                limits:
                  min_give: '0'
                  max_give: '0'
                  min_receive: '0'
                  max_receive: '0'
                rate:
                  type: fixed
                  course: '0'
                  is_type_rate: false
                  default_type_rate: 0
                  modes: []
                features:
                  requires_payment_request: false
                  is_hidden_order_pay: false
                  allow_export: false
                sorting:
                  from: 0
                  to: 0
                timestamps:
                  created_at: '2026-11-21T21:39:37+03:00'
                  updated_at: '2026-11-21T21:39:37+03:00'
              operation:
                id: 2
                type: direction_exchange
                attributes:
                  course:
                    rate: '1.25'
                    cities: []
                    exchange_amount: []
                    exchange_amount_basis: give
                    type_rate: []
                    selector_fees: []
                  min_in: '0'
                  max_in: '0'
                  min_out: '0'
                  max_out: '0'
                  limit_rules:
                    min_in:
                      value: '0'
                      source: base
                      is_limited: false
                    max_in:
                      value: '0'
                      source: base
                      is_limited: false
                    min_out:
                      value: '0'
                      source: base
                      is_limited: false
                    max_out:
                      value: '0'
                      source: base
                      is_limited: false
                  sorting_out: 0
                  buy_currency:
                    id: 3
                    type: payment_system
                    attributes:
                      name: 'Rates fixture give'
                      first_char: null
                      tech_name: ''
                      payment_system: 'Rates fixture give'
                      letter_cod: null
                      short_code: null
                      with_currency_code: 0
                      currency_iso_code: RFTHDDNAALAOP60
                      is_iso_code: 0
                      default_value: '1'
                      income_enabled: 0
                      outcome_enabled: 0
                      valid_type_in: null
                      valid_type_out: null
                      sorting_reserve: null
                      display_scan_qr_from: 0
                      display_scan_qr_to: 0
                      outcome_fee: 0
                      aml_text_in: null
                      aml_text_out: null
                      formalization_text: null
                      amount_decimal: 4
                      income_notice: null
                      outcome_notice: null
                      icon_url: null
                      icon_url_path: /storage/payment_systems/
                      color: ''
                      filter_ids: []
                      currency:
                        symbol: RFTHDDNAALAOP60
                        sorting: 0
                      order_form_fields:
                        field_type: string
                        label_in: null
                        label_out: null
                      mask_in: null
                      mask_out: null
                      mask_placeholder_in: null
                      mask_placeholder_out: null
                      field_comment_in: null
                      field_comment_out: null
                      button_create_order: null
                      button_create_order_text: null
                      recount_course_text: null
                      income_form_fields: []
                      outcome_form_fields: []
                      extra_out:
                        enabled: false
                  sell_currency:
                    id: 4
                    type: payment_system
                    attributes:
                      name: 'Rates fixture receive'
                      first_char: null
                      tech_name: ''
                      payment_system: 'Rates fixture receive'
                      letter_cod: null
                      short_code: null
                      with_currency_code: 0
                      currency_iso_code: RFTWN6MSUG0SAFV
                      is_iso_code: 0
                      default_value: '1'
                      income_enabled: 0
                      outcome_enabled: 0
                      valid_type_in: null
                      valid_type_out: null
                      sorting_reserve: null
                      display_scan_qr_from: 0
                      display_scan_qr_to: 0
                      outcome_fee: 0
                      aml_text_in: null
                      aml_text_out: null
                      formalization_text: null
                      amount_decimal: 4
                      income_notice: null
                      outcome_notice: null
                      icon_url: null
                      icon_url_path: /storage/payment_systems/
                      color: ''
                      filter_ids: []
                      currency:
                        symbol: RFTWN6MSUG0SAFV
                        sorting: 0
                      order_form_fields:
                        field_type: string
                        label_in: null
                        label_out: null
                      mask_in: null
                      mask_out: null
                      mask_placeholder_in: null
                      mask_placeholder_out: null
                      field_comment_in: null
                      field_comment_out: null
                      button_create_order: null
                      button_create_order_text: null
                      recount_course_text: null
                      income_form_fields: []
                      outcome_form_fields: []
                      extra_out:
                        enabled: false
                  direction_fields: []
                  user_fields: []
                  reserve_value: '100000'
                  is_user_discount: false
                  extra_commissions: []
                  is_notify_exchange_amount: 0
                  amount_range:
                    basis: give
                    ranges: []
                  prices: []
                  cities: []
                  city_detail: []
                  default_city_id: null
                  seo:
                    title: ''
                    description: ''
                    keywords: ''
                  checkbox_agreements: []
                  customer_notifications: []
                  identity_verification:
                    mode: disabled
                    description: null
                  card_verification:
                    mode: 0
                    description: null
              snapshot:
                version: route-snapshot-v1
                route_id: 2
                hash: 626062a83e6f6a4b902a8cc5a216b7749c2e4df2f1ef42ebf71383dd4697c340
                generated_at: '2026-11-21T18:40:41.046909Z'
                expires_at: '2026-11-21T18:50:41.046909Z'
                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'
              contract:
                preflight_endpoint: /api/v3/private/exchange/orders/preflight
                quote_endpoint: /api/v3/private/exchange/quotes
                order_endpoint: /api/v3/private/exchange/orders
                status_endpoint: '/api/v3/private/exchange/orders/{order}/status'
                actions_endpoint: '/api/v3/private/exchange/orders/{order}/actions'
                payment_instructions_endpoint: '/api/v3/private/exchange/orders/{order}/payment-instructions'
                amount_side: give
                currency_fields:
                  - route_id
                  - income_payment_system
                  - outcome_payment_system
                  - from_currency_id
                  - to_currency_id
                amount_fields:
                  - income_amount
                  - amount
                requisite_fields:
                  give:
                    - income_account
                    - from_requisite
                  receive:
                    - outcome_account
                    - to_requisite
                handover:
                  field: handover
                  city_field: city_id
                  methods:
                    - office
                    - courier
                    - agreement
                dynamic_fields:
                  direction_fields: []
                  fields_in: []
                  fields_out: []
                  user_fields: []
                  checkbox_agreements: []
                rate:
                  selector: null
                  city_prices: []
                  selector_fees_title: null
                  selector_fees_text: null
                  selector_fees:
                    mode: single
                    options: []
                verification:
                  identity:
                    mode: disabled
                    description: null
                  card:
                    mode: 0
                    description: null
                  card_settings: null
                  requirements_endpoint: /api/v3/private/verifications/requirements
                files:
                  create_upload_intent_endpoint: /api/v3/private/files/upload-intents
                  commit_upload_intent_endpoint: '/api/v3/private/files/upload-intents/{intent}/commit'
                  order_field_upload_endpoint: '/api/v3/private/exchange/routes/{route}/fields/{group}/{field}/files'
                  receipts_endpoint: '/api/v3/private/exchange/orders/{order}/receipts'
                  receipts_allowed: false
            requirements:
              route_id: 2
              identity:
                required: false
                mode: disabled
                description: null
                current:
                  key: not_submitted
                  label: 'Not submitted'
                  is_final_approved: false
                flow: /api/v3/private/verifications/identity
                create_endpoint: /api/v3/private/verifications/identity
              card:
                required: false
                mode: 0
                description: null
                settings: null
                additional_photos:
                  enabled: false
                  max_count: 3
                  max_file_size_mb: 10
                  accepted_mime_types:
                    - image/jpeg
                    - image/png
                current:
                  key: not_submitted
                  label: 'Not submitted'
                  is_final_approved: false
                create_endpoint: /api/v3/private/verifications/cards
              files:
                upload_intent_endpoint: /api/v3/private/files/upload-intents
            snapshot:
              version: route-snapshot-v1
              route_id: 2
              hash: 626062a83e6f6a4b902a8cc5a216b7749c2e4df2f1ef42ebf71383dd4697c340
              generated_at: '2026-11-21T18:40:41.046909Z'
              expires_at: '2026-11-21T18:50:41.046909Z'
              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: 'Order created and awaiting payment'
      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: 'The same order returned with 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: 'An identical request is in progress'
      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: 'This key already belongs to a different request'
      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
    QuickstartRateLimited:
      summary: 'Short-lived rate limit reached'
      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: 'The daily quota is exhausted'
      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'
    QuickstartWebhookTestInput:
      summary: 'Request a test notification for a selected subscription'
      value:
        endpoint_id: 02f69097-6934-483e-b3c9-72767fdc4a6c
        event_type: order.payment_received
    QuickstartWebhookTest:
      summary: 'Test event and delivery queued'
      value:
        state: 0
        message: OK
        meta:
          request_id: bd34ec7e-8007-41a0-86d2-de8a30e63d85
          correlation_id: bd34ec7e-8007-41a0-86d2-de8a30e63d85
          timestamp: '2026-11-21T18:40:41.539921Z'
        result:
          event:
            id: 96da6cfd-7d0b-4c7d-a86c-845d24544baf
            type: api.test
            status: queued
            request_id: bd34ec7e-8007-41a0-86d2-de8a30e63d85
            correlation_id: bd34ec7e-8007-41a0-86d2-de8a30e63d85
          deliveries:
            -
              id: 9d338990-e7ef-4945-b2cb-0e50777b3561
              status: queued
              endpoint_id: 02f69097-6934-483e-b3c9-72767fdc4a6c
              payload_version: v2
              signature_version: v2
              retry_blocked_reason: null
    QuickstartUnsupportedWebhookEvent:
      summary: 'The sample event type is unknown'
      value:
        state: 1
        message: 'The given data was invalid.'
        code: 422
        meta:
          request_id: quickstart-webhook-validation
          correlation_id: quickstart-webhook-validation
          timestamp: '2026-11-21T18:40:00.000000Z'
        error:
          code: validation_failed
          type: validation_failed
          details:
            event_type:
              - 'The selected event type is invalid.'
            fields:
              event_type:
                - 'The selected event type is invalid.'
            issues:
              -
                field: event_type
                code: validation_failed
                message: 'The selected event type is invalid.'
    QuickstartStatusChangedNotification:
      summary: 'Order status changed'
      value:
        id: 356b5b2e-ba7b-45c6-9be2-b00e21253723
        type: order.status_changed
        created_at: '2026-11-21T18:45:00.000000Z'
        request_id: quickstart-order-payment
        correlation_id: quickstart-order-payment
        payload_version: v2
        data:
          resource:
            type: order
            id: 01a1ff69-1d03-7c35-aa9e-784a66d64f88
          from_status: 2
          to_status: 3
    QuickstartTestNotification:
      summary: 'Outbound delivery of the queued test event'
      value:
        created_at: '2026-11-21T18:40:41.539921Z'
        request_id: bd34ec7e-8007-41a0-86d2-de8a30e63d85
        correlation_id: bd34ec7e-8007-41a0-86d2-de8a30e63d85
        type: api.test
        test: true
        sample_of: order.payment_received
        payload_version: v2
        data:
          resource:
            type: api_test
            id: 02f69097-6934-483e-b3c9-72767fdc4a6c
        id: 96da6cfd-7d0b-4c7d-a86c-845d24544baf
  schemas:
    ExchangeDynamicFields:
      type: object
      properties:
        direction_fields:
          type: array
          items: { $ref: "#/components/schemas/ExchangeDynamicField" }
        fields_in:
          type: array
          items: { $ref: "#/components/schemas/ExchangeDynamicField" }
        fields_out:
          type: array
          items: { $ref: "#/components/schemas/ExchangeDynamicField" }
        user_fields:
          type: array
          items: { $ref: "#/components/schemas/ExchangeDynamicField" }
        checkbox_agreements:
          type: array
          items: { type: object }
    ExchangeDynamicField:
      type: object
      required: [key, type, required]
      properties:
        key: { type: string }
        type: { type: string }
        required: { type: boolean }
        show_label: { type: boolean }
        label: { type: string }
        placeholder: { type: string }
        description: { type: string }
        example:
          type: string
          description: Localized example of a field value.
        content_type:
          type: string
          description: Input content format for displaying the field.
        validation:
          type: object
          description: Client validation hints. The server applies the configured rules when creating an order.
          properties:
            min_length: { type: integer, minimum: 1 }
            max_length: { type: integer, minimum: 1 }
            error_message: { type: string }
            remove_spaces: { type: boolean }
            has_validator_combination: { type: boolean }
            show_card_brand: { type: boolean }
            qr_wallet_schemes:
              type: array
              items: { type: string }
        display_scan_qr:
          type: boolean
          description: Enables the QR scanner on a currency input, select, or radio field in clients that support scanning.
        mask:
          type: string
          description: Input mask for a text currency field.
        mask_placeholder:
          type: string
          minLength: 1
          maxLength: 1
          description: Placeholder character for slots in the currency input mask.
        wallet_validator_type:
          type: string
          description: Server-side wallet validation type for a text currency field.
        options:
          type: array
          items: { type: object }
        file:
          type: object
          properties:
            allowed_types: { type: array, items: { type: string } }
            allowed_extensions: { type: array, items: { type: string } }
            accept: { type: string }
            max_file_size_mb: { type: [integer, "null"] }
            max_files: { type: [integer, "null"] }
        upload:
          type: object
          properties:
            endpoint: { type: string }
            direction_id: { type: integer }
            field_id: { type: integer }
            scope: { type: string, enum: [currency, direction, user] }
            group: { type: string, enum: [in, out, direction, user] }
    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 }
    IdentityVerificationRequirements:
      type: object
      required: [mode, current, form, handoff_url]
      properties:
        mode: { enum: [manual, provider, unavailable] }
        current:
          $ref: "#/components/schemas/VerificationStatus"
        form:
          anyOf:
            - $ref: "#/components/schemas/IdentityVerificationForm"
            - type: "null"
        handoff_url: { type: [string, "null"] }
    IdentityVerificationForm:
      type: object
      required: [id, name, description, purpose, version, fields, upload]
      properties:
        id: { type: [integer, "null"] }
        name: { type: string }
        description: { type: [string, "null"] }
        purpose: { type: string }
        version: { type: integer }
        fields:
          type: array
          items:
            $ref: "#/components/schemas/IdentityVerificationField"
        upload:
          type: object
          required: [purpose, endpoint, extensions, max_bytes]
          properties:
            purpose: { const: identity_verification }
            endpoint: { type: string }
            extensions: { type: array, items: { type: string } }
            max_bytes: { type: integer }
    IdentityVerificationField:
      type: object
      required: [key, type, label, placeholder, help_text, required, sort, options, validation]
      properties:
        key: { type: string }
        type: { enum: [input, description, textarea, email, phone, date, select, file, image, multi_file] }
        label: { type: string }
        placeholder: { type: [string, "null"] }
        help_text: { type: [string, "null"] }
        required: { type: boolean }
        sort: { type: integer }
        options:
          type: array
          items:
            type: object
            required: [label, value]
            properties:
              label: { type: string }
              value: { type: string }
        validation:
          type: [object, array]
          properties:
            min: { type: [integer, "null"] }
            max: { type: integer }
            regex: { type: [string, "null"] }
            mimes: { type: array, items: { type: string } }
            max_mb: { type: integer }
            max_files: { type: integer }
    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: Headers expected by signature verification. For v2 signing errors this includes 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 }
    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] }
    PreflightChecks:
      type: object
      required: [local, external]
      properties:
        local: { enum: [passed, failed, not_run] }
        external: { const: deferred }
    RouteCapabilityAction:
      type: object
      required: [available, method, endpoint, scope]
      properties:
        available: { type: boolean }
        authorized: { type: [boolean, "null"] }
        method: { type: string }
        endpoint: { type: string }
        scope: { type: string }
        required_scopes_any:
          type: array
          items: { type: string }
    RouteCapabilityField:
      type: object
      required: [key, required, type, source]
      properties:
        key: { type: string }
        required: { type: boolean }
        type: { type: string }
        source: { type: string }
        aliases:
          type: array
          items: { type: string }
        alternatives:
          type: array
          items: { type: string }
        allowed:
          type: array
          items: { type: [string, integer] }
        schema: { type: [object, array] }
    ExchangeOrderIdentity:
      type: object
      required: [public_id, tracking_id]
      properties:
        public_id: { type: string }
        tracking_id: { type: [string, "null"] }
    ExchangeOrderStatusSummary:
      type: object
      required: [order, status, updated_at]
      properties:
        order:
          $ref: "#/components/schemas/ExchangeOrderIdentity"
        status:
          $ref: "#/components/schemas/OrderState"
        updated_at: { type: [string, "null"], format: date-time }
    ExchangeOrderPaymentStatus:
      type: object
      required: [order, payment]
      properties:
        order:
          $ref: "#/components/schemas/ExchangeOrderIdentity"
        payment:
          type: object
          required: [checking, provider_confirmed, provider_confirmed_at, current_status, timeline, timeline_truncated]
          properties:
            checking: { type: boolean }
            provider_confirmed: { type: boolean }
            provider_confirmed_at: { type: [string, "null"], format: date-time }
            current_status:
              type: [object, "null"]
              required: [key, value, updated_at]
              properties:
                key: { type: string }
                value: { type: integer }
                updated_at: { type: [string, "null"], format: date-time }
            timeline:
              type: array
              items:
                $ref: "#/components/schemas/OrderPaymentTimelineItem"
            timeline_truncated: { type: boolean }
    OrderPaymentTimelineItem:
      type: object
      required: [key, status_value, state, occurred_at]
      properties:
        key: { type: string }
        status_value: { type: [integer, "null"] }
        state: { enum: [todo, active, done, warning, error] }
        occurred_at: { type: [string, "null"], format: date-time }
    ExchangeOrderReceipt:
      type: object
      required: [id, mime_type, size_bytes, created_at]
      properties:
        id: { type: integer }
        mime_type: { type: [string, "null"] }
        size_bytes: { type: [integer, "null"] }
        created_at: { type: [string, "null"], format: date-time }
    ExchangeOrderReceipts:
      type: object
      required: [receipts, next_after_id]
      properties:
        receipts:
          type: array
          items:
            $ref: "#/components/schemas/ExchangeOrderReceipt"
        next_after_id: { type: [integer, "null"] }
    OrderFieldUpload:
      type: object
      required: [token, public_id, name, extension, mime_type, size_bytes, expires_at]
      properties:
        token: { type: string }
        public_id: { type: string }
        name: { type: string }
        extension: { type: string }
        mime_type: { type: string }
        size_bytes: { type: integer }
        expires_at: { type: string, format: date-time }
    WebhookPayloadVersion:
      type: string
      const: v2
    WebhookNotificationV2:
      type: object
      required: [id, type, created_at, request_id, correlation_id, payload_version, data]
      properties:
        id: { type: string, format: uuid }
        type: { type: string }
        created_at: { type: string, format: date-time }
        request_id: { type: string }
        correlation_id: { type: string }
        payload_version: { const: v2 }
        data:
          type: object
          required: [resource]
          additionalProperties: false
          properties:
            resource:
              type: object
              required: [type, id]
              additionalProperties: false
              properties:
                type: { type: [string, "null"] }
                id: { type: [string, "null"] }
            from_status: { type: integer }
            to_status: { type: integer }
        test: { const: true }
        sample_of: { type: string }
    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
    PartnerProfile:
      type: object
      required: [id, name, email, method, personal_percent, max_percent]
      properties:
        id: { type: integer }
        name: { type: string }
        email: { type: string }
        method: { type: integer }
        personal_percent: { type: number }
        max_percent: { type: number }
    PartnerReferralLink:
      type: object
      required: [id, code, url, created_at]
      properties:
        id: { type: [integer, "null"] }
        code: { type: [string, "null"] }
        url: { type: [string, "null"] }
        created_at: { type: [string, "null"], format: date-time }
    PartnerProgram:
      type: object
      required: [id, name, title, description, percent, minimum_accrual]
      properties:
        id: { type: integer }
        name: { type: [string, "null"] }
        title: { type: [string, "null"] }
        description: { type: [string, "null"] }
        percent: { type: number }
        minimum_accrual: { type: string }
    PartnerBalance:
      type: object
      required: [available, hold, currency]
      properties:
        available: { type: string }
        hold: { type: string }
        currency: { type: string }
    PartnerReferral:
      type: object
      required: [id, client, orders, created_at]
      properties:
        id: { type: integer }
        client: { anyOf: [{ $ref: "#/components/schemas/PartnerReferralClient" }, { type: "null" }] }
        orders:
          type: object
          required: [total, completed, last_completed_at]
          properties:
            total: { type: integer }
            completed: { type: integer }
            last_completed_at: { type: [string, "null"], format: date-time }
        created_at: { type: [string, "null"], format: date-time }
    PartnerExchange:
      type: object
      required: [id, status, is_reversal, reversal_of_id, bonus, order, client, available_at, confirmed_at, reversed_at, created_at]
      properties:
        id: { type: integer }
        status: { type: string }
        is_reversal: { type: boolean }
        reversal_of_id: { type: [integer, "null"] }
        bonus:
          type: object
          required: [amount, currency, percent]
          properties:
            amount: { type: string }
            currency: { type: [string, "null"] }
            percent: { type: string }
        order: { anyOf: [{ $ref: "#/components/schemas/PartnerExchangeOrder" }, { type: "null" }] }
        client: { anyOf: [{ $ref: "#/components/schemas/PartnerExchangeClient" }, { type: "null" }] }
        available_at: { type: [string, "null"], format: date-time }
        confirmed_at: { type: [string, "null"], format: date-time }
        reversed_at: { type: [string, "null"], format: date-time }
        created_at: { type: [string, "null"], format: date-time }
    PartnerExchangeOrder:
      type: object
      required: [id, public_id, status_id, amount_in, amount_out, rate]
      properties:
        id: { type: integer }
        public_id: { type: string }
        status_id: { type: integer }
        amount_in: { type: string }
        amount_out: { type: string }
        rate: { type: [string, "null"] }
    PartnerReferralClient:
      type: object
      required: [id, name, email, created_at]
      properties:
        id: { type: integer }
        name: { type: string }
        email: { type: string }
        created_at: { type: [string, "null"], format: date-time }
    PartnerExchangeClient:
      type: object
      required: [id, name, email]
      properties:
        id: { type: integer }
        name: { type: string }
        email: { type: string }
    PartnerPayoutStatistics:
      type: object
      required: [total, paid, pending, rejected, paid_amount, pending_amount, paid_currency, pending_currency, by_currency]
      properties:
        total: { type: integer }
        paid: { type: integer }
        pending: { type: integer }
        rejected: { type: integer }
        paid_amount: { type: string }
        pending_amount: { type: string }
        paid_currency: { type: [string, "null"] }
        pending_currency: { type: [string, "null"] }
        by_currency: { type: array, items: { $ref: "#/components/schemas/PartnerPayoutCurrencySummary" } }
    PartnerBonusCurrencySummary:
      type: object
      required: [currency, bonus_sum, confirmed_accruals]
      properties:
        currency: { type: [string, "null"] }
        bonus_sum: { type: string }
        confirmed_accruals: { type: integer }
    PartnerLedgerStatistics:
      type: object
      required: [referral_total_earned, referral_total_withdrawn, total_earned, total_withdrawn]
      properties:
        referral_total_earned: { type: string }
        referral_total_withdrawn: { type: string }
        total_earned: { type: string }
        total_withdrawn: { type: string }
    VerificationActionState:
      type: object
      required: [status, allowed_actions]
      properties:
        status: { $ref: "#/components/schemas/VerificationStatus" }
        allowed_actions:
          type: object
          required: [wait_review, resubmit_after_reject]
          properties:
            wait_review:
              type: object
              required: [allowed]
              properties:
                allowed: { type: boolean }
            resubmit_after_reject:
              type: object
              required: [allowed]
              properties:
                allowed: { type: boolean }
    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 }
    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"] } }
    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
    OrderStatusDictionaryItem:
      type: object
      required: [id, key, name, is_final, is_payment_flow, is_problem, color, class, allows_operator_actions, sorting]
      properties:
        id:
          type: integer
        key:
          type: string
        name:
          type: string
        is_final:
          type: boolean
        is_payment_flow:
          type: boolean
        is_problem:
          type: boolean
        color:
          type: [string, "null"]
        class:
          type: [string, "null"]
        allows_operator_actions:
          type: boolean
        sorting:
          type: integer
    IdentityVerification:
      type: object
      required: [id, uuid, purpose, status, review, created_at, updated_at]
      properties:
        id: { type: integer }
        uuid:
          type: [string, "null"]
          description: "Opaque public identifier of the verification."
        source: { const: manual_kyc }
        purpose: { type: string }
        full_name: { type: [string, "null"] }
        files:
          type: array
          items: { type: string }
        status:
          $ref: "#/components/schemas/VerificationStatus"
        review:
          type: object
          required: [reason, comment, reviewed_at]
          properties:
            reason: { type: [string, "null"] }
            comment: { type: [string, "null"] }
            reviewed_at: { type: [string, "null"], format: date-time }
        created_at: { type: [string, "null"], format: date-time }
        updated_at: { type: [string, "null"], format: date-time }
    PartnerPayoutMethod:
      type: object
      required: [currency_id, payment, code, designation, precision, wallet, fees]
      properties:
        currency_id:
          type: integer
        payment:
          type: string
        code:
          type: string
        designation:
          type: string
        precision:
          type: integer
        wallet:
          type: object
          required: [mask, min_length, max_length]
          properties:
            mask:
              type: string
            min_length:
              type: integer
            max_length:
              type: integer
        fees:
          type: object
          required: [percent, fixed]
          properties:
            percent:
              type: string
            fixed:
              type: string
    PartnerPayoutCurrencySummary:
      type: object
      required: [currency, paid_amount, pending_amount]
      properties:
        currency:
          type: [string, "null"]
        paid_amount:
          type: string
        pending_amount:
          type: string
    PartnerStatistics:
      type: object
      required: [referrals, exchanges, payouts, ledger]
      properties:
        referrals:
          type: object
          required: [total, with_bonus_orders, active_last_30_days]
          properties:
            total: { type: integer }
            with_bonus_orders: { type: integer }
            active_last_30_days: { type: integer }
        exchanges:
          type: object
          required: [bonus_orders, bonus_orders_in_currency, currency, total_bonus, avg_bonus, by_currency, first_bonus_at, last_bonus_at]
          properties:
            bonus_orders: { type: integer }
            bonus_orders_in_currency: { type: integer }
            currency: { type: [string, "null"] }
            total_bonus: { type: string }
            avg_bonus: { type: string }
            by_currency: { type: array, items: { $ref: "#/components/schemas/PartnerBonusCurrencySummary" } }
            first_bonus_at: { type: [string, "null"] }
            last_bonus_at: { type: [string, "null"] }
        payouts: { $ref: "#/components/schemas/PartnerPayoutStatistics" }
        ledger: { $ref: "#/components/schemas/PartnerLedgerStatistics" }
    SuccessEnvelope:
      type: object
      required: [state, message, result, meta]
      properties:
        state:
          type: integer
          enum: [0]
        message:
          type: string
        result: {}
        meta:
          $ref: "#/components/schemas/Meta"
    ErrorEnvelope:
      type: object
      required: [state, message, code, error, meta]
      properties:
        state:
          type: integer
          enum: [1]
        message:
          type: string
        code:
          type: integer
          description: HTTP status code.
        error:
          type: object
          required: [code, type, details]
          properties:
            code:
              $ref: "#/components/schemas/ApiErrorCode"
              description: Stable machine-readable API error code.
            type:
              $ref: "#/components/schemas/ApiErrorCode"
              deprecated: true
              description: Backward-compatible alias of `error.code`.
            details:
              $ref: "#/components/schemas/ApiErrorDetails"
        meta:
          $ref: "#/components/schemas/Meta"
    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"
    Pagination:
      oneOf:
        - $ref: "#/components/schemas/PagePagination"
        - $ref: "#/components/schemas/CursorPagination"
      discriminator:
        propertyName: mode
        mapping:
          page: "#/components/schemas/PagePagination"
          cursor: "#/components/schemas/CursorPagination"
    Client:
      type: object
      properties:
        id:
          type: integer
        name:
          type: string
        email:
          type: string
        balance:
          type: [object, "null"]
          description: Available only when the token also has public-api:client:balance:read; otherwise null.
        orders:
          type: object
        api_token:
          anyOf:
            - $ref: "#/components/schemas/ApiTokenSummary"
            - type: "null"
    PartnerPayoutCreateRequest:
      type: object
      required: [currency_id, wallet]
      properties:
        currency_id:
          type: integer
          minimum: 1
          description: ID returned by GET /private/partner/payout-methods.
        wallet:
          type: string
          minLength: 2
          maxLength: 191
        amount:
          type: [string, "null"]
          pattern: "^[0-9]{1,30}(\\.[0-9]{1,18})?$"
          description: "Fits the base balance precision from partner payout methods. Omit or use null to request all available funds."
    PartnerPayoutPreview:
      type: object
      required: [amount, currency, fees, precision, confirmation_required, calculated_at]
      properties:
        amount:
          type: object
          required: [requested, base, base_currency]
          properties:
            requested:
              type: string
            base:
              type: string
            base_currency:
              type: string
        currency:
          type: object
          required: [id, code, payment, designation]
          properties:
            id:
              type: integer
            code:
              type: string
            payment:
              type: [string, "null"]
            designation:
              type: [string, "null"]
        fees:
          type: object
          required: [percent, fixed]
          properties:
            percent:
              type: string
            fixed:
              type: string
        precision:
          type: integer
        confirmation_required:
          type: boolean
        calculated_at:
          type: string
          format: date-time
    PartnerPayoutCreateResponse:
      allOf:
        - $ref: "#/components/schemas/SuccessEnvelope"
        - type: object
          properties:
            result:
              type: object
              required: [payout, confirmation_required, replayed]
              properties:
                payout:
                  $ref: "#/components/schemas/PartnerPayout"
                confirmation_required:
                  type: boolean
                replayed:
                  type: boolean
    PartnerPayout:
      type: object
      required: [id, status, amount, currency, wallet, created_at]
      properties:
        id:
          type: integer
        status:
          type: string
          enum: [pending, paid, rejected]
        amount:
          type: object
          properties:
            requested:
              type: string
              description: Payout currency amount after conversion and fees.
            base:
              type: string
              description: Exact amount debited from partner base balance.
            base_currency:
              type: string
        currency:
          type: [object, "null"]
          properties:
            id:
              type: integer
            payment:
              type: [string, "null"]
            code:
              type: [string, "null"]
            designation:
              type: [string, "null"]
        wallet:
          type: [string, "null"]
        reason:
          type: [string, "null"]
        created_at:
          type: [string, "null"]
          format: date-time
        verified_at:
          type: [string, "null"]
          format: date-time
        updated_at:
          type: [string, "null"]
          format: date-time
        rejected_at:
          type: [string, "null"]
          format: date-time
    ApiScope:
      type: object
      required: [scope, group, title, description, risk, grantable, endpoints]
      properties:
        scope:
          type: string
          example: public-api:client:read
        group:
          type: string
          example: client
        title:
          type: string
          example: Client profile
        description:
          type: string
        risk:
          type: string
          enum: [low, standard, medium, high]
        grantable:
          type: boolean
        endpoints:
          type: array
          items:
            type: string
    ApiTokenSummary:
      type: [object, "null"]
      properties:
        id:
          type: integer
        name:
          type: string
        scopes:
          type: array
          items:
            type: string
        scope_details:
          type: array
          items:
            $ref: "#/components/schemas/ApiScope"
        security:
          type: object
          properties:
            hmac_required:
              type: boolean
            hmac_verified:
              type: boolean
            signature_algorithm:
              type: string
              const: hmac-sha256-v2
        last_used_at:
          type: [string, "null"]
          format: date-time
        expires_at:
          type: [string, "null"]
          format: date-time
    UsagePeriod:
      type: object
      required: [limit, used, remaining, resets_at]
      properties:
        limit:
          type: [integer, "null"]
        used:
          type: integer
        remaining:
          type: [integer, "null"]
        resets_at:
          type: string
          format: date-time
    UsageSummary:
      type: object
      properties:
        api_token:
          type: [object, "null"]
          properties:
            id:
              type: integer
            name:
              type: string
            status:
              type: string
            plan:
              type: string
            billable:
              type: boolean
        quota:
          type: [object, "null"]
          properties:
            day:
              $ref: "#/components/schemas/UsagePeriod"
            month:
              $ref: "#/components/schemas/UsagePeriod"
        billing:
          type: [object, "null"]
          properties:
            currency:
              type: string
            unit_price:
              type: string
            billable_units:
              type: integer
            estimated_amount:
              type: string
        usage:
          type: object
          additionalProperties:
            type: object
            properties:
              requests:
                type: integer
              errors:
                type: integer
              billable_units:
                type: integer
              total_duration_ms:
                type: integer
    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
    PaymentSystem:
      type: object
      properties:
        id:
          type: integer
        type:
          type: string
          enum: [payment_system]
        name:
          type: string
        payment:
          type: object
          properties:
            id:
              type: integer
            name:
              type: string
            logo:
              type: [string, "null"]
            logo_url:
              type: [string, "null"]
        currency:
          type: object
          properties:
            id:
              type: integer
            code:
              type: string
            sign:
              type: [string, "null"]
        codes:
          type: object
          properties:
            letter:
              type: [string, "null"]
            short:
              type: [string, "null"]
            network_in:
              type: [string, "null"]
            network_out:
              type: [string, "null"]
        precision:
          type: object
          properties:
            amount_decimal:
              type: integer
        capabilities:
          type: object
          properties:
            can_give:
              type: boolean
            can_receive:
              type: boolean
            income_enabled:
              type: integer
            outcome_enabled:
              type: integer
        routes:
          type: object
          properties:
            give_to:
              type: array
              items:
                type: object
                properties:
                  route_id:
                    type: integer
                  currency_id:
                    type: integer
            receive_from:
              type: array
              items:
                type: object
                properties:
                  route_id:
                    type: integer
                  currency_id:
                    type: integer
        form:
          type: object
          additionalProperties: true
        notices:
          type: object
          additionalProperties: true
        network:
          type: [object, "null"]
          additionalProperties: true
        filters:
          type: object
          properties:
            ids:
              type: array
              items:
                type: integer
        sorting:
          type: object
          additionalProperties:
            type: integer
    ExchangeRoute:
      type: object
      properties:
        id:
          type: integer
        status:
          type: integer
        is_enabled:
          type: boolean
        name:
          type: [string, "null"]
        from:
          $ref: "#/components/schemas/CurrencySummary"
        to:
          $ref: "#/components/schemas/CurrencySummary"
        limits:
          type: object
          properties:
            min_give:
              type: [string, "null"]
            max_give:
              type: [string, "null"]
            min_receive:
              type: [string, "null"]
            max_receive:
              type: [string, "null"]
        rate:
          type: object
          properties:
            type:
              type: string
              enum: [fixed, selectable]
            course:
              type: [string, "null"]
            is_type_rate:
              type: boolean
            default_type_rate:
              type: integer
              enum: [0, 1]
            modes:
              $ref: "#/components/schemas/ExchangeRateModes"
        features:
          type: object
          additionalProperties: true
        sorting:
          type: object
          additionalProperties:
            type: integer
        timestamps:
          type: object
          additionalProperties: true
    ExchangeRateModes:
      description: "Available rate modes keyed by name. When no modes are available, the wire value is an empty array."
      anyOf:
        - type: object
          additionalProperties:
            type: object
        - type: array
          maxItems: 0
          items: {}
    ExchangeRouteDetail:
      type: object
      properties:
        route:
          $ref: "#/components/schemas/ExchangeRoute"
        operation:
          type: object
          description: Client operation payload compatible with backend-api client operation details.
          additionalProperties: true
          properties:
            attributes:
              type: object
              additionalProperties: true
              properties:
                city_detail:
                  $ref: "#/components/schemas/ExchangeCityDetails"
        snapshot:
          $ref: "#/components/schemas/RouteSnapshot"
        operation_contract:
          $ref: "#/components/schemas/OperationContract"
        contract:
          type: object
          properties:
            quote_endpoint:
              type: string
            preflight_endpoint:
              type: string
            order_endpoint:
              type: string
            amount_side:
              type: string
              enum: [give]
            currency_fields:
              type: array
              items:
                type: string
    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: "Opaque proof for the expiry window. Echo the complete snapshot without changes. Obtain a fresh quote, route detail or preflight if this field is missing."
        generated_at:
          type: string
          format: date-time
        expires_at:
          type: string
          format: date-time
        fingerprint:
          type: object
          additionalProperties: true
    OperationContract:
      type: object
      properties:
        version:
          type: string
          example: operation-contract-v1
        route:
          $ref: "#/components/schemas/ExchangeRoute"
        operation:
          type: object
          additionalProperties: true
          properties:
            attributes:
              type: object
              additionalProperties: true
              properties:
                city_detail:
                  $ref: "#/components/schemas/ExchangeCityDetails"
        snapshot:
          $ref: "#/components/schemas/RouteSnapshot"
        contract:
          type: object
          additionalProperties: true
          properties:
            dynamic_fields:
              $ref: "#/components/schemas/ExchangeDynamicFields"
            rate:
              type: object
              required: [selector_fees]
              properties:
                selector_fees:
                  $ref: "#/components/schemas/ExchangeSelectorFees"
            files:
              type: object
              properties:
                create_upload_intent_endpoint: { type: string }
                commit_upload_intent_endpoint: { type: string }
                order_field_upload_endpoint: { type: string }
                receipts_endpoint: { type: string }
                receipts_allowed: { type: boolean }
    ExchangeCityDetails:
      description: "Keys use id_<direction-city-row-id>, not the geographical city ID. A route without available cities returns an empty array."
      anyOf:
        - type: object
          additionalProperties:
            type: object
            properties:
              information: { type: [string, "null"] }
              handover:
                $ref: "#/components/schemas/CityHandoverConfiguration"
        - type: array
          maxItems: 0
          items: {}
    CityHandoverConfiguration:
      type: object
      required: [enabled, methods, offices]
      properties:
        enabled:
          type: boolean
          description: Empty legacy configuration is disabled; enabled with no available methods must not be treated as legacy.
        methods:
          type: array
          items:
            type: string
            enum: [office, courier, agreement]
        courier_description:
          type: string
          minLength: 1
          description: Optional resolved description in the request locale with configured language fallback. Omitted when courier is unavailable or every translation is blank; translation maps are never returned.
        offices:
          type: array
          description: Active linked company offices in the selected geographical city, never customer courier addresses.
          items:
            $ref: "#/components/schemas/CityHandoverOffice"
    CityHandoverOffice:
      type: object
      required: [id, name, address]
      properties:
        id:
          type: integer
          minimum: 1
        name:
          type: string
          description: Resolved office name in the request locale; missing or blank translations use the configured language fallback. Never a translation map.
        address:
          type: string
          description: Resolved company address with the same language fallback. Never a customer courier address or a translation map.
    CityHandoverSelection:
      type: object
      description: Required only when the selected direction-city enables handover. It never changes quote prices or adds a delivery fee.
      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]
    CashHandoverSnapshot:
      type: [object, "null"]
      description: Historical order terms, returned only by private owner-authorized order responses. The courier address is personal data.
      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"]
    ExchangeAmountInput:
      description: "Positive decimal amount without exponent notation. Clients should send a decimal string to retain precision."
      anyOf:
        - type: string
          pattern: "^[0-9]+(?:[.][0-9]+)?$"
        - type: number
          exclusiveMinimum: 0
    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 }
    ExchangeSelectedFeeInput:
      type: object
      required: [id]
      properties:
        id: { type: integer, minimum: 1 }
        scope: { type: string, enum: [common, individual] }
    ExchangeSelectedFee:
      allOf:
        - $ref: "#/components/schemas/ExchangeSelectedFeeInput"
        - type: object
          required: [scope]
    ExchangeSelectorFees:
      type: object
      required: [mode, options]
      properties:
        mode: { type: string, enum: [single, multi] }
        options:
          type: array
          items:
            allOf:
              - $ref: "#/components/schemas/ExchangeSelectedFee"
              - type: object
                required: [name, description]
                properties:
                  name: { type: string }
                  description: { type: string }
    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: Alias of amount.
        city_id:
          type: [integer, "null"]
        type_rate:
          description: "0/fixed = fixed rate, 1/floating = floating rate."
          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: "Accepted for compatibility. Use selected_fees for selection."
        selected_fees:
          description: "Selected fee selectors from the route operation contract. Object maps are accepted for compatibility."
          anyOf:
            - type: array
              items:
                $ref: "#/components/schemas/ExchangeSelectedFeeInput"
            - type: object
              additionalProperties: true
            - type: "null"
        selector_fees:
          type: [object, array, "null"]
          deprecated: true
          description: "Accepted for compatibility. Use selected_fees for selection."
        checkbox_agreements:
          type: object
          additionalProperties: true
          description: Selected agreement keys and their checked states, as returned by the route operation contract. Fees are resolved from active server agreements available to this route.
          example:
            discount: true
            commission: false
        checkbox_fees:
          type: object
          additionalProperties: true
          deprecated: true
          description: Accepted for compatibility and ignored. Send checkbox_agreements; fee values are resolved by the server.
        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" }
    ExchangeOrderPreflightRequest:
      $ref: "#/components/schemas/ExchangeOrderCreateRequest"
      description: "Order fields for preflight and sandbox simulation."
    ExchangeOrderPreflight:
      type: object
      required: [allowed, can_create_order, checks, missing_fields, validation_errors, validation_issues, quote, operation_contract, requirements, snapshot]
      properties:
        checks:
          $ref: "#/components/schemas/PreflightChecks"
        validation_issues:
          type: array
          items:
            $ref: "#/components/schemas/ApiIssue"
        allowed:
          type: boolean
        can_create_order:
          type: boolean
        missing_fields:
          type: array
          items:
            type: object
            properties:
              field:
                type: string
              type:
                type: string
              message:
                type: string
        validation_errors:
          type: object
          description: "Validation messages by field after required inputs are provided. This check covers local rules."
          additionalProperties:
            type: array
            items:
              type: string
        quote:
          $ref: "#/components/schemas/ExchangeQuote"
        operation_contract:
          $ref: "#/components/schemas/OperationContract"
        requirements:
          $ref: "#/components/schemas/VerificationRequirements"
        snapshot:
          $ref: "#/components/schemas/RouteSnapshot"
    ExchangeQuote:
      type: object
      required: [selector_fees]
      properties:
        selector_fees:
          $ref: "#/components/schemas/ExchangeSelectorFees"
        route:
          $ref: "#/components/schemas/ExchangeRoute"
        amounts:
          type: object
          properties:
            give:
              type: string
            receive:
              type: string
        components:
          type: array
          items:
            type: object
            additionalProperties: true
        rate:
          type: object
          properties:
            display:
              type: string
            value:
              type: string
            source:
              type: string
              enum: [calculation]
            selected:
              type: [string, "null"]
              enum: [fixed, floating, null]
            modes:
              $ref: "#/components/schemas/ExchangeRateModes"
        base_rate:
          type: object
          description: Base direction rate without quote-level city, selector, checkbox or verification adjustments. When an independent city formula is usable but the base source is unavailable, value and display are null and available is false.
          properties:
            display:
              type: [string, 'null']
            value:
              type: [string, 'null']
            available:
              type: boolean
              description: Present as false when the base source is unavailable. An omitted property preserves the normal available-base response.
            source:
              type: string
              enum: [direction]
            selected:
              type: [string, "null"]
              enum: [fixed, floating, null]
            modes:
              $ref: "#/components/schemas/ExchangeRateModes"
            note:
              type: string
        adjustments:
          type: object
          description: Quote-level options that affected the calculation rate.
          properties:
            city_id:
              type: [integer, "null"]
            selected_fee_type:
              type: [string, "null"]
            selected_fees:
              type: array
              items:
                $ref: "#/components/schemas/ExchangeSelectedFee"
            selector_fees:
              type: array
              items: {}
            checkbox_fees:
              type: array
              items: {}
            card_verification_required:
              type: boolean
        promo:
          type: object
          properties:
            applied:
              type: boolean
            base_receive_amount:
              type: string
        task_payload:
          type: object
          additionalProperties: true
    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: Alias of outcome_amount.
        email:
          type: [string, "null"]
          format: email
          deprecated: true
          description: "Accepted for compatibility. The order uses the API key owner email."
        income_account:
          type: [string, "null"]
        outcome_account:
          type: [string, "null"]
        from_requisite:
          type: [string, "null"]
          description: Alias of income_account.
        to_requisite:
          type: [string, "null"]
          description: Alias of 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: For file fields, provide an array of one-time tokens from the route's `user` group. Other fields accept their usual scalar values.
        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"
    ExchangeOrderConfirmRequest:
      type: object
      required: [type]
      properties:
        type:
          type: string
          enum: [paid, unpaid]
        income_code:
          deprecated: true
          description: "Accepted for compatibility. Attach a receipt using the separate receipts operation."
          type: string
          minLength: 15
    ExchangePaymentInstructions:
      type: object
      required: [tracking_id, status, mode, payment_expires_at, amount, currency, network, details]
      properties:
        tracking_id:
          type: string
        status:
          type: string
          enum: [ready, expired, unavailable, verification_required, awaiting_operator, pending, not_prepared]
        mode:
          type: string
          enum: [none, checkout, requisites]
        payment_expires_at:
          type: [string, "null"]
          format: date-time
        amount:
          type: string
          description: "Decimal amount to be paid."
        currency:
          type: [string, "null"]
        network:
          type: [string, "null"]
        details:
          oneOf:
            - type: "null"
            - type: object
              required: [checkout_url]
              additionalProperties: false
              properties:
                checkout_url:
                  type: string
            - type: object
              required: [account, memo, bank, fields]
              additionalProperties: false
              properties:
                account:
                  type: string
                memo:
                  type: [string, "null"]
                bank:
                  type: [string, "null"]
                fields:
                  type: array
                  items:
                    type: object
                    required: [key, name, value, comment]
                    properties:
                      key:
                        type: string
                      name:
                        type: string
                      value:
                        type: string
                      comment:
                        type: [string, "null"]
    ExchangePaymentInstructionsPreparation:
      allOf:
        - $ref: "#/components/schemas/ExchangePaymentInstructions"
        - type: object
          properties:
            details:
              type: "null"
    OrderActions:
      type: object
      properties:
        status:
          type: object
          additionalProperties: true
        allowed_actions:
          type: object
          additionalProperties:
            type: object
            required:
              - allowed
            properties:
              allowed:
                type: boolean
                description: Available in the current order state.
              authorized:
                type: boolean
                description: The current API key has permission to invoke the action.
              reason:
                enum:
                  - expired
                  - unavailable
                  - verification_required
                  - null
              method:
                type: string
              endpoint:
                type: string
              payload:
                type: object
        transitions:
          type: array
          items:
            type: object
            properties:
              id:
                type: integer
              key:
                type: string
        requirements:
          $ref: '#/components/schemas/VerificationRequirements'
        payment_timing:
          $ref: '#/components/schemas/OrderPaymentTiming'
        request_payment_timing:
          anyOf:
            - $ref: '#/components/schemas/OrderRequestPaymentTiming'
            - type: 'null'
      required:
        - status
        - payment_timing
        - request_payment_timing
        - allowed_actions
        - transitions
        - requirements
    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 }
    UploadIntentCreateRequest:
      type: object
      required:
        - purpose
      properties:
        purpose:
          type: string
          enum:
            - identity_verification
            - card_verification
        resource_type:
          type:
            - string
            - 'null'
          maxLength: 64
        resource_id:
          type:
            - string
            - 'null'
          maxLength: 128
        field_key:
          type:
            - string
            - 'null'
          maxLength: 128
        allowed_extensions:
          type:
            - array
            - 'null'
          items:
            type: string
            maxLength: 16
        max_bytes:
          type:
            - integer
            - 'null'
          minimum: 1024
      if:
        required:
          - resource_type
        properties:
          resource_type:
            const: order
      then:
        required:
          - resource_id
        properties:
          resource_id:
            type: string
            pattern: \S
    UploadIntent:
      type: object
      properties:
        id:
          type: integer
        uuid:
          type: string
          format: uuid
        purpose:
          type: string
        resource_type:
          type: [string, "null"]
        resource_id:
          type: [string, "null"]
        field_key:
          type: [string, "null"]
        status:
          type: string
          enum: [pending, committed, consumed, expired]
        allowed_extensions:
          type: array
          items:
            type: string
        max_bytes:
          type: integer
        file:
          type: object
          additionalProperties: true
        expires_at:
          type: [string, "null"]
          format: date-time
        committed_at:
          type: [string, "null"]
          format: date-time
        consumed_at:
          type: [string, "null"]
          format: date-time
    VerificationStatus:
      type: object
      required: [key, label, is_final_approved]
      properties:
        id:
          type: [integer, "null"]
        key:
          type: string
          enum: [not_submitted, pending, approved, rejected]
        label:
          type: string
        is_final_approved:
          type: boolean
        verification_id:
          type: [integer, "null"]
        verification_uuid:
          type: string
          description: "Opaque public identifier of the verification."
    VerificationRequirements:
      type: object
      properties:
        route_id:
          type: [integer, "null"]
        order:
          type: [object, "null"]
          additionalProperties: true
        identity:
          type: object
          properties:
            required:
              type: boolean
            mode:
              type: [string, "null"]
            description:
              type: [string, "null"]
            current:
              $ref: "#/components/schemas/VerificationStatus"
            create_endpoint:
              type: string
            blocks_payment: { type: boolean }
            can_submit: { type: boolean }
            flow: { type: string }
        card:
          type: object
          properties:
            required:
              type: boolean
            mode:
              type: [integer, "null"]
            description:
              type: [string, "null"]
            settings:
              type: [object, "null"]
              additionalProperties: true
            additional_photos:
              $ref: "#/components/schemas/CardVerificationAdditionalPhotos"
            current:
              $ref: "#/components/schemas/VerificationStatus"
            create_endpoint:
              type: string
            blocks_payment: { type: boolean }
            can_submit: { type: boolean }
        files:
          type: [object, "null"]
          additionalProperties: true
    CardVerificationAdditionalPhotos:
      type: object
      required: [enabled, max_count, max_file_size_mb, accepted_mime_types]
      properties:
        enabled:
          type: boolean
        max_count:
          type: integer
          minimum: 1
          maximum: 5
        max_file_size_mb:
          type: integer
          minimum: 1
          maximum: 10
        accepted_mime_types:
          type: array
          items:
            type: string
            enum: [image/jpeg, image/png]
    IdentityVerificationCreateRequest:
      type: object
      description: "Submit values and file intents using keys from the published form. Legacy top-level full_name and file_intents are accepted when they match the form."
      properties:
        fields:
          type: object
          maxProperties: 80
          additionalProperties:
            type: [string, number, boolean, array, "null"]
        file_intents_by_field:
          type: object
          maxProperties: 30
          additionalProperties:
            type: array
            maxItems: 10
            uniqueItems: true
            items: { type: string, format: uuid }
        full_name: { type: [string, "null"], maxLength: 255 }
        file_intents:
          type: array
          minItems: 1
          maxItems: 2
          uniqueItems: true
          items: { type: string, format: uuid }
    CardVerificationCreateRequest:
      type: object
      required:
        - card_number
        - file_intent
      properties:
        order:
          type:
            - string
            - 'null'
          maxLength: 128
        order_id:
          type:
            - string
            - 'null'
          maxLength: 128
        currency_id:
          type:
            - integer
            - 'null'
        card_number:
          type: string
          maxLength: 255
        name:
          type:
            - string
            - 'null'
          maxLength: 255
        file_intent:
          type: string
          format: uuid
        additional_file_intents:
          type: array
          description: Optional additional card photos; accepted only when enabled in verification settings.
          maxItems: 5
          uniqueItems: true
          items:
            type: string
            format: uuid
    CardVerificationFile:
      type: object
      required: [image, preview]
      properties:
        image:
          type: [string, "null"]
        preview:
          type: [string, "null"]
    CardVerificationAdditionalFile:
      allOf:
        - $ref: "#/components/schemas/CardVerificationFile"
        - type: object
          properties:
            original_name:
              type: [string, "null"]
            mime:
              type: [string, "null"]
            size:
              type: [integer, "null"]
              minimum: 0
    CardVerification:
      type: object
      required: [id, card_mask, status, file, additional_files]
      properties:
        id:
          type: integer
        uuid:
          type: [string, "null"]
        order_id:
          type: [integer, "null"]
        currency_id:
          type: [integer, "null"]
        name:
          type: [string, "null"]
        card_mask:
          type: string
        status:
          $ref: "#/components/schemas/VerificationStatus"
        file:
          $ref: "#/components/schemas/CardVerificationFile"
        additional_files:
          type: array
          items:
            $ref: "#/components/schemas/CardVerificationAdditionalFile"
        message:
          type: [string, "null"]
        created_at:
          type: [string, "null"]
          format: date-time
        updated_at:
          type: [string, "null"]
          format: date-time
    OrderVerificationSubmitRequest:
      type: object
      properties:
        identity:
          anyOf:
            - $ref: '#/components/schemas/IdentityVerificationCreateRequest'
            - type: 'null'
        card:
          anyOf:
            - $ref: '#/components/schemas/CardVerificationCreateRequest'
            - type: 'null'
      anyOf:
        - required:
            - identity
          properties:
            identity:
              type: object
              minProperties: 1
        - required:
            - card
          properties:
            card:
              type: object
              minProperties: 1
    ReviewCreateRequest:
      type: object
      required:
        - name
        - text
      properties:
        name:
          type: string
          maxLength: 40
        text:
          type: string
          maxLength: 200
        rating:
          type:
            - integer
            - 'null'
          minimum: 1
          maximum: 5
        rate_speed:
          type:
            - integer
            - 'null'
          minimum: 1
          maximum: 5
        order_id:
          type:
            - string
            - 'null'
          maxLength: 64
        tracking_id:
          type:
            - string
            - 'null'
          maxLength: 64
      anyOf:
        - required:
            - order_id
          properties:
            order_id:
              type: string
              pattern: \S
        - required:
            - tracking_id
          properties:
            tracking_id:
              type: string
              pattern: \S
      description: Pass a nonblank order_id or tracking_id. If both are nonblank, tracking_id is used. If both ratings are nonnull,
        rate_speed is used.
    Review:
      type: object
      description: Published review. Hidden orders are excluded from the feed; related order identifiers and amounts are returned only to the order owner.
      properties:
        id:
          type: integer
        status:
          type: object
          properties:
            id:
              type: integer
            name:
              type: string
              enum: [published, moderation]
            is_published:
              type: boolean
        name:
          type: [string, "null"]
        text:
          type: [string, "null"]
        rating:
          type: integer
        order:
          type: [object, "null"]
        timestamps:
          type: object
    ContractVersion:
      type: object
      required: [key, version, title, status, stability, description, headers, schemas]
      properties:
        key:
          type: string
          example: operation-contract
        version:
          type: string
          example: operation-contract-v1
        title:
          type: string
        status:
          type: string
          example: current
        stability:
          type: string
          example: stable
        description:
          type: string
        headers:
          type: array
          items:
            type: string
        schemas:
          type: array
          items:
            type: string
    SchemaRegistryItem:
      type: object
      required: [key, title, version, contract, content_type, endpoint]
      properties:
        key:
          type: string
          example: success-envelope.v1
        title:
          type: string
        version:
          type: string
        contract:
          type: string
        content_type:
          type: string
          example: application/json
        endpoint:
          type: string
    ClientApiHealth:
      type: object
      required: [version, status, client, token, quota, security, webhooks, contracts, time]
      properties:
        version:
          type: string
          example: client-health-v1
        status:
          type: string
          enum: [ok, warning, blocked]
        client:
          type: object
          additionalProperties: true
        token:
          type: [object, "null"]
          additionalProperties: true
        security:
          type: [object, "null"]
          additionalProperties: true
        quota:
          type: [object, "null"]
          additionalProperties: true
        webhooks:
          type: object
          additionalProperties: true
        contracts:
          type: object
          additionalProperties: true
        time:
          type: string
          format: date-time
    RouteCapabilities:
      type: object
      required: [version, route_id, status, actions, amounts, rate, fields, endpoints, snapshot]
      properties:
        version:
          type: string
          example: route-capabilities-v1
        route_id:
          type: integer
        status:
          type: object
          additionalProperties: true
        actions:
          type: object
          additionalProperties:
            $ref: "#/components/schemas/RouteCapabilityAction"
        amounts:
          type: object
          additionalProperties: true
        rate:
          type: object
          required: [selector_fees]
          properties:
            selector_fees:
              allOf:
                - $ref: "#/components/schemas/ExchangeSelectorFees"
                - type: object
                  required: [title, text]
                  properties:
                    title: { type: [string, "null"] }
                    text: { type: [string, "null"] }
        fields:
          type: array
          items:
            $ref: "#/components/schemas/RouteCapabilityField"
        dynamic_fields:
          $ref: "#/components/schemas/ExchangeDynamicFields"
        requirements:
          $ref: "#/components/schemas/VerificationRequirements"
        files:
          type: object
          properties:
            supported_purposes:
              type: array
              items: { enum: [identity_verification, card_verification] }
            upload_intent_endpoint: { type: string }
            order_field_upload_endpoint: { type: [string, "null"] }
            receipts_endpoint: { type: [string, "null"] }
            receipts_allowed: { type: boolean }
        endpoints:
          type: object
          additionalProperties:
            type: string
          properties:
            status_summary: { type: string }
            payment_status: { type: string }
        snapshot:
          $ref: "#/components/schemas/RouteSnapshot"
        operation_contract:
          $ref: "#/components/schemas/OperationContract"
    WebhookNotification:
      $ref: "#/components/schemas/WebhookNotificationV2"
    WebhookEvent:
      description: "Delivery Center event record with lifecycle metadata."
      type: object
      required: [id, type, status, payload, deliveries_count]
      properties:
        id:
          type: string
          format: uuid
        type:
          type: string
          example: order.created
        resource:
          type: object
          additionalProperties: true
        status:
          type: string
        request_id:
          type: [string, "null"]
        correlation_id:
          type: [string, "null"]
        idempotency_key:
          type: [string, "null"]
        payload:
          type: object
          required: [payload_version]
          properties:
            payload_version: { const: v2 }
        deliveries_count:
          type: integer
        deliveries:
          type: array
          items:
            $ref: "#/components/schemas/WebhookDelivery"
        created_at:
          type: [string, "null"]
          format: date-time
    WebhookDelivery:
      type: object
      required: [id, status, attempt, endpoint, event, payload_version, signature_version, retry_blocked_reason]
      properties:
        payload_version: { type: [string, "null"], enum: [v2, null] }
        signature_version: { type: [string, "null"], enum: [v2, null] }
        retry_blocked_reason: { type: [string, "null"], enum: [protocol_retired, null] }
        id:
          type: string
          format: uuid
        status:
          type: string
          enum: [queued, sending, succeeded, failed]
        attempt:
          type: integer
        endpoint:
          type: [object, "null"]
          additionalProperties: true
        event:
          type: [object, "null"]
          additionalProperties: true
        request:
          type: object
          additionalProperties: true
        response:
          type: object
          description: "Diagnostic metadata only. Receiver response bodies are omitted."
          required: [status, body, duration_ms]
          properties:
            status:
              type: [integer, "null"]
            body:
              type: "null"
            duration_ms:
              type: [integer, "null"]
        attempts:
          type: array
          items:
            $ref: "#/components/schemas/WebhookDeliveryAttempt"
        error:
          type: object
          additionalProperties: true
        next_retry_at:
          type: [string, "null"]
          format: date-time
        delivered_at:
          type: [string, "null"]
          format: date-time
    WebhookDeliveryAttempt:
      type: object
      required: [attempt, status, response_status, error_code, duration_ms, started_at, finished_at, next_retry_at]
      properties:
        attempt:
          type: integer
        status:
          type: string
        response_status:
          type: [integer, "null"]
        error_code:
          type: [string, "null"]
        duration_ms:
          type: [integer, "null"]
        started_at:
          type: string
          format: date-time
        finished_at:
          type: [string, "null"]
          format: date-time
        next_retry_at:
          type: [string, "null"]
          format: date-time
    WebhookEventCatalogItem:
      type: object
      required: [event, title]
      properties:
        event:
          type: string
          example: order.status_changed
        title:
          type: string
    WebhookEndpoint:
      type: object
      required: [id, name, url, events, status, signing_algorithm]
      properties:
        payload_version:
          $ref: "#/components/schemas/WebhookPayloadVersion"
        id:
          type: string
          format: uuid
        name:
          type: string
        url:
          type: string
          format: uri
        events:
          type: array
          items:
            type: string
        status:
          type: string
          enum: [active, paused, disabled]
        signing_algorithm:
          type: string
          const: hmac-sha256-v2
        secret_fingerprint:
          type: [string, "null"]
        failure_count:
          type: integer
        last_delivery_at:
          type: [string, "null"]
          format: date-time
        last_success_at:
          type: [string, "null"]
          format: date-time
        last_failure_at:
          type: [string, "null"]
          format: date-time
        created_at:
          type: [string, "null"]
          format: date-time
        updated_at:
          type: [string, "null"]
          format: date-time
    WebhookEndpointCreate:
      type: object
      required: [name, url, events]
      properties:
        payload_version:
          $ref: "#/components/schemas/WebhookPayloadVersion"
        name:
          type: string
          maxLength: 80
        url:
          $ref: "#/components/schemas/WebhookDeliveryTargetUrl"
        events:
          type: array
          minItems: 1
          items:
            type: string
    WebhookEndpointUpdate:
      type: object
      properties:
        payload_version:
          $ref: "#/components/schemas/WebhookPayloadVersion"
          description: Only v2 is accepted when the field is provided.
        name:
          type: string
          maxLength: 80
        url:
          $ref: "#/components/schemas/WebhookDeliveryTargetUrl"
        events:
          type: array
          minItems: 1
          items:
            type: string
        status:
          type: string
          enum: [active, paused, disabled]
    WebhookDeliveryTargetUrl:
      type: string
      format: uri
      maxLength: 500
      description: >-
        HTTPS URL resolving only to public IP addresses. HTTP is available if
        the installation explicitly enables legacy delivery. Use the final
        destination URL for direct delivery without redirects.
    WebhookTestRequest:
      type: object
      properties:
        endpoint_id:
          type: [string, "null"]
          format: uuid
        event_type:
          type: string
          description: "Selects the subscription and sample. The delivered event type is always api.test."
          example: api.test
        payload:
          type: object
          additionalProperties: true
    WebhookTestResult:
      type: object
      properties:
        event:
          type: object
          properties:
            id:
              type: string
              format: uuid
            type:
              type: string
              const: api.test
            status:
              type: string
            request_id:
              type: string
            correlation_id:
              type: string
        deliveries:
          type: array
          items:
            type: object
            required: [payload_version, signature_version, retry_blocked_reason]
            properties:
              payload_version:
                $ref: "#/components/schemas/WebhookPayloadVersion"
              signature_version: { const: v2 }
              retry_blocked_reason: { type: "null" }
              id:
                type: string
                format: uuid
              status:
                type: string
              endpoint_id:
                type: string
                format: uuid
