Generating Offramp Quotes
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
URL
Request Parameters
The Offramp Quote API is an RPC endpoint that accepts parameters as JSON in the request body.
Name | Type | Req | Description |
---|---|---|---|
sell_currency | Y | ID of the crypto asset the user wants to offramp. Retrieved from the Offramp Options API. | |
sell_network | N | Name 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_amount | String | Y | Crypto amount the user wants to offramp, exclusive of network fees |
cashout_currency | String | Y | Fiat currency of the cashout amount, e.g., USD . |
payment_method | Y | ID of payment method used to cashout the sell. Retrieved from the options API. | |
country | Y | ISO 3166-1 two-digit country code string representing the user’s country of residence, e.g., US . | |
subdivision | N | ISO 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.
Name | Description |
---|---|
cashout_total | Object 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_subtotal | Object with amount and currency of the total fiat cost of the crypto asset, fees not deducted. The currency will match the cashout_currency . |
sell_amount | Object 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_fee | Object with amount and currency of the fee changed by the Coinbase exchange to complete the transaction. The currency will match the cashout_currency . |
quote_id | Reference 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.