Skip to main content
POST
/
buy-token
Buy tokens
curl --request POST \
  --url https://yppncslmsswqydhhgygz.supabase.co/functions/v1/buy-token \
  --header 'Authorization: Bearer <token>' \
  --header 'Content-Type: application/json' \
  --data '{
  "tokenId": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
  "userAddress": "<string>",
  "chainSlug": "base-sepolia",
  "buyAmountUSD": 1,
  "buyAmountToken": 1
}'
{
  "success": true,
  "transaction": {
    "to": "<string>",
    "data": "<string>",
    "value": "<string>",
    "gasLimit": "<string>"
  }
}

Authorizations

Authorization
string
header
required

JWT token or API key

Body

application/json
tokenId
string<uuid>
required
userAddress
string
required
chainSlug
enum<string>
required

Blockchain identifier

Available options:
base,
base-sepolia
Example:

"base-sepolia"

buyAmountUSD
number

USD amount to spend (provide either this or buyAmountToken)

Required range: x > 0
buyAmountToken
number

Amount of tokens to buy (provide either this or buyAmountUSD)

Required range: x > 0

Response

Successful response

success
boolean
required
transaction
object
required