---
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`

## Request

- Base URL: `https://app.dynamicauth.com/api/v0`
- URL: `https://app.dynamicauth.com/api/v0/sdk/{environmentId}/onramps/coinbase/buy`
- Auth: none declared

## 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.dev/dynamic/apis/dashboard-api.md) - [All operations](https://skmtc.dev/dynamic/apis/dashboard-api/llms.txt) - [OpenAPI document](https://skmtc.dev/dynamic/apis/dashboard-api/revisions/95da47b93dbc?raw)
