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 entitlement = await client.v1.addons.entitlements.create('addonId', {
entitlements: [{ id: 'id', type: 'FEATURE' }],
});
console.log(entitlement.data);import os
from stigg import Stigg
client = Stigg(
api_key=os.environ.get("STIGG_API_KEY"), # This is the default and can be omitted
)
entitlement = client.v1.addons.entitlements.create(
addon_id="addonId",
entitlements=[{
"id": "id",
"type": "FEATURE",
}],
)
print(entitlement.data)package main
import (
"context"
"fmt"
"github.com/stiggio/stigg-go"
"github.com/stiggio/stigg-go/option"
)
func main() {
client := stigg.NewClient(
option.WithAPIKey("My API Key"),
)
entitlement, err := client.V1.Addons.Entitlements.New(
context.TODO(),
"addonId",
stigg.V1AddonEntitlementNewParams{
Entitlements: []stigg.V1AddonEntitlementNewParamsEntitlementUnion{{
OfFeature: &stigg.V1AddonEntitlementNewParamsEntitlementFeature{
ID: "id",
},
}},
},
)
if err != nil {
panic(err.Error())
}
fmt.Printf("%+v\n", entitlement.Data)
}package io.stigg.example;
import io.stigg.client.StiggClient;
import io.stigg.client.okhttp.StiggOkHttpClient;
import io.stigg.models.v1.addons.entitlements.EntitlementCreateParams;
import io.stigg.models.v1.addons.entitlements.EntitlementCreateResponse;
public final class Main {
private Main() {}
public static void main(String[] args) {
StiggClient client = StiggOkHttpClient.fromEnv();
EntitlementCreateParams params = EntitlementCreateParams.builder()
.addonId("addonId")
.addFeatureEntitlement("id")
.build();
EntitlementCreateResponse entitlement = client.v1().addons().entitlements().create(params);
}
}require "stigg"
stigg = Stigg::Client.new(api_key: "My API Key")
entitlement = stigg.v1.addons.entitlements.create("addonId", entitlements: [{id: "id", type: :FEATURE}])
puts(entitlement)using System;
using Stigg.Client;
using Stigg.Client.Models.V1.Addons.Entitlements;
StiggClient client = new();
EntitlementCreateParams parameters = new()
{
AddonID = "addonId",
Entitlements =
[
new Feature()
{
ID = "id",
Behavior = Behavior.Increment,
Description = "description",
DisplayNameOverride = "displayNameOverride",
EnumValues =
[
"string"
],
HasSoftLimit = true,
HasUnlimitedUsage = true,
HiddenFromWidgets =
[
HiddenFromWidget.Paywall
],
IsCustom = true,
IsGranted = true,
MonthlyResetPeriodConfiguration = new(
AccordingTo.SubscriptionStart
),
Order = 0,
ResetPeriod = ResetPeriod.Year,
UsageLimit = 0,
WeeklyResetPeriodConfiguration = new(
WeeklyResetPeriodConfigurationAccordingTo.SubscriptionStart
),
YearlyResetPeriodConfiguration = new(
YearlyResetPeriodConfigurationAccordingTo.SubscriptionStart
),
},
],
};
var entitlement = await client.V1.Addons.Entitlements.Create(parameters);
Console.WriteLine(entitlement);stigg v1:addons:entitlements create \
--api-key 'My API Key' \
--addon-id addonId \
--entitlement '{id: id, type: FEATURE}'curl --request POST \
--url https://api.stigg.io/api/v1/addons/{addonId}/entitlements \
--header 'Content-Type: application/json' \
--header 'X-API-KEY: <api-key>' \
--data '
{
"entitlements": [
{
"type": "FEATURE",
"id": "<string>",
"description": "<string>",
"isGranted": true,
"isCustom": true,
"order": 123,
"hiddenFromWidgets": [],
"displayNameOverride": "<string>",
"usageLimit": 123,
"hasUnlimitedUsage": true,
"hasSoftLimit": true,
"yearlyResetPeriodConfiguration": {
"accordingTo": "SubscriptionStart"
},
"monthlyResetPeriodConfiguration": {},
"weeklyResetPeriodConfiguration": {},
"enumValues": [
"<string>"
]
}
]
}
'<?php
$curl = curl_init();
curl_setopt_array($curl, [
CURLOPT_URL => "https://api.stigg.io/api/v1/addons/{addonId}/entitlements",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "POST",
CURLOPT_POSTFIELDS => json_encode([
'entitlements' => [
[
'type' => 'FEATURE',
'id' => '<string>',
'description' => '<string>',
'isGranted' => true,
'isCustom' => true,
'order' => 123,
'hiddenFromWidgets' => [
],
'displayNameOverride' => '<string>',
'usageLimit' => 123,
'hasUnlimitedUsage' => true,
'hasSoftLimit' => true,
'yearlyResetPeriodConfiguration' => [
'accordingTo' => 'SubscriptionStart'
],
'monthlyResetPeriodConfiguration' => [
],
'weeklyResetPeriodConfiguration' => [
],
'enumValues' => [
'<string>'
]
]
]
]),
CURLOPT_HTTPHEADER => [
"Content-Type: application/json",
"X-API-KEY: <api-key>"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}{
"data": [
{
"id": "<string>",
"description": "<string>",
"isGranted": true,
"isCustom": true,
"order": 123,
"hiddenFromWidgets": [],
"displayNameOverride": "<string>",
"createdAt": "2023-11-07T05:31:56Z",
"updatedAt": "2023-11-07T05:31:56Z",
"type": "FEATURE",
"usageLimit": 123,
"hasUnlimitedUsage": true,
"hasSoftLimit": true,
"resetPeriodConfiguration": {
"accordingTo": "SubscriptionStart"
},
"enumValues": [
"<string>"
]
}
]
}{
"message": "<string>"
}{
"message": "<string>",
"code": "Unauthenticated"
}{
"message": "<string>"
}{
"message": "<string>"
}{
"message": "<string>",
"code": "RateLimitExceeded"
}Addon Entitlements
Create addon entitlements
Creates one or more entitlements (feature or credit) on a draft addon.
POST
/
api
/
v1
/
addons
/
{addonId}
/
entitlements
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 entitlement = await client.v1.addons.entitlements.create('addonId', {
entitlements: [{ id: 'id', type: 'FEATURE' }],
});
console.log(entitlement.data);import os
from stigg import Stigg
client = Stigg(
api_key=os.environ.get("STIGG_API_KEY"), # This is the default and can be omitted
)
entitlement = client.v1.addons.entitlements.create(
addon_id="addonId",
entitlements=[{
"id": "id",
"type": "FEATURE",
}],
)
print(entitlement.data)package main
import (
"context"
"fmt"
"github.com/stiggio/stigg-go"
"github.com/stiggio/stigg-go/option"
)
func main() {
client := stigg.NewClient(
option.WithAPIKey("My API Key"),
)
entitlement, err := client.V1.Addons.Entitlements.New(
context.TODO(),
"addonId",
stigg.V1AddonEntitlementNewParams{
Entitlements: []stigg.V1AddonEntitlementNewParamsEntitlementUnion{{
OfFeature: &stigg.V1AddonEntitlementNewParamsEntitlementFeature{
ID: "id",
},
}},
},
)
if err != nil {
panic(err.Error())
}
fmt.Printf("%+v\n", entitlement.Data)
}package io.stigg.example;
import io.stigg.client.StiggClient;
import io.stigg.client.okhttp.StiggOkHttpClient;
import io.stigg.models.v1.addons.entitlements.EntitlementCreateParams;
import io.stigg.models.v1.addons.entitlements.EntitlementCreateResponse;
public final class Main {
private Main() {}
public static void main(String[] args) {
StiggClient client = StiggOkHttpClient.fromEnv();
EntitlementCreateParams params = EntitlementCreateParams.builder()
.addonId("addonId")
.addFeatureEntitlement("id")
.build();
EntitlementCreateResponse entitlement = client.v1().addons().entitlements().create(params);
}
}require "stigg"
stigg = Stigg::Client.new(api_key: "My API Key")
entitlement = stigg.v1.addons.entitlements.create("addonId", entitlements: [{id: "id", type: :FEATURE}])
puts(entitlement)using System;
using Stigg.Client;
using Stigg.Client.Models.V1.Addons.Entitlements;
StiggClient client = new();
EntitlementCreateParams parameters = new()
{
AddonID = "addonId",
Entitlements =
[
new Feature()
{
ID = "id",
Behavior = Behavior.Increment,
Description = "description",
DisplayNameOverride = "displayNameOverride",
EnumValues =
[
"string"
],
HasSoftLimit = true,
HasUnlimitedUsage = true,
HiddenFromWidgets =
[
HiddenFromWidget.Paywall
],
IsCustom = true,
IsGranted = true,
MonthlyResetPeriodConfiguration = new(
AccordingTo.SubscriptionStart
),
Order = 0,
ResetPeriod = ResetPeriod.Year,
UsageLimit = 0,
WeeklyResetPeriodConfiguration = new(
WeeklyResetPeriodConfigurationAccordingTo.SubscriptionStart
),
YearlyResetPeriodConfiguration = new(
YearlyResetPeriodConfigurationAccordingTo.SubscriptionStart
),
},
],
};
var entitlement = await client.V1.Addons.Entitlements.Create(parameters);
Console.WriteLine(entitlement);stigg v1:addons:entitlements create \
--api-key 'My API Key' \
--addon-id addonId \
--entitlement '{id: id, type: FEATURE}'curl --request POST \
--url https://api.stigg.io/api/v1/addons/{addonId}/entitlements \
--header 'Content-Type: application/json' \
--header 'X-API-KEY: <api-key>' \
--data '
{
"entitlements": [
{
"type": "FEATURE",
"id": "<string>",
"description": "<string>",
"isGranted": true,
"isCustom": true,
"order": 123,
"hiddenFromWidgets": [],
"displayNameOverride": "<string>",
"usageLimit": 123,
"hasUnlimitedUsage": true,
"hasSoftLimit": true,
"yearlyResetPeriodConfiguration": {
"accordingTo": "SubscriptionStart"
},
"monthlyResetPeriodConfiguration": {},
"weeklyResetPeriodConfiguration": {},
"enumValues": [
"<string>"
]
}
]
}
'<?php
$curl = curl_init();
curl_setopt_array($curl, [
CURLOPT_URL => "https://api.stigg.io/api/v1/addons/{addonId}/entitlements",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "POST",
CURLOPT_POSTFIELDS => json_encode([
'entitlements' => [
[
'type' => 'FEATURE',
'id' => '<string>',
'description' => '<string>',
'isGranted' => true,
'isCustom' => true,
'order' => 123,
'hiddenFromWidgets' => [
],
'displayNameOverride' => '<string>',
'usageLimit' => 123,
'hasUnlimitedUsage' => true,
'hasSoftLimit' => true,
'yearlyResetPeriodConfiguration' => [
'accordingTo' => 'SubscriptionStart'
],
'monthlyResetPeriodConfiguration' => [
],
'weeklyResetPeriodConfiguration' => [
],
'enumValues' => [
'<string>'
]
]
]
]),
CURLOPT_HTTPHEADER => [
"Content-Type: application/json",
"X-API-KEY: <api-key>"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}{
"data": [
{
"id": "<string>",
"description": "<string>",
"isGranted": true,
"isCustom": true,
"order": 123,
"hiddenFromWidgets": [],
"displayNameOverride": "<string>",
"createdAt": "2023-11-07T05:31:56Z",
"updatedAt": "2023-11-07T05:31:56Z",
"type": "FEATURE",
"usageLimit": 123,
"hasUnlimitedUsage": true,
"hasSoftLimit": true,
"resetPeriodConfiguration": {
"accordingTo": "SubscriptionStart"
},
"enumValues": [
"<string>"
]
}
]
}{
"message": "<string>"
}{
"message": "<string>",
"code": "Unauthenticated"
}{
"message": "<string>"
}{
"message": "<string>"
}{
"message": "<string>",
"code": "RateLimitExceeded"
}Authorizations
Server API Key
Headers
Account ID — optional when authenticating with a user JWT (Bearer token); falls back to the user's first membership. Ignored for API-key auth.
Environment ID — required when authenticating with a user JWT (Bearer token) on environment-scoped endpoints. Ignored for API-key auth (env is intrinsic to the key).
Path Parameters
The addon ID
Required string length:
1 - 255Pattern:
^[a-zA-Z0-9][a-zA-Z0-9_|.-]*$Body
application/json
Request to create one or more entitlements on an addon
entitlements
(CreateFeatureEntitlementRequest · object | CreateCreditEntitlementRequest · object)[]
required
Entitlements to create
Minimum array length:
1Request to create a feature entitlement
- CreateFeatureEntitlementRequest
- CreateCreditEntitlementRequest
Show child attributes
Show child attributes
Response
The newly created addon entitlement objects.
Response object
Feature entitlement response
- FeatureEntitlementResponse
- CreditEntitlementResponse
Show child attributes
Show child attributes
⌘I
