@stigg/api-client-js is the generated GraphQL client underlying @stigg/node-server-sdk, @stigg/js-client-sdk, @stigg/react-sdk, and persistent-cache-service. Most integrations use one of those SDKs directly rather than this package — see the Node.js SDK and JavaScript SDK changelogs for consumer-facing changes. This page tracks the underlying GraphQL client and schema types.
- Added:
errorCodeonSubscriptionInvoiceFragment, so a subscription’slatestInvoicereturns the payment failure code reported by the billing provider, for examplecard_declined. Use it to tell failed payments apart without matching onerrorMessage.
- Added: optional
startDateandendDatefilters ongetCreditLedger, to return only ledger events with a timestamp in that range. Both are inclusive.
- Added:
defaultPaymentMethodCardBrandanddefaultPaymentMethodWalletTypeon the customer fragment, so customer queries return the default payment method’s card brand and wallet type.defaultPaymentMethodCardBrandis the card brand reported by the billing provider, for examplevisa,mastercardoramex.defaultPaymentMethodWalletTypeis the digital wallet the card was added through, for exampleapple_payorgoogle_pay. Both arenullwhen the billing provider doesn’t report them, so anulldefaultPaymentMethodWalletTypedoesn’t prove the card is a regular one: cards saved before this field existed have no value.
- No functional change to
@stigg/api-client-js. This release only bumped the package version to track releases of other packages in the monorepo.
Cost estimation queries
- Added:
estimateEventCostandestimateUsageCostqueries 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,estimatedCost,currentBalance,balanceAfterEstimate,wouldOverdraft, and a feature-level breakdown. - Added:
eventCountfield ongetCreditUsageseries and points, reporting the number of distinct usage events that consumed credits.
- Added:
STRIPE_INVOICINGvendor identifier value, for customers using Stripe Invoicing as their billing connection.
- Added: Edge API support for
getPaywall— public paywall reads are now served from the low-latency Edge cache instead of the GraphQL API.
- Added: optional
eventTypefilter ongetCreditLedger, to return only the given ledger event types.
- Added:
RECEIVEDbilling vendor identifier value, for Stripe billing brokered by Received.
- Added: optional
idempotencyKeyparameter onreportUsage, to safely retry usage reports without double-counting.
Direct credit consumption
- Added:
consumeCredits(synchronous) andconsumeCreditsAsync(asynchronous) methods to deduct credits directly from a customer’s pool, without reporting usage against a metered feature or requiring an active subscription. See direct credit consumption. getCreditEntitlementandgetEntitlementcontinue to return a valid credit balance for customers with no active subscription, so credit governance can run fully decoupled from Stigg subscription management.
- Added:
previewNextInvoiceon customer portal subscriptions, with the next invoice’s total, amount due and per-line usage quantities.
Synchronous credit balance updates via
reportUsage- Added: When
reportUsageis called for a credit-backed feature, the response now includes acreditobject with the updated credit balance — immediately, before the asynchronous metering pipeline settles.creditcontainscurrencyId,currentUsage,usageLimit, andtimestamp.
- Added:
hasSoftLimitfield on credit entitlement responses. When a credit entitlement is configured as a soft limit,getEntitlementreturnshasAccess: trueandhasSoftLimit: trueeven after the credit balance reaches zero.
- Added:
cancellationDateon 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:
groupByarray parameter ongetCreditUsageto 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:
startDateandendDateparameters ongetCreditUsage. 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:
dependencyFeatureon package entitlements, the feature a credit entitlement depends on (for example seats). - ⚠️ Deprecated:
dependencyon package entitlements (usedependencyFeatureinstead). - 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:
billingCadence,customCurrency(display name and units) andtopUpCustomCurrencyIdon 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.
This major version reflects a monorepo-wide version increment driven by a breaking change in the Python SDK (pydantic v1 → v2 dependency update). There are no breaking changes for this client in this version.
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 this client in this version.
- Added credit balance subscription handling with automatic entitlement updates, expiration checks, and cache mapping for credit rate and validity.
- Added:
grantPromotionalEntitlementsGroupfor 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:
SubscriptionBillingInfo.prorationBehaviorfor controlling the proration behavior when provisioning and updating subscriptions. The new parameter accepts the following values: CREATE_PRORATIONS- bill for proration immediately. This is the default behavior.INVOICE_IMMEDIATELY- include prorated charges in the upcoming invoice.NONE- don’t prorate subscription changes.
- Added:
getUsageHistoryV2 - ⚠️ Deprecated:
getUsageHistory(please usegetUsageHistoryV2instead) - Changed:
- Input Object:
customerRefIdrenamed tocustomerIdresourceRefIdrenamed toresourceIdfeatureRefIdrenamed tofeatureIdresetPeriodremovedyearlyResetPeriodConfigurationremovedmonthlyResetPeriodConfigurationremovedweeklyResetPeriodConfigurationremoved
- Output Object
startDateremovedendDateremovedusageMeasurements[i].daterenamed toseries[0].point[i].timestampusageMeasurements[i].valuerenamed toseries[0].point[i].valueusageMeasurements[i].isResetPointrenamed toseries[0].point[i].isResetPointgroups[i].groupInfo[j].keyrenamed toseries[i].tags[j].keygroups[i].groupInfo[j].valuerenamed toseries[i].tags[j].valuegroups[i].usageMeasurements[j].daterenamed toseries[i].point[j].timestampgroups[i].usageMeasurements[j].valuerenamed toseries[i].point[j].valuegroups[i].usageMeasurements[j].isResetPointrenamed toseries[i].point[j].isResetPoint
- Input Object:
- Added:
getActiveSubscriptionsList_trialConfigurationandgetActiveSubscriptionsList_trialConfiguration_trialEndDate
- Added:
SubscriptionCoupon.amountsOff - Added:
SubscriptionCoupon.description - Added:
SubscriptionCoupon.durationInMonths - Added:
SubscriptionCoupon.name - Added:
SubscriptionCoupon.percentOff
- Added:
EstimateSubscriptionInput.TrialOverrideConfigurationInput.trialEndBehavior - Added:
PreviewSubscriptionInput.TrialOverrideConfigurationInput.trialEndBehavior
- Added:
EstimateSubscriptionInput.TrialOverrideConfigurationInput.trialEndDate - Added:
PreviewSubscriptionInput.TrialOverrideConfigurationInput.trialEndDate
- Added: ability to remove customer’s email address by passing an empty string on
updateCustomer.email
- Added:
delegateSubscriptionToCustomer() - Added:
transferSubscriptionToResource() - ⚠️ Deprecated:
transferSubscription()method (please usetransferSubscriptionToResource()instead)
- Added: ability to estimate the subscription cost when the payment of the subscription is delegated to a different customer using:
ProvisionSubscriptionInput.payingCustomerIdUpdateSubscriptionInput.payingCustomerIdApplySubscriptionInput.payingCustomerIdPreviewSubscriptionInput.payingCustomerIdEstimateSubscriptionInput.payingCustomerIdEstimateSubscriptionUpdateInput.payingCustomerId
- 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:
Entitlement.usagePeriodStartEntitlement.usagePeriodEnd
- ⚠️ Deprecated:
Entitlement.nextResetDatefield
- Added:
SubscriptionCouponInput.billingCouponId - ⚠️ Deprecated:
ProvisionSubscriptionInput.promotionCode,UpdateSubscriptionInput.promotionCode,ApplySubscriptionInput.promotionCode,PreviewSubscriptionInput.promotionCode,EstimateSubscriptionInput.promotionCode,EstimateSubscriptionUpdateInput.promotionCode
- Added: ability to delegate payment of a provisioned subscription to a different customer using:
ProvisionSubscriptionInput.payingCustomerIdApplySubscriptionInput.payingCustomerIdSlimSubscriptionFragmentV2.payingCustomerFullSubscription.payingCustomer
- Added: ability to apply a coupon to a subscription using the Stigg coupon ID using:
ProvisionSubscriptionInput.appliedCouponUpdateSubscriptionInput.appliedCouponApplySubscriptionInput.appliedCouponPreviewSubscriptionInput.appliedCouponEstimateSubscriptionInput.appliedCouponEstimateSubscriptionUpdateInput.appliedCoupon
- Added: ability to undo subscription scheduled cancelation using
cancelSubscriptionUpdates()
- Changed:
UpdateSubscriptionInput.subscriptionEntitlementsdoes not require the full list of entitlements when needing to add or update specific entitlements
- Added: ability to get the list of active subscriptions from Edge using
getActiveSubscriptionsList()