A public referral program accepts any referral code or Support-a-Creator code, so no setup is required. To create a referral, send a POST request to the following route, authenticating with your private API key.
/Here’s how you call that with curl:
curl -X 'POST' \ 'https://api.nexus.gg/v1/referrals' \ -H 'accept: application/json' \ -H 'X-SHARED-SECRET: nexus_sk_your_key_here' \ -d '{ "code": "samzorz", "playerId": "dlad04-fr9k", "playerName": "Test Player"}'The code may be any valid Support-a-Creator code or referral code. The playerId and playerName properties are both optional and are used to identify the player making the referral. The playerId is a unique identifier intended to map the referral to the player in your system and is never displayed to the creator. The playerName is a display name for the player and is shown to the creator.
The status should be 200 OK with a JSON response body that looks something like this:
{ "groupId": "CsRKC8uD0NLtyQ0LOt8Ru", "groupName": "Test Group", "referral": { "id": "kFpZIMecDEw0M95Kat3Qr", "code": "samzorz", "playerId": "dlad04-fr9k", "playerName": "Test Player", "referralDate": "2022-09-29T21:30:25.400Z" }}If the code used is not valid, you will receive a 400 Bad Request response with the following JSON response body:
{ "code": "ReferralNexusNotFound", "message": "No nexus found with code: samzorz."}