import SnagSolutions from '@snagsolutions/sdk';
const client = new SnagSolutions({
apiKey: 'My API Key',
});
const response = await client.referral.createCode({ loyaltyRuleId: '558bcf56-24f1-4ef4-9787-043086295780' });
console.log(response.id);
{
"id": "<string>",
"websiteId": "<string>",
"organizationId": "<string>",
"referralCode": "<string>",
"createdAt": "2023-11-07T05:31:56Z",
"updatedAt": "2023-11-07T05:31:56Z",
"deletedAt": "2023-11-07T05:31:56Z",
"userId": "<string>"
}
This endpoint allows you to create a referral code
import SnagSolutions from '@snagsolutions/sdk';
const client = new SnagSolutions({
apiKey: 'My API Key',
});
const response = await client.referral.createCode({ loyaltyRuleId: '558bcf56-24f1-4ef4-9787-043086295780' });
console.log(response.id);
{
"id": "<string>",
"websiteId": "<string>",
"organizationId": "<string>",
"referralCode": "<string>",
"createdAt": "2023-11-07T05:31:56Z",
"updatedAt": "2023-11-07T05:31:56Z",
"deletedAt": "2023-11-07T05:31:56Z",
"userId": "<string>"
}
Body
The body is of type object
.
200
The response is of type object
.
Was this page helpful?