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

# Get a fixed exchange quote

> Get a fixed exchange quote for a specific amount, which can then be used with [/exchange/fixed](/api-reference/endpoints/exchange-fixed).



## OpenAPI

````yaml POST /exchange/calculate
openapi: 3.0.0
info:
  title: Merchant Backend V2
  version: '1.0'
  description: Documentation for merchant backend processing endpoints
servers:
  - url: https://app.cryptoprocessing.com/api/v2
security:
  - xProcessingKey: []
tags:
  - name: Status
  - name: Balance
  - name: Currencies
  - name: Deposit addresses
  - name: Withdrawal
  - name: Exchange
  - name: Invoices
  - name: Transactions
paths:
  /exchange/calculate:
    post:
      tags:
        - Exchange
      summary: Get an exchange quote
      description: >-
        Get a fixed exchange quote for a specific amount, which can then be used
        with [/exchange/fixed](/api-reference/endpoints/exchange-fixed).
      operationId: post-exchange-calculate
      parameters:
        - $ref: '#/components/parameters/XProcessingSignatureHeader'
      requestBody:
        content:
          application/json:
            schema:
              type: object
              properties:
                sender_currency:
                  type: string
                  description: >-
                    Currency to exchange from. For a list of all available
                    currencies, see [API currency
                    codes](/api-reference/currency-codes).
                receiver_currency:
                  type: string
                  description: >-
                    Currency to exchange to. For a list of all available
                    currencies, see [API currency
                    codes](/api-reference/currency-codes).
                sender_amount:
                  description: >-
                    Amount to send. You must include either this parameter or
                    `receiver_amount`.
                  type: number
                receiver_amount:
                  description: >-
                    Amount to receive. You must include either this parameter or
                    `sender_amount`.
                  type: number
              required:
                - sender_currency
                - receiver_currency
            examples:
              sender_amount:
                value:
                  sender_currency: BTC
                  receiver_currency: EUR
                  sender_amount: 0.02
              receiver_amount:
                value:
                  sender_currency: BTC
                  receiver_currency: EUR
                  receiver_amount: 100
        description: ''
      responses:
        '200':
          description: OK
          content:
            application/json:
              schema:
                type: object
                properties:
                  data:
                    type: object
                    properties:
                      sender_currency:
                        type: string
                        description: The currency being exchanged from.
                      sender_amount:
                        type: string
                        description: >-
                          If `sender_amount` was provided in the request, this
                          is the requested send amount. If `receiver_amount` was
                          provided, this is the calculated amount to send.
                      receiver_currency:
                        type: string
                        description: The currency being exchanged to.
                      receiver_amount:
                        type: string
                        description: >-
                          If `receiver_amount` was provided in the request, this
                          is the requested receive amount. If `sender_amount`
                          was provided, this is the calculated amount to
                          receive.
                      fee_currency:
                        type: string
                        description: The currency in which the exchange fee is charged.
                      fee_amount:
                        type: string
                        description: >-
                          The exchange fee amount. If the fee is charged in the
                          sender currency, the total debited amount is
                          `sender_amount + fee_amount`.
                      price:
                        type: string
                        description: >-
                          The quoted exchange rate, expressed as units of
                          `receiver_currency` for 1 unit of `sender_currency`.
                      ts_fixed:
                        type: integer
                        description: >-
                          Unix timestamp, in seconds, when the quote rate was
                          fixed.
                        format: int64
                      ts_release:
                        type: integer
                        format: int64
                        description: Unix timestamp, in seconds, when the quote expires.
                      fix_period:
                        type: integer
                        format: int32
                        description: >-
                          How long the fixed quote remains valid, in seconds.
                          After this period, request a new quote.
              examples:
                sender_amount:
                  value:
                    data:
                      sender_currency: BTC
                      sender_amount: '0.02000000'
                      receiver_currency: EUR
                      receiver_amount: '1546.28528889'
                      fee_currency: BTC
                      fee_amount: '0.00100000'
                      price: '77314.26444450'
                      ts_fixed: 1775172819
                      ts_release: 1775172879
                      fix_period: 60
                receiver_amount:
                  value:
                    data:
                      sender_currency: BTC
                      sender_amount: '0.00129342'
                      receiver_currency: EUR
                      receiver_amount: '100.00000000'
                      fee_currency: BTC
                      fee_amount: '0.00006467'
                      price: '77314.40676655'
                      ts_fixed: 1775172897
                      ts_release: 1775172957
                      fix_period: 60
        '400':
          description: Bad Request.
          content:
            text/html:
              schema:
                $ref: '#/components/schemas/ValidationOrMalformedJson'
              examples:
                Invalid sender currency:
                  summary: Sender currency not supported
                  value:
                    errors:
                      sender_currency: Currency not supported
                Invalid receiver currency:
                  summary: Receiver currency not supported
                  value:
                    errors:
                      receiver_currency: Currency not supported
                Invalid amount:
                  summary: Amount below minimum or invalid format
                  value:
                    errors:
                      sender_amount: Invalid amount format
                Same currency pair:
                  summary: Cannot exchange same currency
                  value:
                    errors:
                      receiver_currency: Cannot exchange currency to itself
                Missing fields:
                  summary: Required fields missing
                  value:
                    errors:
                      receiver_currency: The receiver currency field is required.
                      receiver_amount: >-
                        The receiver amount field is required when the sender
                        amount field is not presented.
                Malformed JSON:
                  summary: Invalid JSON body
                  value:
                    error: Bad content format
                    code: bad_content_format
        '403':
          $ref: '#/components/responses/HeaderAuthorization'
components:
  parameters:
    XProcessingSignatureHeader:
      name: X-Processing-Signature
      in: header
      required: true
      description: >-
        Hex-encoded HMAC-SHA512 signature of the request body, [generated using
        your secret key](/api-reference/authentication).
      schema:
        type: string
  schemas:
    ValidationOrMalformedJson:
      oneOf:
        - type: object
          title: ValidationError
          description: One or more request parameters failed validation.
          properties:
            errors:
              type: object
              additionalProperties:
                type: string
        - type: object
          title: MalformedJson
          description: >-
            The request body is not valid JSON or the Content-Type header is not
            set to `application/json`.
          properties:
            error:
              type: string
            code:
              type: string
  responses:
    HeaderAuthorization:
      description: |
        Forbidden
      content:
        application/json:
          schema:
            type: object
            properties:
              error:
                type: string
                description: Human-readable error message.
              code:
                type: string
                description: Error code.
            description: >-
              Invalid or missing headers. Refer to
              [Errors](/api-reference/errors#403) for troubleshooting steps.
          examples:
            Bad signature header:
              value:
                error: Bad signature header
                code: bad_header_signature
            No signature header:
              value:
                error: No signature header
                code: required_header_signature
            Bad key header:
              value:
                error: Bad key header
                code: bad_header_key
            No key header:
              value:
                error: No key header
                code: required_header_key
  securitySchemes:
    xProcessingKey:
      type: apiKey
      description: Your [API key](/integration-guide/get-your-api-key).
      in: header
      name: X-Processing-Key

````