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

# Get Quote Rate

Retrieves a real-time exchange rate quote for an on-ramp or off-ramp transaction. Use this to display estimated conversion amounts to users before they commit to a transaction.

***

## Field Relationships

* `cryptoAmount` is required for `OFF_RAMP` transactions, `fiatAmount` is required for `ON_RAMP`.
* `country` and `rail` are optional overrides — use them only when the currency is not the default for the country (e.g., USD in China via SWIFT).

***

## Important Notes

* This returns a **real-time rate** that is not locked. To lock a rate, use [POST /api/partner/v2/quotes](/reference/quotepartnerv2controller_createpartnerquote) instead.
* The `flow` field indicates whether the transaction qualifies as `OTC`, `PAYMENT`, or `REGULAR` based on the amount.
* Use consistent `tokenSymbol`, `blockchainSymbol`, and `fiatCurrency` values when creating the actual transaction.

***

## Error Codes

### Common Errors

| HTTP Status | Code                   | Message                            |
| ----------- | ---------------------- | ---------------------------------- |
| 401         | `UNAUTHORIZED`         | "API Key is missing"               |
| 401         | `UNAUTHORIZED`         | "Invalid API Key format"           |
| 401         | `UNAUTHORIZED`         | "Invalid API Key"                  |
| 403         | `INVALID_PARTNER_FLOW` | "The partner has an invalid flow." |

### Endpoint-Specific Errors

| HTTP Status | Code                       | Message                                                               |
| ----------- | -------------------------- | --------------------------------------------------------------------- |
| 400         | `INVALID_USER_INPUT_ERROR` | "Invalid User Input"                                                  |
| 400         | `BAD_REQUEST`              | "Fiat currency is disabled or does not exist"                         |
| 400         | `BAD_REQUEST`              | "This blockchain and token combination is disabled or does not exist" |
| 500         | `INTERNAL_SERVER_ERROR`    | "Internal error doing quote"                                          |


## OpenAPI

````yaml reference/openapi/QuotePartnerV2Controller_getPartnerQuoteRate.json GET /api/partner/v2/quotes
openapi: 3.0.0
info:
  title: Capa Partner API - V2
  description: >-
    Partner API for integrating cryptocurrency on-ramp and off-ramp services
    using Capa's infrastructure. Enable your users to seamlessly convert between
    fiat and crypto.
  version: v2
  contact: {}
servers:
  - url: https://staging-api.capa.fi
  - url: https://production-api.capa.fi
security: []
paths:
  /api/partner/v2/quotes:
    get:
      tags:
        - quotes
      operationId: QuotePartnerV2Controller_getPartnerQuoteRate
      parameters:
        - name: tokenSymbol
          required: true
          in: query
          description: The token symbol
          schema:
            example: USDC
            enum:
              - USDC
              - USDT
            type: string
        - name: transactionType
          required: true
          in: query
          description: Transaction type (ON_RAMP or OFF_RAMP)
          schema:
            example: ON_RAMP
            enum:
              - ON_RAMP
              - OFF_RAMP
              - CROSS_RAMP
            type: string
        - name: blockchainSymbol
          required: true
          in: query
          description: >-
            The blockchain symbol. BSC is only available for transactions over
            50,000 MXN.
          schema:
            example: POL
            enum:
              - POL
              - SOL
              - ETH
              - BSC
            type: string
        - name: fiatCurrency
          required: true
          in: query
          description: The fiat currency
          schema:
            example: MXN
            enum:
              - MXN
              - DOP
              - USD
              - EUR
            type: string
        - name: cryptoAmount
          required: false
          in: query
          description: The amount of crypto (required for OFF_RAMP)
          schema:
            type: number
        - name: fiatAmount
          required: false
          in: query
          description: The amount of fiat (required for ON_RAMP)
          schema:
            type: number
        - name: premiumSpread
          required: false
          in: query
          description: Spread percentage to be applied to the exchange rate
          schema:
            type: number
        - name: country
          required: false
          in: query
          description: |-
            The country where the transaction is being performed.
            Use it only when the currency is not default for the country.
          schema:
            enum:
              - MX
              - DO
              - US
              - AT
              - BE
              - BG
              - HR
              - CY
              - CZ
              - DK
              - EE
              - FI
              - FR
              - DE
              - GR
              - HU
              - IE
              - IT
              - LV
              - LT
              - LU
              - MT
              - NL
              - PL
              - PT
              - RO
              - SK
              - SI
              - ES
              - SE
              - IS
              - LI
              - 'NO'
              - CH
              - GB
              - MC
              - SM
              - AD
              - VA
              - CN
            type: string
        - name: rail
          required: false
          in: query
          description: |-
            The payment rail for the transaction.
            Use it only when the rail is not default for the country.
          schema:
            enum:
              - SPEI
              - ACH
              - WIRE
              - SEPA
              - SWIFT
            type: string
      responses:
        '200':
          description: Successful response
          content:
            application/json:
              schema:
                type: object
                properties:
                  success:
                    type: boolean
                    example: true
                  data:
                    type: object
                    properties:
                      fiatAmount:
                        type: number
                        description: Amount to be exchanged in fiat (DOP or MXN)
                        example: 5000
                      fiatCurrency:
                        description: This field refers to the currency that user will sent
                        example: DOP, MXN
                        enum:
                          - MXN
                          - DOP
                          - USD
                          - EUR
                        type: string
                      blockchainSymbol:
                        description: This field represents the blockchain symbol
                        example: POL
                        enum:
                          - POL
                          - SOL
                          - ETH
                          - BSC
                        type: string
                      tokenSymbol:
                        description: >-
                          This field refers to the token symbol that user will
                          received
                        example: USDC
                        enum:
                          - USDC
                          - USDT
                        type: string
                      transactionType:
                        description: Transaction type
                        example: ON_RAMP
                        enum:
                          - ON_RAMP
                          - OFF_RAMP
                          - CROSS_RAMP
                        type: string
                      cryptoAmount:
                        type: number
                        description: Amount the user would received in crypto
                        example: 40
                      rate:
                        type: number
                        description: Sell exchange rate used to buy usdc
                        example: 57.01
                      premiumSpread:
                        type: number
                        description: Premium spread
                        example: 0.01
                      flow:
                        description: Transaction flow based on the amount
                        example: REGULAR | OTC
                        enum:
                          - OTC
                          - PAYMENT
                          - REGULAR
                        type: string
                    required:
                      - fiatAmount
                      - fiatCurrency
                      - blockchainSymbol
                      - tokenSymbol
                      - transactionType
                      - cryptoAmount
                      - rate
                      - flow
                    x-readme-ref-name: GetPartnerQuoteExchangeV2Response
              example:
                success: true
                data:
                  fiatAmount: 5000
                  fiatCurrency: MXN
                  blockchainSymbol: POL
                  tokenSymbol: USDC
                  transactionType: ON_RAMP
                  cryptoAmount: 40
                  rate: 57.01
                  premiumSpread: 0.01
                  flow: REGULAR
        '400':
          description: Bad Request
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponse'
              examples:
                INVALID_USER_INPUT_ERROR:
                  value:
                    success: false
                    code: INVALID_USER_INPUT_ERROR
                    message: Invalid User Input
                BAD_REQUEST:
                  value:
                    success: false
                    code: BAD_REQUEST
                    message: >-
                      This blockchain and token combination is disabled or does
                      not exist
                INVALID_USER_INPUT_ERROR_2:
                  value:
                    success: false
                    code: INVALID_USER_INPUT_ERROR
                    message: forwardingDays is only supported for OTC orders
                INVALID_USER_INPUT_ERROR_3:
                  value:
                    success: false
                    code: INVALID_USER_INPUT_ERROR
                    message: Unable to calculate exchange rate for the provided amount
                INVALID_FIAT_AMOUNT_ERROR:
                  value:
                    success: false
                    code: INVALID_FIAT_AMOUNT_ERROR
                    message: >-
                      Fiat amount {amount} is outside of the allowed range for
                      {type}. Should be between {min} and {max}
                INVALID_TOKEN_AMOUNT_ERROR:
                  value:
                    success: false
                    code: INVALID_TOKEN_AMOUNT_ERROR
                    message: >-
                      Token amount {amount} is outside of the allowed range for
                      {type}. Should be between {min} and {max}
                BAD_REQUEST_2:
                  value:
                    success: false
                    code: BAD_REQUEST
                    message: >-
                      forwardingDays can only be specified for partners with
                      manual off-ramp enabled
        '401':
          description: Unauthorized
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponse'
              examples:
                UNAUTHORIZED:
                  value:
                    success: false
                    code: UNAUTHORIZED
                    message: API Key is missing
                UNAUTHORIZED_2:
                  value:
                    success: false
                    code: UNAUTHORIZED
                    message: Invalid API Key format
                UNAUTHORIZED_3:
                  value:
                    success: false
                    code: UNAUTHORIZED
                    message: Invalid API Key
        '404':
          description: Not Found
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponse'
              example:
                success: false
                code: NOT_FOUND_ERROR
                message: Requested FiatCurrency was not found
        '500':
          description: Internal Server Error
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponse'
              example:
                success: false
                code: INTERNAL_SERVER_ERROR
                message: Internal server error
      security:
        - PartnerApiKey: []
components:
  schemas:
    ErrorResponse:
      type: object
      properties:
        success:
          type: boolean
          example: false
        code:
          type: string
          description: Machine-readable error code.
        message:
          type: string
          description: Human-readable error message.
        errors:
          type: array
          description: Optional per-field validation details.
          items:
            type: object
            properties:
              field:
                type: string
              message:
                type: string
      required:
        - success
        - code
        - message
  securitySchemes:
    PartnerApiKey:
      type: apiKey
      in: header
      name: partner-api-key
      description: API key for the affiliated partner performing the request.

````