Skip to main content
POST
/
create-referral-code
Create protocol referral code
curl --request POST \
  --url https://yppncslmsswqydhhgygz.supabase.co/functions/v1/create-referral-code \
  --header 'Authorization: Bearer <token>' \
  --header 'Content-Type: application/json' \
  --data '
{
  "code": "ALICE2025",
  "network_mode": "mainnet"
}
'
{
  "success": true,
  "referral_code": "alice2025",
  "created_at": "2025-01-06T12:00:00Z"
}

Authorizations

Authorization
string
header
required

JWT token or API key

Body

application/json
code
string
required

Custom referral code (4-20 alphanumeric characters)

Example:

"ALICE2025"

network_mode
enum<string>
default:mainnet

Network mode for this referral code

Available options:
testnet,
mainnet,
both
Example:

"mainnet"

Response

Successful response

success
enum<boolean>
required
Available options:
true,
false
referral_code
string
required

The created referral code (lowercase). Frontend should construct full URL as ${APP_URL}/join/${code}

Example:

"alice2025"

created_at
string
required

Timestamp when the code was created

Example:

"2025-01-06T12:00:00Z"