---
title: "Generate a Coinbase onramp buy URL"
method: POST
path: "/sdk/{environmentId}/onramps/coinbase/buy"
tags: ["SDK"]
---

# Generate a Coinbase onramp buy URL

`POST /sdk/{environmentId}/onramps/coinbase/buy`

## Path parameters

- `environmentId` string, required

## Request body

- CoinbaseOnrampGetBuyUrlRequest
  - `assets` NonEmptyStringWith50MaxLength[]
  - `defaultNetwork` string
  - `defaultAsset` string
  - `defaultExperience` 'buy' | 'send' — Default visual experience. Either transfer funds from Coinbase (send) or buy assets (buy)
  - `defaultPaymentMethod` string
  - `destinationAddress` string, required — Valid blockchain wallet address, must be an alphanumeric string without any special characters
  - `fiatCurrency` string
  - `handlingRequestedUrls` boolean — Prevents the widget from opening URLs directly & relies on onRequestedUrl entirely for opening links
  - `networks` NonEmptyStringWith50MaxLength[], required
  - `partnerUserRef` string
  - `presetCryptoAmount` string — Digits with optional decimal part
  - `presetFiatAmount` string — Digits with optional decimal part
  - `redirectUrl` string

## Response `200`

Successfully generated a Coinbase onramp buy URL

- CoinbaseOnrampGetBuyUrlResponse
  - `url` string, required — The URL to the hosted widget the user should be redirected to.

## Other responses

- `400` — Bad Request
- `500` — Internal Server Error

---

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