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

# Get Real-time Buy quote

> Get detailed real-time quote based on the provided currency code, base amount, your extra fee percentage, payment method, and the inclusion of the fees.




## OpenAPI

````yaml GET /v3/currencies/{currencyCode}/buy_quote
openapi: 3.0.0
info:
  title: Ramps & Swaps
  version: 1.0.0
servers:
  - url: https://api.moonpay.com
security: []
tags:
  - name: Account details
    description: >-
      Get your account details, including the verification status and the
      current fees.
  - name: On-ramp
    description: Get quotes and transaction details for buying cryptocurrencies.
  - name: Off-ramp
    description: Get quotes and transaction details for selling cryptocurrencies.
  - name: Swaps
    description: Get quotes and transaction details for swapping cryptocurrencies.
  - name: Data
    description: >-
      Get currently supported countries, currencies, and payment methods. Also
      check the customers's IP address restrictions.
  - name: DefiToken
    description: Retrieve token data and token lists for DeFi assets.
paths:
  /v3/currencies/{currencyCode}/buy_quote:
    get:
      tags:
        - On-ramp
      summary: Get Real-time Buy quote
      description: >
        Get detailed real-time quote based on the provided currency code, base
        amount, your extra fee percentage, payment method, and the inclusion of
        the fees.
      operationId: getBuyQuote
      parameters:
        - name: currencyCode
          in: path
          schema:
            type: string
          example: eth
          description: >-
            The code of the cryptocurrency of interest from <a
            href="/reference/getcurrencies">the currencies list</a> with
            `type=crypto`
          required: true
        - name: query
          in: query
          style: form
          explode: true
          required: true
          schema:
            type: object
            properties:
              baseCurrencyCode:
                type: string
                example: usd
                description: >-
                  The code of the base currency used for the transaction from <a
                  href="/reference/getcurrencies">the currencies list</a> with
                  `type=fiat`
              quoteCurrencyAmount:
                type: number
                example: 3
                description: >-
                  A positive number representing how much crypto the customer
                  wants to buy. Best used together with the `currencyCode`
                  parameter. Note that if you pass both `baseCurrencyAmount` and
                  `quoteCurrencyAmount`, the quote currency amount will take
                  precedence. REQUIRED if `baseCurrencyAmount` is not provided.
              baseCurrencyAmount:
                type: number
                example: 200
                description: >-
                  A positive number representing how much fiat the user wants to
                  spend. Note that if you give us a `baseCurrencyAmount` that is
                  lower than the currency's minimum amount, we will return a
                  quote based on the currency's minimum amount instead. REQUIRED
                  if `quoteCurrencyAmount` is not provided.
              extraFeePercentage:
                type: integer
                example: 1
                description: >-
                  A positive integer representing your extra fee percentage for
                  the transaction. The minimum is <span class="value">0</span>
                  and the maximum is <span class="value">10</span>. If you don't
                  provide it, we'll use the default value set to your account.
              paymentMethod:
                $ref: '#/components/schemas/PaymentMethods'
              areFeesIncluded:
                type: boolean
                example: false
                description: >-
                  A boolean indicating whether `baseCurrencyAmount` should
                  include extra fees. Defaults to <span
                  class="value">false</span>.
              walletAddress:
                type: string
                example: '0xd75233704795206de38Cc58B77a1f660B5C60896'
                description: Wallet address of the customer who requested the quote
      responses:
        '200':
          description: Successful response — Buy Quote
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/BuyQuote'
        '401':
          description: Unauthorized
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Error'
      security:
        - apiKey: []
components:
  schemas:
    PaymentMethods:
      type: string
      example: credit_debit_card
      enum:
        - ach_bank_transfer
        - credit_debit_card
        - paypal
        - gbp_bank_transfer
        - gbp_open_banking_payment
        - pix_instant_payment
        - sepa_bank_transfer
      description: The transaction's payment method.
    BuyQuote:
      type: object
      properties:
        accountId:
          type: string
          description: ID of your business account
          example: 717a8a80-5c17-46f9-84f8-a5253c372f51
        baseCurrency:
          $ref: '#/components/schemas/FiatCurrency'
          description: The fiat currency the customer wants to use for the transaction.
        baseCurrencyCode:
          type: string
          example: usd
        baseCurrencyAmount:
          type: number
          description: >-
            A positive number representing how much the customer wants to spend.
            The minimum amount is 20.
          example: 288.37
        quoteCurrency:
          $ref: '#/components/schemas/CryptoCurrency'
          description: The cryptocurrency the customer wants to purchase.
        quoteCurrencyCode:
          type: string
          example: btc
        quoteCurrencyAmount:
          type: number
          example: 0.0055
          description: >-
            A positive number representing the amount of cryptocurrency the
            customer will receive. Set when the purchase of cryptocurrency has
            been executed.
        quoteCurrencyPrice:
          type: number
          example: 52474.5036
          description: The price of the crypto the customer will receive
        paymentMethod:
          $ref: '#/components/schemas/PaymentMethods'
        feeAmount:
          type: number
          example: 3.99
          description: A positive number representing the fee for the transaction.
        extraFeePercentage:
          type: number
          example: 0
        extraFeeAmount:
          type: number
          example: 0
        networkFeeAmount:
          type: number
          example: 7.64
          description: >-
            A positive number representing the network fee for the transaction.
            It is added to baseCurrencyAmount, feeAmount and extraFeeAmount when
            the customer's card is charged.
        networkFeeAmountNonRefundable:
          type: boolean
          example: false
        totalAmount:
          type: number
          example: 300
        externalId:
          type: string
          nullable: true
          example: null
        externalCustomerId:
          type: string
          nullable: true
          example: null
        signature:
          type: string
          nullable: true
          description: The signature for executing the quote for fixed flow
          example: really-long-string
        expiresIn:
          type: number
          nullable: true
          example: 1800
          description: The time in seconds until the quote expires.
        expiresAt:
          type: string
          nullable: true
          example: '2024-02-23T00:58:26.577Z'
          description: Time at which the quote expires. Returned as an ISO 8601 string.
    Error:
      type: object
      properties:
        message:
          type: string
          description: A descriptive error message.
        type:
          type: string
          description: An error type.
    FiatCurrency:
      type: object
      properties:
        id:
          type: string
          description: Unique identifier for the currency.
          example: 6f424585-8936-4eb1-b01e-443fb306d1f5
        createdAt:
          type: string
          description: >-
            Time at which the object was created. Returned as an ISO 8601
            string.
          example: '2019-05-17T18:24:45.206Z'
        updatedAt:
          type: string
          description: >-
            Time at which the object was last updated. Returned as an ISO 8601
            string.
          example: '2019-05-17T18:24:45.206Z'
        type:
          type: string
          enum:
            - fiat
          description: Always `fiat`
          example: fiat
        name:
          type: string
          description: The currency's name.
          example: Pound Sterling
        code:
          type: string
          description: The currency's code.
          example: gbp
        precision:
          type: number
          description: The currency's precision (number of digits after decimal point).
          example: 2
        minBuyAmount:
          type: number
          nullable: true
          description: >-
            Represents the minimum transaction buy amount when using this
            currency as a base currency.
          example: 30
        maxBuyAmount:
          type: number
          nullable: true
          description: >-
            Represents the maximum transaction buy amount when using this
            currency as a base currency.
          example: 9000
        isSellSupported:
          type: boolean
          description: Whether sales for this currency are supported.
          example: true
    CryptoCurrency:
      type: object
      properties:
        id:
          type: string
          description: Unique identifier for the currency.
          example: aaefa32f-161b-42c8-8115-debcbf3d6a2d
        createdAt:
          type: string
          description: >-
            Time at which the object was created. Returned as an ISO 8601
            string.
          example: '2019-05-17T18:24:45.206Z'
        updatedAt:
          type: string
          description: >-
            Time at which the object was last updated. Returned as an ISO 8601
            string.
          example: '2019-05-17T18:24:45.206Z'
        type:
          type: string
          enum:
            - crypto
          description: Always `crypto`
          example: crypto
        name:
          type: string
          description: The currency's name.
          example: USD Coin (ERC-20)
        code:
          type: string
          description: The currency's code.
          example: usdc
        precision:
          type: number
          description: The currency's precision (number of digits after decimal point).
          example: 2
        minBuyAmount:
          type: number
          nullable: true
          description: Represents the minimum amount of cryptocurrency you can buy.
          example: 30
        maxBuyAmount:
          type: number
          nullable: true
          description: Represents the maximum amount of cryptocurrency you can buy.
          example: 1000
        minSellAmount:
          type: number
          nullable: true
          description: The minimum amount of cryptocurrency you can sell.
          example: 15
        maxSellAmount:
          type: number
          nullable: true
          description: The maximum amount of cryptocurrency you can sell.
          example: 100000
        addressRegex:
          type: string
          description: >-
            A regular expression which you can test against your end user's
            wallet addresses.
          example: ^(0x)[0-9A-Fa-f]{40}$
        testnetAddressRegex:
          type: string
          description: >-
            A regular expression which you can test against your end user's
            testnet wallet addresses.
          example: ^(0x)[0-9A-Fa-f]{40}$
        supportsAddressTag:
          type: boolean
          description: Whether the currency supports address tags.
          example: false
        addressTagRegex:
          type: string
          nullable: true
          description: >-
            A regular expression which you can test against a wallet address
            tag. Defined only if the currency supports address tags.
          example: null
        supportsTestMode:
          type: boolean
          description: Whether the currency supports test mode.
          example: true
        isSuspended:
          type: boolean
          description: >-
            Whether purchases for this currency are suspended. If the currency
            is suspended, exchange rates may not be available and it is not
            possible to create a transaction with this currency.
          example: false
        isSupportedInUs:
          type: boolean
          description: Whether purchases for this currency are supported in the US.
          example: true
        isSellSupported:
          type: boolean
          description: Whether sales for this currency are supported.
          example: true
        notAllowedUSStates:
          type: array
          items:
            type: string
            enum:
              - AL
              - AK
              - AZ
              - AR
              - AS
              - CA
              - CO
              - CT
              - DC
              - DE
              - FL
              - GA
              - GU
              - HI
              - ID
              - IL
              - IN
              - IA
              - KS
              - KY
              - LA
              - MA
              - MD
              - ME
              - MI
              - MN
              - MO
              - MP
              - MS
              - MT
              - NE
              - NH
              - NV
              - NH
              - NJ
              - NM
              - NY
              - NC
              - ND
              - OH
              - OK
              - OR
              - PA
              - PR
              - RI
              - SC
              - SD
              - TN
              - TX
              - TT
              - UT
              - VT
              - VA
              - VI
              - WA
              - WV
              - WI
              - WY
          description: >-
            A list with all the US states for this currency that are not
            supported.
          example:
            - LA
            - VI
        notAllowedCountries:
          type: array
          items:
            type: string
          description: >-
            A list with all the ISO 3166-1 alpha-2 country codes for this
            currency that are not supported.
          example:
            - CA
        metadata:
          type: object
          description: Additional metadata for the currency.
          properties:
            contractAddress:
              type: string
              nullable: true
              description: >-
                Unique contract address where the token smart contract is
                hosted.
              example: 0
            chainId:
              type: string
              nullable: true
              description: ID used to identify different EVM compatible chains.
              example: '1'
            networkCode:
              type: string
              description: Name of the cryptocurrency
              example: ethereum
  securitySchemes:
    apiKey:
      type: apiKey
      name: apiKey
      in: query

````