POST
/
api
/
referral
/
codes
import SnagSolutions from '@snagsolutions/sdk';

const client = new SnagSolutions({
  apiKey: process.env['X_API_KEY'], // This is the default and can be omitted
});

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>"
}

Authorizations

X-API-KEY
string
header
required

Body

application/json

Body

The body is of type object.

Response

200
application/json

200

The response is of type object.