import Stigg from '@stigg/typescript';
const client = new Stigg({
apiKey: process.env['STIGG_API_KEY'], // This is the default and can be omitted
});
const subscription = await client.v1.subscriptions.update('x');
console.log(subscription.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
)
subscription = client.v1.subscriptions.update(
id="x",
)
print(subscription.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"),
)
subscription, err := client.V1.Subscriptions.Update(
context.TODO(),
"x",
stigg.V1SubscriptionUpdateParams{},
)
if err != nil {
panic(err.Error())
}
fmt.Printf("%+v\n", subscription.Data)
}package io.stigg.example;
import io.stigg.client.StiggClient;
import io.stigg.client.okhttp.StiggOkHttpClient;
import io.stigg.models.v1.subscriptions.Subscription;
import io.stigg.models.v1.subscriptions.SubscriptionUpdateParams;
public final class Main {
private Main() {}
public static void main(String[] args) {
StiggClient client = StiggOkHttpClient.fromEnv();
Subscription subscription = client.v1().subscriptions().update("x");
}
}require "stigg"
stigg = Stigg::Client.new(api_key: "My API Key")
subscription = stigg.v1.subscriptions.update("x")
puts(subscription)using System;
using Stigg.Client;
using Stigg.Client.Models.V1.Subscriptions;
StiggClient client = new();
SubscriptionUpdateParams parameters = new() { ID = "x" };
var subscription = await client.V1.Subscriptions.Update(parameters);
Console.WriteLine(subscription);stigg v1:subscriptions update \
--api-key 'My API Key' \
--id xcurl --request PATCH \
--url https://api.stigg.io/api/v1/subscriptions/{id} \
--header 'Content-Type: application/json' \
--header 'X-API-KEY: <api-key>' \
--data '
{
"metadata": {},
"charges": [
{
"id": "<string>",
"quantity": 1
}
],
"addons": [
{
"id": "<string>",
"quantity": 1
}
],
"trialEndDate": "2023-11-07T05:31:56Z",
"promotionCode": "<string>",
"entitlements": [
{
"type": "FEATURE",
"id": "<string>",
"usageLimit": 1,
"hasUnlimitedUsage": true,
"hasSoftLimit": true,
"yearlyResetPeriodConfiguration": {
"accordingTo": "SubscriptionStart"
},
"monthlyResetPeriodConfiguration": {},
"weeklyResetPeriodConfiguration": {}
}
],
"awaitPaymentConfirmation": true,
"billingInformation": {
"taxRateIds": [
"<string>"
],
"couponId": "<string>",
"taxPercentage": 50,
"billingAddress": {
"city": "<string>",
"country": "<string>",
"line1": "<string>",
"line2": "<string>",
"postalCode": "<string>",
"state": "<string>"
},
"metadata": {},
"chargeOnBehalfOfAccount": "<string>",
"isBackdated": true,
"isInvoicePaid": true,
"invoiceDaysUntilDue": 123,
"integrationId": "<string>",
"taxIds": [
{
"type": "<string>",
"value": "<string>"
}
]
},
"budget": {
"limit": 123,
"hasSoftLimit": true
},
"minimumSpend": {
"amount": 123
},
"priceOverrides": [
{
"amount": 123,
"featureId": "<string>",
"currencyId": "<string>",
"addonId": "<string>",
"baseCharge": true
}
],
"appliedCoupon": {
"couponId": "<string>",
"billingCouponId": "<string>",
"promotionCode": "<string>",
"discount": {
"name": "<string>",
"description": "<string>",
"durationInMonths": 2,
"percentOff": 50.5,
"amountsOff": [
{
"amount": 123
}
]
},
"configuration": {
"startDate": "2023-11-07T05:31:56Z"
}
},
"cancellationDate": "2023-11-07T05:31:56Z",
"salesforceId": "<string>"
}
'<?php
$curl = curl_init();
curl_setopt_array($curl, [
CURLOPT_URL => "https://api.stigg.io/api/v1/subscriptions/{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([
'metadata' => [
],
'charges' => [
[
'id' => '<string>',
'quantity' => 1
]
],
'addons' => [
[
'id' => '<string>',
'quantity' => 1
]
],
'trialEndDate' => '2023-11-07T05:31:56Z',
'promotionCode' => '<string>',
'entitlements' => [
[
'type' => 'FEATURE',
'id' => '<string>',
'usageLimit' => 1,
'hasUnlimitedUsage' => true,
'hasSoftLimit' => true,
'yearlyResetPeriodConfiguration' => [
'accordingTo' => 'SubscriptionStart'
],
'monthlyResetPeriodConfiguration' => [
],
'weeklyResetPeriodConfiguration' => [
]
]
],
'awaitPaymentConfirmation' => true,
'billingInformation' => [
'taxRateIds' => [
'<string>'
],
'couponId' => '<string>',
'taxPercentage' => 50,
'billingAddress' => [
'city' => '<string>',
'country' => '<string>',
'line1' => '<string>',
'line2' => '<string>',
'postalCode' => '<string>',
'state' => '<string>'
],
'metadata' => [
],
'chargeOnBehalfOfAccount' => '<string>',
'isBackdated' => true,
'isInvoicePaid' => true,
'invoiceDaysUntilDue' => 123,
'integrationId' => '<string>',
'taxIds' => [
[
'type' => '<string>',
'value' => '<string>'
]
]
],
'budget' => [
'limit' => 123,
'hasSoftLimit' => true
],
'minimumSpend' => [
'amount' => 123
],
'priceOverrides' => [
[
'amount' => 123,
'featureId' => '<string>',
'currencyId' => '<string>',
'addonId' => '<string>',
'baseCharge' => true
]
],
'appliedCoupon' => [
'couponId' => '<string>',
'billingCouponId' => '<string>',
'promotionCode' => '<string>',
'discount' => [
'name' => '<string>',
'description' => '<string>',
'durationInMonths' => 2,
'percentOff' => 50.5,
'amountsOff' => [
[
'amount' => 123
]
]
],
'configuration' => [
'startDate' => '2023-11-07T05:31:56Z'
]
],
'cancellationDate' => '2023-11-07T05:31:56Z',
'salesforceId' => '<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>",
"customerId": "<string>",
"billingId": "<string>",
"createdAt": "2023-11-07T05:31:56Z",
"startDate": "2023-11-07T05:31:56Z",
"planId": "<string>",
"payingCustomerId": "<string>",
"resourceId": "<string>",
"endDate": "2023-11-07T05:31:56Z",
"effectiveEndDate": "2023-11-07T05:31:56Z",
"cancellationDate": "2023-11-07T05:31:56Z",
"trialEndDate": "2023-11-07T05:31:56Z",
"metadata": {},
"currentBillingPeriodStart": "2023-11-07T05:31:56Z",
"currentBillingPeriodEnd": "2023-11-07T05:31:56Z",
"billingCycleAnchor": "2023-11-07T05:31:56Z",
"prices": [],
"addons": [],
"coupons": [],
"futureUpdates": [],
"budget": {
"limit": 123,
"hasSoftLimit": true
},
"minimumSpend": {
"amount": 123
},
"subscriptionEntitlements": [],
"latestInvoice": {
"billingId": "<string>",
"createdAt": "2023-11-07T05:31:56Z",
"requiresAction": true,
"total": 123,
"amountDue": 123,
"currency": "<string>",
"pdfUrl": "<string>"
},
"trial": {}
}
}{
"message": "<string>"
}{
"message": "<string>",
"code": "Unauthenticated"
}{
"message": "<string>"
}{
"message": "<string>"
}{
"message": "<string>",
"code": "RateLimitExceeded"
}Update a subscription
Updates an active subscription’s properties including billing period, add-ons, unit quantities, and discounts.
import Stigg from '@stigg/typescript';
const client = new Stigg({
apiKey: process.env['STIGG_API_KEY'], // This is the default and can be omitted
});
const subscription = await client.v1.subscriptions.update('x');
console.log(subscription.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
)
subscription = client.v1.subscriptions.update(
id="x",
)
print(subscription.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"),
)
subscription, err := client.V1.Subscriptions.Update(
context.TODO(),
"x",
stigg.V1SubscriptionUpdateParams{},
)
if err != nil {
panic(err.Error())
}
fmt.Printf("%+v\n", subscription.Data)
}package io.stigg.example;
import io.stigg.client.StiggClient;
import io.stigg.client.okhttp.StiggOkHttpClient;
import io.stigg.models.v1.subscriptions.Subscription;
import io.stigg.models.v1.subscriptions.SubscriptionUpdateParams;
public final class Main {
private Main() {}
public static void main(String[] args) {
StiggClient client = StiggOkHttpClient.fromEnv();
Subscription subscription = client.v1().subscriptions().update("x");
}
}require "stigg"
stigg = Stigg::Client.new(api_key: "My API Key")
subscription = stigg.v1.subscriptions.update("x")
puts(subscription)using System;
using Stigg.Client;
using Stigg.Client.Models.V1.Subscriptions;
StiggClient client = new();
SubscriptionUpdateParams parameters = new() { ID = "x" };
var subscription = await client.V1.Subscriptions.Update(parameters);
Console.WriteLine(subscription);stigg v1:subscriptions update \
--api-key 'My API Key' \
--id xcurl --request PATCH \
--url https://api.stigg.io/api/v1/subscriptions/{id} \
--header 'Content-Type: application/json' \
--header 'X-API-KEY: <api-key>' \
--data '
{
"metadata": {},
"charges": [
{
"id": "<string>",
"quantity": 1
}
],
"addons": [
{
"id": "<string>",
"quantity": 1
}
],
"trialEndDate": "2023-11-07T05:31:56Z",
"promotionCode": "<string>",
"entitlements": [
{
"type": "FEATURE",
"id": "<string>",
"usageLimit": 1,
"hasUnlimitedUsage": true,
"hasSoftLimit": true,
"yearlyResetPeriodConfiguration": {
"accordingTo": "SubscriptionStart"
},
"monthlyResetPeriodConfiguration": {},
"weeklyResetPeriodConfiguration": {}
}
],
"awaitPaymentConfirmation": true,
"billingInformation": {
"taxRateIds": [
"<string>"
],
"couponId": "<string>",
"taxPercentage": 50,
"billingAddress": {
"city": "<string>",
"country": "<string>",
"line1": "<string>",
"line2": "<string>",
"postalCode": "<string>",
"state": "<string>"
},
"metadata": {},
"chargeOnBehalfOfAccount": "<string>",
"isBackdated": true,
"isInvoicePaid": true,
"invoiceDaysUntilDue": 123,
"integrationId": "<string>",
"taxIds": [
{
"type": "<string>",
"value": "<string>"
}
]
},
"budget": {
"limit": 123,
"hasSoftLimit": true
},
"minimumSpend": {
"amount": 123
},
"priceOverrides": [
{
"amount": 123,
"featureId": "<string>",
"currencyId": "<string>",
"addonId": "<string>",
"baseCharge": true
}
],
"appliedCoupon": {
"couponId": "<string>",
"billingCouponId": "<string>",
"promotionCode": "<string>",
"discount": {
"name": "<string>",
"description": "<string>",
"durationInMonths": 2,
"percentOff": 50.5,
"amountsOff": [
{
"amount": 123
}
]
},
"configuration": {
"startDate": "2023-11-07T05:31:56Z"
}
},
"cancellationDate": "2023-11-07T05:31:56Z",
"salesforceId": "<string>"
}
'<?php
$curl = curl_init();
curl_setopt_array($curl, [
CURLOPT_URL => "https://api.stigg.io/api/v1/subscriptions/{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([
'metadata' => [
],
'charges' => [
[
'id' => '<string>',
'quantity' => 1
]
],
'addons' => [
[
'id' => '<string>',
'quantity' => 1
]
],
'trialEndDate' => '2023-11-07T05:31:56Z',
'promotionCode' => '<string>',
'entitlements' => [
[
'type' => 'FEATURE',
'id' => '<string>',
'usageLimit' => 1,
'hasUnlimitedUsage' => true,
'hasSoftLimit' => true,
'yearlyResetPeriodConfiguration' => [
'accordingTo' => 'SubscriptionStart'
],
'monthlyResetPeriodConfiguration' => [
],
'weeklyResetPeriodConfiguration' => [
]
]
],
'awaitPaymentConfirmation' => true,
'billingInformation' => [
'taxRateIds' => [
'<string>'
],
'couponId' => '<string>',
'taxPercentage' => 50,
'billingAddress' => [
'city' => '<string>',
'country' => '<string>',
'line1' => '<string>',
'line2' => '<string>',
'postalCode' => '<string>',
'state' => '<string>'
],
'metadata' => [
],
'chargeOnBehalfOfAccount' => '<string>',
'isBackdated' => true,
'isInvoicePaid' => true,
'invoiceDaysUntilDue' => 123,
'integrationId' => '<string>',
'taxIds' => [
[
'type' => '<string>',
'value' => '<string>'
]
]
],
'budget' => [
'limit' => 123,
'hasSoftLimit' => true
],
'minimumSpend' => [
'amount' => 123
],
'priceOverrides' => [
[
'amount' => 123,
'featureId' => '<string>',
'currencyId' => '<string>',
'addonId' => '<string>',
'baseCharge' => true
]
],
'appliedCoupon' => [
'couponId' => '<string>',
'billingCouponId' => '<string>',
'promotionCode' => '<string>',
'discount' => [
'name' => '<string>',
'description' => '<string>',
'durationInMonths' => 2,
'percentOff' => 50.5,
'amountsOff' => [
[
'amount' => 123
]
]
],
'configuration' => [
'startDate' => '2023-11-07T05:31:56Z'
]
],
'cancellationDate' => '2023-11-07T05:31:56Z',
'salesforceId' => '<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>",
"customerId": "<string>",
"billingId": "<string>",
"createdAt": "2023-11-07T05:31:56Z",
"startDate": "2023-11-07T05:31:56Z",
"planId": "<string>",
"payingCustomerId": "<string>",
"resourceId": "<string>",
"endDate": "2023-11-07T05:31:56Z",
"effectiveEndDate": "2023-11-07T05:31:56Z",
"cancellationDate": "2023-11-07T05:31:56Z",
"trialEndDate": "2023-11-07T05:31:56Z",
"metadata": {},
"currentBillingPeriodStart": "2023-11-07T05:31:56Z",
"currentBillingPeriodEnd": "2023-11-07T05:31:56Z",
"billingCycleAnchor": "2023-11-07T05:31:56Z",
"prices": [],
"addons": [],
"coupons": [],
"futureUpdates": [],
"budget": {
"limit": 123,
"hasSoftLimit": true
},
"minimumSpend": {
"amount": 123
},
"subscriptionEntitlements": [],
"latestInvoice": {
"billingId": "<string>",
"createdAt": "2023-11-07T05:31:56Z",
"requiresAction": true,
"total": 123,
"amountDue": 123,
"currency": "<string>",
"pdfUrl": "<string>"
},
"trial": {}
}
}{
"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 unique identifier of the entity
1 - 255Body
Partially update an existing subscriptoin. Only provided fields are updated.
Additional metadata for the subscription
Show child attributes
Show child attributes
Show child attributes
Show child attributes
Show child attributes
Show child attributes
Subscription trial end date
Promotion code
255Feature entitlement configuration for a subscription
- SubscriptionFeatureEntitlementRequest
- SubscriptionCreditEntitlementRequest
Show child attributes
Show child attributes
MONTHLY, ANNUALLY Await payment confirmation
Show child attributes
Show child attributes
END_OF_BILLING_PERIOD, END_OF_BILLING_MONTH, IMMEDIATE Show child attributes
Show child attributes
Minimum spend amount
Show child attributes
Show child attributes
Show child attributes
Show child attributes
Show child attributes
Show child attributes
UNCHANGED, NOW Subscription cancellation date
Salesforce ID
255Response
The updated subscription object.
Response object
Customer subscription to a plan
Show child attributes
Show child attributes
