Authorizations
A JWT signed using your CDP API Key Secret, encoded in base64. Refer to the Generate Bearer Token section of our Authentication docs for information on how to generate your Bearer Token.
Body
The ticker (e.g. BTC
, USDC
, SOL
) or the Coinbase UUID (e.g. d85dce9b-5b73-5c3c-8978-522ce1d1c1b4
) of the crypto asset to be purchased.
Use the Onramp Buy Options API to discover the supported purchase currencies for your user's location.
"USDC"
The name of the crypto network the purchased currency will be sent on.
Use the Onramp Buy Options API to discover the supported networks for your user's location.
"base"
The address the purchased crypto will be sent to.
"0x71C7656EC7ab88b098defB751B7401B5f6d8976F"
A string representing the amount of fiat the user wishes to pay in exchange for crypto.
"100.00"
The fiat currency to be converted to crypto.
"USD"
The type of payment method used to generate the onramp quote.
CARD
, ACH
, APPLE_PAY
, PAYPAL
, FIAT_WALLET
, CRYPTO_WALLET
"CARD"
The ISO 3166-1 two letter country code (e.g. US).
"US"
The ISO 3166-2 two letter state code (e.g. NY). Only required for US.
"NY"
URL to redirect the user to when they successfully complete a transaction. This URL will be embedded in the returned onramp URL as a query parameter.
"https://yourapp.com/success"
The IP address of the end user requesting the onramp transaction.
"127.0.0.1"
Response
Onramp session created successfully.
An onramp session containing a ready-to-use onramp URL.
{
"onrampUrl": "https://pay.coinbase.com/buy?sessionToken=abc123F"
}
Quote information with pricing details for the crypto purchase.
{
"paymentTotal": "100.75",
"paymentSubtotal": "100.00",
"paymentCurrency": "USD",
"purchaseAmount": "100.000000",
"purchaseCurrency": "USDC",
"destinationNetwork": "base",
"fees": [
{
"type": "FEE_TYPE_EXCHANGE",
"amount": "0.5",
"currency": "USD"
},
{
"type": "FEE_TYPE_NETWORK",
"amount": "0.25",
"currency": "USD"
}
],
"exchangeRate": "1"
}