> ## Documentation Index
> Fetch the complete documentation index at: https://docs.stigg.io/llms.txt
> Use this file to discover all available pages before exploring further.

# API Client (JS)

`@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](https://docs.stigg.io/api-and-sdks/changelog/backend-graphql/node.md) and [JavaScript SDK](https://docs.stigg.io/api-and-sdks/changelog/frontend/javascript.md) changelogs for consumer-facing changes. This page tracks the underlying GraphQL client and schema types.

**6.26.0**

2026-10-11

* Added: `defaultPaymentMethodCardBrand` and `defaultPaymentMethodWalletType` on the customer fragment, so customer queries return the default payment method's card brand and wallet type. `defaultPaymentMethodCardBrand` is the card brand reported by the billing provider, for example `visa`, `mastercard` or `amex`. `defaultPaymentMethodWalletType` is the digital wallet the card was added through, for example `apple_pay` or `google_pay`. Both are `null` when the billing provider doesn't report them, so a `null` `defaultPaymentMethodWalletType` doesn't prove the card is a regular one: cards saved before this field existed have no value.

**6.25.0**

2026-10-11

* No functional change to `@stigg/api-client-js`. This release only bumped the package version to track releases of other packages in the monorepo.

**6.24.0**

2026-08-05

**Cost estimation queries**

* Added: `estimateEventCost` and `estimateUsageCost` queries 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: `eventCount` field on `getCreditUsage` series and points, reporting the number of distinct usage events that consumed credits.

**Other**

* Added: `STRIPE_INVOICING` vendor identifier value, for customers using Stripe Invoicing as their billing connection.

**6.23.0**

2026-07-28

* Added: Edge API support for `getPaywall` — public paywall reads are now served from the low-latency Edge cache instead of the GraphQL API.

**6.22.0**

2026-07-22

* Added: optional `eventType` filter on `getCreditLedger`, to return only the given ledger event types.

**6.21.0**

2026-07-14

* Added: `RECEIVED` billing vendor identifier value, for Stripe billing brokered by Received.

**6.18.0**

2026-07-09

* Added: optional `idempotencyKey` parameter on `reportUsage`, to safely retry usage reports without double-counting.

**6.17.0**

2026-07-08

**Direct credit consumption**

* Added: `consumeCredits` (synchronous) and `consumeCreditsAsync` (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](https://docs.stigg.io/documentation/modeling-your-pricing-in-stigg/credits/credits-core-concepts.md#direct-credit-consumption).
* `getCreditEntitlement` and `getEntitlement` continue to return a valid credit balance for customers with no active subscription, so credit governance can run fully decoupled from Stigg subscription management.

**6.16.0**

2026-06-24

* Added: `previewNextInvoice` on customer portal subscriptions, with the next invoice's total, amount due and per-line usage quantities.

**6.14.0**

2026-06-23

**Synchronous credit balance updates via `reportUsage`**

* Added: When `reportUsage` is called for a credit-backed feature, the response now includes a `credit` object with the updated credit balance — immediately, before the asynchronous metering pipeline settles. `credit` contains `currencyId`, `currentUsage`, `usageLimit`, and `timestamp`.

**Credit wallet soft limit**

* Added: `hasSoftLimit` field on credit entitlement responses. When a credit entitlement is configured as a soft limit, `getEntitlement` returns `hasAccess: true` and `hasSoftLimit: true` even after the credit balance reaches zero.

**6.13.0**

2026-06-14

* Added: `cancellationDate` on the provision and update subscription inputs, to schedule a cancellation on a specific date. On update, passing `null` clears a scheduled cancellation.

**6.11.0**

2026-06-01

**Credit usage breakdown by event dimensions**

* Added: `groupBy` array parameter on `getCreditUsage` to 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.

**6.10.0**

2026-05-10

**Credit usage date filters**

* Added: `startDate` and `endDate` parameters on `getCreditUsage`. 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](https://docs.stigg.io/documentation/modeling-your-pricing-in-stigg/credits/customer-credits.md).

**6.8.0**

2026-03-19

* Added: `dependencyFeature` on package entitlements, the feature a credit entitlement depends on (for example seats).
* ⚠️ Deprecated: `dependency` on package entitlements (use `dependencyFeature` instead).
* Added: `entitlements` on the subscription import input, accepting both feature and credit entitlements.

**6.6.1**

2026-03-19

* Added: `billingCycleAnchor` property when provisioning and updating subscriptions. Accepts `SubscriptionBillingCycleAnchor.UNCHANGED` (default) to keep the existing billing cycle anchor, or `SubscriptionBillingCycleAnchor.NOW` to reset it to the current timestamp.

**6.4.0**

2026-03-11

* Added: `billingCadence`, `customCurrency` (display name and units) and `topUpCustomCurrencyId` on paywall prices, for plans with credit charges.

**6.2.3**

2026-03-09

* Added: `includeInactiveSubscriptions` parameter on `getUsageHistoryV2`. When set to `true`, 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 a `markers` array containing the subscription's usage reset timestamps.

**6.2.0**

2026-03-17

* 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.

**5.74.0**

2026-01-24

* Added: Support for configuring and managing credit auto-recharge settings, including trigger balance, target top-up amount, and monthly spend limit.

**5.0.0**

2025-11

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.

**4.5.0**

2025-11-02

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.

**3.75.0**

2025-09-29

* Added `getCreditLedger` and `getCreditUsage` methods.

**3.74.0**

2025-09-29

* Added void credit grant `voidCreditGrant`.

**3.73.0**

2025-09-29

* Added credit balance subscription handling with automatic entitlement updates, expiration checks, and cache mapping for credit rate and validity.

**3.72.0**

2025-09-25

* Added credit rate mapping.

**3.71.0**

2025-09-23

* Added `awsMarketplaceCustomerId` to update and provision customers.

**3.68.0**

2025-09-04

* Added: `grantPromotionalEntitlementsGroup` for granting a promotional entitlements group - all entitlements that are not already granted to a customer, need to be included in the request.
* Added: `revokePromotionalEntitlementsGroup` for revoking all of the entitlements of a group, unless they are a part of a different group.
* Added: `unlinkPromotionalEntitlementsGroup` for removing the references of the group from promotional entitlements that are a part of it, while keep granting access to those entitlements.

**3.64.0**

2025-09-03

* Added support for subscriptions filter by resourceId and plan (planId/displayName).

**3.59.2**

2025-09-02

* Added: `CancelSubscription.awaitSubscriptionCancellation` for controlling whether to wait for confirmation from billing solutions that are integrated with Stigg before marking subscription as canceled in Stigg

**3.22.2**

2025-08-15

* Added: `SubscriptionBillingInfo.prorationBehavior` for 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.

**2.448.1**

2025-06-26

* Added: `getSubscriptions` endpoint that allows retrieving all of customers' subscriptions

**2.307.0**

2025-02-23

* Added: `SubscriptionFragmentLatestInvoice.attemptCount`

**2.293.0**

2025-01-21

* Added: `ImportSubscriptionInput.subscriptionId`

**2.289.0**

2025-01-19

* Added: `importSubscriptionInput.salesforceId`, `importCustomerInput.salesforceId`

**2.235.0**

2024-12-17

* Added: `getUsageHistoryV2`
* ⚠️ Deprecated: `getUsageHistory` (please use `getUsageHistoryV2` instead)
* Changed:
  * Input Object:
    * `customerRefId` renamed to `customerId`
    * `resourceRefId` renamed to `resourceId`
    * `featureRefId` renamed to `featureId`
    * `resetPeriod` removed
    * `yearlyResetPeriodConfiguration` removed
    * `monthlyResetPeriodConfiguration` removed
    * `weeklyResetPeriodConfiguration` removed
  * Output Object
    * `startDate` removed
    * `endDate` removed
    * `usageMeasurements[i].date` renamed to `series[0].point[i].timestamp`
    * `usageMeasurements[i].value` renamed to `series[0].point[i].value`
    * `usageMeasurements[i].isResetPoint` renamed to `series[0].point[i].isResetPoint`
    * `groups[i].groupInfo[j].key` renamed to `series[i].tags[j].key`
    * `groups[i].groupInfo[j].value` renamed to `series[i].tags[j].value`
    * `groups[i].usageMeasurements[j].date` renamed to `series[i].point[j].timestamp`
    * `groups[i].usageMeasurements[j].value` renamed to `series[i].point[j].value`
    * `groups[i].usageMeasurements[j].isResetPoint` renamed to `series[i].point[j].isResetPoint`

**2.233.0**

2024-12-15

* Added: `getActiveSubscriptionsList_trialConfiguration` and `getActiveSubscriptionsList_trialConfiguration_trialEndDate`

**2.217.0**

2024-12-08

* Added: ability to override prices when there's a scheduled update in place

**2.212.4**

2024-12-03

* Added: `TrialConfiguration` to `getActiveSubscriptions()`

**2.212.1**

2024-12-02

* Added: validation that coupon name does not exceed 40 characters

**2.209.0**

2024-12-02

* Added: `SubscriptionCoupon.amountsOff`
* Added: `SubscriptionCoupon.description`
* Added: `SubscriptionCoupon.durationInMonths`
* Added: `SubscriptionCoupon.name`
* Added: `SubscriptionCoupon.percentOff`

**2.207.0**

2024-12-01

* Added: `EstimateSubscriptionInput.TrialOverrideConfigurationInput.trialEndBehavior`
* Added: `PreviewSubscriptionInput.TrialOverrideConfigurationInput.trialEndBehavior`

**2.204.0**

2024-11-24

* Added: `EstimateSubscriptionInput.TrialOverrideConfigurationInput.trialEndDate`
* Added: `PreviewSubscriptionInput.TrialOverrideConfigurationInput.trialEndDate`

**2.199.0**

2024-11-21

* Added: support for price localization in fixed fee coupons

**2.196.1**

2024-11-18

* Added: ability to remove customer's email address by passing an empty string on `updateCustomer.email`

**2.196.0**

2024-11-18

* Added: `delegateSubscriptionToCustomer()`
* Added: `transferSubscriptionToResource()`
* ⚠️ Deprecated: `transferSubscription()` method (please use `transferSubscriptionToResource()` instead)

**2.188.0**

2024-11-05

* Added: `UsageHistoryFragment.markers` to reflect information about the reset usage dates

**2.178.1**

2024-11-04

* Fixed: issue where `customer.discount.deleted` event from Stripe isn't handled properly

**2.175.4**

2024-10-31

* Added: ability to set any date in the `SubscriptionFragment.trialEndDate`

**2.162.0**

2024-10-13

* Added: ability to estimate the subscription cost when the payment of the subscription is delegated to a different customer using:
  * `ProvisionSubscriptionInput.payingCustomerId`
  * `UpdateSubscriptionInput.payingCustomerId`
  * `ApplySubscriptionInput.payingCustomerId`
  * `PreviewSubscriptionInput.payingCustomerId`
  * `EstimateSubscriptionInput.payingCustomerId`
  * `EstimateSubscriptionUpdateInput.payingCustomerId`

**2.160.0**

2024-10-13

* Added: raise error when sync to Stripe fails due to unrecognized customer billing address

**2.151.0**

2024-10-06

* Added: ability to more easily determine the usage period of metered entitlements using:
  * `Entitlement.usagePeriodStart`
  * `Entitlement.usagePeriodEnd`
* ⚠️ Deprecated: `Entitlement.nextResetDate` field

**2.131.1**

2024-09-19

* Added: raise error when attempting to import a customer with an existing `billingId`

**2.129.0**

2024-09-17

* Added: `CustomerPortalSubscription.planId`

**2.123.1**

2024-09-11

* Added: `SubscriptionCouponInput.billingCouponId`
* ⚠️ Deprecated: `ProvisionSubscriptionInput.promotionCode`, `UpdateSubscriptionInput.promotionCode`, `ApplySubscriptionInput.promotionCode`, `PreviewSubscriptionInput.promotionCode`, `EstimateSubscriptionInput.promotionCode`, `EstimateSubscriptionUpdateInput.promotionCode`

**2.100.2**

2024-09-01

* Added: ability to delegate payment of a provisioned subscription to a different customer using:
  * `ProvisionSubscriptionInput.payingCustomerId`
  * `ApplySubscriptionInput.payingCustomerId`
  * `SlimSubscriptionFragmentV2.payingCustomer`
  * `FullSubscription.payingCustomer`

**2.86.0**

2024-08-22

* Added: ability to apply a coupon to a subscription using the Stigg coupon ID using:
  * `ProvisionSubscriptionInput.appliedCoupon`
  * `UpdateSubscriptionInput.appliedCoupon`
  * `ApplySubscriptionInput.appliedCoupon`
  * `PreviewSubscriptionInput.appliedCoupon`
  * `EstimateSubscriptionInput.appliedCoupon`
  * `EstimateSubscriptionUpdateInput.appliedCoupon`

**2.80.2**

2024-08-20

* Changed: `ImportCustomerBulk` changed to `ImportCustomerBulkInput`

**2.62.4**

2024-08-07

* Added: ability to undo subscription scheduled cancelation using `cancelSubscriptionUpdates()`

**2.62.0**

2024-08-07

* Added: ability to preview a subscription's upcoming invoice using `previewNextInvoice()`

**2.20.0**

2024-07-07

* Changed: `fetchUsageHistory()` now returns the precise timestamp when the usage was reset

**2.13.5**

2024-07-01

* Changed: `UpdateSubscriptionInput.subscriptionEntitlements` does not require the full list of entitlements when needing to add or update specific entitlements

**1.236.0**

2024-06-20

* Added: ability to get the list of active subscriptions from Edge using `getActiveSubscriptionsList()`

**1.232.0**

2024-06-16

* Added: ability to get the list of active subscriptions using `getActiveSubscriptions()`

**1.0.0**

2024-01-26

🛑 Breaking change

* Changed: For Volume/tiered pricing, `unitPrice` was moved to `flatPrice`.


## Related topics

- [Node.js SDK](https://docs.stigg.io/api-and-sdks/changelog/backend-graphql/node.md)
- [Stripe Projects](https://docs.stigg.io/documentation/native-integrations/billing/stripe/stripe-projects.md)
- [Vue.js SDK](https://docs.stigg.io/api-and-sdks/changelog/frontend/vuejs.md)
- [Backend](https://docs.stigg.io/api-and-sdks/integration/backend.md)
- [Vue.js](https://docs.stigg.io/api-and-sdks/integration/frontend/vuejs.md)


This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.