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);import os
from stigg import Stigg
client = Stigg(
api_key=os.environ.get("STIGG_API_KEY"), # This is the default and can be omitted
)
addon_package_entitlement = client.v1.addons.entitlements.update(
id="id",
addon_id="addonId",
type="FEATURE",
)
print(addon_package_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"),
)
addonPackageEntitlement, err := client.V1.Addons.Entitlements.Update(
context.TODO(),
"id",
stigg.V1AddonEntitlementUpdateParams{
AddonID: "addonId",
OfFeature: &stigg.V1AddonEntitlementUpdateParamsBodyFeature{},
},
)
if err != nil {
panic(err.Error())
}
fmt.Printf("%+v\n", addonPackageEntitlement.Data)
}
package io.stigg.example;
import io.stigg.client.StiggClient;
import io.stigg.client.okhttp.StiggOkHttpClient;
import io.stigg.models.v1.addons.entitlements.AddonPackageEntitlement;
import io.stigg.models.v1.addons.entitlements.EntitlementUpdateParams;
public final class Main {
private Main() {}
public static void main(String[] args) {
StiggClient client = StiggOkHttpClient.fromEnv();
EntitlementUpdateParams params = EntitlementUpdateParams.builder()
.addonId("addonId")
.id("id")
.body(EntitlementUpdateParams.Body.Feature.builder().build())
.build();
AddonPackageEntitlement addonPackageEntitlement = client.v1().addons().entitlements().update(params);
}
}require "stigg"
stigg = Stigg::Client.new(api_key: "My API Key")
addon_package_entitlement = stigg.v1.addons.entitlements.update("id", addon_id: "addonId", body: {type: :FEATURE})
puts(addon_package_entitlement)using System;
using Stigg.Client;
using Stigg.Client.Models.V1.Addons.Entitlements;
StiggClient client = new();
EntitlementUpdateParams parameters = new()
{
AddonID = "addonId",
ID = "id",
Body = new BodyFeature()
{
Behavior = BodyFeatureBehavior.Increment,
Description = "description",
DisplayNameOverride = "displayNameOverride",
EnumValues =
[
"string"
],
HasSoftLimit = true,
HasUnlimitedUsage = true,
HiddenFromWidgets =
[
BodyFeatureHiddenFromWidget.Paywall
],
IsCustom = true,
IsGranted = true,
MonthlyResetPeriodConfiguration = new(
BodyFeatureMonthlyResetPeriodConfigurationAccordingTo.SubscriptionStart
),
Order = 0,
ResetPeriod = BodyFeatureResetPeriod.Year,
UsageLimit = 0,
WeeklyResetPeriodConfiguration = new(
BodyFeatureWeeklyResetPeriodConfigurationAccordingTo.SubscriptionStart
),
YearlyResetPeriodConfiguration = new(
BodyFeatureYearlyResetPeriodConfigurationAccordingTo.SubscriptionStart
),
},
};
var addonPackageEntitlement = await client.V1.Addons.Entitlements.Update(parameters);
Console.WriteLine(addonPackageEntitlement);stigg v1:addons:entitlements update \
--api-key 'My API Key' \
--addon-id addonId \
--id id \
--type FEATUREcurl --request PATCH \
--url https://api.stigg.io/api/v1/addons/{addonId}/entitlements/{id} \
--header 'Content-Type: application/json' \
--header 'X-API-KEY: <api-key>' \
--data '
{
"type": "FEATURE",
"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/{id}",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "PATCH",
CURLOPT_POSTFIELDS => json_encode([
'type' => 'FEATURE',
'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,
"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>"
]
}
}{
"message": "<string>",
"code": "BadUserInput",
"reason": "<string>"
}{
"message": "<string>",
"code": "Unauthenticated"
}{
"message": "<string>",
"code": "IdentityForbidden"
}{
"message": "<string>",
"code": "CustomerNotFound"
}{
"message": "<string>",
"code": "RateLimitExceeded"
}Addon Entitlements
Update a addon entitlement
Updates an existing entitlement on a draft addon.
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);import os
from stigg import Stigg
client = Stigg(
api_key=os.environ.get("STIGG_API_KEY"), # This is the default and can be omitted
)
addon_package_entitlement = client.v1.addons.entitlements.update(
id="id",
addon_id="addonId",
type="FEATURE",
)
print(addon_package_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"),
)
addonPackageEntitlement, err := client.V1.Addons.Entitlements.Update(
context.TODO(),
"id",
stigg.V1AddonEntitlementUpdateParams{
AddonID: "addonId",
OfFeature: &stigg.V1AddonEntitlementUpdateParamsBodyFeature{},
},
)
if err != nil {
panic(err.Error())
}
fmt.Printf("%+v\n", addonPackageEntitlement.Data)
}
package io.stigg.example;
import io.stigg.client.StiggClient;
import io.stigg.client.okhttp.StiggOkHttpClient;
import io.stigg.models.v1.addons.entitlements.AddonPackageEntitlement;
import io.stigg.models.v1.addons.entitlements.EntitlementUpdateParams;
public final class Main {
private Main() {}
public static void main(String[] args) {
StiggClient client = StiggOkHttpClient.fromEnv();
EntitlementUpdateParams params = EntitlementUpdateParams.builder()
.addonId("addonId")
.id("id")
.body(EntitlementUpdateParams.Body.Feature.builder().build())
.build();
AddonPackageEntitlement addonPackageEntitlement = client.v1().addons().entitlements().update(params);
}
}require "stigg"
stigg = Stigg::Client.new(api_key: "My API Key")
addon_package_entitlement = stigg.v1.addons.entitlements.update("id", addon_id: "addonId", body: {type: :FEATURE})
puts(addon_package_entitlement)using System;
using Stigg.Client;
using Stigg.Client.Models.V1.Addons.Entitlements;
StiggClient client = new();
EntitlementUpdateParams parameters = new()
{
AddonID = "addonId",
ID = "id",
Body = new BodyFeature()
{
Behavior = BodyFeatureBehavior.Increment,
Description = "description",
DisplayNameOverride = "displayNameOverride",
EnumValues =
[
"string"
],
HasSoftLimit = true,
HasUnlimitedUsage = true,
HiddenFromWidgets =
[
BodyFeatureHiddenFromWidget.Paywall
],
IsCustom = true,
IsGranted = true,
MonthlyResetPeriodConfiguration = new(
BodyFeatureMonthlyResetPeriodConfigurationAccordingTo.SubscriptionStart
),
Order = 0,
ResetPeriod = BodyFeatureResetPeriod.Year,
UsageLimit = 0,
WeeklyResetPeriodConfiguration = new(
BodyFeatureWeeklyResetPeriodConfigurationAccordingTo.SubscriptionStart
),
YearlyResetPeriodConfiguration = new(
BodyFeatureYearlyResetPeriodConfigurationAccordingTo.SubscriptionStart
),
},
};
var addonPackageEntitlement = await client.V1.Addons.Entitlements.Update(parameters);
Console.WriteLine(addonPackageEntitlement);stigg v1:addons:entitlements update \
--api-key 'My API Key' \
--addon-id addonId \
--id id \
--type FEATUREcurl --request PATCH \
--url https://api.stigg.io/api/v1/addons/{addonId}/entitlements/{id} \
--header 'Content-Type: application/json' \
--header 'X-API-KEY: <api-key>' \
--data '
{
"type": "FEATURE",
"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/{id}",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "PATCH",
CURLOPT_POSTFIELDS => json_encode([
'type' => 'FEATURE',
'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,
"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>"
]
}
}{
"message": "<string>",
"code": "BadUserInput",
"reason": "<string>"
}{
"message": "<string>",
"code": "Unauthenticated"
}{
"message": "<string>",
"code": "IdentityForbidden"
}{
"message": "<string>",
"code": "CustomerNotFound"
}{
"message": "<string>",
"code": "RateLimitExceeded"
}Headers
Path Parameters
Body
application/json
- UpdateFeatureEntitlementRequest
- UpdateCreditEntitlementRequest
Fields to update on a feature entitlement