---
title: "Create an onramp session"
method: POST
path: "/v2/onramp/sessions"
tags: ["Onramp"]
---

# Create an onramp session

`POST /v2/onramp/sessions`

## Request

- Base URL: `https://api.cdp.coinbase.com/platform`
- URL: `https://api.cdp.coinbase.com/platform/v2/onramp/sessions`
- Auth: HTTP bearer

Returns a single-use URL for an Onramp session. This API provides flexible  functionality based on the parameters provided, supporting three cases:

**Important**: The returned URL is single-use only. Once a user visits the URL,  no one else can access it.
## Use Cases
### 1. Basic Session (Minimum Parameters)
**Required**: `destinationAddress`, `purchaseCurrency`, `destinationNetwork`

**Returns**: Basic single-use onramp URL. The `quote` object will not be included in the response.
### 2. One-Click Onramp URL
**Required**: Basic parameters + (`paymentAmount` OR `purchaseAmount`), `paymentCurrency`

**Returns**: One-click onramp URL for streamlined checkout. The `quote` object will not be included in the response.
### 3. One-Click Onramp URL with Quote
**Required**: One-Click Onramp parameters + `paymentMethod`, `country`, `subdivision`

**Returns**: Complete pricing quote and one-click onramp URL. Both `session` and `quote` objects will be included in the response.

**Note**: Only one of `paymentAmount` or `purchaseAmount` should be provided, not both. Providing both will result in an error. When `paymentAmount` is provided, the quote shows how much crypto the user will receive for the specified fiat amount (fee-inclusive). When `purchaseAmount` is provided, the quote shows how much fiat the user needs to pay for the specified crypto amount (fee-exclusive).

## Headers

- `X-Onramp-Partner-Id` string, uuid

## Request body

- OnrampSessionRequest: Common request parameters shared by [Create Onramp Session](#operation/createOnrampSession) and [Create Onramp Mobile Challenge](#operation/createOnrampMobileChallenge).
  - `purchaseCurrency` string, required: 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](https://docs.cdp.coinbase.com/api-reference/rest-api/onramp-offramp/get-buy-options) to discover the supported purchase currencies for your user's location.
  - `destinationNetwork` string, required: The name of the crypto network the purchased currency will be sent on. Use the [Onramp Buy Options API](https://docs.cdp.coinbase.com/api-reference/rest-api/onramp-offramp/get-buy-options) to discover the supported networks for your user's location.
  - `destinationAddress` string, required: The address the purchased crypto will be sent to.
  - `paymentAmount` string: A string representing the amount of fiat the user wishes to pay in exchange for crypto. When using this parameter, the returned quote will be inclusive of fees i.e. the user will pay this exact amount of the payment currency.
  - `purchaseAmount` string: A string representing the amount of crypto the user wishes to purchase. When using this parameter, the returned quote will be exclusive of fees i.e. the user will receive this exact amount of the purchase currency.
  - `paymentCurrency` string: The fiat currency to be converted to crypto.
  - `paymentMethod` 'CARD' | 'ACH' | 'APPLE_PAY' | 'GOOGLE_PAY' | 'PAYPAL' | 'FIAT_WALLET' | 'CRYPTO_WALLET': The type of payment method used to generate the onramp quote.
  - `country` string: The ISO 3166-1 two letter country code (e.g. US).
  - `subdivision` string: The ISO 3166-2 two letter state code (e.g. NY). Only required for US.
  - `redirectUrl` string, uri: URI to redirect the user to after they complete or dismiss the transaction. Embedded in the returned onramp URL as a query parameter.
  - `clientIp` string: The IP address of the end user requesting the onramp transaction.
  - `partnerUserRef` string: A unique string that represents the user in your app. This can be used to link individual transactions together so you can retrieve the transaction history for your users. Prefix this string with "sandbox-" (e.g. "sandbox-user-1234") to perform a sandbox transaction which will allow you to test your integration without any real transfer of funds. This value can be used with the [Onramp User Transactions API](https://docs.cdp.coinbase.com/api-reference/rest-api/onramp-offramp/get-onramp-transactions-by-id) to retrieve all transactions created by the user.

## Response `201`

Onramp session created successfully.

- object
  - `session` OnrampSession, required: An onramp session containing a ready-to-use onramp URL.
    - `onrampUrl` string, uri, required: Ready-to-use onramp URL.
  - `quote` OnrampQuote: Quote information with pricing details for the crypto purchase.
    - `paymentTotal` string, required: The total amount of fiat to be paid, inclusive of any fees.
    - `paymentSubtotal` string, required: The amount of fiat to be converted to crypto.
    - `paymentCurrency` string, required: The fiat currency to be converted to crypto.
    - `purchaseAmount` string, required: The amount of crypto to be purchased.
    - `purchaseCurrency` string, required: The crypto currency to be purchased.
    - `destinationNetwork` string, required: The network to send the crypto on.
    - `fees` OnrampOrderFee[], required: The fees associated with the quote.
      - `type` 'FEE_TYPE_NETWORK' | 'FEE_TYPE_EXCHANGE', required: The type of fee.
      - `amount` string, required: The amount of the fee.
      - `currency` string, required: The currency of the fee.
    - `exchangeRate` string, required: The exchange rate used to convert fiat to crypto i.e. the crypto value of one fiat.

## Other responses

- `400`: Invalid request.
- `401`: Unauthorized.
- `404`: Partner not found.
- `429`: Rate limit exceeded.
- `500`: Internal server error.

## Changes

- **2026-12-01** `06cb41a4fb57`: 5 warning, 1 info
  - added the new `policy_not_applicable` enum value to the `errorType` response property for the response status `400`
  - added the new `policy_not_applicable` enum value to the `errorType` response property for the response status `401`
  - added the new `policy_not_applicable` enum value to the `errorType` response property for the response status `404`
  - added the new `policy_not_applicable` enum value to the `errorType` response property for the response status `429`
  - …2 more
- **2026-10-16** `ff3c1fdef902`: 5 warning
  - added the new `entity_not_configured_for_top_up` enum value to the `errorType` response property for the response status `400`
  - added the new `entity_not_configured_for_top_up` enum value to the `errorType` response property for the response status `401`
  - added the new `entity_not_configured_for_top_up` enum value to the `errorType` response property for the response status `404`
  - added the new `entity_not_configured_for_top_up` enum value to the `errorType` response property for the response status `429`
  - …1 more
- …earlier changes not shown

[Operation history](https://skmtc.dev/coinbase/apis/coinbase-developer-platform-apis/changes/v2/onramp/sessions/post.md)

---

[API](https://skmtc.dev/coinbase/apis/coinbase-developer-platform-apis.md) - [All operations](https://skmtc.dev/coinbase/apis/coinbase-developer-platform-apis/llms.txt) - [OpenAPI document](https://skmtc.dev/coinbase/apis/coinbase-developer-platform-apis/revisions/06cb41a4fb57?raw)
