> ## 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 Cross-Ramp Rate

Retrieves a real-time exchange rate for a fiat-to-fiat (cross-ramp) conversion. Use this to display estimated amounts before creating a transaction.

***

## Field Relationships

* Provide either `sourceAmount` or `targetAmount`, not both.

***

## Important Notes

* This returns a real-time rate that is **not locked**. To lock a rate, use [POST /api/partner/v2/cross-ramp/quotes](/reference/crossramppartnerv2controller_createpartnercrossrampquote).
* To quote a USD payout to **China (CN)** or **Hong Kong (HK)**, pass `targetCountry=CN` (or `HK`) and optionally `targetRail` (`LOCAL` default, or `SWIFT`). See the [Cross-Ramp guide](/docs/cross-ramp#china--hong-kong-destinations).

***

## 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`              | "Requested fiat currency is invalid or inactive" |


## OpenAPI

````yaml reference/openapi/CrossRampPartnerV2Controller_getPartnerCrossRampQuoteRate.json GET /api/partner/v2/cross-ramp/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/cross-ramp/quotes:
    get:
      tags:
        - cross-ramp
      operationId: CrossRampPartnerV2Controller_getPartnerCrossRampQuoteRate
      parameters:
        - name: sourceCurrency
          required: true
          in: query
          description: The source fiat currency symbol
          schema:
            example: MXN
            enum:
              - MXN
              - DOP
              - USD
              - EUR
            type: string
        - name: targetCurrency
          required: true
          in: query
          description: The target fiat currency symbol
          schema:
            example: USD
            enum:
              - MXN
              - DOP
              - USD
              - EUR
            type: string
        - name: sourceAmount
          required: false
          in: query
          description: The amount of source fiat currency to convert
          schema:
            type: number
        - name: targetAmount
          required: false
          in: query
          description: The desired amount of target fiat currency to receive
          schema:
            type: number
        - name: premiumSpread
          required: false
          in: query
          description: Spread percentage to be applied to the exchange rate
          schema:
            type: number
        - name: targetCountry
          required: false
          in: query
          description: >-
            Target country. Required to quote a USD payout to China (CN) or Hong
            Kong (HK), since USD otherwise defaults to the US.
          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
              - HK
            type: string
        - name: targetRail
          required: false
          in: query
          description: >-
            Target payment rail for CN/HK destinations. Defaults to LOCAL; use
            SWIFT for an international wire.
          schema:
            enum:
              - LOCAL
              - SWIFT
            type: string
      responses:
        '200':
          description: Successful response
          content:
            application/json:
              schema:
                type: object
                properties:
                  success:
                    type: boolean
                    example: true
                  data:
                    type: object
                    properties:
                      fees:
                        type: object
                        description: Fee information for the transaction
                        properties:
                          fixedFee:
                            type: number
                            description: Fixed fee amount
                            example: 25
                          feeCurrency:
                            type: string
                            description: Currency of the fee
                            example: MXN
                        required:
                          - fixedFee
                          - feeCurrency
                      sourceAmount:
                        type: number
                        description: Amount to be exchanged in fiat (DOP or MXN)
                        example: 5000
                      sourceCurrency:
                        description: This field refers to the currency that user will sent
                        example: DOP, MXN, USD
                        enum:
                          - MXN
                          - DOP
                          - USD
                          - EUR
                        type: string
                      targetAmount:
                        type: number
                        description: Amount the user would received in crypto
                        example: 40
                      targetCurrency:
                        description: This field refers to the currency that user will sent
                        example: DOP, MXN, USD
                        enum:
                          - MXN
                          - DOP
                          - USD
                          - EUR
                        type: string
                      rate:
                        type: number
                        description: Sell exchange rate used to buy usdc
                        example: 57.01
                      premiumSpread:
                        type: number
                        description: Premium spread
                        example: 0.01
                      spread:
                        type: number
                        description: Spread percentage
                        example: 0.005
                      flow:
                        description: Transaction flow based on the amount
                        example: REGULAR | OTC
                        enum:
                          - OTC
                          - PAYMENT
                          - REGULAR
                        type: string
                    required:
                      - fees
                      - sourceAmount
                      - sourceCurrency
                      - targetAmount
                      - targetCurrency
                      - rate
                      - spread
                      - flow
                    x-readme-ref-name: GetPartnerCrossRampQuoteExchangeV2Response
        '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
                BAD_REQUEST_2:
                  value:
                    success: false
                    code: BAD_REQUEST
                    message: Source and target currencies must differ
        '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.

````