Skip to main content
Complete API reference for Onramp and Offramp integration.
Security Requirements: Your backend API that generates session tokens must implement proper security measures. See Security Requirements for complete implementation guidance.

Shared APIs

These APIs are used by both Onramp and Offramp.

Session Token API

Create secure, single-use session tokens for both Onramp and Offramp. Endpoint: POST https://api.developer.coinbase.com/onramp/v1/token

Request Parameters

NameTypeRequiredDescription
addressesAddress[]YesList of wallet addresses. Each entry contains an address and supported blockchains.
clientIpStringYesThe end user’s IP address. Required for security validation. Do not trust X-Forwarded-For headers.
assetsString[]NoList of asset symbols (e.g., “ETH”, “BTC”) or UUIDs to filter available options.

Address Object

ParameterRequiredTypeDescription
addressYesStringDestination wallet address
blockchainsYesString[]Networks enabled for this address (e.g., “ethereum”, “base”, “solana”, “polygon”)

Response

FieldDescription
tokenSingle-use session token (expires after 5 minutes)
channel_idReserved for future use

Example

cdpcurl -X POST 'https://api.developer.coinbase.com/onramp/v1/token' \
  -k ~/Downloads/cdp_api_key.json \
  -d '{
    "addresses": [{
      "address": "0x1234567890abcdef1234567890abcdef12345678",
      "blockchains": ["base", "ethereum"]
    }],
    "clientIp": "192.0.2.1"
  }'
Response:
{
  "token": "abc123xyz789",
  "channel_id": ""
}

Transaction Status API

Track Onramp and Offramp transactions in real-time. Onramp Transactions:
GET https://api.developer.coinbase.com/onramp/v1/buy/user/{partnerUserRef}/transactions
Offramp Transactions:
GET https://api.developer.coinbase.com/onramp/v1/sell/user/{partnerUserRef}/transactions

Query Parameters

NameTypeDescription
pageKeyStringPagination key from previous response
pageSizeNumberNumber of transactions to return (1-1000)
See Transaction Status for detailed response schemas.

Rate Limits

Buy Quote API and Sell Quote API are rate limited to 10 requests per second per app ID. Rate limit exceeded responses return HTTP 429 with rate_limit_exceeded error.

Onramp

Reference documentation specific to Onramp (buying crypto with fiat).

Onramp URL Parameters

Format: https://pay.coinbase.com/buy/select-asset?sessionToken=<token>
ParameterRequiredTypeDescription
sessionTokenYesStringToken from Session Token API
partnerUserRefNoStringUnique user identifier for tracking transactions (max 50 chars)
redirectUrlNoStringURL to redirect after purchase completion
defaultNetworkNoStringDefault network when multiple options available
defaultAssetNoStringDefault asset when multiple options available
presetCryptoAmountNoNumberPreset crypto amount
presetFiatAmountNoNumberPreset fiat amount (USD, CAD, GBP, EUR only)
defaultExperienceNoStringEither “send” (transfer from Coinbase) or “buy” (purchase)
defaultPaymentMethodNoStringDefault payment method
fiatCurrencyNoStringFiat currency (e.g., USD, CAD, GBP)

Example

https://pay.coinbase.com/buy/select-asset?sessionToken=abc123&partnerUserRef=user-789&redirectUrl=https://yourapp.com

Buy Quote API

Get a quote for purchasing crypto with fiat. Endpoint: POST https://api.developer.coinbase.com/onramp/v1/buy/quote

Request Parameters

NameTypeRequiredDescription
purchase_currencyStringYesCrypto asset to purchase
payment_amountStringYesFiat amount to spend (e.g., “100.00”)
payment_currencyStringYesFiat currency (e.g., “USD”)
payment_methodStringYesPayment method type
countryStringYesISO 3166-1 country code (e.g., “US”)
purchase_networkStringNoNetwork for purchase (e.g., “base”, “ethereum”)
subdivisionStringNoISO 3166-2 state code (required for US, e.g., “NY”)

Payment Methods

CARD, ACH_BANK_ACCOUNT, APPLE_PAY, FIAT_WALLET, CRYPTO_ACCOUNT, GUEST_CHECKOUT_CARD, PAYPAL, RTP, GUEST_CHECKOUT_APPLE_PAY

Buy Config & Options

Get supported countries, currencies, and assets for Onramp.
  • Buy Config: GET https://api.developer.coinbase.com/onramp/v1/buy/config
  • Buy Options: GET https://api.developer.coinbase.com/onramp/v1/buy/options?country=<code>&subdivision=<code>

Offramp

Reference documentation specific to Offramp (selling crypto for fiat).

Offramp URL Parameters

Format: https://pay.coinbase.com/v3/sell/input?sessionToken=<token>&partnerUserRef=<id>&redirectUrl=<url>
ParameterRequiredTypeDescription
sessionTokenYesStringToken from Session Token API
partnerUserRefYesStringUnique user identifier (max 50 chars)
redirectUrlYesStringURL to redirect after cash out. Must be in domain allowlist for production.
defaultNetworkNoStringDefault network when multiple options available
defaultAssetNoStringDefault asset when multiple options available
presetCryptoAmountNoNumberPreset crypto amount
presetFiatAmountNoNumberPreset fiat amount (USD, CAD, GBP, EUR only)
defaultCashoutMethodNoStringDefault payment method: “FIAT_WALLET”, “CRYPTO_ACCOUNT”, “ACH_BANK_ACCOUNT”, “PAYPAL”
fiatCurrencyNoStringFiat currency (e.g., USD, CAD, GBP)
disableEditNoBooleanPrevents users from editing order in One-Click Sell flow (default: false)

Example

https://pay.coinbase.com/v3/sell/input?sessionToken=abc123&partnerUserRef=user-789&redirectUrl=https://yourapp.com
Production redirectUrl values must be added to your domain allowlist. See Security Requirements.

Sell Quote API

Get a quote for selling crypto to fiat. Endpoint: POST https://api.developer.coinbase.com/onramp/v1/sell/quote

Request Parameters

NameTypeRequiredDescription
sell_currencyStringYesCrypto asset to sell
sell_amountStringYesCrypto amount to sell
sell_networkStringYesNetwork of the asset (e.g., “ethereum”)
cashout_currencyStringYesFiat currency to receive (e.g., “USD”)
payment_methodStringYesCashout method
countryStringYesISO 3166-1 country code
subdivisionStringNoISO 3166-2 state code (required for US)
Include source_address, redirect_url, and partner_user_ref to receive a ready-to-use offramp_url in the response.

Sell Config & Options

Get supported countries, currencies, and assets for Offramp.
  • Sell Config: GET https://api.developer.coinbase.com/onramp/v1/sell/config
  • Sell Options: GET https://api.developer.coinbase.com/onramp/v1/sell/options?country=<code>&subdivision=<code>