Skip to main content
GET
Get User Referral Code
GET https://api.baanx.com/v1/referral Retrieves the referral code for the authenticated user. If the user is within an active referral campaign, a code will be created and returned. If no active campaign exists, nothing is returned.

Overview

Returns the authenticated user’s referral code along with the cap (maximum number of referrals allowed) and how many have been used. Codes are only issued when an active referral campaign is running for the tenant.

Authentication

This endpoint requires both a client key and a Bearer token:

Request

Headers

string
required
Your public API client key
string
required
Bearer token for the authenticated user
boolean
default:false
Set to true to route requests to the US backend environment

Request Example

Response

200 Success

Returns the user’s referral code details. If no active campaign exists, the response body will be empty.
string
The user’s unique referral code (e.g., FHLSO5)
number
Maximum number of successful referrals allowed for this code
number
Number of times this referral code has been successfully used

Error Responses

  • GET /v1/referral/:code/validate - Validate a referral code entered by a user during registration