Skip to main content
PATCH
/
api
/
v1
/
addons
/
{addonId}
/
entitlements
/
{id}
JavaScript
import Stigg from '@stigg/typescript';

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

const addonPackageEntitlement = await client.v1.addons.entitlements.update('id', {
  addonId: 'addonId',
  type: 'FEATURE',
});

console.log(addonPackageEntitlement.data);
{
  "data": {
    "id": "<string>",
    "description": "<string>",
    "isGranted": true,
    "isCustom": true,
    "order": 123,
    "behavior": "Increment",
    "hiddenFromWidgets": [
      "PAYWALL"
    ],
    "displayNameOverride": "<string>",
    "createdAt": "2023-11-07T05:31:56Z",
    "updatedAt": "2023-11-07T05:31:56Z",
    "type": "FEATURE",
    "usageLimit": 123,
    "hasUnlimitedUsage": true,
    "hasSoftLimit": true,
    "resetPeriod": "YEAR",
    "resetPeriodConfiguration": {
      "accordingTo": "SubscriptionStart"
    },
    "enumValues": [
      "<string>"
    ]
  }
}

Authorizations

X-API-KEY
string
header
required

Server API Key

Path Parameters

addonId
string
required

The addon ID

Required string length: 1 - 255
Pattern: ^[a-zA-Z0-9][a-zA-Z0-9_|.-]*$
id
string
required

The feature ID or custom currency ID of the entitlement

Required string length: 1 - 255
Pattern: ^[a-zA-Z0-9][a-zA-Z0-9_|.-]*$

Body

application/json

Fields to update on a feature entitlement

type
enum<string>
required

UpdateFeatureEntitlementRequest

Available options:
FEATURE
description
string

Description of the entitlement

Maximum string length: 255
isGranted
boolean

Whether the entitlement is granted

isCustom
boolean

Whether this is a custom entitlement

order
number

Display order of the entitlement

behavior
enum<string>

Entitlement behavior (Increment or Override)

Available options:
Increment,
Override
hiddenFromWidgets
enum<string>[]

Widget types where this entitlement is hidden

Available options:
PAYWALL,
CUSTOMER_PORTAL,
CHECKOUT
displayNameOverride
string

Override display name for the entitlement

Maximum string length: 255
usageLimit
integer | null

Maximum allowed usage for the feature

hasUnlimitedUsage
boolean

Whether usage is unlimited

hasSoftLimit
boolean

Whether the usage limit is a soft limit

resetPeriod
enum<string>

Period at which usage resets

Available options:
YEAR,
MONTH,
WEEK,
DAY,
HOUR
yearlyResetPeriodConfiguration
YearlyResetPeriodConfig · object

Configuration for yearly reset period

monthlyResetPeriodConfiguration
MonthlyResetPeriodConfig · object

Configuration for monthly reset period

weeklyResetPeriodConfiguration
WeeklyResetPeriodConfig · object

Configuration for weekly reset period

enumValues
string[]

Allowed enum values for the feature entitlement

Allowed enum values for the feature entitlement

Maximum string length: 255

Response

The updated addon entitlement object.

Response object

data
FeatureEntitlementResponse · object
required

Feature entitlement response