Skip to main content
Coinbase-hosted Onramp is accessed by creating and directing users to a URL with query parameters specific to their request. In your backend, generate a JWT, following the CDP authentication steps In your backend, generate a One Click Buy URL by doing the following:
  1. Generate a JWT to authenticate your requests. Follow the instructions here to make authenticated requests.
  2. Generate a One Click Buy URL using the Create Onramp Session API
  3. Pass this URL to your frontend to load the Onramp experience for the client.

Onramp URL parameters:

For reference, here is what all the query parameters do to configure the Onramp experience.
ParameterRequiredTypeDescription
sessionTokenYesStringToken generated by the Onramp Session Token API.
defaultNetworkNoStringDefault network that should be selected when multiple networks are present
defaultAssetNoStringDefault asset that should be selected when multiple assets are present
presetCryptoAmountNoNumberPreset crypto amount value
presetFiatAmountNoNumberPreset fiat amount value (for USD, CAD, GBP, EUR only). Ignored if presetCryptoAmount is also set.
defaultExperienceNo’send’, ‘buy’Default visual experience: either (1) Transfer funds from Coinbase (‘send’) or (2) Buy assets (‘buy’)
defaultPaymentMethodNoStringDefault payment method used to purchase the asset
fiatCurrencyNoStringe.g: USD, CAD, GBP, etc.
handlingRequestedUrlsNoBooleanPrevents the widget from opening URLs directly & relies on onRequestedUrl entirely for opening links
partnerUserRefNoStringUnique ID representing the end-user. Must be less than 50 chars. Use with the Transaction Status API to retrieve transactions made during the session.
redirectUrlNoStringURL to redirect the user to when they successfully complete a transaction.