Create Coinbase session token
Generates a Coinbase Onramp session token that can be reused when constructing buy URLs.
POST
/onramp/coinbase/session-token
Generates a Coinbase Onramp session token that can be reused when constructing buy URLs.
Request Body required
application/jsondestinationAddress
string
REQUIRED
Wallet address that will receive purchased assets
blockchains
string[]
REQUIRED
List of supported blockchain identifiers
Array of:
assets
string[]
Optional list of asset symbols to whitelist
Array of:
Responses
200
Session token created successfully
application/jsonsuccess
boolean
REQUIRED
message
string
REQUIRED
data
object
REQUIRED
Coinbase session token result
token
string
REQUIRED
Session token identifier
channelId
string
Optional session channel identifier
statusCode
number
REQUIRED
400
Bad request
curl -X POST 'https://mainnet.anyspend.com/onramp/coinbase/session-token' \
-H 'Content-Type: application/json' \
-d '{
"destinationAddress": "0x58241893EF1f86C9fBd8109Cd44Ea961fDb474e1",
"blockchains": [
"base"
],
"assets": [
"USDC"
]
}'
const response = await fetch('https://mainnet.anyspend.com/onramp/coinbase/session-token', {
method: 'POST',
headers: {
"Content-Type": "application/json"
},
body: JSON.stringify({
"destinationAddress": "0x58241893EF1f86C9fBd8109Cd44Ea961fDb474e1",
"blockchains": [
"base"
],
"assets": [
"USDC"
]
})
});
const data = await response.json();
console.log(data);
import requests
response = requests.post('https://mainnet.anyspend.com/onramp/coinbase/session-token', json={
"destinationAddress": "0x58241893EF1f86C9fBd8109Cd44Ea961fDb474e1",
"blockchains": [
"base"
],
"assets": [
"USDC"
]
})
print(response.json())
200
Response
{
"success": true,
"message": "Session token created successfully",
"data": {
"token": "token_123",
"channelId": "channel_abc"
},
"statusCode": 200
}
POST
/onramp/coinbase/session-token