> ## 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.

# Create Cross-Ramp Quote

Creates a locked cross-ramp quote with a guaranteed exchange rate. Pass the returned `quoteId` when creating a cross-ramp transaction.

***

## Field Relationships

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

***

## Important Notes

* Quotes expire — check the `expiresAt` field and create the transaction before it lapses.
* Pass the returned `quoteId` to [Create Cross-Ramp](/reference/crossramppartnerv2controller_createpartnercrossramp).
* 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" |
| 500         | `INTERNAL_SERVER_ERROR`    | "Failed to create quote"                         |


## OpenAPI

````yaml reference/openapi/CrossRampPartnerV2Controller_createPartnerCrossRampQuote.json POST /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:
    post:
      tags:
        - cross-ramp
      operationId: CrossRampPartnerV2Controller_createPartnerCrossRampQuote
      requestBody:
        required: true
        content:
          application/json:
            schema:
              type: object
              properties:
                sourceCurrency:
                  description: The source fiat currency symbol
                  example: MXN
                  enum:
                    - MXN
                    - DOP
                    - USD
                    - EUR
                  type: string
                targetCurrency:
                  description: The target fiat currency symbol
                  example: USD
                  enum:
                    - MXN
                    - DOP
                    - USD
                    - EUR
                  type: string
                sourceAmount:
                  type: number
                  description: The amount of source fiat currency to convert
                targetAmount:
                  type: number
                  description: The desired amount of target fiat currency to receive
                premiumSpread:
                  type: number
                  description: Spread percentage to be applied to the exchange rate
                targetCountry:
                  type: string
                  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
                  description: >-
                    Target country. Required to quote a USD payout to China (CN)
                    or Hong Kong (HK), since USD otherwise defaults to the US.
                targetRail:
                  type: string
                  enum:
                    - LOCAL
                    - SWIFT
                  description: >-
                    Target payment rail for CN/HK destinations. Defaults to
                    LOCAL; use SWIFT for an international wire.
              required:
                - sourceCurrency
                - targetCurrency
              x-readme-ref-name: CreatePartnerCrossRampQuoteBody
      responses:
        '201':
          description: ''
          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
                      quoteId:
                        type: string
                        description: Quote id
                        example: 123e4567-e89b-12d3-a456-426614174000
                      expiresAt:
                        format: date-time
                        type: string
                        description: Quote expiration date
                        example: '2025-01-01T00:00:00.000Z'
                    required:
                      - fees
                      - sourceAmount
                      - sourceCurrency
                      - targetAmount
                      - targetCurrency
                      - rate
                      - spread
                      - flow
                      - quoteId
                      - expiresAt
                    x-readme-ref-name: CreatePartnerCrossRampQuoteResponse
        '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.

````