import Stigg from '@stigg/typescript';
const client = new Stigg({
apiKey: process.env['STIGG_API_KEY'], // This is the default and can be omitted
});
const promotionalEntitlement = await client.v1.customers.promotionalEntitlements.create('x', {
promotionalEntitlements: [
{
customEndDate: '2019-12-27T18:11:19.117Z',
enumValues: ['string'],
featureId: 'featureId',
hasSoftLimit: true,
hasUnlimitedUsage: true,
isVisible: true,
monthlyResetPeriodConfiguration: { accordingTo: 'SubscriptionStart' },
period: '1 week',
resetPeriod: 'YEAR',
usageLimit: -9007199254740991,
weeklyResetPeriodConfiguration: { accordingTo: 'SubscriptionStart' },
yearlyResetPeriodConfiguration: { accordingTo: 'SubscriptionStart' },
},
],
});
console.log(promotionalEntitlement.data);{
"data": [
{
"id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"description": "<string>",
"featureId": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"createdAt": "2023-11-07T05:31:56Z",
"updatedAt": "2023-11-07T05:31:56Z",
"startDate": "2023-11-07T05:31:56Z",
"endDate": "2023-11-07T05:31:56Z",
"isVisible": true,
"usageLimit": 123,
"hasSoftLimit": true,
"hasUnlimitedUsage": true,
"status": "Active",
"period": "1 week",
"resetPeriod": "YEAR",
"resetPeriodConfiguration": {
"accordingTo": "SubscriptionStart"
},
"environmentId": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"enumValues": [
"<string>"
],
"featureGroupIds": [
"<string>"
]
}
]
}Grants promotional entitlements to a customer, providing feature access outside their subscription. Entitlements can be time-limited or permanent.
import Stigg from '@stigg/typescript';
const client = new Stigg({
apiKey: process.env['STIGG_API_KEY'], // This is the default and can be omitted
});
const promotionalEntitlement = await client.v1.customers.promotionalEntitlements.create('x', {
promotionalEntitlements: [
{
customEndDate: '2019-12-27T18:11:19.117Z',
enumValues: ['string'],
featureId: 'featureId',
hasSoftLimit: true,
hasUnlimitedUsage: true,
isVisible: true,
monthlyResetPeriodConfiguration: { accordingTo: 'SubscriptionStart' },
period: '1 week',
resetPeriod: 'YEAR',
usageLimit: -9007199254740991,
weeklyResetPeriodConfiguration: { accordingTo: 'SubscriptionStart' },
yearlyResetPeriodConfiguration: { accordingTo: 'SubscriptionStart' },
},
],
});
console.log(promotionalEntitlement.data);{
"data": [
{
"id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"description": "<string>",
"featureId": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"createdAt": "2023-11-07T05:31:56Z",
"updatedAt": "2023-11-07T05:31:56Z",
"startDate": "2023-11-07T05:31:56Z",
"endDate": "2023-11-07T05:31:56Z",
"isVisible": true,
"usageLimit": 123,
"hasSoftLimit": true,
"hasUnlimitedUsage": true,
"status": "Active",
"period": "1 week",
"resetPeriod": "YEAR",
"resetPeriodConfiguration": {
"accordingTo": "SubscriptionStart"
},
"environmentId": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"enumValues": [
"<string>"
],
"featureGroupIds": [
"<string>"
]
}
]
}Server API Key
API Key
The unique identifier of the entity
1 - 255Grant promotional entitlements to a customer for a specified period.
Promotional entitlements to grant
1Show child attributes
The granted promotional entitlement objects.
Response object
Show child attributes