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

Creates a locked quote with a guaranteed exchange rate. Pass the returned `quoteId` when creating a transaction to use this rate.

***

## Field Relationships

* `cryptoAmount` is required for `OFF_RAMP` transactions, `fiatAmount` is required for `ON_RAMP`.
* `country` and `rail` are optional overrides for non-default currency/country combinations.
* `forwardingDays` (0–4) is only supported for MXN OTC transactions (T+N settlement).

***

## Important Notes

* Quotes expire — check the `expiresAt` field and create the transaction before it lapses.
* Pass the returned `quoteId` to [Create On-Ramp](/reference/onramppartnerv2controller_createpartneronramp), [Create Off-Ramp](/reference/offramppartnerv2controller_createpartnerofframp), or [Create Cross-Ramp](/reference/crossramppartnerv2controller_createpartnercrossramp).

***

## 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`    | "Failed to create quote"                                              |


## OpenAPI

````yaml reference/openapi/QuotePartnerV2Controller_createPartnerQuote.json POST /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:
    post:
      tags:
        - quotes
      operationId: QuotePartnerV2Controller_createPartnerQuote
      requestBody:
        required: true
        content:
          application/json:
            schema:
              type: object
              properties:
                tokenSymbol:
                  description: The token symbol
                  example: USDC
                  enum:
                    - USDC
                    - USDT
                  type: string
                transactionType:
                  description: Transaction type (ON_RAMP or OFF_RAMP)
                  example: ON_RAMP
                  enum:
                    - ON_RAMP
                    - OFF_RAMP
                    - CROSS_RAMP
                  type: string
                blockchainSymbol:
                  description: |-
                    The blockchain symbol.
                    BSC is only available for transactions over 50,000 MXN.
                  example: POL
                  enum:
                    - POL
                    - SOL
                    - ETH
                    - BSC
                  type: string
                fiatCurrency:
                  description: The fiat currency
                  example: MXN
                  enum:
                    - MXN
                    - DOP
                    - USD
                    - EUR
                  type: string
                cryptoAmount:
                  type: number
                  description: The amount of crypto (required for OFF_RAMP)
                fiatAmount:
                  type: number
                  description: The amount of fiat (required for ON_RAMP)
                premiumSpread:
                  type: number
                  description: Spread percentage to be applied to the exchange rate
                country:
                  description: >-
                    The country where the transaction is being performed.

                    Use it only when the currency is not default for the
                    country.
                  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
                rail:
                  description: |-
                    The payment rail for the transaction.
                    Use it only when the rail is not default for the country.
                  enum:
                    - SPEI
                    - ACH
                    - WIRE
                    - SEPA
                    - SWIFT
                  type: string
                forwardingDays:
                  type: number
                  description: >-
                    Number of T+N forwarding days for settlement (0-4). Only
                    supported for MXN OTC transactions.
              required:
                - tokenSymbol
                - transactionType
                - blockchainSymbol
                - fiatCurrency
              x-readme-ref-name: CreatePartnerQuoteBody
      responses:
        '201':
          description: >-
            Quote created successfully. Returns the locked quote with amounts,
            rate and expiration.
          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
                      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'
                      forwardingDays:
                        type: number
                        description: >-
                          Number of T+N forwarding days for settlement (0-4).
                          Only for MXN OTC transactions.
                        example: 2
                      effectiveForwardingDays:
                        type: number
                        description: >-
                          Effective forwarding days for settlement (may differ
                          from requested due to holidays/weekends).
                        example: 4
                      forwardingSettlementDate:
                        format: date-time
                        type: string
                        description: >-
                          Calculated settlement date based on effective
                          forwarding days offset.
                        example: '2026-03-14T03:25:27.495Z'
                    required:
                      - fiatAmount
                      - fiatCurrency
                      - blockchainSymbol
                      - tokenSymbol
                      - transactionType
                      - cryptoAmount
                      - rate
                      - flow
                      - quoteId
                      - expiresAt
                    x-readme-ref-name: CreatePartnerQuoteResponse
              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
                  quoteId: 123e4567-e89b-12d3-a456-426614174000
                  expiresAt: '2025-01-01T00:00:00.000Z'
                  forwardingDays: 2
                  effectiveForwardingDays: 4
                  forwardingSettlementDate: '2026-03-14T03:25:27.495Z'
        '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}
        '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.

````