POST
/
api
/
v1
/
user
/
referrer-code
Get or create user's referral code
const url = 'https://api.gnosispay.com/api/v1/user/referrer-code';
const options = {method: 'POST', headers: {Authorization: 'Bearer <token>'}, body: undefined};

try {
  const response = await fetch(url, options);
  const data = await response.json();
  console.log(data);
} catch (error) {
  console.error(error);
}
{
  "userId": "user_123",
  "referrerCode": "ABC123DEF456"
}

Authorizations

Authorization
string
header
required

Bearer authentication header of the form Bearer <token>, where <token> is your auth token.

Response

200
application/json

Successfully retrieved or created referral code

The response is of type object.