Skip to main content
POST
/
sdk
/
{environmentId}
/
onramps
/
coinbase
/
buy
Generate a Coinbase onramp buy URL
curl --request POST \
  --url https://app.dynamicauth.com/api/v0/sdk/{environmentId}/onramps/coinbase/buy \
  --header 'Authorization: Bearer <token>' \
  --header 'Content-Type: application/json' \
  --data '
{
  "destinationAddress": "0xbF394748301603f18d953C90F0b087CBEC0E1834",
  "networks": [
    "An example name"
  ],
  "assets": [
    "An example name"
  ],
  "defaultNetwork": "An example name",
  "defaultAsset": "An example name",
  "defaultExperience": "buy",
  "defaultPaymentMethod": "An example name",
  "fiatCurrency": "An example name",
  "handlingRequestedUrls": true,
  "partnerUserRef": "An example name",
  "presetCryptoAmount": "100.00",
  "presetFiatAmount": "100.00",
  "redirectUrl": "https://website-sample.com"
}
'
{
  "url": "<string>"
}

Authorizations

Authorization
string
header
required

Bearer authentication header of the form Bearer <token>, where <token> is your auth token.

Path Parameters

environmentId
string
required

ID of the environment

Required string length: 36
Pattern: ^[0-9a-f]{8}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{12}$
Example:

"95b11417-f18f-457f-8804-68e361f9164f"

Body

application/json

Coinbase onramp order data

destinationAddress
string
required

Valid blockchain wallet address, must be an alphanumeric string without any special characters

Maximum string length: 255
Pattern: ^[A-Za-z0-9]{18,100}$
Example:

"0xbF394748301603f18d953C90F0b087CBEC0E1834"

networks
string[]
required
Maximum string length: 50
Pattern: ^(?=\S)[\p{L}\p{N}a-zA-Z _.,:!?&%@\/+\-'|]+(?<=\S)$
assets
string[]
Maximum string length: 50
Pattern: ^(?=\S)[\p{L}\p{N}a-zA-Z _.,:!?&%@\/+\-'|]+(?<=\S)$
defaultNetwork
string
Maximum string length: 50
Pattern: ^(?=\S)[\p{L}\p{N}a-zA-Z _.,:!?&%@\/+\-'|]+(?<=\S)$
Example:

"An example name"

defaultAsset
string
Maximum string length: 50
Pattern: ^(?=\S)[\p{L}\p{N}a-zA-Z _.,:!?&%@\/+\-'|]+(?<=\S)$
Example:

"An example name"

defaultExperience
enum<string>

Default visual experience. Either transfer funds from Coinbase (send) or buy assets (buy)

Available options:
buy,
send
defaultPaymentMethod
string
Maximum string length: 50
Pattern: ^(?=\S)[\p{L}\p{N}a-zA-Z _.,:!?&%@\/+\-'|]+(?<=\S)$
Example:

"An example name"

fiatCurrency
string
Maximum string length: 50
Pattern: ^(?=\S)[\p{L}\p{N}a-zA-Z _.,:!?&%@\/+\-'|]+(?<=\S)$
Example:

"An example name"

handlingRequestedUrls
boolean

Prevents the widget from opening URLs directly & relies on onRequestedUrl entirely for opening links

partnerUserRef
string
Maximum string length: 255
Pattern: ^(?=\S)[\p{L}\p{N}a-zA-Z _.,:!?&%@\/+\-'|]+(?<=\S)$
Example:

"An example name"

presetCryptoAmount
string

Digits with optional decimal part

Pattern: ^(\d+(\.\d+)?|\.\d+)$
Example:

"100.00"

presetFiatAmount
string

Digits with optional decimal part

Pattern: ^(\d+(\.\d+)?|\.\d+)$
Example:

"100.00"

redirectUrl
string
Pattern: ^$|^((https?:\/\/)?([a-z0-9]+([-.]+[a-z0-9]+)*\.[a-z]{2,10}|localhost)(:[0-9]{1,5})?(\/.*)?|([a-zA-Z+-]{2,20}):\/\/(?!.*\*.*\*.*)[-*a-zA-Z0-9.-\/]{0,255}(:[*0-9]{1,5})?((\/|\?).*)?)$
Example:

"https://website-sample.com"

Response

Successfully generated a Coinbase onramp buy URL

url
string
required

The URL to the hosted widget the user should be redirected to.