- Added:
entitlements_updated_atonget_entitlements_state, onProvisionCustomerFragment,ProvisionSubscriptionFragmentandApplySubscriptionFragment, and on theEntitlementsUpdatedV2Payloadevent. It’s when the customer’s entitlements last changed, the latest of the entitlement, customer and subscription update times, and it’s set even when the list is empty.
- Added:
error_codeonSubscriptionInvoiceFragment, so a subscription’slatest_invoicereturns the payment failure code reported by the billing provider, for examplecard_declined. Use it to tell failed payments apart without matching onerror_message.
- Added: optional
start_dateandend_datefilters onget_credit_ledger, to return only ledger events with a timestamp in that range. Both are inclusive.
- Added:
default_payment_method_card_brandanddefault_payment_method_wallet_typeon the customer fragment, so customer queries return the default payment method’s card brand and wallet type.default_payment_method_card_brandis the card brand reported by the billing provider, for examplevisa,mastercardoramex.default_payment_method_wallet_typeis the digital wallet the card was added through, for exampleapple_payorgoogle_pay. Both areNonewhen the billing provider doesn’t report them, so aNonedefault_payment_method_wallet_typedoesn’t prove the card is a regular one: cards saved before this field existed have no value.
- No functional change to the Python SDK. This release only bumped the package version to track releases of other packages in the monorepo.
- Fixed:
get_entitlement_v_2no longer fails withPydanticSerializationErrorbefore sending the request. The supplied input is now passed as the query variable.
Usage and event cost estimation
- Added:
estimate_event_costandestimate_usage_costmethods to preview the credits a usage event or usage report would consume before sending it, without persisting any data or affecting balances. Each returns, per currency,estimated_cost,current_balance,balance_after_estimate,would_overdraft, and a feature-level breakdown. - Added:
event_countfield onget_credit_usageseries and points, reporting the number of distinct usage events that consumed credits. - Added: optional
idempotency_keyparameter onreport_usage, to safely retry usage reports without double-counting. - Added:
STRIPE_INVOICINGvendor identifier value, for customers using Stripe Invoicing as their billing connection.
- Added: optional
event_typefilter onget_credit_ledger, to return only the given ledger event types.
- Added:
RECEIVEDbilling vendor identifier value, for Stripe billing brokered by Received.
Direct credit consumption
- Added:
consume_credits(synchronous) andconsume_credits_async(asynchronous) methods to deduct credits directly from a customer’s pool, without reporting usage against a metered feature or requiring an active subscription. Useconsume_creditsfor strict, real-time enforcement; useconsume_credits_asyncfor high-volume, eventually-consistent consumption. See direct credit consumption. get_credit_entitlementandget_entitlementcontinue to return a valid credit balance for customers with no active subscription, so credit governance can run fully decoupled from Stigg subscription management.
- Added:
preview_next_invoiceon customer portal subscriptions, with the next invoice’s total, amount due and per-line usage quantities.
Synchronous credit balance updates via
report_usage- Added: When
report_usageis called for a credit-backed feature, the response now includes acreditobject with the updated credit balance — immediately, before the asynchronous metering pipeline settles.creditcontainscurrency_id,current_usage,usage_limit, andtimestamp. Usereport_usagefor sub-second, strict credit enforcement; usereport_eventfor high-volume, eventually-consistent metering.
- Added:
has_soft_limitfield on credit entitlement responses. When a credit entitlement is configured as a soft limit,get_entitlementreturnsis_granted: Trueandhas_soft_limit: Trueeven after the credit balance reaches zero. Credit-backed features inherit the wallet’s soft-limit so dependent feature reads stay consistent.
- Added:
cancellation_dateon the provision and update subscription inputs, to schedule a cancellation on a specific date. On update, passingnullclears a scheduled cancellation.
Credit usage breakdown by event dimensions
- Added:
group_byarray parameter onget_credit_usageto break down credit consumption by any dimension key attached to reported usage events (e.g.,user,model,region). Results are paginated for performance at high event volumes.
Credit usage date filters
- Added:
start_dateandend_dateparameters onget_credit_usage. Pass specific start and end timestamps to retrieve credit consumption data for an exact time window, in addition to the existing preset period enums. See customer credits.
- Added:
dependency_featureon package entitlements, the feature a credit entitlement depends on (for example seats). - ⚠️ Deprecated:
dependencyon package entitlements (usedependency_featureinstead). - Added:
entitlementson the subscription import input, accepting both feature and credit entitlements.
- Added:
billingCycleAnchorproperty when provisioning and updating subscriptions. AcceptsSubscriptionBillingCycleAnchor.UNCHANGED(default) to keep the existing billing cycle anchor, orSubscriptionBillingCycleAnchor.NOWto reset it to the current timestamp.
- Added:
billing_cadence,custom_currency(display name and units) andtop_up_custom_currency_idon paywall prices, for plans with credit charges.
- Added:
includeInactiveSubscriptionsparameter ongetUsageHistoryV2. When set totrue, usage history is returned regardless of whether the customer currently has an active subscription. If they do have an active subscription, the response also includes amarkersarray containing the subscription’s usage reset timestamps.
- Added:
getCreditEntitlement()method for low-latency retrieval of customer credit balance from the local cache. - Added: Support for provisioning subscriptions with variable recurring credit grant entitlements.
- Added: Support for configuring and managing credit auto-recharge settings, including trigger balance, target top-up amount, and monthly spend limit.
🛑 Breaking changeThe Python SDK has been rewritten with
pydantic v2 and is now published under a new package name: stigg-api-client-v2.What changed
- Package renamed from
stigg-api-clienttostigg-api-client-v2 - Migrated from
pydanticv1 topydanticv2 for model definitions - Now uses
ariadne-codegenfor type-safe async code generation - Now uses
httpxinstead ofrequests(async-first) - Minimum supported Python version is 3.9 (previously 3.7)
Migration
Replace the installed package:This major version reflects a monorepo-wide version increment driven by breaking changes in the Node.js and Sidecar SDKs (entitlements retrieval logic). There are no breaking changes for the Python SDK in this version.
- Added credit balance subscription handling with automatic entitlement updates, expiration checks, and cache mapping for credit rate and validity.
- Added:
grantPromotionalEntitlementsGroupor granting a promotional entitlements group - all entitlements that are not already granted to a customer, need to be included in the request. - Added:
revokePromotionalEntitlementsGroupfor revoking all of the entitlements of a group, unless they are a part of a different group. - Added:
unlinkPromotionalEntitlementsGroupfor removing the references of the group from promotional entitlements that are a part of it, while keep granting access to those entitlements.
- Added:
CancelSubscription.awaitSubscriptionCancellationfor controlling whether to wait for confirmation from billing solutions that are integrated with Stigg before marking subscription as canceled in Stigg
- Added:
AccessDeniedReason.Revokedfor determining when an entitlement has been explicitly revoked.
- Added:
SubscriptionBillingInfo.prorationBehaviorfor controlling the proration behavior when provisioning and updating subscriptions. The new parameter accepts the following value INVOICE_IMMEDIATELY- bill for proration immediately. This is the default behavior.CREATE_PRORATIONS- include prorated charges in the upcoming invoice.NONE- don’t prorate subscription changes.
- Added:
get_usage_history_v_2 - ⚠️ Deprecated:
get_usage_history(please useget_usage_history_v_2instead) - Changed:
- Input Object:
customer_ref_idrenamed tocustomer_idresource_ref_idrenamed toresource_idfeature_ref_idrenamed tofeature_idreset_periodremovedyearly_reset_period_configurationremovedmonthly_reset_period_configurationremovedweekly_reset_period_configurationremoved
- Output Object
start_dateremovedend_dateremovedusage.measurements[i].daterenamed toseries[0].point[i].timestampusage.measurements[i].valuerenamed toseries[0].point[i].valueusage.measurements[i].is_reset_pointrenamed toseries[0].point[i].is_reset_point- Old Value:
trueif and only if usage was reset due to periodic reset. - New Value:
trueif and only if usage was reset due to periodic reset or due to a plan transition.
- Old Value:
groups[i].group_info[j].keyrenamed toseries[i].tags[j].keygroups[i].group_info[j].valuerenamed toseries[i].tags[j].valuegroups[i].usage_measurements[j].daterenamed toseries[i].point[j].timestampgroups[i].usage_measurements[j].valuerenamed toseries[i].point[j].valuegroups[i].usage_measurements[j].is_reset_pointrenamed toseries[i].point[j].is_reset_point- Old Value:
trueif and only if usage was reset due to periodic reset. - New Value:
trueif and only if usage was reset due to periodic reset or due to a plan transition.
- Old Value:
- Input Object:
- Added:
SlimSubscriptionFragmentV2.trial_configurationandSlimSubscriptionFragmentV2.trial_end_date
- Added:
SubscriptionCouponDiscountInput.amounts_off - Added:
SubscriptionCouponDiscountInput.description - Added:
SubscriptionCouponDiscountInput.duration_in_months - Added:
SubscriptionCouponDiscountInput.name - Added:
SubscriptionCouponDiscountInput.percent_off
- Added:
EstimateSubscriptionInput.TrialOverrideConfigurationInput.trial_end_behavior - Added:
PreviewSubscriptionInput.TrialOverrideConfigurationInput.trial_end_behavior
- Added:
EstimateSubscriptionInput.TrialOverrideConfigurationInput.trial_end_date - Added:
PreviewSubscriptionInput.TrialOverrideConfigurationInput.trial_end_date
- Added: Ability to remove customer’s email address by passing an empty string on
updateCustomerInput.email
- Added:
delegate_subscription_to_customer() - Added:
transfer_subscription_to_resource() - ⚠️ Deprecated:
transfer_subscription()method (please usetransfer_subscription_to_resource()instead)
- Added: ability to estimate the subscription cost when the payment of the subscription is delegated to a different customer using:
ProvisionSubscriptionInput.paying_customer_idAUpdateSubscriptionInput.paying_customer_idApplySubscriptionInput.paying_customer_idPreviewSubscriptionInput.paying_customer_idEstimateSubscriptionInput.paying_customer_idEstimateSubscriptionUpdateInput.paying_customer_id
- Added: raise error when sync to Stripe fails due to unrecognized customer billing address
- Added: ability to more easily determine the usage period of metered entitlements using:
EntitlementFragment.usage_period_startEntitlementFragment.usage_period_end
- ⚠️ Deprecated:
EntitlementFragment.next_reset_datefield
- Added: raise error when attempting to import a customer with an existing
billing_id - Added: the default value of optional fields is
None
- Added:
SubscriptionCouponInput.billing_coupon_id - ⚠️ Deprecated:
ProvisionSubscriptionInput.promotion_code - ⚠️ Deprecated:
UpdateSubscriptionInput.promotion_code - ⚠️ Deprecated:
ApplySubscriptionInput.promotion_code - ⚠️ Deprecated:
PreviewSubscriptionInput.promotion_code - ⚠️ Deprecated:
EstimateSubscriptionInput.promotion_code - ⚠️ Deprecated:
EstimateSubscriptionUpdateInput.promotion_code
- Added: ability to delegate payment of a provisioned subscription to a different customer using:
ProvisionSubscriptionInput.paying_customer_idApplySubscriptionInput.paying_customer_idSlimSubscriptionFragmentV2.payingCustomerFullSubscription.payingCustomer
- Added: ability to apply a coupon to a subscription using the Stigg coupon ID using:
ProvisionSubscriptionInput.applied_couponUpdateSubscriptionInput.applied_couponApplySubscriptionInput.applied_couponPreviewSubscriptionInput.applied_couponEstimateSubscriptionInput.applied_couponEstimateSubscriptionUpdateInput.applied_coupon
- Added: ability to undo subscription scheduled cancelation using
cancel_subscription_updates()
- Changed:
fetch_usage_history()now returns the precise timestamp when the usage was reset
- Changed:
UpdateSubscriptionInput.subscription_entitlementsdoes not require the full list of entitlements when needing to add or update specific entitlements
- Added:
TrialOverrideConfigurationInput.trial_end_dateto allow scheduled trial cancelation when provisioning and updating subscriptions
- Added: ability to get the list of active subscriptions from Edge using
get_active_subscriptions()