Generating an Offramp URL
Coinbase Offramp is accessed by creating and directing users to a URL with query parameters specific to their request.
Example URL
Session tokens are now required and will be enforced starting 7/31/2025. The URL should look like this:
Offramp URL parameters
The following table outlines parameters to generate the Offramp URL
Parameter | Req’d | Type | Description |
---|---|---|---|
appId | Yes | String | The Project ID found on the project Dashboard. Not required if using sessionToken . |
addresses | Yes | Record<Address> | User address which cashout is being initiated from. Not required if using sessionToken . Referenced as from_address in Offramp Transaction Status API Addresses that the purchased crypto should be sent to. An object whose keys are addresses and values are arrays of networks each address supports. (e.g. addresses={"0x1":["base"]} ) |
redirectUrl | Yes | String | URL to redirect the user to send crypto to the destination after they send crypto. Add your redirectUrl in your onramp app domain allowlist on CDP portal and use Offramp Transaction Status API to fetch the send to_address details. |
partnerUserId | Yes | String | Unique ID representing the end-user. Must be less than 50 chars. Use with the Offramp Transaction Status API to retrieve transactions made during the session. |
sessionToken | Yes | String | Token generated by the Session Token API. Required if Require secure initialization is true which all apps must do by 7/31/2025. If sessionToken is included, appId and addresses parameters are not used. |
defaultNetwork | No | String | Default network that should be selected when multiple networks are present |
defaultAsset | No | String | Default asset that should be selected when multiple assets are present |
presetCryptoAmount | No | Number | Preset crypto amount value |
presetFiatAmount | No | Number | Preset fiat amount value (for USD, CAD, GBP, EUR only). Ignored if presetCryptoAmount is also set. |
defaultCashoutMethod | No | String | Default payment method to cashout fiat (“FIAT_WALLET”, “CRYPTO_ACCOUNT”, “ACH_BANK_ACCOUNT”, “PAYPAL”) |
fiatCurrency | No | String | e.g: USD, CAD, GBP, etc. |
disableEdit | No | Boolean | If set to true , prevents users from editing their order in the One-Click Sell flow. By default, this is set to false . |
All transactions made during the session are linked to partnerUserId
which can be used with the Transaction Status API to retrieve these transactions later.
Getting a Session Token
All apps must use session tokens starting 7/31/2025. Developers can create session token to securely authenticate users and manage sessions.
Authentication
To authenticate your requests to the Session Token API, you’ll need to:
- Create a CDP Secret API Key
- Follow the instructions for CDP API key authentication to make signed requests
Using the JWT token, you can make a request to the Session Token API to obtain a token, then pass that token as the sessionToken
query string parameter when generating Offramp URLs.
The token expires after a short period of time and can only be used once. A new token must be obtained for every new session.
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 Session Token API is an RPC endpoint that accepts parameters as JSON in the request body.
Name | Type | Req | Description |
---|---|---|---|
addresses | Address[] | Y | List of addresses that the purchased crypto should be sent to. Each entry in this array is an object containing an address and a list of blockchains the address supports. |
assets | String[] | N | List of assets that will be available for the user to buy/send. Assets can either be symbols e.g. “ETH” or “BTC”, or UUIDs retrieved from the Buy Options API. This optional parameter acts as a filter on the addresses parameter. If it is included then only the assets in this list that are available on one of the supported blockchains in the Addresses list will be available to the user. See the See the Buy Options API for the full list of assets. |
Address Parameters
An Address object accepts the following parameters:
Parameter | Req’d | Type | Description |
---|---|---|---|
address | Yes | String | Destination address where the purchased tokens will be sent. |
blockchains | Yes | String[] | List of blockchains enabled for the associated address. All tokens available per blockchain are displayed to the user. Available blockchains include: “ethereum”, “bitcoin”, “base”, “avachain”, “optimism”, “solana”, “polygon”, “arbitrum”, “stellar” and many more. See the Buy Options API for the full list. |
Response Fields
The Session Token API returns a JSON response including the following fields.
Name | Description |
---|---|
token | A unique string to be passed the URL as sessionToken parameter when manually generating a URL to initialize the onramp widget (the resulting URL will look like https://pay.coinbase.com/buy/select-asset?sessionToken=<token>&<other params> ). This token is associated with the parameters and App ID header provided in the request. This token can only be used once. |
channel_id | Not yet functional. Upcoming implementation: A socket.io channel ID that can be used to receive events from the Onramp API while the customer goes through the transaction flow. |