Offramp Quote

The Offramp Quote API provides clients with a quote based on the asset the user would like to sell, the network of the asset is on, the crypto amount of the asset, the cashout fiat currency, the payment method, and country of the user.

Limitations

The quote provided by this API is an estimate only. It does not guarantee that the user will be able to complete their purchase using the returned quote. Depending on fluctuations in exchange rates, the actual fees charged may be different.

Full API endpoint list

For a complete list of all API endpoints supported by Onramp/Offramp, visit our API Reference section.

Method

POST

URL

https://api.developer.coinbase.com/onramp/v1/sell/quote

Request Parameters

The Offramp Quote API is an RPC endpoint that accepts parameters as JSON in the request body.

NameTypeReqDescription
sell_currencyYID of the crypto asset the user wants to offramp. Retrieved from the Offramp Options API.
sell_networkNName of the network that the sell currency is on. Retrieved from the Offramp Options API. If omitted, the default network for the crypto currency is used.
sell_amountStringYCrypto amount the user wants to offramp, exclusive of network fees
cashout_currencyStringYFiat currency of the cashout amount, e.g., USD.
payment_methodYID of payment method used to cashout the sell. Retrieved from the options API.
countryYISO 3166-1 two-digit country code string representing the user’s country of residence, e.g., US.
subdivisionNISO 3166-2 two-digit country subdivision code representing the user’s subdivision of residence within their country, e.g. NY. Required if the country=“US” because certain states (e.g., NY) have state specific asset restrictions.

Response Fields

The Offramp Quote API returns a JSON response including the following fields.

NameDescription
cashout_totalObject with amount and currency of the fiat amount of crypto asset to be received, fees deducted. The currency will match the cashout_currency in the request if it is supported, otherwise it falls back to USD.
cashout_subtotalObject with amount and currency of the total fiat cost of the crypto asset, fees not deducted. The currency will match the cashout_currency.
sell_amountObject with amount and currency of the crypto that to be sold. The currency will match the sell_currency in the request. The number of decimals will be based on the crypto asset.
coinbase_feeObject with amount and currency of the fee changed by the Coinbase exchange to complete the transaction. The currency will match the cashout_currency.
quote_idReference to the quote that should be passed into the initialization parameters when launching the Coinbase Onramp widget via the SDK or URL generator.

Creating a One-Click-Buy URL with the Quote

To create an Onramp link with all inputs pre-filled that takes users straight to the final order preview screen, please go to our One-click-buy URL section for information.

Example Request/Response

cdpcurl -X POST 'https://api.developer.coinbase.com/onramp/v1/sell/quote' \
  -k /tmp/cdp_api_key.json \
  -d '{"sell_currency": "BTC", "sell_amount": "0.01", "cashout_currency": "USD", "payment_method": "FIAT_WALLET", "country": "US", "subdivision": "NY"}'