Get User Referral Code
Referral
Get User Referral Code
Retrieve the referral code for the authenticated user
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
Your public API client key
Bearer token for the authenticated user
Set to
true to route requests to the US backend environmentRequest Example
Response
200 Success
Returns the user’s referral code details. If no active campaign exists, the response body will be empty.The user’s unique referral code (e.g.,
FHLSO5)Maximum number of successful referrals allowed for this code
Number of times this referral code has been successfully used
Error Responses
Related Endpoints
GET /v1/referral/:code/validate- Validate a referral code entered by a user during registration