> ## Documentation Index
> Fetch the complete documentation index at: https://docs.cloud.coinbase.com/llms.txt
> Use this file to discover all available pages before exploring further.

# Generating an Onramp URL

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](https://docs.cdp.coinbase.com/get-started/authentication/jwt-authentication)

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](/api-reference/v2/authentication#generate-bearer-token-jwt-and-export) to make authenticated requests.
2. Generate a One Click Buy URL using the [Create Onramp Session API](https://docs.cdp.coinbase.com/api-reference/v2/rest-api/onramp/create-an-onramp-session)
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.

| Parameter               | Required | Type          | Description                                                                                                                                                                                     |
| :---------------------- | :------- | :------------ | :---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| `sessionToken`          | Yes      | String        | Token generated by the [Onramp Session Token API](#getting-a-session-token).                                                                                                                    |
| `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.                                                                                            |
| `defaultExperience`     | No       | 'send', 'buy' | Default visual experience: either (1) Transfer funds from Coinbase ('send') or (2) Buy assets ('buy')                                                                                           |
| `defaultPaymentMethod`  | No       | String        | Default payment method used to purchase the asset                                                                                                                                               |
| `fiatCurrency`          | No       | String        | e.g: USD, CAD, GBP, etc.                                                                                                                                                                        |
| `handlingRequestedUrls` | No       | Boolean       | Prevents the widget from opening URLs directly & relies on `onRequestedUrl` entirely for opening links                                                                                          |
| `partnerUserRef`        | No       | String        | Unique ID representing the end-user. Must be less than 50 chars. Use with the Transaction Status API to retrieve transactions made during the session.                                          |
| `redirectUrl`           | No       | String        | URL to redirect the user to when they successfully complete a transaction. Production URLs must be added to your domain allowlist (see [Security Requirements](/onramp/security-requirements)). |
