import SnagSolutions from '@snagsolutions/sdk';
const client = new SnagSolutions({
apiKey: process.env['X_API_KEY'], // This is the default and can be omitted
});
const users = await client.referral.users.list();
console.log(users.data);{
"data": [
{
"referralCode": {
"id": "<string>",
"referralCode": "<string>",
"createdAt": "2023-11-07T05:31:56Z",
"updatedAt": "2023-11-07T05:31:56Z",
"deletedAt": "2023-11-07T05:31:56Z",
"userId": "<string>",
"loyaltyRuleId": "3c90c3cc-0d44-4b50-8888-8dd25736052a"
},
"user": {
"id": "<string>",
"walletAddress": "<string>"
},
"id": "<string>",
"tier1Amount": 123,
"tier2Amount": 123,
"amount": 123,
"eligible": true
}
],
"hasNextPage": true
}This endpoint allows you to get referrals
import SnagSolutions from '@snagsolutions/sdk';
const client = new SnagSolutions({
apiKey: process.env['X_API_KEY'], // This is the default and can be omitted
});
const users = await client.referral.users.list();
console.log(users.data);{
"data": [
{
"referralCode": {
"id": "<string>",
"referralCode": "<string>",
"createdAt": "2023-11-07T05:31:56Z",
"updatedAt": "2023-11-07T05:31:56Z",
"deletedAt": "2023-11-07T05:31:56Z",
"userId": "<string>",
"loyaltyRuleId": "3c90c3cc-0d44-4b50-8888-8dd25736052a"
},
"user": {
"id": "<string>",
"walletAddress": "<string>"
},
"id": "<string>",
"tier1Amount": 123,
"tier2Amount": 123,
"amount": 123,
"eligible": true
}
],
"hasNextPage": true
}Was this page helpful?