New Features
Entitlements Aggregation Engine
When a customer has multiple active subscriptions, the API can return duplicatefeatureId entries. The SDK now automatically aggregates them into a single Entitlement model while preserving the raw data.| Field | Aggregation Strategy |
|---|---|
hasAccess | True if any raw entry grants access |
usageLimit | Summed across all entries (for METER feature types) |
currentUsage | Summed across all entries (for METER feature types) |
remaining | Computed as usageLimit - currentUsage |
hardLimit | True if any entry has a hard limit |
Note:resetAtis intentionally not aggregated at the top level because each subscription item can have a different reset date. Access individual reset dates viaentitlement.items[i].resetAt.
New Entitlement Pydantic Model
A new model representing an aggregated entitlement:featureId,featureType,hasAccess,hardLimit,usageLimit,currentUsage,remainingitems: List[EntitlementDetail]— the raw entries that were aggregated into this model
get_entitlements(customerId) — All Entitlements as a Map
Returns a Dict[str, Entitlement] keyed by featureId. Each value is an aggregated model with an .items list containing the original raw entries.get_raw_entitlement(customerId, featureId) — Raw API Response for a Feature
Returns the raw API response (CheckEntitlementsResponse) for a specific feature without any aggregation. Includes the customerId wrapper.get_raw_entitlements(customerId) — Full Raw API Response
Returns the raw API response for all entitlements without any aggregation.Enum Helpers for IDE Autocompletion
Newstr-based Enum classes that improve developer experience with IDE autocompletion and prevent typos:ChargePeriod—ONE_TIME,MONTHLY,YEARLY,WEEKLY,DAILY,THREE_MONTHS,SIX_MONTHSCancellationType—IMMEDIATE,CURRENT_PERIOD_ENDS,SPECIFIC_DATE
"MONTHLY") continue to work everywhere — the enums are fully backward-compatible.Changed
get_entitlement(customerId, featureId)now returnsOptional[Entitlement](aggregated) instead of rawCheckEntitlementsResponse. Useget_raw_entitlement()if you need the original response.get_all_entitlementsremoved — Useget_entitlements()instead, which returns aDict[str, Entitlement]keyed byfeatureId.resetAtremoved from top-levelEntitlement— Access individual reset dates via the.itemslist.
Fixed
- Removed invalid JavaScript-style comments (
// Server-generated UUID) from JSON response blocks in documentation. - Fixed
//comments to#comments in Python code snippets. - Fixed trailing comma in Checkout response JSON block.
- Fixed typo: “newly created customer” → “updated customer” in
customers.updatereturn description. - Removed placeholder text from “Supported Functionalities” section.
- Updated entitlements description to explain multi-subscription aggregation and the
itemsattribute.