Skip to main content
GET
/
v1
/
referral
/
{code}
/
validate
Validate Referral Code
curl --request GET \
  --url https://api.example.com/v1/referral/{code}/validate \
  --header 'x-client-key: <x-client-key>'
{
  "valid": true
}
GET https://api.baanx.com/v1/referral/{code}/validate Validates a referral code when a user enters it, checking whether it is valid or has expired.

Overview

Use this endpoint during the registration flow to verify a referral code before accepting it. Returns a boolean indicating whether the code is currently valid.
This endpoint only requires the client key — no user Bearer token is needed, as it is intended for use during registration before a user account exists.

Authentication

This endpoint requires only a client key:
x-client-key: YOUR_CLIENT_KEY

Request

Headers

x-client-key
string
required
Your public API client key
x-us-env
boolean
default:false
Set to true to route requests to the US backend environment

Path Parameters

code
string
required
The referral code to validate (e.g., FHLSO5)

Request Example

curl -X GET https://api.baanx.com/v1/referral/FHLSO5/validate \
  -H "x-client-key: YOUR_CLIENT_KEY"

Response

200 Success

valid
boolean
true if the referral code is valid and can be used. false if the code is expired or has reached its usage cap.
{
  "valid": true
}

Error Responses

{
  "message": "Invalid request"
}
  • GET /v1/referral/ - Get the authenticated user’s own referral code