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

# Create quote

> Create a quote



## OpenAPI

````yaml https://api.fernhq.com/json post /quotes
openapi: 3.1.1
info:
  title: Fern Developer API
  description: >-
    Fern is a seamless currency conversion and payments API that enables
    developers to integrate onramps, offramps, and third-party fiat/crypto
    payments into their applications. 


    Fern works with licensed liquidity providers and financial institutions to
    offer global currency support in one standardized API. 
  termsOfService: https://fernhq.com/terms
  version: 1.0.0
  contact:
    name: Fern API Support
    url: https://support.fernhq.com
    email: support@fernhq.com
servers:
  - url: https://api.fernhq.com
    description: API Server
security:
  - bearerAuth: []
tags:
  - name: Customers
    description: >-
      Use Customers API to create a customer, update their details, and get
      their details.
  - name: Payment Accounts
    description: >-
      Use Payment Accounts API to add, update and get bank accounts for an
      existing customer. Currently, only USD bank accounts with domestic
      ACH/wire routing numbers are supported.
  - name: Quotes
    description: >-
      Use Quotes API to create and fetch quotes for transactions. Currently,
      onramp and offramp transaction types are supported and will be inferred
      from the source and destination. 


      Before you can create a transaction, you must create a quote. Quotes
      enable you to specify important information about the transaction, such as
      the source and destination currencies and accounts and your developer
      fees. Quotes also provide useful information that you can use to display
      in your application, such as exchange rates and total fees. 


      - **Quotes expire after 5 minutes** 

      - You must create a quote before you create a transaction, and you will
      use the quote ID when creating a transaction. 

      - Quotes can only be created for verified customers. /n- Once you create a
      transaction with a quote, that quote can no longer be used. To generate a
      new transaction, you will have to create a new quote.
  - name: Transactions
    description: >-
      Use Transactions API to create and get transactions for a customer and a
      quote. Requires the creation of a quote beforehand per transaction.
  - name: Automation Rules
    description: >-
      Use Automation Rules API to create and manage automation rules for a
      customer.
  - name: Webhooks
    description: >-
      Use Webhooks API to manage webhook endpoints and view recent webhook
      deliveries.
paths:
  /quotes:
    post:
      tags:
        - Quotes
      summary: Create quote
      description: Create a quote
      operationId: createQuote
      requestBody:
        content:
          application/json:
            schema:
              type: object
              properties:
                customerId:
                  format: uuid
                  type: string
                  description: >-
                    A unique identifier for the customer initiating the
                    transaction.
                  example: 03b7030f-6da1-4d76-9352-cdebd82112c8
                source:
                  type: object
                  properties:
                    sourcePaymentAccountId:
                      format: uuid
                      type: string
                      description: The sending Payment Account Id.
                      example: 072a8b7b-38c7-429a-a6cf-35dae7f2fb77
                    sourceCurrency:
                      type: string
                      description: Currency label or contract address.
                      example: USD
                    sourcePaymentMethod:
                      title: Source Payment Method Schema
                      description: The payment method for the source transaction
                      anyOf:
                        - enum:
                            - ACH
                            - WIRE
                            - SEPA
                            - AE_UAEFTS
                            - AR_TRANSFERS_3
                            - AU_BECS
                            - BD_BEFTN
                            - BO_RTGS
                            - BR_TED_DOC_PIX
                            - CA_INTERAC
                            - CL_TEF
                            - CN_CNAPS
                            - CO_ACH
                            - CR_SINPE
                            - CZ_CERTIS
                            - DK_NEMKONTO_FI
                            - DO_ACH
                            - EC_LOCAL
                            - EG_RTGS_IPN
                            - GB_BACS_CHAPS_FPS
                            - GH_GHIPSS
                            - GT_ACH
                            - HK_HKICL_CHATS_ECG
                            - HU_GIRO
                            - ID_SKN_RTGS
                            - IL_ZAHAV
                            - IN_NEFT_RTGS_IMPS
                            - JM_LOCAL
                            - JO_ACH
                            - JP_ZENGIN
                            - KE_KIBBS_PESALINK
                            - KR_LOCAL
                            - LK_LOCAL
                            - MX_SPEI
                            - MY_IBG_RENTAS
                            - NG_NIBSS_NEFT
                            - NO_NICS
                            - NP_LOCAL
                            - NZ_LOCAL
                            - PE_CCE
                            - PH_INSTAPAY_PESONET
                            - PK_RAAST_IBFT
                            - PL_ELIXIR_BLUE_CASH
                            - QA_QPS
                            - RO_RTGS
                            - SA_MADA
                            - SE_BANKGIROT
                            - SG_FAST_MEPS
                            - SV_LOCAL
                            - SWIFT
                            - TH_BAHTNET_PROMPTPAY
                            - TR_FAST_EFT
                            - TZ_RTGS
                            - VN_IBPS
                            - ZA_RTGS_EFT
                            - ACH_SAME_DAY
                          title: Fiat Payment Method
                          description: The payment method for the source funds (fiat)
                          type: string
                        - enum:
                            - ARBITRUM
                            - BASE
                            - ETHEREUM
                            - OPTIMISM
                            - POLYGON
                            - SOLANA
                          title: Crypto Payment Method
                          description: The payment method for the source funds (crypto)
                          type: string
                      example: ACH
                    sourceAmount:
                      type: string
                      description: Amount of source currency to be converted
                      example: '100'
                  required:
                    - sourceCurrency
                    - sourcePaymentMethod
                    - sourceAmount
                destination:
                  type: object
                  properties:
                    destinationPaymentAccountId:
                      format: uuid
                      type: string
                      description: The receiving Payment Account Id.
                      example: 072a8b7b-38c7-429a-a6cf-35dae7f2fb77
                    destinationPaymentMethod:
                      title: Destination Payment Method Schema
                      description: The payment method for the destination transaction
                      anyOf:
                        - enum:
                            - ACH
                            - WIRE
                            - SEPA
                            - AE_UAEFTS
                            - AR_TRANSFERS_3
                            - AU_BECS
                            - BD_BEFTN
                            - BO_RTGS
                            - BR_TED_DOC_PIX
                            - CA_INTERAC
                            - CL_TEF
                            - CN_CNAPS
                            - CO_ACH
                            - CR_SINPE
                            - CZ_CERTIS
                            - DK_NEMKONTO_FI
                            - DO_ACH
                            - EC_LOCAL
                            - EG_RTGS_IPN
                            - GB_BACS_CHAPS_FPS
                            - GH_GHIPSS
                            - GT_ACH
                            - HK_HKICL_CHATS_ECG
                            - HU_GIRO
                            - ID_SKN_RTGS
                            - IL_ZAHAV
                            - IN_NEFT_RTGS_IMPS
                            - JM_LOCAL
                            - JO_ACH
                            - JP_ZENGIN
                            - KE_KIBBS_PESALINK
                            - KR_LOCAL
                            - LK_LOCAL
                            - MX_SPEI
                            - MY_IBG_RENTAS
                            - NG_NIBSS_NEFT
                            - NO_NICS
                            - NP_LOCAL
                            - NZ_LOCAL
                            - PE_CCE
                            - PH_INSTAPAY_PESONET
                            - PK_RAAST_IBFT
                            - PL_ELIXIR_BLUE_CASH
                            - QA_QPS
                            - RO_RTGS
                            - SA_MADA
                            - SE_BANKGIROT
                            - SG_FAST_MEPS
                            - SV_LOCAL
                            - SWIFT
                            - TH_BAHTNET_PROMPTPAY
                            - TR_FAST_EFT
                            - TZ_RTGS
                            - VN_IBPS
                            - ZA_RTGS_EFT
                            - ACH_SAME_DAY
                          title: Fiat Payment Method
                          description: The payment method for the source funds (fiat)
                          type: string
                        - enum:
                            - ARBITRUM
                            - BASE
                            - ETHEREUM
                            - OPTIMISM
                            - POLYGON
                            - SOLANA
                          title: Crypto Payment Method
                          description: The payment method for the source funds (crypto)
                          type: string
                      example: ETHEREUM
                    destinationCurrency:
                      type: string
                      description: Currency label or contract address.
                      example: USD
                  required:
                    - destinationPaymentAccountId
                    - destinationPaymentMethod
                    - destinationCurrency
                developerFee:
                  type: object
                  properties:
                    developerFeeType:
                      type: string
                      description: The Developer Fee type
                      enum:
                        - USD
                        - SOURCE_CURRENCY
                    developerFeeAmount:
                      type: string
                      description: Amount of this fee that was applied
                      example: '5.45'
                  required:
                    - developerFeeType
                    - developerFeeAmount
                  additionalProperties: false
                  title: Developer Fees Schema
                  description: >-
                    The fee amount you would like Fern to deduct from the
                    transaction. For Builder tier, developer fee must be greater
                    than or equal to the fernFee.
                guaranteeQuote:
                  type: boolean
                  description: >-
                    When enabled guarantees that the exact destination amount
                    from the quote will be received
              required:
                - customerId
                - source
                - destination
              additionalProperties: false
              title: Create Quote Request Schema
              description: >-
                Get a proposed price for your specified currency route (price
                guaranteed for 5 mins)
        required: true
        description: >-
          Get a proposed price for your specified currency route (price
          guaranteed for 5 mins)
      responses:
        '201':
          description: >-
            Response containing quote details including exchange rate, fees, and
            expiration
          content:
            application/json:
              schema:
                type: object
                properties:
                  quoteId:
                    format: uuid
                    type: string
                    description: Unique identifier for this quote
                    example: quote_abc123
                  expiresAt:
                    format: date-time
                    type: string
                    description: >-
                      ISO timestamp when this quote expires (5 minutes from
                      creation)
                    example: '2025-03-20T12:24:49.717Z'
                  estimatedExchangeRate:
                    type: string
                    description: >-
                      The rate at which the source currency is multiplied to
                      determine the equivalent amount in the destination
                      currency
                    example: '1.2'
                  destinationAmount:
                    type: string
                    description: The amount that will be received after conversion and fees
                    example: '100'
                  fees:
                    $ref: '#/components/schemas/FeesSchema'
                required:
                  - quoteId
                  - expiresAt
                  - estimatedExchangeRate
                  - destinationAmount
                  - fees
                additionalProperties: false
                title: Quote Response Schema
                description: >-
                  Response containing quote details including exchange rate,
                  fees, and expiration
        '400':
          description: Bad Request
          content:
            application/json:
              schema:
                description: Bad Request
                type: object
                properties:
                  message:
                    type: string
                    description: Human-readable error message
                    example: Invalid input provided
                  code:
                    type: string
                    description: Error code for programmatic handling
                    example: VALIDATION_ERROR
                  details:
                    description: Additional error context
                required:
                  - message
                additionalProperties: false
              examples:
                example1:
                  value:
                    code: BAD_REQUEST
                    message: ''
                    statusCode: 400
                example2:
                  value:
                    code: VALIDATION_ERROR
                    message: Invalid body data
                    details:
                      - path: []
                        message: ''
                        location: body
                    statusCode: 400
        '401':
          description: Unauthorized
          content:
            application/json:
              schema:
                description: Unauthorized
                type: object
                properties:
                  message:
                    type: string
                    description: Human-readable error message
                    example: Invalid input provided
                  code:
                    type: string
                    description: Error code for programmatic handling
                    example: VALIDATION_ERROR
                  details:
                    description: Additional error context
                required:
                  - message
                additionalProperties: false
              example:
                code: UNAUTHORIZED
                message: Missing API Key
                statusCode: 401
        '403':
          description: Forbidden
          content:
            application/json:
              schema:
                description: Forbidden
                type: object
                properties:
                  message:
                    type: string
                    description: Human-readable error message
                    example: Invalid input provided
                  code:
                    type: string
                    description: Error code for programmatic handling
                    example: VALIDATION_ERROR
                  details:
                    description: Additional error context
                required:
                  - message
                additionalProperties: false
              example:
                code: FORBIDDEN
                message: ''
                statusCode: 403
        '404':
          description: Not Found
          content:
            application/json:
              schema:
                description: Not Found
                type: object
                properties:
                  message:
                    type: string
                    description: Human-readable error message
                    example: Invalid input provided
                  code:
                    type: string
                    description: Error code for programmatic handling
                    example: VALIDATION_ERROR
                  details:
                    description: Additional error context
                required:
                  - message
                additionalProperties: false
              example:
                code: NOT_FOUND
                message: >-
                  Customer not found with id
                  9eb88b00-f04f-409b-9df7-7dcc9003bc35
                statusCode: 404
        '500':
          description: Internal Server Error
          content:
            application/json:
              schema:
                description: Internal Server Error
                type: object
                properties:
                  message:
                    type: string
                    description: Human-readable error message
                    example: Invalid input provided
                  code:
                    type: string
                    description: Error code for programmatic handling
                    example: VALIDATION_ERROR
                  details:
                    description: Additional error context
                required:
                  - message
                additionalProperties: false
              example:
                code: INTERNAL_SERVER_ERROR
                message: INTERNAL_SERVER_ERROR
                statusCode: 500
components:
  schemas:
    FeesSchema:
      type: object
      properties:
        feeCurrency:
          $ref: '#/components/schemas/CurrencySchema'
        fernFee:
          $ref: '#/components/schemas/FeeSchema'
        developerFee:
          $ref: '#/components/schemas/FeeSchema'
      required:
        - feeCurrency
        - fernFee
        - developerFee
      additionalProperties: false
      title: Fees Schema
      description: Fee structure for a transaction
    CurrencySchema:
      title: Currency Schema
      description: Schema representing either a fiat or crypto currency
      anyOf:
        - type: object
          properties:
            label:
              type: string
            chain:
              enum:
                - ARBITRUM
                - BASE
                - ETHEREUM
                - OPTIMISM
                - POLYGON
                - SOLANA
              title: Crypto Chain
              description: The chain the crypto currency is on
              type: string
            contractAddress:
              type: string
            currencyDecimals:
              type: number
          required:
            - label
        - type: object
          properties:
            label:
              type: string
          required:
            - label
      example:
        label: USDC
        chain: ETHEREUM
        contractAddress: '0x123456789abcd123456789abcd123456789abcd'
        currencyDecimals: 18
    FeeSchema:
      title: Fee Schema
      description: Fee Amount in USD and in the fee currency
      type: object
      properties:
        feeAmount:
          type: string
          title: Fee Amount Schema
          description: Amount of this fee that was applied
          example: '5.45'
        feeUSDAmount:
          type: string
          title: Fee USD Amount Schema
          description: Amount of this fee that was applied in USD
          example: '5.45'
      required:
        - feeAmount
        - feeUSDAmount
      additionalProperties: false
  securitySchemes:
    bearerAuth:
      type: http
      scheme: bearer
      bearerFormat: API Key
      description: To authenticate server-side requests

````