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

# Create buy quote

> The Buy Quote API provides clients with a quote based on the asset the user would like to purchase, the network they want to receive it on, the fiat amount of the payment, the payment currency, the payment method, and country of the user.



## OpenAPI

````yaml POST /v1/buy/quote
openapi: 3.0.3
info:
  title: OnrampUnauthService API
  version: v1
servers:
  - url: https://api.developer.coinbase.com/onramp
security:
  - bearerAuth: []
tags:
  - name: Onramp/Offramp
paths:
  /v1/buy/quote:
    post:
      tags:
        - Onramp/Offramp
      summary: Create buy quote
      description: >-
        The Buy Quote API provides clients with a quote based on the asset the
        user would like to purchase, the network they want to receive it on, the
        fiat amount of the payment, the payment currency, the payment method,
        and country of the user.
      operationId: OnrampOfframp_CreateBuyQuote
      requestBody:
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/CreateBuyQuoteRequest'
        required: true
      responses:
        '200':
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/CreateBuyQuoteResponse'
          description: OK
        default:
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Status'
          description: Default error response
components:
  schemas:
    CreateBuyQuoteRequest:
      description: Create Buy Quote API request parameters
      properties:
        country:
          description: The ISO 3166-1 two letter country code e.g. `US`
          type: string
        paymentAmount:
          description: Amount of fiat to be converted to purchase_currency e.g. `100.00`
          type: string
        paymentCurrency:
          description: Fiat currency for payment_amount e.g. `USD`
          type: string
        paymentMethod:
          description: The type of payment method to be used to purchase
          enum:
            - UNSPECIFIED
            - CARD
            - ACH_BANK_ACCOUNT
            - APPLE_PAY
            - FIAT_WALLET
            - CRYPTO_ACCOUNT
            - GUEST_CHECKOUT_CARD
            - PAYPAL
            - RTP
            - GUEST_CHECKOUT_APPLE_PAY
          format: enum
          type: string
        purchaseCurrency:
          description: >-
            The ticker (e.g. `BTC`, `USDC`) or the UUID (e.g.
            `d85dce9b-5b73-5c3c-8978-522ce1d1c1b4`) of crypto asset to be
            purchased
          type: string
        purchaseNetwork:
          description: Network name to receive crypto on e.g. `ethereum`, `base`
          type: string
        subdivision:
          description: >-
            The ISO 3166-2 two letter state code e.g. `NY`, only required for
            `US`
          type: string
        destinationAddress:
          description: >-
            Destination Wallet address. Optional for creating buy quote.
            Required for generating a ready-to-use one-click-buy URL
          type: string
        clientIp:
          description: >-
            The client IP address of the end user. This parameter ensures the
            quote can only be used by the requesting user. **Do not trust HTTP
            headers** like `X-Forwarded-For` — these can be easily spoofed.
          type: string
      required:
        - purchaseCurrency
        - paymentAmount
        - paymentCurrency
        - paymentMethod
        - country
      type: object
    CreateBuyQuoteResponse:
      description: Create Buy Quote API response
      properties:
        coinbase_fee:
          $ref: '#/components/schemas/Amount'
        network_fee:
          $ref: '#/components/schemas/Amount'
        onramp_url:
          description: >-
            Ready-to-use one-click-buy URL. Only returned when
            `destination_address` is provided in the request
          type: string
        payment_subtotal:
          $ref: '#/components/schemas/Amount'
        payment_total:
          $ref: '#/components/schemas/Amount'
        purchase_amount:
          $ref: '#/components/schemas/Amount'
        quote_id:
          description: >-
            UUID that should be passed into the Onramp Widget URL as the
            `quoteId` query parameter
          type: string
      type: object
    Status:
      description: >-
        The `Status` type defines a logical error model that is suitable for
        different programming environments, including REST APIs and RPC APIs. It
        is used by [gRPC](https://github.com/grpc). Each `Status` message
        contains three pieces of data: error code, error message, and error
        details. You can find out more about this error model and how to work
        with it in the [API Design
        Guide](https://cloud.google.com/apis/design/errors).
      properties:
        code:
          description: >-
            The status code, which should be an enum value of
            [google.rpc.Code][google.rpc.Code].
          format: int32
          type: integer
        details:
          description: >-
            A list of messages that carry the error details.  There is a common
            set of message types for APIs to use.
          items:
            $ref: '#/components/schemas/GoogleProtobufAny'
          type: array
        message:
          description: >-
            A developer-facing error message, which should be in English. Any
            user-facing error message should be localized and sent in the
            [google.rpc.Status.details][google.rpc.Status.details] field, or
            localized by the client.
          type: string
      type: object
    Amount:
      description: A monetary amount represented by a decimal value and currency symbol
      properties:
        currency:
          description: Currency symbol e.g. `USD`, `BTC`
          type: string
        value:
          description: Non-localized amount in decimal notation (e.g. `1.234`)
          type: string
      type: object
    GoogleProtobufAny:
      additionalProperties: true
      description: >-
        Contains an arbitrary serialized message along with a @type that
        describes the type of the serialized message.
      properties:
        '@type':
          description: The type of the serialized message.
          type: string
      type: object
  securitySchemes:
    bearerAuth:
      bearerFormat: JWT
      description: >-
        Enter your JSON Web Token (JWT) here. Refer to the [Generate
        JWT](/api-reference/authentication#2-generate-jwt-server-only) section
        of our Authentication docs for information on how to generate your
        Bearer Token.
      scheme: bearer
      type: http

````