Skip to main content
POST
/
onramp
/
coinbase
/
onramp-url
Create Coinbase onramp URL
curl --request POST \
  --url https://mainnet.anyspend.com/onramp/coinbase/onramp-url \
  --header 'Content-Type: application/json' \
  --data '{
  "presetFiatAmount": "100",
  "fiatCurrency": "USD",
  "defaultAsset": "USDC",
  "defaultPaymentMethod": "CARD",
  "destinationAddress": "0x58241893EF1f86C9fBd8109Cd44Ea961fDb474e1",
  "blockchains": [
    "base"
  ],
  "country": "US",
  "orderId": "5392f7a7-d472-4d6b-9848-bd07117fb82d",
  "redirectUrl": "https://www.anyspend.com/orders",
  "useSessionToken": false
}'
{
  "success": true,
  "message": "Onramp URL created successfully",
  "data": {
    "url": "https://pay.coinbase.com/buy/select-asset?... ",
    "sessionToken": "token_123"
  },
  "statusCode": 200
}

Body

application/json

Request body to create a Coinbase onramp URL

presetFiatAmount
string
required

Preset fiat amount for purchase

Example:

"100"

fiatCurrency
string
required

Fiat currency code

Example:

"USD"

defaultAsset
string
required

Default asset to purchase

Example:

"USDC"

defaultPaymentMethod
string
required

Default payment method identifier

Example:

"CARD"

destinationAddress
string
required

Destination wallet address

Example:

"0x58241893EF1f86C9fBd8109Cd44Ea961fDb474e1"

blockchains
string[]
required

Supported blockchains for the session

Example:
["base"]
country
string
required

ISO country code of the end user

Example:

"US"

orderId
string
required

Associated AnySpend order ID

Example:

"5392f7a7-d472-4d6b-9848-bd07117fb82d"

redirectUrl
string
required

Redirect URL after completing the purchase

Example:

"https://www.anyspend.com/orders"

useSessionToken
boolean
default:false

Whether to create and embed a session token automatically

Response

Onramp URL created successfully

success
boolean
required
Example:

true

message
string
required
Example:

"Onramp URL created successfully"

data
object
required

Coinbase onramp URL result

statusCode
number
required
Example:

200