> ## Documentation Index
> Fetch the complete documentation index at: https://docs.miex.solutions/llms.txt
> Use this file to discover all available pages before exploring further.

# Estimate Exchange

> Calculates the estimated source or destination amount for a given currency pair and exchange. Uses the same rate logic as order creation.



## OpenAPI

````yaml POST /partner/public/estimate
openapi: 3.0.3
info:
  title: Exchange Partner API
  version: 1.0.0
  description: >-
    REST API for exchange office partners. Authenticate with a Bearer API key
    (`sk_branch_*`, `sk_personal_*`, or `pk_*`). API key management endpoints
    use JWT Bearer auth from the staff panel.
servers:
  - url: https://api.example.com/api/v1
    description: Production
security:
  - bearerAuth: []
tags:
  - name: Partner — Public
    description: >-
      Read-only endpoints accessible with any key type (including pk_* public
      keys)
  - name: Partner — Exchanges
    description: Read public exchange office data and rates
  - name: Partner — Offers
    description: Browse available currency exchange rate offers
  - name: Partner — Orders
    description: Create and manage client exchange orders
  - name: Partner — Clients
    description: Register and manage client accounts
  - name: Partner — Webhooks
    description: Manage webhook endpoint registrations
  - name: API Keys
    description: Create and revoke partner API keys (JWT auth required)
paths:
  /partner/public/estimate:
    post:
      tags:
        - Partner — Public
      summary: Estimate exchange amount for a currency pair
      description: >-
        Calculates the estimated source or destination amount for a given
        currency pair and exchange. Uses the same rate logic as order creation.
      operationId: publicEstimate
      requestBody:
        required: true
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/EstimateRequest'
            example:
              exchangeId: 1
              sourceCurrencyId: 1
              destCurrencyId: 2
              amount: 1000
              direction: source
      responses:
        '200':
          description: Estimation result
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/EstimateResponse'
        '400':
          $ref: '#/components/responses/ValidationError'
        '401':
          $ref: '#/components/responses/Unauthorized'
        '404':
          $ref: '#/components/responses/NotFound'
        '429':
          $ref: '#/components/responses/TooManyRequests'
      security:
        - bearerAuth: []
components:
  schemas:
    EstimateRequest:
      type: object
      required:
        - exchangeId
        - sourceCurrencyId
        - destCurrencyId
        - amount
        - direction
      properties:
        exchangeId:
          type: integer
          description: Exchange office ID
          example: 1
        sourceCurrencyId:
          type: integer
          description: Source currency ID
          example: 1
        destCurrencyId:
          type: integer
          description: Destination currency ID
          example: 2
        amount:
          type: number
          description: Amount to convert
          example: 1000
        direction:
          type: string
          enum:
            - source
            - dest
          description: Whether amount is in source or destination currency
          example: source
    EstimateResponse:
      type: object
      properties:
        sourceAmount:
          type: number
          example: 1000
        destAmount:
          type: number
          example: 41500
        rate:
          type: number
          example: 41.5
        isReverse:
          type: boolean
          description: Whether the offer was matched in reverse direction
          example: false
        sourceCurrency:
          $ref: '#/components/schemas/PublicCurrency'
        destCurrency:
          $ref: '#/components/schemas/PublicCurrency'
        exchangeId:
          type: integer
          example: 1
        offerId:
          type: integer
          example: 42
    PublicCurrency:
      type: object
      properties:
        id:
          type: integer
          example: 1
        name:
          type: string
          example: US Dollar
        ticker:
          type: string
          example: USD
        image:
          type: object
          nullable: true
          properties:
            id:
              type: string
              example: cbcfa8b8-3a25-4adb-a9c6-e325f0d0f3ae
            path:
              type: string
              example: /uploads/usd.png
    Error:
      type: object
      properties:
        statusCode:
          type: integer
          example: 400
        message:
          oneOf:
            - type: string
            - type: array
              items:
                type: string
          example: Validation failed
        error:
          type: string
          example: Bad Request
      required:
        - statusCode
        - message
  responses:
    ValidationError:
      description: Request body or parameters failed validation
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/Error'
          example:
            statusCode: 400
            message:
              - url must be a URL address
              - events should not be empty
            error: Bad Request
    Unauthorized:
      description: Missing or invalid API key
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/Error'
          example:
            statusCode: 401
            message: Unauthorized
    NotFound:
      description: Resource not found
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/Error'
          example:
            statusCode: 404
            message: Not Found
    TooManyRequests:
      description: Rate limit exceeded (60 req/min per API key)
      headers:
        Retry-After:
          schema:
            type: integer
          description: Seconds until the rate limit window resets
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/Error'
          example:
            statusCode: 429
            message: Too Many Requests
  securitySchemes:
    bearerAuth:
      type: http
      scheme: bearer
      description: >-
        Partner API key. Format: `sk_branch_<32chars>`, `sk_personal_<32chars>`,
        or `pk_<32chars>` (public, read-only)

````