---
title: "Generate a Coinbase onramp URL (Session Token flow)"
method: GET
path: "/v1/onramp/url"
tags: ["onramp"]
---

# Generate a Coinbase onramp URL (Session Token flow)

`GET /v1/onramp/url`

Generate a Coinbase hosted onramp URL for fiat-to-crypto funding.

**How it works:**
1. Creates a session token bound to user's Smart Account earnings wallet
2. Returns URL with session token embedded
3. User completes purchase in Coinbase UI
4. Funds are sent to user's Smart Account earnings wallet (non-custodial)
5. Frontend auto-transfers the settled amount to server (tipping) wallet

**ToS Compliance:** Fiat onramp funds must first go to a non-custodial wallet
(Smart Account earnings wallet) before being transferred to a custodial wallet (server/tipping).

**Response:** Returns `onramp_url` to redirect the user.

**Testing:** No E2E test - the onramp flow completes asynchronously in Coinbase's
hosted UI. URL generation is covered by unit tests.

See: https://docs.cdp.coinbase.com/onramp-&-offramp/onramp-apis/generating-onramp-url

## Query parameters

- `amount` string, required — Fiat amount to onramp in USD (e.g., '10.00').
- `payment_method` string — Payment method: CARD (default) or ACH_BANK_ACCOUNT.
- `network` string — Target blockchain network (e.g., base, base-sepolia, ethereum).
- `token` string — Token to purchase (e.g., USDC, ETH).

## Headers

- `authorization` string, nullable — Bearer JWT issued by Grove.

## Response `200`

Successful Response

- OnrampUrlResponse — Response model for Coinbase Onramp URL generation (Session Token flow). The session token embedded in the URL binds the user's Smart Account earnings wallet address, ensuring purchased crypto lands in the correct destination.
  - `onramp_url` string, required — Coinbase hosted onramp URL. Redirect user here to complete purchase. Contains session token bound to user's Smart Account earnings wallet.
  - `event_id` string, nullable — Onramp event ID for tracking settled amount and transfer idempotency.

## Other responses

- `422` — Validation Error

---

[API](https://skmtc.net/grove/apis/grove-api.md) · [All operations](https://skmtc.net/grove/apis/grove-api/llms.txt) · [OpenAPI document](https://skmtc-service-staging.skmtc.workers.dev/v1/apis/grove/grove-api/versions/f286b48a8105/schema)
