# Create Balance
Source: https://docs.useautumn.com/api-reference/balances/createBalance
openapi POST /v1/balances.create
Create a balance for a customer feature.
### Body Parameters
The ID of the customer.
The ID of the feature.
The ID of the entity for entity-scoped balances (e.g., per-seat limits).
The initial balance amount to grant. For metered features, this is the number of units the customer can use.
If true, the balance has unlimited usage. Cannot be combined with 'included\_grant'.
Reset configuration for the balance. If not provided, the balance is a one-time grant that never resets.
The interval at which the balance resets (e.g., 'month', 'day', 'year').
Number of intervals between resets. Defaults to 1 (e.g., interval\_count: 2 with interval: 'month' resets every 2 months).
Rollover configuration for the balance.
Unix timestamp (milliseconds) when the balance expires. Mutually exclusive with reset.
Unix timestamp (milliseconds) for the first reset boundary, allowing a custom (e.g. shorter) first period. Requires 'reset', and must occur before 'expires\_at' if both are provided. Subsequent resets advance by one reset interval from this boundary.
A unique identifier for this balance. Use this to target the balance in future update / delete calls.
### Response
# Delete Balance
Source: https://docs.useautumn.com/api-reference/balances/deleteBalance
openapi POST /v1/balances.delete
Delete a balance for a customer feature. Can only delete a balance that is not attached to a price (eg. you cannot delete messages that have an overage price).
### Body Parameters
The ID of the customer.
The ID of the entity.
The ID of the feature.
The ID of the balance to delete.
If true, deduct the deleted balance's remaining amount from the customer's other balances for the same feature after deletion.
Target a specific balance by its reset interval. Use when the customer has multiple balances for the same feature with different reset intervals.
### Response
# Finalize Lock
Source: https://docs.useautumn.com/api-reference/balances/finalizeLock
openapi POST /v1/balances.finalize
Finalize a previously locked balance. Use 'confirm' to commit the deduction, or 'release' to return the held balance.
### Body Parameters
The lock ID that was passed into the previous check call.
Use 'confirm' to commit the deduction, or 'release' to return the held balance.
Additional properties to attach to this finalize lock event.
Additional properties to attach to this finalize lock event.
### Response
# Track Token Usage
Source: https://docs.useautumn.com/api-reference/balances/trackTokens
openapi POST /v1/balances.track_tokens
Records AI token usage for a customer and returns the updated AI credit balance.
Use this after an LLM request when you have input and output token counts. Autumn converts token usage to a dollar amount using the configured model pricing and markup, then tracks that value against the customer's AI credit system.
Track AI token usage against a customer's AI credit system balance. Converts token counts to a dollar cost using [Models.dev](https://models.dev) pricing and your configured markup, then deducts from the customer's credit balance.
The `model_id` must use `provider/model` format, matching the provider and model keys from [Models.dev](https://models.dev). For providers with nested model paths (like OpenRouter), include the full path: `openrouter/anthropic/claude-opus-4.6`. The first path segment is the provider key used for provider-level markup lookup.
### Common Use Cases
```typescript Anthropic theme={null}
await autumn.balances.trackTokens({
customerId: "cus_123",
modelId: "anthropic/claude-opus-4-6",
inputTokens: 1000,
outputTokens: 500
});
```
```typescript With cache + reasoning theme={null}
await autumn.balances.trackTokens({
customerId: "cus_123",
modelId: "anthropic/claude-opus-4-6",
inputTokens: 800, // excludes the cached tokens below
outputTokens: 350, // excludes the reasoning tokens below
cacheReadTokens: 1000,
cacheWriteTokens: 200,
reasoningTokens: 150
});
```
```typescript OpenRouter (nested path) theme={null}
await autumn.balances.trackTokens({
customerId: "cus_123",
modelId: "openrouter/anthropic/claude-opus-4.6",
inputTokens: 2000,
outputTokens: 1000
});
```
```typescript With explicit feature theme={null}
await autumn.balances.trackTokens({
customerId: "cus_123",
featureId: "ai_credits",
modelId: "anthropic/claude-haiku-4-5",
inputTokens: 2000,
outputTokens: 1000
});
```
### Token Pools
Each token parameter is an exclusive pool — no token should be counted in more than one. Each pool is billed at the model's published rate for that pool, falling back to the text input/output rate when the model has none.
If you pass a provider's raw totals (e.g. OpenAI's `prompt_tokens` and `completion_tokens`), subtract the cache and reasoning counts first — otherwise those tokens are billed twice. The `@useautumn/gateway` wrappers ([AI SDK](/documentation/external-providers/ai-sdk), [OpenRouter](/documentation/external-providers/openrouter)) do this normalization for you.
### Markup Resolution
Markups are optional — the credit system's default markup applies unless overridden per provider or per model. With no markups set, the Models.dev base cost is charged as-is. A markup of `-100` makes the model free — the usage event is still recorded, but nothing is deducted. See [AI Credit Systems](/documentation/modelling-pricing/credit-systems#ai-credit-systems) for configuration.
`feature_id` is auto-detected when the customer has exactly one AI credit system. The request fails if the customer has none, or has more than one and `feature_id` is omitted.
### Body Parameters
The ID of the customer.
The AI model in `provider/model` format, matching keys from [Models.dev](https://models.dev) (e.g., `anthropic/claude-opus-4-6`, `openai/gpt-4o`, `openrouter/anthropic/claude-opus-4.6`).
Number of non-cached text input tokens consumed. Exclusive of the cache and audio token pools.
Number of text output tokens consumed. Exclusive of the reasoning and audio output pools.
Number of cached input tokens read, billed at the model's cache read rate.
Number of input tokens written to the cache, billed at the model's cache write rate.
Number of reasoning tokens generated, billed at the model's reasoning rate (falls back to the output rate).
Number of audio input tokens consumed, billed at the model's audio input rate (falls back to the input rate).
Number of audio output tokens generated, billed at the model's audio output rate (falls back to the output rate).
The ID of the AI credit system feature. If omitted, automatically detects the customer's AI credit system feature. Required when the customer has more than one.
The ID of the entity for entity-scoped balances.
Additional properties to attach to this usage event. The token counts and a pricing breakdown (`cost`, `base_cost`, `markup`, `markup_source`, `tier_applied`, `rates`) are automatically included.
### Response
The ID of the customer whose token usage was tracked.
The dollar cost that was deducted from the customer's AI credit balance.
The updated balance for the AI credit system feature.
The feature ID this balance is for.
Total balance granted (included + prepaid).
Remaining balance available for use.
Total usage consumed in the current period.
Whether this feature has unlimited usage.
Whether usage beyond the granted balance is allowed.
Timestamp when the balance will reset, or null for no reset.
```json 200 theme={null}
{
"customer_id": "cus_123",
"value": 0.06,
"balance": {
"feature_id": "ai_credits",
"granted": 10.00,
"remaining": 9.94,
"usage": 0.06,
"unlimited": false,
"overage_allowed": false,
"next_reset_at": 1773851121437,
"breakdown": [
{
"id": "cus_ent_abc123",
"plan_id": "pro_plan",
"included_grant": 10.00,
"prepaid_grant": 0,
"remaining": 9.94,
"usage": 0.06,
"unlimited": false,
"reset": {
"interval": "month",
"resets_at": 1773851121437
},
"price": null,
"expires_at": null
}
]
}
}
```
# Update Balance
Source: https://docs.useautumn.com/api-reference/balances/updateBalance
openapi POST /v1/balances.update
Update a customer balance.
### Body Parameters
The ID of the customer.
The ID of the feature.
The ID of the entity for entity-scoped balances (e.g., per-seat limits).
Set the remaining balance to this exact value. Cannot be combined with add\_to\_balance.
Add this amount to the current balance. Use negative values to subtract. Cannot be combined with current\_balance.
The usage amount to update. Cannot be combined with remaining or add\_to\_balance.
Target a specific balance by its reset interval. Use when the customer has multiple balances for the same feature with different reset intervals.
Set the granted balance to this exact value.
Target a specific balance by its ID (set on create). Use when the customer has multiple balances for the same feature.
The next reset time for the balance. If there are multiple breakdowns, this will update the breakdown with the next reset time.
Unix timestamp (milliseconds) when the balance expires. Targets a specific balance via balance\_id / interval when the customer has multiple balances for the same feature.
### Response
# Attach
Source: https://docs.useautumn.com/api-reference/billing/attach
openapi POST /v1/billing.attach
Attaches a plan to a customer. Handles new subscriptions, upgrades and downgrades.
Use this endpoint to subscribe a customer to a plan, upgrade/downgrade between plans, or add an add-on product.
The attach endpoint subscribes a customer to a plan. It handles new
subscriptions, upgrades, and downgrades automatically. For modifying an
existing subscription (like changing quantities or canceling), use
[update](/api-reference/billing/billingUpdate) instead.
### Common Use Cases
```typescript Subscribe to a plan theme={null}
const response = await autumn.billing.attach({
customerId: "cus_123",
planId: "pro_plan",
});
if (response.paymentUrl) {
// Redirect customer to checkout
window.location.href = response.paymentUrl;
}
```
```typescript Custom pricing theme={null}
const response = await autumn.billing.attach({
customerId: "cus_123",
planId: "enterprise_plan",
customize: {
price: {
amount: 999, // $999
interval: "month",
},
},
});
```
```typescript Attach plan with prepaid quantities theme={null}
const response = await autumn.billing.attach({
customerId: "cus_123",
planId: "team_plan",
featureQuantities: [{ featureId: "seats", quantity: 5 }],
});
```
```typescript Pass metadata to Stripe subscription theme={null}
const response = await autumn.billing.attach({
customerId: "cus_123",
planId: "pro_plan",
checkoutSessionParams: {
subscriptionData: {
metadata: {
userId: "internal-user-id",
source: "upgrade-flow",
},
},
},
});
```
### Stripe checkout session params
Use `checkoutSessionParams` to pass additional data to the Stripe checkout session. Values you provide are deep-merged with Autumn's internal parameters, so your fields are preserved alongside ones Autumn sets automatically (like `trial_end` or internal metadata).
This is useful for attaching custom metadata to the Stripe subscription created during checkout — for example, linking subscriptions to internal user IDs or tracking the source of the purchase.
### Currency
Pass `currency` to bill the attach in a specific currency the plan offers via [`additional_currencies`](/documentation/concepts/plans#multiple-currencies). If omitted, Autumn uses the customer's currency, falling back to your organization's default.
A customer who has paid is locked to their currency: passing a different one, or attaching a plan that doesn't offer a paid price in their currency, fails with a `currency_mismatch` error before any billing happens.
### Body Parameters
The ID of the customer to attach the plan to.
The ID of the entity to attach the plan to.
The ID of the plan.
If this plan contains prepaid features, use this field to specify the quantity of each prepaid feature. This quantity includes the included amount and billing units defined when setting up the plan.
The ID of the feature to set quantity for.
The quantity of the feature.
Whether the customer can adjust the quantity.
The version of the plan to attach.
Free trial configuration for a plan.
Number of duration\_type periods the trial lasts.
Unit of time for the trial ('day', 'month', 'year').
If true, a payment method is required to start the trial and the customer is charged when it ends. Defaults to false.
Behavior when the trial ends. 'bill' charges the customer (default). 'revert' expires the trial and restores the customer's previous plan.
Customize the plan to attach. Can override the price, items, licenses, free trial, or a combination.
Base price configuration for a plan.
Base price amount for the plan, in major currency units (e.g. dollars).
Billing interval (e.g. 'month', 'year').
Number of intervals per billing cycle. Defaults to 1.
Base price amounts in additional currencies. The base 'amount' is in the org's default currency.
Three-letter Stripe-supported currency code (e.g. 'eur', 'gbp').
Price amount in this currency. Set explicitly per currency, not converted from the base amount.
Override the items in the plan (PUT-style — replaces all existing items). Mutually exclusive with add\_items / remove\_items / deprecated update\_items.
Bills this many feature units when outstanding overage reaches it.
The ID of the feature to configure.
Number of free units included. Balance resets to this each interval for consumable features.
If true, customer has unlimited access to this feature.
Whether entity-level grants contribute to a shared customer balance.
Reset configuration for consumable features. Omit for non-consumable features like seats.
Interval at which balance resets (e.g. 'month', 'year'). For consumable features only.
Number of intervals between resets. Defaults to 1.
Pricing for usage beyond included units. Omit for free features.
Price per billing\_units after included usage. Either 'amount' or 'tiers' is required.
Amounts in additional currencies for this flat price. The base 'amount' is in the org's default currency. Only valid with 'amount', not 'tiers'.
Three-letter Stripe-supported currency code (e.g. 'eur', 'gbp').
Price amount in this currency. Set explicitly per currency, not converted from the base amount.
Tiered pricing. Either 'amount' or 'tiers' is required.
Per-currency amounts for this tier. Tier boundaries ('to') are shared across all currencies.
Three-letter Stripe-supported currency code (e.g. 'eur', 'gbp').
Per-unit amount for this tier in this currency.
Flat amount for this tier in this currency, if the tier uses one.
Billing interval. For consumable features, should match reset.interval.
Number of intervals per billing cycle. Defaults to 1.
Units per price increment. Usage is rounded UP when billed (e.g. billing\_units=100 means 101 rounds to 200).
'prepaid' for upfront payment (seats), 'usage\_based' for pay-as-you-go.
Max units purchasable beyond included. E.g. included=100, max\_purchase=300 allows 400 total. Null for no limit.
Proration settings for prepaid features. Controls mid-cycle quantity change billing.
Billing behavior when quantity increases mid-cycle.
Credit behavior when quantity decreases mid-cycle.
Rollover config for unused units. If set, unused included units carry over.
Max rollover units. Omit for unlimited rollover.
Maximum rollover as a percentage (0-100) of included + prepaid grant. Mutually exclusive with max.
When rolled over units expire.
Number of periods before expiry.
Overrides fields of this item's feature for customers on this plan (e.g. a credit system's credit\_schema).
For credit system features: replaces the feature's credit\_schema entirely for customers on this plan.
ID of the metered feature that draws from this credit system.
Number of metered-feature units priced together. Defaults to one when omitted.
Named rates chosen by event properties. The most specific match sets the rate; with no match the item's own rate applies.
Event properties this entry applies to. Every key must equal the tracked property, compared as strings.
Breaks ties between dimensions that match the same number of keys. Higher wins.
Inclusive upper usage boundary for this graduated tier. The final tier must be 'inf'.
Credits consumed per billing-unit group within this tier.
Named adjustments chosen by event properties. Every match applies: factors multiply, then adds are summed.
Event properties this entry applies to. Every key must equal the tracked property, compared as strings.
Multiplies the matched rate. All matching multipliers stack.
Added to the rate after every factor is applied, in credits per billing-unit group.
Inclusive upper usage boundary for this graduated tier. The final tier must be 'inf'.
Credits consumed per billing-unit group within this tier.
Credits consumed per billing-unit group.
For AI credit system features: replaces the feature's markup chain entirely for customers on this plan. An unset level means no markup at that level rather than inheriting the feature's.
Default percentage markup for customers on this plan. Use -100 to make usage free.
Per-provider markup percentages for customers on this plan.
Per-model markup overrides for customers on this plan.
Items to add to the plan.
Bills this many feature units when outstanding overage reaches it.
The ID of the feature to configure.
Number of free units included. Balance resets to this each interval for consumable features.
If true, customer has unlimited access to this feature.
Whether entity-level grants contribute to a shared customer balance.
Reset configuration for consumable features. Omit for non-consumable features like seats.
Interval at which balance resets (e.g. 'month', 'year'). For consumable features only.
Number of intervals between resets. Defaults to 1.
Pricing for usage beyond included units. Omit for free features.
Price per billing\_units after included usage. Either 'amount' or 'tiers' is required.
Amounts in additional currencies for this flat price. The base 'amount' is in the org's default currency. Only valid with 'amount', not 'tiers'.
Three-letter Stripe-supported currency code (e.g. 'eur', 'gbp').
Price amount in this currency. Set explicitly per currency, not converted from the base amount.
Tiered pricing. Either 'amount' or 'tiers' is required.
Per-currency amounts for this tier. Tier boundaries ('to') are shared across all currencies.
Three-letter Stripe-supported currency code (e.g. 'eur', 'gbp').
Per-unit amount for this tier in this currency.
Flat amount for this tier in this currency, if the tier uses one.
Billing interval. For consumable features, should match reset.interval.
Number of intervals per billing cycle. Defaults to 1.
Units per price increment. Usage is rounded UP when billed (e.g. billing\_units=100 means 101 rounds to 200).
'prepaid' for upfront payment (seats), 'usage\_based' for pay-as-you-go.
Max units purchasable beyond included. E.g. included=100, max\_purchase=300 allows 400 total. Null for no limit.
Proration settings for prepaid features. Controls mid-cycle quantity change billing.
Billing behavior when quantity increases mid-cycle.
Credit behavior when quantity decreases mid-cycle.
Rollover config for unused units. If set, unused included units carry over.
Max rollover units. Omit for unlimited rollover.
Maximum rollover as a percentage (0-100) of included + prepaid grant. Mutually exclusive with max.
When rolled over units expire.
Number of periods before expiry.
Overrides fields of this item's feature for customers on this plan (e.g. a credit system's credit\_schema).
For credit system features: replaces the feature's credit\_schema entirely for customers on this plan.
ID of the metered feature that draws from this credit system.
Number of metered-feature units priced together. Defaults to one when omitted.
Named rates chosen by event properties. The most specific match sets the rate; with no match the item's own rate applies.
Event properties this entry applies to. Every key must equal the tracked property, compared as strings.
Breaks ties between dimensions that match the same number of keys. Higher wins.
Inclusive upper usage boundary for this graduated tier. The final tier must be 'inf'.
Credits consumed per billing-unit group within this tier.
Named adjustments chosen by event properties. Every match applies: factors multiply, then adds are summed.
Event properties this entry applies to. Every key must equal the tracked property, compared as strings.
Multiplies the matched rate. All matching multipliers stack.
Added to the rate after every factor is applied, in credits per billing-unit group.
Inclusive upper usage boundary for this graduated tier. The final tier must be 'inf'.
Credits consumed per billing-unit group within this tier.
Credits consumed per billing-unit group.
For AI credit system features: replaces the feature's markup chain entirely for customers on this plan. An unset level means no markup at that level rather than inheriting the feature's.
Default percentage markup for customers on this plan. Use -100 to make usage free.
Per-provider markup percentages for customers on this plan.
Per-model markup overrides for customers on this plan.
Filters selecting items to remove from the plan.
Match items linked to this feature.
Match items with this billing method (prepaid or usage\_based).
Match items with this interval. Accepts either a BillingInterval (price-side) or a ResetInterval (reset-side, includes day/hour/minute) so price-less items keyed by reset.interval can be disambiguated.
Match items with this interval\_count. Disambiguates between items that share an interval but differ in count.
Match items whose grant equals this included usage. Omitted is a wildcard.
Free trial configuration for a plan.
Number of duration\_type periods the trial lasts.
Unit of time for the trial ('day', 'month', 'year').
If true, a payment method is required to start the trial and the customer is charged when it ends. Defaults to false.
Behavior when the trial ends. 'bill' charges the customer (default). 'revert' expires the trial and restores the customer's previous plan.
Override the plan's billing controls (auto top-ups, spend limits, usage limits, usage alerts, overage allowed) for this customer.
List of auto top-up configurations per feature.
The ID of the feature (credit balance) to auto top-up.
Whether auto top-up is enabled.
When the balance drops below this threshold, an auto top-up will be purchased.
Amount of credits to add per auto top-up.
Optional rate limit to cap how often auto top-ups occur. Pass count to set the current window's consumed top-ups.
The time interval for the purchase limit window.
Number of intervals in the purchase limit window.
Maximum number of auto top-ups allowed within the interval.
Set the current window's consumed auto top-up count. Omit to leave runtime state unchanged.
When true, auto top-up creates a send\_invoice invoice instead of auto-charging.
List of overage spend limits per feature (caps overage spend).
Optional feature ID this spend limit applies to.
Whether the overage spend limit is enabled.
How overage\_limit is interpreted: an absolute overage cap (default) or a percentage of the main-plan allowance.
Overage cap for the feature: absolute units, or a percent (e.g. 120) when limit\_type is usage\_percentage.
When true, overage for this feature is not posted to Stripe. Usage tracking and balance resets still behave normally.
List of hard usage caps per feature (max units per interval).
The feature this usage limit applies to.
Whether this usage limit is enabled.
Maximum units allowed per interval.
Interval for the cap, aligned to the customer's billing cycle.
Window alignment. 'billing\_cycle' phases the interval to the customer's renewal time; 'utc' aligns to the UTC calendar.
When set, only usage from events whose properties match counts toward this cap. Omit to count all usage of the feature.
List of usage alert configurations per feature.
The feature ID this alert applies to.
Whether this usage alert is enabled.
The threshold value that triggers the alert. For usage or remaining, this is an absolute count. For usage\_percentage or remaining\_percentage, this is a percentage (0-100).
Whether the threshold is an absolute count or a percentage of the usage allowance or remaining balance.
What 100% means. balance: every grant on the feature. included: the plan allowance only. recurring: grants that reset. usage\_limit: the cap of the usage limit with the same feature and filter.
Only valid with basis usage\_limit. Points the alert at the usage limit carrying the same filter.
Optional user-defined label to distinguish multiple alerts on the same feature.
List of overage allowed controls per feature. When enabled, usage can exceed balance.
The feature ID this overage allowed control applies to.
Whether overage is allowed for this feature.
License links to add or override for this customer, keyed by license\_plan\_id. Omitted fields inherit the plan catalog link (included defaults to 1 when the license is not in the catalog). A bare entry restores the license to pure catalog inheritance.
Base price configuration for a plan.
Base price amount for the plan, in major currency units (e.g. dollars).
Billing interval (e.g. 'month', 'year').
Number of intervals per billing cycle. Defaults to 1.
Base price amounts in additional currencies. The base 'amount' is in the org's default currency.
Three-letter Stripe-supported currency code (e.g. 'eur', 'gbp').
Price amount in this currency. Set explicitly per currency, not converted from the base amount.
Bills this many feature units when outstanding overage reaches it.
The ID of the feature to configure.
Number of free units included. Balance resets to this each interval for consumable features.
If true, customer has unlimited access to this feature.
Whether entity-level grants contribute to a shared customer balance.
Reset configuration for consumable features. Omit for non-consumable features like seats.
Interval at which balance resets (e.g. 'month', 'year'). For consumable features only.
Number of intervals between resets. Defaults to 1.
Pricing for usage beyond included units. Omit for free features.
Price per billing\_units after included usage. Either 'amount' or 'tiers' is required.
Amounts in additional currencies for this flat price. The base 'amount' is in the org's default currency. Only valid with 'amount', not 'tiers'.
Three-letter Stripe-supported currency code (e.g. 'eur', 'gbp').
Price amount in this currency. Set explicitly per currency, not converted from the base amount.
Tiered pricing. Either 'amount' or 'tiers' is required.
Per-currency amounts for this tier. Tier boundaries ('to') are shared across all currencies.
Three-letter Stripe-supported currency code (e.g. 'eur', 'gbp').
Per-unit amount for this tier in this currency.
Flat amount for this tier in this currency, if the tier uses one.
Billing interval. For consumable features, should match reset.interval.
Number of intervals per billing cycle. Defaults to 1.
Units per price increment. Usage is rounded UP when billed (e.g. billing\_units=100 means 101 rounds to 200).
'prepaid' for upfront payment (seats), 'usage\_based' for pay-as-you-go.
Max units purchasable beyond included. E.g. included=100, max\_purchase=300 allows 400 total. Null for no limit.
Proration settings for prepaid features. Controls mid-cycle quantity change billing.
Billing behavior when quantity increases mid-cycle.
Credit behavior when quantity decreases mid-cycle.
Rollover config for unused units. If set, unused included units carry over.
Max rollover units. Omit for unlimited rollover.
Maximum rollover as a percentage (0-100) of included + prepaid grant. Mutually exclusive with max.
When rolled over units expire.
Number of periods before expiry.
Overrides fields of this item's feature for customers on this plan (e.g. a credit system's credit\_schema).
For credit system features: replaces the feature's credit\_schema entirely for customers on this plan.
ID of the metered feature that draws from this credit system.
Number of metered-feature units priced together. Defaults to one when omitted.
Named rates chosen by event properties. The most specific match sets the rate; with no match the item's own rate applies.
Event properties this entry applies to. Every key must equal the tracked property, compared as strings.
Breaks ties between dimensions that match the same number of keys. Higher wins.
Inclusive upper usage boundary for this graduated tier. The final tier must be 'inf'.
Credits consumed per billing-unit group within this tier.
Named adjustments chosen by event properties. Every match applies: factors multiply, then adds are summed.
Event properties this entry applies to. Every key must equal the tracked property, compared as strings.
Multiplies the matched rate. All matching multipliers stack.
Added to the rate after every factor is applied, in credits per billing-unit group.
Inclusive upper usage boundary for this graduated tier. The final tier must be 'inf'.
Credits consumed per billing-unit group within this tier.
Credits consumed per billing-unit group.
For AI credit system features: replaces the feature's markup chain entirely for customers on this plan. An unset level means no markup at that level rather than inheriting the feature's.
Default percentage markup for customers on this plan. Use -100 to make usage free.
Per-provider markup percentages for customers on this plan.
Per-model markup overrides for customers on this plan.
Match items linked to this feature.
Match items with this billing method (prepaid or usage\_based).
Match items with this interval. Accepts either a BillingInterval (price-side) or a ResetInterval (reset-side, includes day/hour/minute) so price-less items keyed by reset.interval can be disambiguated.
Match items with this interval\_count. Disambiguates between items that share an interval but differ in count.
Match items whose grant equals this included usage. Omitted is a wildcard.
License links to drop, keyed by license\_plan\_id. Parallel to remove\_items.
Invoice mode creates a draft or open invoice and sends it to the customer, instead of charging their card immediately. This uses Stripe's send\_invoice collection method.
When true, creates an invoice and sends it to the customer instead of charging their card immediately. Uses Stripe's send\_invoice collection method.
If true, enables the plan immediately even though the invoice is not paid yet.
If true, finalizes the invoice so it can be sent to the customer. If false, keeps it as a draft for manual review.
ID of an invoice template (configured in billing settings) whose footer (e.g. bank details) is applied to the invoice.
Number of days the customer has to pay the invoice before it is due (Stripe days\_until\_due).
How to handle proration when updating an existing subscription. 'prorate\_immediately' charges/credits prorated amounts now, 'none' skips creating any charges.
Controls when to return a checkout URL. 'always' returns a URL even if payment succeeds, 'if\_required' only when payment action is needed, 'never' disables redirects.
A unique ID to identify this subscription. Can be used to target specific subscriptions in update operations when a customer has multiple products with the same plan.
List of discounts to apply. Each discount can be an Autumn reward ID, Stripe coupon ID, or Stripe promotion code.
The ID of the reward to apply as a discount.
The promotion code to apply as a discount.
URL to redirect to after successful checkout.
Only applicable when the customer has an existing Stripe subscription. If true, creates a new separate subscription instead of merging into the existing one.
Reset the billing cycle immediately with 'now', or schedule a reset at a future Unix timestamp in milliseconds.
When the plan change should take effect. 'immediate' applies now, 'end\_of\_cycle' schedules for the end of the current billing cycle. By default, upgrades are immediate and downgrades are scheduled.
Unix timestamp in milliseconds for when the attached plan should start. Future dates create a scheduled subscription.
Unix timestamp in milliseconds for when the attached plan should end.
Additional parameters to pass into the creation of the Stripe checkout session.
If true, returns an Autumn-hosted checkout link that can create a fresh Stripe checkout session when opened.
Custom line items that override the auto-generated proration invoice. Only valid for immediate plan changes (eg. upgrades or one off plans).
Amount in dollars for this line item (e.g. 10.50). Can be negative for credits.
Description for the line item.
The processor subscription ID to link. Use this to attach an existing Stripe subscription instead of creating a new one.
Whether to carry over balances from the previous plan.
Whether to carry over balances from the previous plan.
The IDs of the features to carry over balances from. If left undefined, all features will be carried over.
Whether to carry over usages from the previous plan.
Whether to carry over usages from the previous plan.
The IDs of the features to carry over usages for. If left undefined, all consumable features will be carried over.
Seat quantities for the plan's licenses, keyed by license plan.
The license plan to set seat quantity for.
Total seats for the license, inclusive of the plan's included amount — seats beyond it are paid.
Key-value metadata to attach to the Stripe subscription, invoice, and checkout session created during this attach flow. Keys prefixed with 'autumn\_' are reserved and will be stripped.
If true, skips any billing changes for the attach operation.
If true, the customer's plan is activated immediately even when payment is deferred (invoice mode) or pending (Stripe checkout). For Stripe checkout, the customer\_product is inserted before the customer completes the hosted form. Set it here rather than on `invoice_mode`, which only covers the invoice-unpaid case.
Stripe tax rate ID (txr\_...) to apply as the default tax rate on the created subscription, invoice, or checkout session line items.
Currency to bill this attach in (e.g. usd, eur). Must match the customer's currency if they are already locked to one, and the plan must offer a paid price in it. Defaults to the customer's currency, then the org default.
Plan IDs to expire on the customer as part of this attach. Each must be an active plan billed on the same subscription as the attach (or a free plan); plans on a separate subscription are rejected.
### Response
The ID of the customer.
The ID of the entity, if the plan was attached to an entity.
Invoice details if an invoice was created. Only present when a charge was made.
The status of the invoice (e.g., 'paid', 'open', 'draft').
The Stripe invoice ID.
The total amount of the invoice in cents.
The three-letter ISO currency code (e.g., 'usd').
URL to the hosted invoice page where the customer can view and pay the invoice.
URL to redirect the customer to complete payment. Null if no payment action is required.
Details about any action required to complete the payment. Present when the payment could not be processed automatically.
The type of action required to complete the payment.
A human-readable explanation of why this action is required.
```json 200 theme={null}
{
"customer_id": "cus_123",
"payment_url": "https://checkout.stripe.com/..."
}
```
# Update Subscription
Source: https://docs.useautumn.com/api-reference/billing/billingUpdate
openapi POST /v1/billing.update
Updates an existing subscription. Use to modify feature quantities, cancel, or change plan configuration.
Use this endpoint to update prepaid quantities, cancel a subscription (immediately or at end of cycle), or modify subscription settings.
The update endpoint modifies an existing subscription. Use this to change prepaid quantities, cancel subscriptions, or modify plan configuration. For subscribing to a new plan, use [attach](/api-reference/billing/attach) instead.
### Common Use Cases
```typescript Update prepaid quantity theme={null}
const response = await autumn.billing.update({
customerId: "cus_123",
planId: "pro_plan",
featureQuantities: [{ featureId: "seats", quantity: 10 }]
});
```
```typescript Cancel at end of cycle theme={null}
const response = await autumn.billing.update({
customerId: "cus_123",
planId: "pro_plan",
cancelAction: "cancel_end_of_cycle"
});
```
```typescript Uncancel subscription theme={null}
const response = await autumn.billing.update({
customerId: "cus_123",
planId: "pro_plan",
cancelAction: "uncancel"
});
```
### Body Parameters
The ID of the customer to attach the plan to.
The ID of the entity to attach the plan to.
The ID of the plan to update. Optional if subscription\_id is provided, or if the customer has only one product.
If this plan contains prepaid features, use this field to specify the quantity of each prepaid feature. This quantity includes the included amount and billing units defined when setting up the plan.
The ID of the feature to set quantity for.
The quantity of the feature.
Whether the customer can adjust the quantity.
The version of the plan to attach.
Free trial configuration for a plan.
Number of duration\_type periods the trial lasts.
Unit of time for the trial ('day', 'month', 'year').
If true, a payment method is required to start the trial and the customer is charged when it ends. Defaults to false.
Behavior when the trial ends. 'bill' charges the customer (default). 'revert' expires the trial and restores the customer's previous plan.
Customize the plan to attach. Can override the price, items, licenses, free trial, or a combination.
Base price configuration for a plan.
Base price amount for the plan, in major currency units (e.g. dollars).
Billing interval (e.g. 'month', 'year').
Number of intervals per billing cycle. Defaults to 1.
Base price amounts in additional currencies. The base 'amount' is in the org's default currency.
Three-letter Stripe-supported currency code (e.g. 'eur', 'gbp').
Price amount in this currency. Set explicitly per currency, not converted from the base amount.
Override the items in the plan (PUT-style — replaces all existing items). Mutually exclusive with add\_items / remove\_items / deprecated update\_items.
Bills this many feature units when outstanding overage reaches it.
The ID of the feature to configure.
Number of free units included. Balance resets to this each interval for consumable features.
If true, customer has unlimited access to this feature.
Whether entity-level grants contribute to a shared customer balance.
Reset configuration for consumable features. Omit for non-consumable features like seats.
Interval at which balance resets (e.g. 'month', 'year'). For consumable features only.
Number of intervals between resets. Defaults to 1.
Pricing for usage beyond included units. Omit for free features.
Price per billing\_units after included usage. Either 'amount' or 'tiers' is required.
Amounts in additional currencies for this flat price. The base 'amount' is in the org's default currency. Only valid with 'amount', not 'tiers'.
Three-letter Stripe-supported currency code (e.g. 'eur', 'gbp').
Price amount in this currency. Set explicitly per currency, not converted from the base amount.
Tiered pricing. Either 'amount' or 'tiers' is required.
Per-currency amounts for this tier. Tier boundaries ('to') are shared across all currencies.
Three-letter Stripe-supported currency code (e.g. 'eur', 'gbp').
Per-unit amount for this tier in this currency.
Flat amount for this tier in this currency, if the tier uses one.
Billing interval. For consumable features, should match reset.interval.
Number of intervals per billing cycle. Defaults to 1.
Units per price increment. Usage is rounded UP when billed (e.g. billing\_units=100 means 101 rounds to 200).
'prepaid' for upfront payment (seats), 'usage\_based' for pay-as-you-go.
Max units purchasable beyond included. E.g. included=100, max\_purchase=300 allows 400 total. Null for no limit.
Proration settings for prepaid features. Controls mid-cycle quantity change billing.
Billing behavior when quantity increases mid-cycle.
Credit behavior when quantity decreases mid-cycle.
Rollover config for unused units. If set, unused included units carry over.
Max rollover units. Omit for unlimited rollover.
Maximum rollover as a percentage (0-100) of included + prepaid grant. Mutually exclusive with max.
When rolled over units expire.
Number of periods before expiry.
Overrides fields of this item's feature for customers on this plan (e.g. a credit system's credit\_schema).
For credit system features: replaces the feature's credit\_schema entirely for customers on this plan.
ID of the metered feature that draws from this credit system.
Number of metered-feature units priced together. Defaults to one when omitted.
Named rates chosen by event properties. The most specific match sets the rate; with no match the item's own rate applies.
Event properties this entry applies to. Every key must equal the tracked property, compared as strings.
Breaks ties between dimensions that match the same number of keys. Higher wins.
Inclusive upper usage boundary for this graduated tier. The final tier must be 'inf'.
Credits consumed per billing-unit group within this tier.
Named adjustments chosen by event properties. Every match applies: factors multiply, then adds are summed.
Event properties this entry applies to. Every key must equal the tracked property, compared as strings.
Multiplies the matched rate. All matching multipliers stack.
Added to the rate after every factor is applied, in credits per billing-unit group.
Inclusive upper usage boundary for this graduated tier. The final tier must be 'inf'.
Credits consumed per billing-unit group within this tier.
Credits consumed per billing-unit group.
For AI credit system features: replaces the feature's markup chain entirely for customers on this plan. An unset level means no markup at that level rather than inheriting the feature's.
Default percentage markup for customers on this plan. Use -100 to make usage free.
Per-provider markup percentages for customers on this plan.
Per-model markup overrides for customers on this plan.
Items to add to the plan.
Bills this many feature units when outstanding overage reaches it.
The ID of the feature to configure.
Number of free units included. Balance resets to this each interval for consumable features.
If true, customer has unlimited access to this feature.
Whether entity-level grants contribute to a shared customer balance.
Reset configuration for consumable features. Omit for non-consumable features like seats.
Interval at which balance resets (e.g. 'month', 'year'). For consumable features only.
Number of intervals between resets. Defaults to 1.
Pricing for usage beyond included units. Omit for free features.
Price per billing\_units after included usage. Either 'amount' or 'tiers' is required.
Amounts in additional currencies for this flat price. The base 'amount' is in the org's default currency. Only valid with 'amount', not 'tiers'.
Three-letter Stripe-supported currency code (e.g. 'eur', 'gbp').
Price amount in this currency. Set explicitly per currency, not converted from the base amount.
Tiered pricing. Either 'amount' or 'tiers' is required.
Per-currency amounts for this tier. Tier boundaries ('to') are shared across all currencies.
Three-letter Stripe-supported currency code (e.g. 'eur', 'gbp').
Per-unit amount for this tier in this currency.
Flat amount for this tier in this currency, if the tier uses one.
Billing interval. For consumable features, should match reset.interval.
Number of intervals per billing cycle. Defaults to 1.
Units per price increment. Usage is rounded UP when billed (e.g. billing\_units=100 means 101 rounds to 200).
'prepaid' for upfront payment (seats), 'usage\_based' for pay-as-you-go.
Max units purchasable beyond included. E.g. included=100, max\_purchase=300 allows 400 total. Null for no limit.
Proration settings for prepaid features. Controls mid-cycle quantity change billing.
Billing behavior when quantity increases mid-cycle.
Credit behavior when quantity decreases mid-cycle.
Rollover config for unused units. If set, unused included units carry over.
Max rollover units. Omit for unlimited rollover.
Maximum rollover as a percentage (0-100) of included + prepaid grant. Mutually exclusive with max.
When rolled over units expire.
Number of periods before expiry.
Overrides fields of this item's feature for customers on this plan (e.g. a credit system's credit\_schema).
For credit system features: replaces the feature's credit\_schema entirely for customers on this plan.
ID of the metered feature that draws from this credit system.
Number of metered-feature units priced together. Defaults to one when omitted.
Named rates chosen by event properties. The most specific match sets the rate; with no match the item's own rate applies.
Event properties this entry applies to. Every key must equal the tracked property, compared as strings.
Breaks ties between dimensions that match the same number of keys. Higher wins.
Inclusive upper usage boundary for this graduated tier. The final tier must be 'inf'.
Credits consumed per billing-unit group within this tier.
Named adjustments chosen by event properties. Every match applies: factors multiply, then adds are summed.
Event properties this entry applies to. Every key must equal the tracked property, compared as strings.
Multiplies the matched rate. All matching multipliers stack.
Added to the rate after every factor is applied, in credits per billing-unit group.
Inclusive upper usage boundary for this graduated tier. The final tier must be 'inf'.
Credits consumed per billing-unit group within this tier.
Credits consumed per billing-unit group.
For AI credit system features: replaces the feature's markup chain entirely for customers on this plan. An unset level means no markup at that level rather than inheriting the feature's.
Default percentage markup for customers on this plan. Use -100 to make usage free.
Per-provider markup percentages for customers on this plan.
Per-model markup overrides for customers on this plan.
Filters selecting items to remove from the plan.
Match items linked to this feature.
Match items with this billing method (prepaid or usage\_based).
Match items with this interval. Accepts either a BillingInterval (price-side) or a ResetInterval (reset-side, includes day/hour/minute) so price-less items keyed by reset.interval can be disambiguated.
Match items with this interval\_count. Disambiguates between items that share an interval but differ in count.
Match items whose grant equals this included usage. Omitted is a wildcard.
Free trial configuration for a plan.
Number of duration\_type periods the trial lasts.
Unit of time for the trial ('day', 'month', 'year').
If true, a payment method is required to start the trial and the customer is charged when it ends. Defaults to false.
Behavior when the trial ends. 'bill' charges the customer (default). 'revert' expires the trial and restores the customer's previous plan.
Override the plan's billing controls (auto top-ups, spend limits, usage limits, usage alerts, overage allowed) for this customer.
List of auto top-up configurations per feature.
The ID of the feature (credit balance) to auto top-up.
Whether auto top-up is enabled.
When the balance drops below this threshold, an auto top-up will be purchased.
Amount of credits to add per auto top-up.
Optional rate limit to cap how often auto top-ups occur. Pass count to set the current window's consumed top-ups.
The time interval for the purchase limit window.
Number of intervals in the purchase limit window.
Maximum number of auto top-ups allowed within the interval.
Set the current window's consumed auto top-up count. Omit to leave runtime state unchanged.
When true, auto top-up creates a send\_invoice invoice instead of auto-charging.
List of overage spend limits per feature (caps overage spend).
Optional feature ID this spend limit applies to.
Whether the overage spend limit is enabled.
How overage\_limit is interpreted: an absolute overage cap (default) or a percentage of the main-plan allowance.
Overage cap for the feature: absolute units, or a percent (e.g. 120) when limit\_type is usage\_percentage.
When true, overage for this feature is not posted to Stripe. Usage tracking and balance resets still behave normally.
List of hard usage caps per feature (max units per interval).
The feature this usage limit applies to.
Whether this usage limit is enabled.
Maximum units allowed per interval.
Interval for the cap, aligned to the customer's billing cycle.
Window alignment. 'billing\_cycle' phases the interval to the customer's renewal time; 'utc' aligns to the UTC calendar.
When set, only usage from events whose properties match counts toward this cap. Omit to count all usage of the feature.
List of usage alert configurations per feature.
The feature ID this alert applies to.
Whether this usage alert is enabled.
The threshold value that triggers the alert. For usage or remaining, this is an absolute count. For usage\_percentage or remaining\_percentage, this is a percentage (0-100).
Whether the threshold is an absolute count or a percentage of the usage allowance or remaining balance.
What 100% means. balance: every grant on the feature. included: the plan allowance only. recurring: grants that reset. usage\_limit: the cap of the usage limit with the same feature and filter.
Only valid with basis usage\_limit. Points the alert at the usage limit carrying the same filter.
Optional user-defined label to distinguish multiple alerts on the same feature.
List of overage allowed controls per feature. When enabled, usage can exceed balance.
The feature ID this overage allowed control applies to.
Whether overage is allowed for this feature.
License links to add or override for this customer, keyed by license\_plan\_id. Omitted fields inherit the plan catalog link (included defaults to 1 when the license is not in the catalog). A bare entry restores the license to pure catalog inheritance.
Base price configuration for a plan.
Base price amount for the plan, in major currency units (e.g. dollars).
Billing interval (e.g. 'month', 'year').
Number of intervals per billing cycle. Defaults to 1.
Base price amounts in additional currencies. The base 'amount' is in the org's default currency.
Three-letter Stripe-supported currency code (e.g. 'eur', 'gbp').
Price amount in this currency. Set explicitly per currency, not converted from the base amount.
Bills this many feature units when outstanding overage reaches it.
The ID of the feature to configure.
Number of free units included. Balance resets to this each interval for consumable features.
If true, customer has unlimited access to this feature.
Whether entity-level grants contribute to a shared customer balance.
Reset configuration for consumable features. Omit for non-consumable features like seats.
Interval at which balance resets (e.g. 'month', 'year'). For consumable features only.
Number of intervals between resets. Defaults to 1.
Pricing for usage beyond included units. Omit for free features.
Price per billing\_units after included usage. Either 'amount' or 'tiers' is required.
Amounts in additional currencies for this flat price. The base 'amount' is in the org's default currency. Only valid with 'amount', not 'tiers'.
Three-letter Stripe-supported currency code (e.g. 'eur', 'gbp').
Price amount in this currency. Set explicitly per currency, not converted from the base amount.
Tiered pricing. Either 'amount' or 'tiers' is required.
Per-currency amounts for this tier. Tier boundaries ('to') are shared across all currencies.
Three-letter Stripe-supported currency code (e.g. 'eur', 'gbp').
Per-unit amount for this tier in this currency.
Flat amount for this tier in this currency, if the tier uses one.
Billing interval. For consumable features, should match reset.interval.
Number of intervals per billing cycle. Defaults to 1.
Units per price increment. Usage is rounded UP when billed (e.g. billing\_units=100 means 101 rounds to 200).
'prepaid' for upfront payment (seats), 'usage\_based' for pay-as-you-go.
Max units purchasable beyond included. E.g. included=100, max\_purchase=300 allows 400 total. Null for no limit.
Proration settings for prepaid features. Controls mid-cycle quantity change billing.
Billing behavior when quantity increases mid-cycle.
Credit behavior when quantity decreases mid-cycle.
Rollover config for unused units. If set, unused included units carry over.
Max rollover units. Omit for unlimited rollover.
Maximum rollover as a percentage (0-100) of included + prepaid grant. Mutually exclusive with max.
When rolled over units expire.
Number of periods before expiry.
Overrides fields of this item's feature for customers on this plan (e.g. a credit system's credit\_schema).
For credit system features: replaces the feature's credit\_schema entirely for customers on this plan.
ID of the metered feature that draws from this credit system.
Number of metered-feature units priced together. Defaults to one when omitted.
Named rates chosen by event properties. The most specific match sets the rate; with no match the item's own rate applies.
Event properties this entry applies to. Every key must equal the tracked property, compared as strings.
Breaks ties between dimensions that match the same number of keys. Higher wins.
Inclusive upper usage boundary for this graduated tier. The final tier must be 'inf'.
Credits consumed per billing-unit group within this tier.
Named adjustments chosen by event properties. Every match applies: factors multiply, then adds are summed.
Event properties this entry applies to. Every key must equal the tracked property, compared as strings.
Multiplies the matched rate. All matching multipliers stack.
Added to the rate after every factor is applied, in credits per billing-unit group.
Inclusive upper usage boundary for this graduated tier. The final tier must be 'inf'.
Credits consumed per billing-unit group within this tier.
Credits consumed per billing-unit group.
For AI credit system features: replaces the feature's markup chain entirely for customers on this plan. An unset level means no markup at that level rather than inheriting the feature's.
Default percentage markup for customers on this plan. Use -100 to make usage free.
Per-provider markup percentages for customers on this plan.
Per-model markup overrides for customers on this plan.
Match items linked to this feature.
Match items with this billing method (prepaid or usage\_based).
Match items with this interval. Accepts either a BillingInterval (price-side) or a ResetInterval (reset-side, includes day/hour/minute) so price-less items keyed by reset.interval can be disambiguated.
Match items with this interval\_count. Disambiguates between items that share an interval but differ in count.
Match items whose grant equals this included usage. Omitted is a wildcard.
License links to drop, keyed by license\_plan\_id. Parallel to remove\_items.
Invoice mode creates a draft or open invoice and sends it to the customer, instead of charging their card immediately. This uses Stripe's send\_invoice collection method.
When true, creates an invoice and sends it to the customer instead of charging their card immediately. Uses Stripe's send\_invoice collection method.
If true, enables the plan immediately even though the invoice is not paid yet.
If true, finalizes the invoice so it can be sent to the customer. If false, keeps it as a draft for manual review.
ID of an invoice template (configured in billing settings) whose footer (e.g. bank details) is applied to the invoice.
Number of days the customer has to pay the invoice before it is due (Stripe days\_until\_due).
How to handle proration when updating an existing subscription. 'prorate\_immediately' charges/credits prorated amounts now, 'none' skips creating any charges.
Controls when to return a checkout URL. 'always' returns a URL even if payment succeeds, 'if\_required' only when payment action is needed, 'never' disables redirects.
A unique ID to identify this subscription. Can be used to target specific subscriptions in update operations when a customer has multiple products with the same plan.
List of discounts to apply. Each discount can be an Autumn reward ID, Stripe coupon ID, or Stripe promotion code.
The ID of the reward to apply as a discount.
The promotion code to apply as a discount.
Action to perform for cancellation. 'cancel\_immediately' cancels now with prorated refund, 'cancel\_end\_of\_cycle' cancels at period end, 'uncancel' reverses a pending cancellation.
Reset the billing cycle immediately with 'now', or schedule a reset at a future Unix timestamp in milliseconds.
If true, the subscription is updated internally without applying billing changes in Stripe.
Controls how the last payment is refunded on immediate cancellation. 'prorated' refunds the unused portion, 'full' refunds the entire last payment.
Additional parameters to pass into the Stripe subscription update or cancel call.
Controls whether balances should be recalculated during the subscription update.
If true, recalculates balances during the subscription update. Only applicable when updating feature quantities.
Whether to carry over usages from the previous plan.
Whether to carry over usages from the previous plan.
The IDs of the features to carry over usages for. If left undefined, all consumable features will be carried over.
Total seat quantities (inclusive of the license's included count) per license plan offered by this plan. Licenses not listed keep their current paid quantity.
The license plan to set seat quantity for.
Total seats for the license, inclusive of the plan's included amount — seats beyond it are paid.
Custom line items that replace the auto-generated proration invoice, or bill a standalone invoice when nothing else changes. Only valid on an existing recurring subscription.
Amount in dollars for this line item (e.g. 10.50). Can be negative for credits.
Description for the line item.
### Response
The ID of the customer.
The ID of the entity, if the plan was attached to an entity.
Invoice details if an invoice was created. Only present when a charge was made.
The status of the invoice (e.g., 'paid', 'open', 'draft').
The Stripe invoice ID.
The total amount of the invoice in cents.
The three-letter ISO currency code (e.g., 'usd').
URL to the hosted invoice page where the customer can view and pay the invoice.
URL to redirect the customer to complete payment. Null if no payment action is required.
Details about any action required to complete the payment. Present when the payment could not be processed automatically.
The type of action required to complete the payment.
A human-readable explanation of why this action is required.
```json 200 theme={null}
{
"customer_id": "cus_123",
"invoice": {
"status": "paid",
"stripe_id": "in_1234",
"total": 1500,
"currency": "usd",
"hosted_invoice_url": "https://invoice.stripe.com/..."
},
"payment_url": null
}
```
# Create Schedule
Source: https://docs.useautumn.com/api-reference/billing/createSchedule
openapi POST /v1/billing.create_schedule
Creates a multi-phase subscription schedule for a customer. The first phase starts immediately and subsequent phases automatically transition at their scheduled start times.
Use this endpoint to schedule future plan changes (e.g. switch from a trial plan to a paid plan on a specific date) or to define a sequence of plans that should activate over time.
### Body Parameters
The ID of the customer to create the schedule for.
Optional entity ID for an entity-scoped schedule.
Free trial configuration for a plan.
Number of duration\_type periods the trial lasts.
Unit of time for the trial ('day', 'month', 'year').
If true, a payment method is required to start the trial and the customer is charged when it ends. Defaults to false.
Behavior when the trial ends. 'bill' charges the customer (default). 'revert' expires the trial and restores the customer's previous plan.
Three-letter Stripe-supported currency code used to bill the immediate phase (for example, 'usd').
Invoice mode creates and sends an invoice instead of charging the customer's payment method immediately for the first phase.
When true, creates an invoice and sends it to the customer instead of charging their card immediately. Uses Stripe's send\_invoice collection method.
If true, enables the plan immediately even though the invoice is not paid yet.
If true, finalizes the invoice so it can be sent to the customer. If false, keeps it as a draft for manual review.
ID of an invoice template (configured in billing settings) whose footer (e.g. bank details) is applied to the invoice.
Number of days the customer has to pay the invoice before it is due (Stripe days\_until\_due).
List of discounts to apply to the immediate phase. Each discount can be an Autumn reward ID, Stripe coupon ID, or Stripe promotion code.
The ID of the reward to apply as a discount.
The promotion code to apply as a discount.
URL to redirect to after successful checkout.
Additional parameters to pass into the creation of the Stripe checkout session.
Controls when to return a checkout URL for the immediate phase. 'always' forces a confirmation or checkout flow, 'if\_required' only redirects when needed, and 'never' disables redirects.
Whether to prorate the immediate phase. 'none' skips proration charges and credits.
If true, skips any billing changes for the schedule.
Pass 'now' to reset the billing cycle anchor of the immediate phase to the current time.
If true, the immediate-phase cusProducts are activated immediately (and scheduled-phase cusProducts pre-inserted) even when payment is pending via Stripe checkout. The Autumn schedule rows are persisted on checkout.session.completed.
Deprecated and ignored. Active plans the schedule does not declare are always retained.
Plans billed with the immediate phase that the schedule never expires or replaces. No phase may declare a plan in the same group and scope.
The ID of the plan to schedule in this phase.
The plan scope. Omit to inherit the request entity, pass null for customer-level, or pass an entity ID. On phases after the first, the entity must already be scoped by the first phase — a schedule cannot change scope mid-flight.
Optional prepaid feature quantities for this phase's plan.
The ID of the feature to set quantity for.
The quantity of the feature.
Whether the customer can adjust the quantity.
Optional explicit plan version to schedule.
Customize the plan to schedule. Can override price, replace items, or patch items with add\_items and remove\_items.
Base price configuration for a plan.
Base price amount for the plan, in major currency units (e.g. dollars).
Billing interval (e.g. 'month', 'year').
Number of intervals per billing cycle. Defaults to 1.
Base price amounts in additional currencies. The base 'amount' is in the org's default currency.
Three-letter Stripe-supported currency code (e.g. 'eur', 'gbp').
Price amount in this currency. Set explicitly per currency, not converted from the base amount.
Override the items in the plan (PUT-style — replaces all existing items). Mutually exclusive with add\_items / remove\_items / deprecated update\_items.
Bills this many feature units when outstanding overage reaches it.
The ID of the feature to configure.
Number of free units included. Balance resets to this each interval for consumable features.
If true, customer has unlimited access to this feature.
Whether entity-level grants contribute to a shared customer balance.
Reset configuration for consumable features. Omit for non-consumable features like seats.
Interval at which balance resets (e.g. 'month', 'year'). For consumable features only.
Number of intervals between resets. Defaults to 1.
Pricing for usage beyond included units. Omit for free features.
Price per billing\_units after included usage. Either 'amount' or 'tiers' is required.
Amounts in additional currencies for this flat price. The base 'amount' is in the org's default currency. Only valid with 'amount', not 'tiers'.
Three-letter Stripe-supported currency code (e.g. 'eur', 'gbp').
Price amount in this currency. Set explicitly per currency, not converted from the base amount.
Tiered pricing. Either 'amount' or 'tiers' is required.
Per-currency amounts for this tier. Tier boundaries ('to') are shared across all currencies.
Three-letter Stripe-supported currency code (e.g. 'eur', 'gbp').
Per-unit amount for this tier in this currency.
Flat amount for this tier in this currency, if the tier uses one.
Billing interval. For consumable features, should match reset.interval.
Number of intervals per billing cycle. Defaults to 1.
Units per price increment. Usage is rounded UP when billed (e.g. billing\_units=100 means 101 rounds to 200).
'prepaid' for upfront payment (seats), 'usage\_based' for pay-as-you-go.
Max units purchasable beyond included. E.g. included=100, max\_purchase=300 allows 400 total. Null for no limit.
Proration settings for prepaid features. Controls mid-cycle quantity change billing.
Billing behavior when quantity increases mid-cycle.
Credit behavior when quantity decreases mid-cycle.
Rollover config for unused units. If set, unused included units carry over.
Max rollover units. Omit for unlimited rollover.
Maximum rollover as a percentage (0-100) of included + prepaid grant. Mutually exclusive with max.
When rolled over units expire.
Number of periods before expiry.
Overrides fields of this item's feature for customers on this plan (e.g. a credit system's credit\_schema).
For credit system features: replaces the feature's credit\_schema entirely for customers on this plan.
ID of the metered feature that draws from this credit system.
Number of metered-feature units priced together. Defaults to one when omitted.
Named rates chosen by event properties. The most specific match sets the rate; with no match the item's own rate applies.
Event properties this entry applies to. Every key must equal the tracked property, compared as strings.
Breaks ties between dimensions that match the same number of keys. Higher wins.
Inclusive upper usage boundary for this graduated tier. The final tier must be 'inf'.
Credits consumed per billing-unit group within this tier.
Named adjustments chosen by event properties. Every match applies: factors multiply, then adds are summed.
Event properties this entry applies to. Every key must equal the tracked property, compared as strings.
Multiplies the matched rate. All matching multipliers stack.
Added to the rate after every factor is applied, in credits per billing-unit group.
Inclusive upper usage boundary for this graduated tier. The final tier must be 'inf'.
Credits consumed per billing-unit group within this tier.
Credits consumed per billing-unit group.
For AI credit system features: replaces the feature's markup chain entirely for customers on this plan. An unset level means no markup at that level rather than inheriting the feature's.
Default percentage markup for customers on this plan. Use -100 to make usage free.
Per-provider markup percentages for customers on this plan.
Per-model markup overrides for customers on this plan.
Items to add to the plan.
Bills this many feature units when outstanding overage reaches it.
The ID of the feature to configure.
Number of free units included. Balance resets to this each interval for consumable features.
If true, customer has unlimited access to this feature.
Whether entity-level grants contribute to a shared customer balance.
Reset configuration for consumable features. Omit for non-consumable features like seats.
Interval at which balance resets (e.g. 'month', 'year'). For consumable features only.
Number of intervals between resets. Defaults to 1.
Pricing for usage beyond included units. Omit for free features.
Price per billing\_units after included usage. Either 'amount' or 'tiers' is required.
Amounts in additional currencies for this flat price. The base 'amount' is in the org's default currency. Only valid with 'amount', not 'tiers'.
Three-letter Stripe-supported currency code (e.g. 'eur', 'gbp').
Price amount in this currency. Set explicitly per currency, not converted from the base amount.
Tiered pricing. Either 'amount' or 'tiers' is required.
Per-currency amounts for this tier. Tier boundaries ('to') are shared across all currencies.
Three-letter Stripe-supported currency code (e.g. 'eur', 'gbp').
Per-unit amount for this tier in this currency.
Flat amount for this tier in this currency, if the tier uses one.
Billing interval. For consumable features, should match reset.interval.
Number of intervals per billing cycle. Defaults to 1.
Units per price increment. Usage is rounded UP when billed (e.g. billing\_units=100 means 101 rounds to 200).
'prepaid' for upfront payment (seats), 'usage\_based' for pay-as-you-go.
Max units purchasable beyond included. E.g. included=100, max\_purchase=300 allows 400 total. Null for no limit.
Proration settings for prepaid features. Controls mid-cycle quantity change billing.
Billing behavior when quantity increases mid-cycle.
Credit behavior when quantity decreases mid-cycle.
Rollover config for unused units. If set, unused included units carry over.
Max rollover units. Omit for unlimited rollover.
Maximum rollover as a percentage (0-100) of included + prepaid grant. Mutually exclusive with max.
When rolled over units expire.
Number of periods before expiry.
Overrides fields of this item's feature for customers on this plan (e.g. a credit system's credit\_schema).
For credit system features: replaces the feature's credit\_schema entirely for customers on this plan.
ID of the metered feature that draws from this credit system.
Number of metered-feature units priced together. Defaults to one when omitted.
Named rates chosen by event properties. The most specific match sets the rate; with no match the item's own rate applies.
Event properties this entry applies to. Every key must equal the tracked property, compared as strings.
Breaks ties between dimensions that match the same number of keys. Higher wins.
Inclusive upper usage boundary for this graduated tier. The final tier must be 'inf'.
Credits consumed per billing-unit group within this tier.
Named adjustments chosen by event properties. Every match applies: factors multiply, then adds are summed.
Event properties this entry applies to. Every key must equal the tracked property, compared as strings.
Multiplies the matched rate. All matching multipliers stack.
Added to the rate after every factor is applied, in credits per billing-unit group.
Inclusive upper usage boundary for this graduated tier. The final tier must be 'inf'.
Credits consumed per billing-unit group within this tier.
Credits consumed per billing-unit group.
For AI credit system features: replaces the feature's markup chain entirely for customers on this plan. An unset level means no markup at that level rather than inheriting the feature's.
Default percentage markup for customers on this plan. Use -100 to make usage free.
Per-provider markup percentages for customers on this plan.
Per-model markup overrides for customers on this plan.
Filters selecting items to remove from the plan.
Match items linked to this feature.
Match items with this billing method (prepaid or usage\_based).
Match items with this interval. Accepts either a BillingInterval (price-side) or a ResetInterval (reset-side, includes day/hour/minute) so price-less items keyed by reset.interval can be disambiguated.
Match items with this interval\_count. Disambiguates between items that share an interval but differ in count.
Match items whose grant equals this included usage. Omitted is a wildcard.
Override the plan's billing controls (auto top-ups, spend limits, usage limits, usage alerts, overage allowed) for this customer.
List of auto top-up configurations per feature.
The ID of the feature (credit balance) to auto top-up.
Whether auto top-up is enabled.
When the balance drops below this threshold, an auto top-up will be purchased.
Amount of credits to add per auto top-up.
Optional rate limit to cap how often auto top-ups occur. Pass count to set the current window's consumed top-ups.
The time interval for the purchase limit window.
Number of intervals in the purchase limit window.
Maximum number of auto top-ups allowed within the interval.
Set the current window's consumed auto top-up count. Omit to leave runtime state unchanged.
When true, auto top-up creates a send\_invoice invoice instead of auto-charging.
List of overage spend limits per feature (caps overage spend).
Optional feature ID this spend limit applies to.
Whether the overage spend limit is enabled.
How overage\_limit is interpreted: an absolute overage cap (default) or a percentage of the main-plan allowance.
Overage cap for the feature: absolute units, or a percent (e.g. 120) when limit\_type is usage\_percentage.
When true, overage for this feature is not posted to Stripe. Usage tracking and balance resets still behave normally.
List of hard usage caps per feature (max units per interval).
The feature this usage limit applies to.
Whether this usage limit is enabled.
Maximum units allowed per interval.
Interval for the cap, aligned to the customer's billing cycle.
Window alignment. 'billing\_cycle' phases the interval to the customer's renewal time; 'utc' aligns to the UTC calendar.
When set, only usage from events whose properties match counts toward this cap. Omit to count all usage of the feature.
List of usage alert configurations per feature.
The feature ID this alert applies to.
Whether this usage alert is enabled.
The threshold value that triggers the alert. For usage or remaining, this is an absolute count. For usage\_percentage or remaining\_percentage, this is a percentage (0-100).
Whether the threshold is an absolute count or a percentage of the usage allowance or remaining balance.
What 100% means. balance: every grant on the feature. included: the plan allowance only. recurring: grants that reset. usage\_limit: the cap of the usage limit with the same feature and filter.
Only valid with basis usage\_limit. Points the alert at the usage limit carrying the same filter.
Optional user-defined label to distinguish multiple alerts on the same feature.
List of overage allowed controls per feature. When enabled, usage can exceed balance.
The feature ID this overage allowed control applies to.
Whether overage is allowed for this feature.
License links to add or override for this customer, keyed by license\_plan\_id. Omitted fields inherit the plan catalog link (included defaults to 1 when the license is not in the catalog). A bare entry restores the license to pure catalog inheritance.
Base price configuration for a plan.
Base price amount for the plan, in major currency units (e.g. dollars).
Billing interval (e.g. 'month', 'year').
Number of intervals per billing cycle. Defaults to 1.
Base price amounts in additional currencies. The base 'amount' is in the org's default currency.
Three-letter Stripe-supported currency code (e.g. 'eur', 'gbp').
Price amount in this currency. Set explicitly per currency, not converted from the base amount.
Bills this many feature units when outstanding overage reaches it.
The ID of the feature to configure.
Number of free units included. Balance resets to this each interval for consumable features.
If true, customer has unlimited access to this feature.
Whether entity-level grants contribute to a shared customer balance.
Reset configuration for consumable features. Omit for non-consumable features like seats.
Interval at which balance resets (e.g. 'month', 'year'). For consumable features only.
Number of intervals between resets. Defaults to 1.
Pricing for usage beyond included units. Omit for free features.
Price per billing\_units after included usage. Either 'amount' or 'tiers' is required.
Amounts in additional currencies for this flat price. The base 'amount' is in the org's default currency. Only valid with 'amount', not 'tiers'.
Three-letter Stripe-supported currency code (e.g. 'eur', 'gbp').
Price amount in this currency. Set explicitly per currency, not converted from the base amount.
Tiered pricing. Either 'amount' or 'tiers' is required.
Per-currency amounts for this tier. Tier boundaries ('to') are shared across all currencies.
Three-letter Stripe-supported currency code (e.g. 'eur', 'gbp').
Per-unit amount for this tier in this currency.
Flat amount for this tier in this currency, if the tier uses one.
Billing interval. For consumable features, should match reset.interval.
Number of intervals per billing cycle. Defaults to 1.
Units per price increment. Usage is rounded UP when billed (e.g. billing\_units=100 means 101 rounds to 200).
'prepaid' for upfront payment (seats), 'usage\_based' for pay-as-you-go.
Max units purchasable beyond included. E.g. included=100, max\_purchase=300 allows 400 total. Null for no limit.
Proration settings for prepaid features. Controls mid-cycle quantity change billing.
Billing behavior when quantity increases mid-cycle.
Credit behavior when quantity decreases mid-cycle.
Rollover config for unused units. If set, unused included units carry over.
Max rollover units. Omit for unlimited rollover.
Maximum rollover as a percentage (0-100) of included + prepaid grant. Mutually exclusive with max.
When rolled over units expire.
Number of periods before expiry.
Overrides fields of this item's feature for customers on this plan (e.g. a credit system's credit\_schema).
For credit system features: replaces the feature's credit\_schema entirely for customers on this plan.
ID of the metered feature that draws from this credit system.
Number of metered-feature units priced together. Defaults to one when omitted.
Named rates chosen by event properties. The most specific match sets the rate; with no match the item's own rate applies.
Event properties this entry applies to. Every key must equal the tracked property, compared as strings.
Breaks ties between dimensions that match the same number of keys. Higher wins.
Inclusive upper usage boundary for this graduated tier. The final tier must be 'inf'.
Credits consumed per billing-unit group within this tier.
Named adjustments chosen by event properties. Every match applies: factors multiply, then adds are summed.
Event properties this entry applies to. Every key must equal the tracked property, compared as strings.
Multiplies the matched rate. All matching multipliers stack.
Added to the rate after every factor is applied, in credits per billing-unit group.
Inclusive upper usage boundary for this graduated tier. The final tier must be 'inf'.
Credits consumed per billing-unit group within this tier.
Credits consumed per billing-unit group.
For AI credit system features: replaces the feature's markup chain entirely for customers on this plan. An unset level means no markup at that level rather than inheriting the feature's.
Default percentage markup for customers on this plan. Use -100 to make usage free.
Per-provider markup percentages for customers on this plan.
Per-model markup overrides for customers on this plan.
Match items linked to this feature.
Match items with this billing method (prepaid or usage\_based).
Match items with this interval. Accepts either a BillingInterval (price-side) or a ResetInterval (reset-side, includes day/hour/minute) so price-less items keyed by reset.interval can be disambiguated.
Match items with this interval\_count. Disambiguates between items that share an interval but differ in count.
Match items whose grant equals this included usage. Omitted is a wildcard.
License links to drop, keyed by license\_plan\_id. Parallel to remove\_items.
A unique ID to identify this subscription. Useful when scheduling the same plan multiple times.
Ordered phase definitions for the schedule.
When this phase should start, in epoch milliseconds, or 'now' for the immediate phase.
Relative start offset from the previous resolved schedule phase.
The duration unit to offset this phase from the prior phase.
How many duration\_type periods after the prior phase to start.
Plans to materialize for this phase.
The ID of the plan to schedule in this phase.
The plan scope. Omit to inherit the request entity, pass null for customer-level, or pass an entity ID. On phases after the first, the entity must already be scoped by the first phase — a schedule cannot change scope mid-flight.
Optional prepaid feature quantities for this phase's plan.
The ID of the feature to set quantity for.
The quantity of the feature.
Whether the customer can adjust the quantity.
Optional explicit plan version to schedule.
Customize the plan to schedule. Can override price, replace items, or patch items with add\_items and remove\_items.
Base price configuration for a plan.
Base price amount for the plan, in major currency units (e.g. dollars).
Billing interval (e.g. 'month', 'year').
Number of intervals per billing cycle. Defaults to 1.
Base price amounts in additional currencies. The base 'amount' is in the org's default currency.
Three-letter Stripe-supported currency code (e.g. 'eur', 'gbp').
Price amount in this currency. Set explicitly per currency, not converted from the base amount.
Override the items in the plan (PUT-style — replaces all existing items). Mutually exclusive with add\_items / remove\_items / deprecated update\_items.
Bills this many feature units when outstanding overage reaches it.
The ID of the feature to configure.
Number of free units included. Balance resets to this each interval for consumable features.
If true, customer has unlimited access to this feature.
Whether entity-level grants contribute to a shared customer balance.
Reset configuration for consumable features. Omit for non-consumable features like seats.
Interval at which balance resets (e.g. 'month', 'year'). For consumable features only.
Number of intervals between resets. Defaults to 1.
Pricing for usage beyond included units. Omit for free features.
Price per billing\_units after included usage. Either 'amount' or 'tiers' is required.
Amounts in additional currencies for this flat price. The base 'amount' is in the org's default currency. Only valid with 'amount', not 'tiers'.
Three-letter Stripe-supported currency code (e.g. 'eur', 'gbp').
Price amount in this currency. Set explicitly per currency, not converted from the base amount.
Tiered pricing. Either 'amount' or 'tiers' is required.
Per-currency amounts for this tier. Tier boundaries ('to') are shared across all currencies.
Three-letter Stripe-supported currency code (e.g. 'eur', 'gbp').
Per-unit amount for this tier in this currency.
Flat amount for this tier in this currency, if the tier uses one.
Billing interval. For consumable features, should match reset.interval.
Number of intervals per billing cycle. Defaults to 1.
Units per price increment. Usage is rounded UP when billed (e.g. billing\_units=100 means 101 rounds to 200).
'prepaid' for upfront payment (seats), 'usage\_based' for pay-as-you-go.
Max units purchasable beyond included. E.g. included=100, max\_purchase=300 allows 400 total. Null for no limit.
Proration settings for prepaid features. Controls mid-cycle quantity change billing.
Billing behavior when quantity increases mid-cycle.
Credit behavior when quantity decreases mid-cycle.
Rollover config for unused units. If set, unused included units carry over.
Max rollover units. Omit for unlimited rollover.
Maximum rollover as a percentage (0-100) of included + prepaid grant. Mutually exclusive with max.
When rolled over units expire.
Number of periods before expiry.
Overrides fields of this item's feature for customers on this plan (e.g. a credit system's credit\_schema).
For credit system features: replaces the feature's credit\_schema entirely for customers on this plan.
ID of the metered feature that draws from this credit system.
Number of metered-feature units priced together. Defaults to one when omitted.
Named rates chosen by event properties. The most specific match sets the rate; with no match the item's own rate applies.
Event properties this entry applies to. Every key must equal the tracked property, compared as strings.
Breaks ties between dimensions that match the same number of keys. Higher wins.
Inclusive upper usage boundary for this graduated tier. The final tier must be 'inf'.
Credits consumed per billing-unit group within this tier.
Named adjustments chosen by event properties. Every match applies: factors multiply, then adds are summed.
Event properties this entry applies to. Every key must equal the tracked property, compared as strings.
Multiplies the matched rate. All matching multipliers stack.
Added to the rate after every factor is applied, in credits per billing-unit group.
Inclusive upper usage boundary for this graduated tier. The final tier must be 'inf'.
Credits consumed per billing-unit group within this tier.
Credits consumed per billing-unit group.
For AI credit system features: replaces the feature's markup chain entirely for customers on this plan. An unset level means no markup at that level rather than inheriting the feature's.
Default percentage markup for customers on this plan. Use -100 to make usage free.
Per-provider markup percentages for customers on this plan.
Per-model markup overrides for customers on this plan.
Items to add to the plan.
Bills this many feature units when outstanding overage reaches it.
The ID of the feature to configure.
Number of free units included. Balance resets to this each interval for consumable features.
If true, customer has unlimited access to this feature.
Whether entity-level grants contribute to a shared customer balance.
Reset configuration for consumable features. Omit for non-consumable features like seats.
Interval at which balance resets (e.g. 'month', 'year'). For consumable features only.
Number of intervals between resets. Defaults to 1.
Pricing for usage beyond included units. Omit for free features.
Price per billing\_units after included usage. Either 'amount' or 'tiers' is required.
Amounts in additional currencies for this flat price. The base 'amount' is in the org's default currency. Only valid with 'amount', not 'tiers'.
Three-letter Stripe-supported currency code (e.g. 'eur', 'gbp').
Price amount in this currency. Set explicitly per currency, not converted from the base amount.
Tiered pricing. Either 'amount' or 'tiers' is required.
Per-currency amounts for this tier. Tier boundaries ('to') are shared across all currencies.
Three-letter Stripe-supported currency code (e.g. 'eur', 'gbp').
Per-unit amount for this tier in this currency.
Flat amount for this tier in this currency, if the tier uses one.
Billing interval. For consumable features, should match reset.interval.
Number of intervals per billing cycle. Defaults to 1.
Units per price increment. Usage is rounded UP when billed (e.g. billing\_units=100 means 101 rounds to 200).
'prepaid' for upfront payment (seats), 'usage\_based' for pay-as-you-go.
Max units purchasable beyond included. E.g. included=100, max\_purchase=300 allows 400 total. Null for no limit.
Proration settings for prepaid features. Controls mid-cycle quantity change billing.
Billing behavior when quantity increases mid-cycle.
Credit behavior when quantity decreases mid-cycle.
Rollover config for unused units. If set, unused included units carry over.
Max rollover units. Omit for unlimited rollover.
Maximum rollover as a percentage (0-100) of included + prepaid grant. Mutually exclusive with max.
When rolled over units expire.
Number of periods before expiry.
Overrides fields of this item's feature for customers on this plan (e.g. a credit system's credit\_schema).
For credit system features: replaces the feature's credit\_schema entirely for customers on this plan.
ID of the metered feature that draws from this credit system.
Number of metered-feature units priced together. Defaults to one when omitted.
Named rates chosen by event properties. The most specific match sets the rate; with no match the item's own rate applies.
Event properties this entry applies to. Every key must equal the tracked property, compared as strings.
Breaks ties between dimensions that match the same number of keys. Higher wins.
Inclusive upper usage boundary for this graduated tier. The final tier must be 'inf'.
Credits consumed per billing-unit group within this tier.
Named adjustments chosen by event properties. Every match applies: factors multiply, then adds are summed.
Event properties this entry applies to. Every key must equal the tracked property, compared as strings.
Multiplies the matched rate. All matching multipliers stack.
Added to the rate after every factor is applied, in credits per billing-unit group.
Inclusive upper usage boundary for this graduated tier. The final tier must be 'inf'.
Credits consumed per billing-unit group within this tier.
Credits consumed per billing-unit group.
For AI credit system features: replaces the feature's markup chain entirely for customers on this plan. An unset level means no markup at that level rather than inheriting the feature's.
Default percentage markup for customers on this plan. Use -100 to make usage free.
Per-provider markup percentages for customers on this plan.
Per-model markup overrides for customers on this plan.
Filters selecting items to remove from the plan.
Match items linked to this feature.
Match items with this billing method (prepaid or usage\_based).
Match items with this interval. Accepts either a BillingInterval (price-side) or a ResetInterval (reset-side, includes day/hour/minute) so price-less items keyed by reset.interval can be disambiguated.
Match items with this interval\_count. Disambiguates between items that share an interval but differ in count.
Match items whose grant equals this included usage. Omitted is a wildcard.
Override the plan's billing controls (auto top-ups, spend limits, usage limits, usage alerts, overage allowed) for this customer.
List of auto top-up configurations per feature.
The ID of the feature (credit balance) to auto top-up.
Whether auto top-up is enabled.
When the balance drops below this threshold, an auto top-up will be purchased.
Amount of credits to add per auto top-up.
Optional rate limit to cap how often auto top-ups occur. Pass count to set the current window's consumed top-ups.
The time interval for the purchase limit window.
Number of intervals in the purchase limit window.
Maximum number of auto top-ups allowed within the interval.
Set the current window's consumed auto top-up count. Omit to leave runtime state unchanged.
When true, auto top-up creates a send\_invoice invoice instead of auto-charging.
List of overage spend limits per feature (caps overage spend).
Optional feature ID this spend limit applies to.
Whether the overage spend limit is enabled.
How overage\_limit is interpreted: an absolute overage cap (default) or a percentage of the main-plan allowance.
Overage cap for the feature: absolute units, or a percent (e.g. 120) when limit\_type is usage\_percentage.
When true, overage for this feature is not posted to Stripe. Usage tracking and balance resets still behave normally.
List of hard usage caps per feature (max units per interval).
The feature this usage limit applies to.
Whether this usage limit is enabled.
Maximum units allowed per interval.
Interval for the cap, aligned to the customer's billing cycle.
Window alignment. 'billing\_cycle' phases the interval to the customer's renewal time; 'utc' aligns to the UTC calendar.
When set, only usage from events whose properties match counts toward this cap. Omit to count all usage of the feature.
List of usage alert configurations per feature.
The feature ID this alert applies to.
Whether this usage alert is enabled.
The threshold value that triggers the alert. For usage or remaining, this is an absolute count. For usage\_percentage or remaining\_percentage, this is a percentage (0-100).
Whether the threshold is an absolute count or a percentage of the usage allowance or remaining balance.
What 100% means. balance: every grant on the feature. included: the plan allowance only. recurring: grants that reset. usage\_limit: the cap of the usage limit with the same feature and filter.
Only valid with basis usage\_limit. Points the alert at the usage limit carrying the same filter.
Optional user-defined label to distinguish multiple alerts on the same feature.
List of overage allowed controls per feature. When enabled, usage can exceed balance.
The feature ID this overage allowed control applies to.
Whether overage is allowed for this feature.
License links to add or override for this customer, keyed by license\_plan\_id. Omitted fields inherit the plan catalog link (included defaults to 1 when the license is not in the catalog). A bare entry restores the license to pure catalog inheritance.
Base price configuration for a plan.
Base price amount for the plan, in major currency units (e.g. dollars).
Billing interval (e.g. 'month', 'year').
Number of intervals per billing cycle. Defaults to 1.
Base price amounts in additional currencies. The base 'amount' is in the org's default currency.
Three-letter Stripe-supported currency code (e.g. 'eur', 'gbp').
Price amount in this currency. Set explicitly per currency, not converted from the base amount.
Bills this many feature units when outstanding overage reaches it.
The ID of the feature to configure.
Number of free units included. Balance resets to this each interval for consumable features.
If true, customer has unlimited access to this feature.
Whether entity-level grants contribute to a shared customer balance.
Reset configuration for consumable features. Omit for non-consumable features like seats.
Interval at which balance resets (e.g. 'month', 'year'). For consumable features only.
Number of intervals between resets. Defaults to 1.
Pricing for usage beyond included units. Omit for free features.
Price per billing\_units after included usage. Either 'amount' or 'tiers' is required.
Amounts in additional currencies for this flat price. The base 'amount' is in the org's default currency. Only valid with 'amount', not 'tiers'.
Three-letter Stripe-supported currency code (e.g. 'eur', 'gbp').
Price amount in this currency. Set explicitly per currency, not converted from the base amount.
Tiered pricing. Either 'amount' or 'tiers' is required.
Per-currency amounts for this tier. Tier boundaries ('to') are shared across all currencies.
Three-letter Stripe-supported currency code (e.g. 'eur', 'gbp').
Per-unit amount for this tier in this currency.
Flat amount for this tier in this currency, if the tier uses one.
Billing interval. For consumable features, should match reset.interval.
Number of intervals per billing cycle. Defaults to 1.
Units per price increment. Usage is rounded UP when billed (e.g. billing\_units=100 means 101 rounds to 200).
'prepaid' for upfront payment (seats), 'usage\_based' for pay-as-you-go.
Max units purchasable beyond included. E.g. included=100, max\_purchase=300 allows 400 total. Null for no limit.
Proration settings for prepaid features. Controls mid-cycle quantity change billing.
Billing behavior when quantity increases mid-cycle.
Credit behavior when quantity decreases mid-cycle.
Rollover config for unused units. If set, unused included units carry over.
Max rollover units. Omit for unlimited rollover.
Maximum rollover as a percentage (0-100) of included + prepaid grant. Mutually exclusive with max.
When rolled over units expire.
Number of periods before expiry.
Overrides fields of this item's feature for customers on this plan (e.g. a credit system's credit\_schema).
For credit system features: replaces the feature's credit\_schema entirely for customers on this plan.
ID of the metered feature that draws from this credit system.
Number of metered-feature units priced together. Defaults to one when omitted.
Named rates chosen by event properties. The most specific match sets the rate; with no match the item's own rate applies.
Event properties this entry applies to. Every key must equal the tracked property, compared as strings.
Breaks ties between dimensions that match the same number of keys. Higher wins.
Inclusive upper usage boundary for this graduated tier. The final tier must be 'inf'.
Credits consumed per billing-unit group within this tier.
Named adjustments chosen by event properties. Every match applies: factors multiply, then adds are summed.
Event properties this entry applies to. Every key must equal the tracked property, compared as strings.
Multiplies the matched rate. All matching multipliers stack.
Added to the rate after every factor is applied, in credits per billing-unit group.
Inclusive upper usage boundary for this graduated tier. The final tier must be 'inf'.
Credits consumed per billing-unit group within this tier.
Credits consumed per billing-unit group.
For AI credit system features: replaces the feature's markup chain entirely for customers on this plan. An unset level means no markup at that level rather than inheriting the feature's.
Default percentage markup for customers on this plan. Use -100 to make usage free.
Per-provider markup percentages for customers on this plan.
Per-model markup overrides for customers on this plan.
Match items linked to this feature.
Match items with this billing method (prepaid or usage\_based).
Match items with this interval. Accepts either a BillingInterval (price-side) or a ResetInterval (reset-side, includes day/hour/minute) so price-less items keyed by reset.interval can be disambiguated.
Match items with this interval\_count. Disambiguates between items that share an interval but differ in count.
Match items whose grant equals this included usage. Omitted is a wildcard.
License links to drop, keyed by license\_plan\_id. Parallel to remove\_items.
A unique ID to identify this subscription. Useful when scheduling the same plan multiple times.
Pass 'phase\_start' to reset the Stripe billing cycle anchor when this phase starts.
### Response
The ID of the customer.
The entity ID for the schedule, or null when customer-level.
Whether the schedule is fully created or waiting for payment or confirmation to complete.
The ID of the created schedule. Null when the schedule is waiting on Autumn checkout confirmation.
Persisted phases in ascending starts\_at order. Empty when waiting on Autumn checkout confirmation.
The ID of the persisted phase row.
When this phase starts, in epoch milliseconds.
Customer products materialized for this phase.
Invoice details if an invoice was created. Only present when a charge was made.
The status of the invoice (e.g., 'paid', 'open', 'draft').
The Stripe invoice ID.
The total amount of the invoice in cents.
The three-letter ISO currency code (e.g., 'usd').
URL to the hosted invoice page where the customer can view and pay the invoice.
URL to redirect the customer to complete payment. Null if no payment action is required.
The type of action required to complete the payment.
A human-readable explanation of why this action is required.
```json 200 theme={null}
{
"customer_id": "cus_123",
"entity_id": null,
"status": "created",
"schedule_id": "sch_1234",
"phases": [
{
"phase_id": "sphs_1111",
"starts_at": 1735689600000,
"customer_product_ids": [
"cus_prod_1111"
]
},
{
"phase_id": "sphs_2222",
"starts_at": 1736899200000,
"customer_product_ids": [
"cus_prod_2222"
]
}
],
"invoice": null,
"payment_url": null
}
```
# Import
Source: https://docs.useautumn.com/api-reference/billing/import
openapi POST /v1/billing.import
Image a customer into Autumn for live migration. Read-only against processors.
### Body Parameters
Autumn customer to image into.
Optional identity fields upserted onto the customer (applied to existing customers too).
Display name for the customer.
Email address for the customer.
Anti-fraud fingerprint for the customer.
Unix ms timestamp the customer signed up, so a migrated customer keeps its original signup date. Defaults to the import time for a customer Autumn creates here.
The customer's processor identities (e.g. Stripe customer id, RevenueCat app\_user\_id). Omit for customers with no processor, e.g. those only ever on a free plan.
The processor this identity belongs to.
The customer's id in that processor (Stripe customer id, or RevenueCat app\_user\_id).
The billing objects (subscriptions, one-offs) to image, each carrying its plan.
The processor that owns this billable (stripe or revenuecat). Omit for plans with no processor, e.g. a free plan.
Existing processor billing object this billable is adopted from; omit for paid one-offs.
Existing processor subscription id this billable is adopted from.
Existing processor subscription-schedule id this billable is adopted from.
Unix ms billing anchor shared by co-billed plans on this billable.
The single plan on this billable (provide either plan or phases, not both).
The Autumn plan to attach to the customer.
Specific plan version to attach; defaults to the latest.
Set the status of the plan to be flashed. Active if undefined.
When the plan started (Unix ms). Defaults to the linked subscription's start, else the import time. Set this for one-off purchases to record the real purchase date.
Seat/unit quantity for the plan.
Purchased prepaid quantities per feature.
The prepaid feature being quantified.
Purchased quantity for this prepaid feature.
Per-feature balances to image onto the plan.
The feature whose balance is being set.
Disambiguates which entitlement line to target when the feature has multiple.
Reset interval selecting which entitlement line to target when a feature has several ('lifetime' or null = the non-resetting one-off line).
Selects the included vs prepaid vs usage-based (pay-per-use) entitlement line when a feature has several.
Units already consumed; remaining balance is derived from the plan allowance minus this.
Explicit remaining balance override (mutually exclusive with usage).
Unix ms timestamp of this line's next reset.
If true, validate and compute without persisting; returns what would be flashed.
### Response
The imaged customer's id.
Per-plan outcome of the flash.
The plan that was imaged.
The processor that owns the imaged plan.
The created (or existing) customer product id, if any.
The resulting status of the imaged plan.
True if an active plan already existed and this one was left untouched.
True if this was an existing active plan expired because it was absent from the imaged desired state.
True when the imaged state may be wrong — e.g. a resetting plan with no resolvable billing anchor, or a paid recurring plan with no linked subscription for Autumn to manage. The plan is still imaged; see `reason` and fix by supplying started\_at or a subscription\_id.
Why the plan was skipped, expired, or flagged as a mismatch, when applicable.
The freshly-read imaged customer; null for dry\_run.
Your unique identifier for the customer.
The name of the customer.
The email address of the customer.
Timestamp of customer creation in milliseconds since epoch.
A unique identifier (eg. serial number) to de-duplicate customers across devices or browsers. For example: apple device ID.
Stripe customer ID.
The environment this customer was created in.
The metadata for the customer.
Whether to send email receipts to the customer.
Billing controls for the customer (auto top-ups, etc.)
List of auto top-up configurations per feature.
The ID of the feature (credit balance) to auto top-up.
Whether auto top-up is enabled.
When the balance drops below this threshold, an auto top-up will be purchased.
Amount of credits to add per auto top-up.
Optional rate limit to cap how often auto top-ups occur. Expand billing\_controls.auto\_topups.purchase\_limit for a count of top ups and the next\_reset\_at.
The time interval for the purchase limit window. Null when no purchase limit is configured.
Number of intervals in the purchase limit window. Null when no purchase limit is configured.
Maximum number of auto top-ups allowed within the interval. Null when no purchase limit is configured.
Number of auto top-ups already consumed in the current window.
Unix ms timestamp when the current purchase window ends and the count resets.
When true, auto top-up creates a send\_invoice invoice instead of auto-charging.
Response-only: whether the entry is a customer-level override or inherited from an attached plan's defaults.
List of overage spend limits per feature (caps overage spend).
Optional feature ID this spend limit applies to.
Whether the overage spend limit is enabled.
How overage\_limit is interpreted: an absolute overage cap (default) or a percentage of the main-plan allowance.
Overage cap for the feature: absolute units, or a percent (e.g. 120) when limit\_type is usage\_percentage.
When true, overage for this feature is not posted to Stripe. Usage tracking and balance resets still behave normally.
Response-only: whether the entry is a customer-level override or inherited from an attached plan's defaults.
List of hard usage caps per feature, with current interval usage.
The feature this usage limit applies to.
Whether this usage limit is enabled.
Maximum units allowed per interval.
Interval for the cap, aligned to the customer's billing cycle.
Window alignment. 'billing\_cycle' phases the interval to the customer's renewal time; 'utc' aligns to the UTC calendar.
When set, only usage from events whose properties match counts toward this cap. Omit to count all usage of the feature.
Usage consumed in the active interval, stored in the usage-window counter.
Response-only: whether the entry is a customer-level override or inherited from an attached plan's defaults.
List of usage alert configurations per feature.
The feature ID this alert applies to.
Whether this usage alert is enabled.
The threshold value that triggers the alert. For usage or remaining, this is an absolute count. For usage\_percentage or remaining\_percentage, this is a percentage (0-100).
Whether the threshold is an absolute count or a percentage of the usage allowance or remaining balance.
What 100% means. balance: every grant on the feature. included: the plan allowance only. recurring: grants that reset. usage\_limit: the cap of the usage limit with the same feature and filter.
Only valid with basis usage\_limit. Points the alert at the usage limit carrying the same filter.
Optional user-defined label to distinguish multiple alerts on the same feature.
Response-only: whether the entry is a customer-level override or inherited from an attached plan's defaults.
List of overage allowed controls per feature. When enabled, usage can exceed balance.
The feature ID this overage allowed control applies to.
Whether overage is allowed for this feature.
Response-only: whether the entry is a customer-level override or inherited from an attached plan's defaults.
Active and scheduled recurring plans that this customer has attached.
The unique identifier of this subscription. If a subscription\_id was provided at attach time, it is used; otherwise, falls back to the internal ID.
The full plan object if expanded.
Unique identifier for the plan.
Display name of the plan.
Optional description of the plan.
Group identifier for organizing related plans. Plans in the same group are mutually exclusive.
Version number of the plan. Incremented when plan configuration changes.
User-facing version identity. Defaults to v\{n} when the version is minted.
Whether this is the active version of the plan. At most one version is active.
Whether this is an add-on plan that can be attached alongside a main plan.
If true, this plan is automatically attached when a customer is created. Used for free plans.
Base recurring price for the plan. Null for free plans or usage-only plans.
Base price amount for the plan, in major currency units (e.g. dollars).
Base price amounts in additional currencies. The base 'amount' is in the org's default currency.
Three-letter Stripe-supported currency code (e.g. 'eur', 'gbp').
Price amount in this currency. Set explicitly per currency, not converted from the base amount.
Billing interval (e.g. 'month', 'year').
Number of intervals per billing cycle. Defaults to 1.
Display text for showing this price in pricing pages.
Main display text (e.g. '\$10' or '100 messages').
Secondary display text (e.g. 'per month' or 'then \$0.5 per 100').
Payment processors this base price is connected to. Omitted when unset.
Stripe price ID. For prepaid with included > 0 this is the V2 price.
Feature configurations included in this plan. Each item defines included units, pricing, and reset behavior for a feature.
Bills this many feature units when outstanding overage reaches it.
The ID of the feature this item configures.
The full feature object if expanded.
The ID of the feature, used to refer to it in other API calls like /track or /check.
The name of the feature.
The type of the feature
Singular and plural display names for the feature.
The singular display name for the feature.
The plural display name for the feature.
Credit cost schema for credit system features.
The ID of the metered feature (should be a single\_use feature).
The credit cost of the metered feature.
Whether or not the feature is archived.
Number of free units included. For consumable features, balance resets to this number each interval.
Whether the customer has unlimited access to this feature.
Whether entity-level grants contribute to a shared customer balance.
Reset configuration for consumable features. Null for non-consumable features like seats where usage persists across billing cycles.
The interval at which the feature balance resets (e.g. 'month', 'year'). For consumable features, usage resets to 0 and included units are restored.
Number of intervals between resets. Defaults to 1.
Pricing configuration for usage beyond included units. Null if feature is entirely free.
Price per billing\_units after included usage is consumed. Mutually exclusive with tiers.
Amounts in additional currencies for this flat price. The base 'amount' is in the org's default currency. Only valid with 'amount', not 'tiers' (tiered prices carry per-currency amounts on each tier).
Three-letter Stripe-supported currency code (e.g. 'eur', 'gbp').
Price amount in this currency. Set explicitly per currency, not converted from the base amount.
Tiered pricing configuration. Each tier's 'to' INCLUDES the included amount. Either 'tiers' or 'amount' is required.
Three-letter Stripe-supported currency code (e.g. 'eur', 'gbp').
Per-unit amount for this tier in this currency.
Flat amount for this tier in this currency, if the tier uses one.
Billing interval for this price. For consumable features, should match reset.interval.
Number of intervals per billing cycle. Defaults to 1.
Number of units per price increment. Usage is rounded UP to the nearest billing\_units when billed (e.g. billing\_units=100 means 101 usage rounds to 200).
'prepaid' for features like seats where customers pay upfront, 'usage\_based' for pay-as-you-go after included usage.
Maximum units a customer can purchase beyond included. E.g. if included=100 and max\_purchase=300, customer can use up to 400 total before usage is capped. Null for no limit.
Payment processors this item price is connected to. Omitted when unset.
Stripe price ID. For prepaid with included > 0 this is the V2 price.
Display text for showing this item in pricing pages.
Main display text (e.g. '\$10' or '100 messages').
Secondary display text (e.g. 'per month' or 'then \$0.5 per 100').
Rollover configuration for unused units. If set, unused included units roll over to the next period.
Maximum rollover units. Null for unlimited rollover.
Maximum rollover as a percentage (0-100) of included + prepaid grant. Mutually exclusive with max.
When rolled over units expire.
Number of periods before expiry.
Overrides fields of this item's feature for customers on this plan (e.g. a credit system's credit\_schema).
For credit system features: replaces the feature's credit\_schema entirely for customers on this plan.
ID of the metered feature that draws from this credit system.
Number of metered-feature units priced together. Defaults to one when omitted.
Named rates chosen by event properties. The most specific match sets the rate; with no match the item's own rate applies.
Event properties this entry applies to. Every key must equal the tracked property, compared as strings.
Breaks ties between dimensions that match the same number of keys. Higher wins.
Inclusive upper usage boundary for this graduated tier. The final tier must be 'inf'.
Credits consumed per billing-unit group within this tier.
Named adjustments chosen by event properties. Every match applies: factors multiply, then adds are summed.
Event properties this entry applies to. Every key must equal the tracked property, compared as strings.
Multiplies the matched rate. All matching multipliers stack.
Added to the rate after every factor is applied, in credits per billing-unit group.
Inclusive upper usage boundary for this graduated tier. The final tier must be 'inf'.
Credits consumed per billing-unit group within this tier.
Credits consumed per billing-unit group.
For AI credit system features: replaces the feature's markup chain entirely for customers on this plan. An unset level means no markup at that level rather than inheriting the feature's.
Default percentage markup for customers on this plan. Use -100 to make usage free.
Per-provider markup percentages for customers on this plan.
Per-model markup overrides for customers on this plan.
Payment processors this plan is connected to. Omitted when unset.
Stripe product ID this plan is billed under.
Extra Stripe product IDs aliased to this plan.
Every RevenueCat product that maps to this plan. Replaces the current set.
RevenueCat product ID that grants this plan when purchased.
Prepaid quantities granted when this specific RevenueCat product is purchased, in feature units.
Free trial configuration. If set, new customers can try this plan before being charged.
Number of duration\_type periods the trial lasts.
Unit of time for the trial duration ('day', 'month', 'year').
Whether a payment method is required to start the trial. If true, customer will be charged after trial ends.
Behavior when the trial ends. 'bill' charges the customer (default). 'revert' expires the trial and restores the customer's previous plan.
Unix timestamp (ms) when the plan was created.
Environment this plan belongs to ('sandbox' or 'live').
Whether the plan is archived. Archived plans cannot be attached to new customers.
Miscellaneous plan-level configuration flags.
If true, entitlements attached to this plan will still reset on schedule even when the customer's product is in a past\_due state.
Plan-level billing controls used as customer defaults.
List of auto top-up configurations per feature.
The ID of the feature (credit balance) to auto top-up.
Whether auto top-up is enabled.
When the balance drops below this threshold, an auto top-up will be purchased.
Amount of credits to add per auto top-up.
Optional rate limit to cap how often auto top-ups occur.
The time interval for the purchase limit window.
Number of intervals in the purchase limit window.
Maximum number of auto top-ups allowed within the interval.
When true, auto top-up creates a send\_invoice invoice instead of auto-charging.
List of overage spend limits per feature (caps overage spend).
Optional feature ID this spend limit applies to.
Whether the overage spend limit is enabled.
How overage\_limit is interpreted: an absolute overage cap (default) or a percentage of the main-plan allowance.
Overage cap for the feature: absolute units, or a percent (e.g. 120) when limit\_type is usage\_percentage.
When true, overage for this feature is not posted to Stripe. Usage tracking and balance resets still behave normally.
List of hard usage caps per feature (max units per interval).
The feature this usage limit applies to.
Whether this usage limit is enabled.
Maximum units allowed per interval.
Interval for the cap, aligned to the customer's billing cycle.
Window alignment. 'billing\_cycle' phases the interval to the customer's renewal time; 'utc' aligns to the UTC calendar.
When set, only usage from events whose properties match counts toward this cap. Omit to count all usage of the feature.
List of usage alert configurations per feature.
The feature ID this alert applies to.
Whether this usage alert is enabled.
The threshold value that triggers the alert. For usage or remaining, this is an absolute count. For usage\_percentage or remaining\_percentage, this is a percentage (0-100).
Whether the threshold is an absolute count or a percentage of the usage allowance or remaining balance.
What 100% means. balance: every grant on the feature. included: the plan allowance only. recurring: grants that reset. usage\_limit: the cap of the usage limit with the same feature and filter.
Only valid with basis usage\_limit. Points the alert at the usage limit carrying the same filter.
Optional user-defined label to distinguish multiple alerts on the same feature.
List of overage allowed controls per feature. When enabled, usage can exceed balance.
The feature ID this overage allowed control applies to.
Whether overage is allowed for this feature.
Arbitrary key-value metadata defined by you for your own use. Shared across all versions of the plan.
Whether the trial on this plan is available to this customer. For example, if the customer used the trial in the past, this will be false.
The customer's current status with this plan. 'active' if attached, 'scheduled' if pending activation.
Whether the customer's active instance of this plan is set to cancel.
Whether the customer is currently on a free trial of this plan.
The action that would occur if this plan were attached to the customer.
Deprecated. Use variant\_details.base\_plan\_id instead. If this is a variant, the ID of the base plan it was created from.
Details about how this variant relates to its latest base plan.
The ID of the base plan this variant was derived from.
The customization that transforms the base plan into this variant.
Base price configuration for a plan.
Base price amount for the plan, in major currency units (e.g. dollars).
Billing interval (e.g. 'month', 'year').
Number of intervals per billing cycle. Defaults to 1.
Base price amounts in additional currencies. The base 'amount' is in the org's default currency.
Three-letter Stripe-supported currency code (e.g. 'eur', 'gbp').
Price amount in this currency. Set explicitly per currency, not converted from the base amount.
Items to add to the plan.
Bills this many feature units when outstanding overage reaches it.
The ID of the feature to configure.
Number of free units included. Balance resets to this each interval for consumable features.
If true, customer has unlimited access to this feature.
Whether entity-level grants contribute to a shared customer balance.
Reset configuration for consumable features. Omit for non-consumable features like seats.
Interval at which balance resets (e.g. 'month', 'year'). For consumable features only.
Number of intervals between resets. Defaults to 1.
Pricing for usage beyond included units. Omit for free features.
Price per billing\_units after included usage. Either 'amount' or 'tiers' is required.
Amounts in additional currencies for this flat price. The base 'amount' is in the org's default currency. Only valid with 'amount', not 'tiers'.
Three-letter Stripe-supported currency code (e.g. 'eur', 'gbp').
Price amount in this currency. Set explicitly per currency, not converted from the base amount.
Tiered pricing. Either 'amount' or 'tiers' is required.
Three-letter Stripe-supported currency code (e.g. 'eur', 'gbp').
Per-unit amount for this tier in this currency.
Flat amount for this tier in this currency, if the tier uses one.
Billing interval. For consumable features, should match reset.interval.
Number of intervals per billing cycle. Defaults to 1.
Units per price increment. Usage is rounded UP when billed (e.g. billing\_units=100 means 101 rounds to 200).
'prepaid' for upfront payment (seats), 'usage\_based' for pay-as-you-go.
Max units purchasable beyond included. E.g. included=100, max\_purchase=300 allows 400 total. Null for no limit.
Proration settings for prepaid features. Controls mid-cycle quantity change billing.
Billing behavior when quantity increases mid-cycle.
Credit behavior when quantity decreases mid-cycle.
Rollover config for unused units. If set, unused included units carry over.
Max rollover units. Omit for unlimited rollover.
Maximum rollover as a percentage (0-100) of included + prepaid grant. Mutually exclusive with max.
When rolled over units expire.
Number of periods before expiry.
Overrides fields of this item's feature for customers on this plan (e.g. a credit system's credit\_schema).
For credit system features: replaces the feature's credit\_schema entirely for customers on this plan.
ID of the metered feature that draws from this credit system.
Number of metered-feature units priced together. Defaults to one when omitted.
Named rates chosen by event properties. The most specific match sets the rate; with no match the item's own rate applies.
Event properties this entry applies to. Every key must equal the tracked property, compared as strings.
Breaks ties between dimensions that match the same number of keys. Higher wins.
Inclusive upper usage boundary for this graduated tier. The final tier must be 'inf'.
Credits consumed per billing-unit group within this tier.
Named adjustments chosen by event properties. Every match applies: factors multiply, then adds are summed.
Event properties this entry applies to. Every key must equal the tracked property, compared as strings.
Multiplies the matched rate. All matching multipliers stack.
Added to the rate after every factor is applied, in credits per billing-unit group.
Inclusive upper usage boundary for this graduated tier. The final tier must be 'inf'.
Credits consumed per billing-unit group within this tier.
Credits consumed per billing-unit group.
For AI credit system features: replaces the feature's markup chain entirely for customers on this plan. An unset level means no markup at that level rather than inheriting the feature's.
Default percentage markup for customers on this plan. Use -100 to make usage free.
Per-provider markup percentages for customers on this plan.
Per-model markup overrides for customers on this plan.
Filters selecting items to remove from the plan.
Match items linked to this feature.
Match items with this billing method (prepaid or usage\_based).
Match items with this interval. Accepts either a BillingInterval (price-side) or a ResetInterval (reset-side, includes day/hour/minute) so price-less items keyed by reset.interval can be disambiguated.
Match items with this interval\_count. Disambiguates between items that share an interval but differ in count.
Match items whose grant equals this included usage. Omitted is a wildcard.
Free trial configuration for a plan.
Number of duration\_type periods the trial lasts.
Unit of time for the trial ('day', 'month', 'year').
If true, a payment method is required to start the trial and the customer is charged when it ends. Defaults to false.
Behavior when the trial ends. 'bill' charges the customer (default). 'revert' expires the trial and restores the customer's previous plan.
Override the plan's billing controls (auto top-ups, spend limits, usage limits, usage alerts, overage allowed) for this customer.
List of auto top-up configurations per feature.
The ID of the feature (credit balance) to auto top-up.
Whether auto top-up is enabled.
When the balance drops below this threshold, an auto top-up will be purchased.
Amount of credits to add per auto top-up.
Optional rate limit to cap how often auto top-ups occur. Pass count to set the current window's consumed top-ups.
The time interval for the purchase limit window.
Number of intervals in the purchase limit window.
Maximum number of auto top-ups allowed within the interval.
Set the current window's consumed auto top-up count. Omit to leave runtime state unchanged.
When true, auto top-up creates a send\_invoice invoice instead of auto-charging.
List of overage spend limits per feature (caps overage spend).
Optional feature ID this spend limit applies to.
Whether the overage spend limit is enabled.
How overage\_limit is interpreted: an absolute overage cap (default) or a percentage of the main-plan allowance.
Overage cap for the feature: absolute units, or a percent (e.g. 120) when limit\_type is usage\_percentage.
When true, overage for this feature is not posted to Stripe. Usage tracking and balance resets still behave normally.
List of hard usage caps per feature (max units per interval).
The feature this usage limit applies to.
Whether this usage limit is enabled.
Maximum units allowed per interval.
Interval for the cap, aligned to the customer's billing cycle.
Window alignment. 'billing\_cycle' phases the interval to the customer's renewal time; 'utc' aligns to the UTC calendar.
When set, only usage from events whose properties match counts toward this cap. Omit to count all usage of the feature.
List of usage alert configurations per feature.
The feature ID this alert applies to.
Whether this usage alert is enabled.
The threshold value that triggers the alert. For usage or remaining, this is an absolute count. For usage\_percentage or remaining\_percentage, this is a percentage (0-100).
Whether the threshold is an absolute count or a percentage of the usage allowance or remaining balance.
What 100% means. balance: every grant on the feature. included: the plan allowance only. recurring: grants that reset. usage\_limit: the cap of the usage limit with the same feature and filter.
Only valid with basis usage\_limit. Points the alert at the usage limit carrying the same filter.
Optional user-defined label to distinguish multiple alerts on the same feature.
List of overage allowed controls per feature. When enabled, usage can exceed balance.
The feature ID this overage allowed control applies to.
Whether overage is allowed for this feature.
License links to add or override for this customer, keyed by license\_plan\_id. Omitted fields inherit the plan catalog link (included defaults to 1 when the license is not in the catalog). A bare entry restores the license to pure catalog inheritance.
Base price configuration for a plan.
Base price amount for the plan, in major currency units (e.g. dollars).
Billing interval (e.g. 'month', 'year').
Number of intervals per billing cycle. Defaults to 1.
Base price amounts in additional currencies. The base 'amount' is in the org's default currency.
Three-letter Stripe-supported currency code (e.g. 'eur', 'gbp').
Price amount in this currency. Set explicitly per currency, not converted from the base amount.
Bills this many feature units when outstanding overage reaches it.
The ID of the feature to configure.
Number of free units included. Balance resets to this each interval for consumable features.
If true, customer has unlimited access to this feature.
Whether entity-level grants contribute to a shared customer balance.
Reset configuration for consumable features. Omit for non-consumable features like seats.
Interval at which balance resets (e.g. 'month', 'year'). For consumable features only.
Number of intervals between resets. Defaults to 1.
Pricing for usage beyond included units. Omit for free features.
Price per billing\_units after included usage. Either 'amount' or 'tiers' is required.
Amounts in additional currencies for this flat price. The base 'amount' is in the org's default currency. Only valid with 'amount', not 'tiers'.
Three-letter Stripe-supported currency code (e.g. 'eur', 'gbp').
Price amount in this currency. Set explicitly per currency, not converted from the base amount.
Tiered pricing. Either 'amount' or 'tiers' is required.
Three-letter Stripe-supported currency code (e.g. 'eur', 'gbp').
Per-unit amount for this tier in this currency.
Flat amount for this tier in this currency, if the tier uses one.
Billing interval. For consumable features, should match reset.interval.
Number of intervals per billing cycle. Defaults to 1.
Units per price increment. Usage is rounded UP when billed (e.g. billing\_units=100 means 101 rounds to 200).
'prepaid' for upfront payment (seats), 'usage\_based' for pay-as-you-go.
Max units purchasable beyond included. E.g. included=100, max\_purchase=300 allows 400 total. Null for no limit.
Proration settings for prepaid features. Controls mid-cycle quantity change billing.
Billing behavior when quantity increases mid-cycle.
Credit behavior when quantity decreases mid-cycle.
Rollover config for unused units. If set, unused included units carry over.
Max rollover units. Omit for unlimited rollover.
Maximum rollover as a percentage (0-100) of included + prepaid grant. Mutually exclusive with max.
When rolled over units expire.
Number of periods before expiry.
Overrides fields of this item's feature for customers on this plan (e.g. a credit system's credit\_schema).
For credit system features: replaces the feature's credit\_schema entirely for customers on this plan.
ID of the metered feature that draws from this credit system.
Number of metered-feature units priced together. Defaults to one when omitted.
Named rates chosen by event properties. The most specific match sets the rate; with no match the item's own rate applies.
Event properties this entry applies to. Every key must equal the tracked property, compared as strings.
Breaks ties between dimensions that match the same number of keys. Higher wins.
Inclusive upper usage boundary for this graduated tier. The final tier must be 'inf'.
Credits consumed per billing-unit group within this tier.
Named adjustments chosen by event properties. Every match applies: factors multiply, then adds are summed.
Event properties this entry applies to. Every key must equal the tracked property, compared as strings.
Multiplies the matched rate. All matching multipliers stack.
Added to the rate after every factor is applied, in credits per billing-unit group.
Inclusive upper usage boundary for this graduated tier. The final tier must be 'inf'.
Credits consumed per billing-unit group within this tier.
Credits consumed per billing-unit group.
For AI credit system features: replaces the feature's markup chain entirely for customers on this plan. An unset level means no markup at that level rather than inheriting the feature's.
Default percentage markup for customers on this plan. Use -100 to make usage free.
Per-provider markup percentages for customers on this plan.
Per-model markup overrides for customers on this plan.
Match items linked to this feature.
Match items with this billing method (prepaid or usage\_based).
Match items with this interval. Accepts either a BillingInterval (price-side) or a ResetInterval (reset-side, includes day/hour/minute) so price-less items keyed by reset.interval can be disambiguated.
Match items with this interval\_count. Disambiguates between items that share an interval but differ in count.
Match items whose grant equals this included usage. Omitted is a wildcard.
License links to drop, keyed by license\_plan\_id. Parallel to remove\_items.
The unique identifier of the subscribed plan.
Whether the plan was automatically enabled for the customer.
Whether this is an add-on plan rather than a base subscription.
Current status of the subscription.
Whether the subscription has overdue payments.
Timestamp when the subscription was canceled, or null if not canceled.
Timestamp when the subscription will expire, or null if no expiry set.
Timestamp when the trial period ends, or null if not on trial.
Timestamp when the subscription started.
Start timestamp of the current billing period.
End timestamp of the current billing period.
Number of units of this subscription (for per-seat plans).
Whether this subscription is attached at the customer level or entity level.
One-time purchases made by the customer.
The full plan object if expanded.
Unique identifier for the plan.
Display name of the plan.
Optional description of the plan.
Group identifier for organizing related plans. Plans in the same group are mutually exclusive.
Version number of the plan. Incremented when plan configuration changes.
User-facing version identity. Defaults to v\{n} when the version is minted.
Whether this is the active version of the plan. At most one version is active.
Whether this is an add-on plan that can be attached alongside a main plan.
If true, this plan is automatically attached when a customer is created. Used for free plans.
Base recurring price for the plan. Null for free plans or usage-only plans.
Base price amount for the plan, in major currency units (e.g. dollars).
Base price amounts in additional currencies. The base 'amount' is in the org's default currency.
Three-letter Stripe-supported currency code (e.g. 'eur', 'gbp').
Price amount in this currency. Set explicitly per currency, not converted from the base amount.
Billing interval (e.g. 'month', 'year').
Number of intervals per billing cycle. Defaults to 1.
Display text for showing this price in pricing pages.
Main display text (e.g. '\$10' or '100 messages').
Secondary display text (e.g. 'per month' or 'then \$0.5 per 100').
Payment processors this base price is connected to. Omitted when unset.
Stripe price ID. For prepaid with included > 0 this is the V2 price.
Feature configurations included in this plan. Each item defines included units, pricing, and reset behavior for a feature.
Bills this many feature units when outstanding overage reaches it.
The ID of the feature this item configures.
The full feature object if expanded.
The ID of the feature, used to refer to it in other API calls like /track or /check.
The name of the feature.
The type of the feature
Singular and plural display names for the feature.
The singular display name for the feature.
The plural display name for the feature.
Credit cost schema for credit system features.
The ID of the metered feature (should be a single\_use feature).
The credit cost of the metered feature.
Whether or not the feature is archived.
Number of free units included. For consumable features, balance resets to this number each interval.
Whether the customer has unlimited access to this feature.
Whether entity-level grants contribute to a shared customer balance.
Reset configuration for consumable features. Null for non-consumable features like seats where usage persists across billing cycles.
The interval at which the feature balance resets (e.g. 'month', 'year'). For consumable features, usage resets to 0 and included units are restored.
Number of intervals between resets. Defaults to 1.
Pricing configuration for usage beyond included units. Null if feature is entirely free.
Price per billing\_units after included usage is consumed. Mutually exclusive with tiers.
Amounts in additional currencies for this flat price. The base 'amount' is in the org's default currency. Only valid with 'amount', not 'tiers' (tiered prices carry per-currency amounts on each tier).
Three-letter Stripe-supported currency code (e.g. 'eur', 'gbp').
Price amount in this currency. Set explicitly per currency, not converted from the base amount.
Tiered pricing configuration. Each tier's 'to' INCLUDES the included amount. Either 'tiers' or 'amount' is required.
Three-letter Stripe-supported currency code (e.g. 'eur', 'gbp').
Per-unit amount for this tier in this currency.
Flat amount for this tier in this currency, if the tier uses one.
Billing interval for this price. For consumable features, should match reset.interval.
Number of intervals per billing cycle. Defaults to 1.
Number of units per price increment. Usage is rounded UP to the nearest billing\_units when billed (e.g. billing\_units=100 means 101 usage rounds to 200).
'prepaid' for features like seats where customers pay upfront, 'usage\_based' for pay-as-you-go after included usage.
Maximum units a customer can purchase beyond included. E.g. if included=100 and max\_purchase=300, customer can use up to 400 total before usage is capped. Null for no limit.
Payment processors this item price is connected to. Omitted when unset.
Stripe price ID. For prepaid with included > 0 this is the V2 price.
Display text for showing this item in pricing pages.
Main display text (e.g. '\$10' or '100 messages').
Secondary display text (e.g. 'per month' or 'then \$0.5 per 100').
Rollover configuration for unused units. If set, unused included units roll over to the next period.
Maximum rollover units. Null for unlimited rollover.
Maximum rollover as a percentage (0-100) of included + prepaid grant. Mutually exclusive with max.
When rolled over units expire.
Number of periods before expiry.
Overrides fields of this item's feature for customers on this plan (e.g. a credit system's credit\_schema).
For credit system features: replaces the feature's credit\_schema entirely for customers on this plan.
ID of the metered feature that draws from this credit system.
Number of metered-feature units priced together. Defaults to one when omitted.
Named rates chosen by event properties. The most specific match sets the rate; with no match the item's own rate applies.
Event properties this entry applies to. Every key must equal the tracked property, compared as strings.
Breaks ties between dimensions that match the same number of keys. Higher wins.
Inclusive upper usage boundary for this graduated tier. The final tier must be 'inf'.
Credits consumed per billing-unit group within this tier.
Named adjustments chosen by event properties. Every match applies: factors multiply, then adds are summed.
Event properties this entry applies to. Every key must equal the tracked property, compared as strings.
Multiplies the matched rate. All matching multipliers stack.
Added to the rate after every factor is applied, in credits per billing-unit group.
Inclusive upper usage boundary for this graduated tier. The final tier must be 'inf'.
Credits consumed per billing-unit group within this tier.
Credits consumed per billing-unit group.
For AI credit system features: replaces the feature's markup chain entirely for customers on this plan. An unset level means no markup at that level rather than inheriting the feature's.
Default percentage markup for customers on this plan. Use -100 to make usage free.
Per-provider markup percentages for customers on this plan.
Per-model markup overrides for customers on this plan.
Payment processors this plan is connected to. Omitted when unset.
Stripe product ID this plan is billed under.
Extra Stripe product IDs aliased to this plan.
Every RevenueCat product that maps to this plan. Replaces the current set.
RevenueCat product ID that grants this plan when purchased.
Prepaid quantities granted when this specific RevenueCat product is purchased, in feature units.
Free trial configuration. If set, new customers can try this plan before being charged.
Number of duration\_type periods the trial lasts.
Unit of time for the trial duration ('day', 'month', 'year').
Whether a payment method is required to start the trial. If true, customer will be charged after trial ends.
Behavior when the trial ends. 'bill' charges the customer (default). 'revert' expires the trial and restores the customer's previous plan.
Unix timestamp (ms) when the plan was created.
Environment this plan belongs to ('sandbox' or 'live').
Whether the plan is archived. Archived plans cannot be attached to new customers.
Miscellaneous plan-level configuration flags.
If true, entitlements attached to this plan will still reset on schedule even when the customer's product is in a past\_due state.
Plan-level billing controls used as customer defaults.
List of auto top-up configurations per feature.
The ID of the feature (credit balance) to auto top-up.
Whether auto top-up is enabled.
When the balance drops below this threshold, an auto top-up will be purchased.
Amount of credits to add per auto top-up.
Optional rate limit to cap how often auto top-ups occur.
The time interval for the purchase limit window.
Number of intervals in the purchase limit window.
Maximum number of auto top-ups allowed within the interval.
When true, auto top-up creates a send\_invoice invoice instead of auto-charging.
List of overage spend limits per feature (caps overage spend).
Optional feature ID this spend limit applies to.
Whether the overage spend limit is enabled.
How overage\_limit is interpreted: an absolute overage cap (default) or a percentage of the main-plan allowance.
Overage cap for the feature: absolute units, or a percent (e.g. 120) when limit\_type is usage\_percentage.
When true, overage for this feature is not posted to Stripe. Usage tracking and balance resets still behave normally.
List of hard usage caps per feature (max units per interval).
The feature this usage limit applies to.
Whether this usage limit is enabled.
Maximum units allowed per interval.
Interval for the cap, aligned to the customer's billing cycle.
Window alignment. 'billing\_cycle' phases the interval to the customer's renewal time; 'utc' aligns to the UTC calendar.
When set, only usage from events whose properties match counts toward this cap. Omit to count all usage of the feature.
List of usage alert configurations per feature.
The feature ID this alert applies to.
Whether this usage alert is enabled.
The threshold value that triggers the alert. For usage or remaining, this is an absolute count. For usage\_percentage or remaining\_percentage, this is a percentage (0-100).
Whether the threshold is an absolute count or a percentage of the usage allowance or remaining balance.
What 100% means. balance: every grant on the feature. included: the plan allowance only. recurring: grants that reset. usage\_limit: the cap of the usage limit with the same feature and filter.
Only valid with basis usage\_limit. Points the alert at the usage limit carrying the same filter.
Optional user-defined label to distinguish multiple alerts on the same feature.
List of overage allowed controls per feature. When enabled, usage can exceed balance.
The feature ID this overage allowed control applies to.
Whether overage is allowed for this feature.
Arbitrary key-value metadata defined by you for your own use. Shared across all versions of the plan.
Whether the trial on this plan is available to this customer. For example, if the customer used the trial in the past, this will be false.
The customer's current status with this plan. 'active' if attached, 'scheduled' if pending activation.
Whether the customer's active instance of this plan is set to cancel.
Whether the customer is currently on a free trial of this plan.
The action that would occur if this plan were attached to the customer.
Deprecated. Use variant\_details.base\_plan\_id instead. If this is a variant, the ID of the base plan it was created from.
Details about how this variant relates to its latest base plan.
The ID of the base plan this variant was derived from.
The customization that transforms the base plan into this variant.
Base price configuration for a plan.
Base price amount for the plan, in major currency units (e.g. dollars).
Billing interval (e.g. 'month', 'year').
Number of intervals per billing cycle. Defaults to 1.
Base price amounts in additional currencies. The base 'amount' is in the org's default currency.
Three-letter Stripe-supported currency code (e.g. 'eur', 'gbp').
Price amount in this currency. Set explicitly per currency, not converted from the base amount.
Items to add to the plan.
Bills this many feature units when outstanding overage reaches it.
The ID of the feature to configure.
Number of free units included. Balance resets to this each interval for consumable features.
If true, customer has unlimited access to this feature.
Whether entity-level grants contribute to a shared customer balance.
Reset configuration for consumable features. Omit for non-consumable features like seats.
Interval at which balance resets (e.g. 'month', 'year'). For consumable features only.
Number of intervals between resets. Defaults to 1.
Pricing for usage beyond included units. Omit for free features.
Price per billing\_units after included usage. Either 'amount' or 'tiers' is required.
Amounts in additional currencies for this flat price. The base 'amount' is in the org's default currency. Only valid with 'amount', not 'tiers'.
Three-letter Stripe-supported currency code (e.g. 'eur', 'gbp').
Price amount in this currency. Set explicitly per currency, not converted from the base amount.
Tiered pricing. Either 'amount' or 'tiers' is required.
Three-letter Stripe-supported currency code (e.g. 'eur', 'gbp').
Per-unit amount for this tier in this currency.
Flat amount for this tier in this currency, if the tier uses one.
Billing interval. For consumable features, should match reset.interval.
Number of intervals per billing cycle. Defaults to 1.
Units per price increment. Usage is rounded UP when billed (e.g. billing\_units=100 means 101 rounds to 200).
'prepaid' for upfront payment (seats), 'usage\_based' for pay-as-you-go.
Max units purchasable beyond included. E.g. included=100, max\_purchase=300 allows 400 total. Null for no limit.
Proration settings for prepaid features. Controls mid-cycle quantity change billing.
Billing behavior when quantity increases mid-cycle.
Credit behavior when quantity decreases mid-cycle.
Rollover config for unused units. If set, unused included units carry over.
Max rollover units. Omit for unlimited rollover.
Maximum rollover as a percentage (0-100) of included + prepaid grant. Mutually exclusive with max.
When rolled over units expire.
Number of periods before expiry.
Overrides fields of this item's feature for customers on this plan (e.g. a credit system's credit\_schema).
For credit system features: replaces the feature's credit\_schema entirely for customers on this plan.
ID of the metered feature that draws from this credit system.
Number of metered-feature units priced together. Defaults to one when omitted.
Named rates chosen by event properties. The most specific match sets the rate; with no match the item's own rate applies.
Event properties this entry applies to. Every key must equal the tracked property, compared as strings.
Breaks ties between dimensions that match the same number of keys. Higher wins.
Inclusive upper usage boundary for this graduated tier. The final tier must be 'inf'.
Credits consumed per billing-unit group within this tier.
Named adjustments chosen by event properties. Every match applies: factors multiply, then adds are summed.
Event properties this entry applies to. Every key must equal the tracked property, compared as strings.
Multiplies the matched rate. All matching multipliers stack.
Added to the rate after every factor is applied, in credits per billing-unit group.
Inclusive upper usage boundary for this graduated tier. The final tier must be 'inf'.
Credits consumed per billing-unit group within this tier.
Credits consumed per billing-unit group.
For AI credit system features: replaces the feature's markup chain entirely for customers on this plan. An unset level means no markup at that level rather than inheriting the feature's.
Default percentage markup for customers on this plan. Use -100 to make usage free.
Per-provider markup percentages for customers on this plan.
Per-model markup overrides for customers on this plan.
Filters selecting items to remove from the plan.
Match items linked to this feature.
Match items with this billing method (prepaid or usage\_based).
Match items with this interval. Accepts either a BillingInterval (price-side) or a ResetInterval (reset-side, includes day/hour/minute) so price-less items keyed by reset.interval can be disambiguated.
Match items with this interval\_count. Disambiguates between items that share an interval but differ in count.
Match items whose grant equals this included usage. Omitted is a wildcard.
Free trial configuration for a plan.
Number of duration\_type periods the trial lasts.
Unit of time for the trial ('day', 'month', 'year').
If true, a payment method is required to start the trial and the customer is charged when it ends. Defaults to false.
Behavior when the trial ends. 'bill' charges the customer (default). 'revert' expires the trial and restores the customer's previous plan.
Override the plan's billing controls (auto top-ups, spend limits, usage limits, usage alerts, overage allowed) for this customer.
List of auto top-up configurations per feature.
The ID of the feature (credit balance) to auto top-up.
Whether auto top-up is enabled.
When the balance drops below this threshold, an auto top-up will be purchased.
Amount of credits to add per auto top-up.
Optional rate limit to cap how often auto top-ups occur. Pass count to set the current window's consumed top-ups.
The time interval for the purchase limit window.
Number of intervals in the purchase limit window.
Maximum number of auto top-ups allowed within the interval.
Set the current window's consumed auto top-up count. Omit to leave runtime state unchanged.
When true, auto top-up creates a send\_invoice invoice instead of auto-charging.
List of overage spend limits per feature (caps overage spend).
Optional feature ID this spend limit applies to.
Whether the overage spend limit is enabled.
How overage\_limit is interpreted: an absolute overage cap (default) or a percentage of the main-plan allowance.
Overage cap for the feature: absolute units, or a percent (e.g. 120) when limit\_type is usage\_percentage.
When true, overage for this feature is not posted to Stripe. Usage tracking and balance resets still behave normally.
List of hard usage caps per feature (max units per interval).
The feature this usage limit applies to.
Whether this usage limit is enabled.
Maximum units allowed per interval.
Interval for the cap, aligned to the customer's billing cycle.
Window alignment. 'billing\_cycle' phases the interval to the customer's renewal time; 'utc' aligns to the UTC calendar.
When set, only usage from events whose properties match counts toward this cap. Omit to count all usage of the feature.
List of usage alert configurations per feature.
The feature ID this alert applies to.
Whether this usage alert is enabled.
The threshold value that triggers the alert. For usage or remaining, this is an absolute count. For usage\_percentage or remaining\_percentage, this is a percentage (0-100).
Whether the threshold is an absolute count or a percentage of the usage allowance or remaining balance.
What 100% means. balance: every grant on the feature. included: the plan allowance only. recurring: grants that reset. usage\_limit: the cap of the usage limit with the same feature and filter.
Only valid with basis usage\_limit. Points the alert at the usage limit carrying the same filter.
Optional user-defined label to distinguish multiple alerts on the same feature.
List of overage allowed controls per feature. When enabled, usage can exceed balance.
The feature ID this overage allowed control applies to.
Whether overage is allowed for this feature.
License links to add or override for this customer, keyed by license\_plan\_id. Omitted fields inherit the plan catalog link (included defaults to 1 when the license is not in the catalog). A bare entry restores the license to pure catalog inheritance.
Base price configuration for a plan.
Base price amount for the plan, in major currency units (e.g. dollars).
Billing interval (e.g. 'month', 'year').
Number of intervals per billing cycle. Defaults to 1.
Base price amounts in additional currencies. The base 'amount' is in the org's default currency.
Three-letter Stripe-supported currency code (e.g. 'eur', 'gbp').
Price amount in this currency. Set explicitly per currency, not converted from the base amount.
Bills this many feature units when outstanding overage reaches it.
The ID of the feature to configure.
Number of free units included. Balance resets to this each interval for consumable features.
If true, customer has unlimited access to this feature.
Whether entity-level grants contribute to a shared customer balance.
Reset configuration for consumable features. Omit for non-consumable features like seats.
Interval at which balance resets (e.g. 'month', 'year'). For consumable features only.
Number of intervals between resets. Defaults to 1.
Pricing for usage beyond included units. Omit for free features.
Price per billing\_units after included usage. Either 'amount' or 'tiers' is required.
Amounts in additional currencies for this flat price. The base 'amount' is in the org's default currency. Only valid with 'amount', not 'tiers'.
Three-letter Stripe-supported currency code (e.g. 'eur', 'gbp').
Price amount in this currency. Set explicitly per currency, not converted from the base amount.
Tiered pricing. Either 'amount' or 'tiers' is required.
Three-letter Stripe-supported currency code (e.g. 'eur', 'gbp').
Per-unit amount for this tier in this currency.
Flat amount for this tier in this currency, if the tier uses one.
Billing interval. For consumable features, should match reset.interval.
Number of intervals per billing cycle. Defaults to 1.
Units per price increment. Usage is rounded UP when billed (e.g. billing\_units=100 means 101 rounds to 200).
'prepaid' for upfront payment (seats), 'usage\_based' for pay-as-you-go.
Max units purchasable beyond included. E.g. included=100, max\_purchase=300 allows 400 total. Null for no limit.
Proration settings for prepaid features. Controls mid-cycle quantity change billing.
Billing behavior when quantity increases mid-cycle.
Credit behavior when quantity decreases mid-cycle.
Rollover config for unused units. If set, unused included units carry over.
Max rollover units. Omit for unlimited rollover.
Maximum rollover as a percentage (0-100) of included + prepaid grant. Mutually exclusive with max.
When rolled over units expire.
Number of periods before expiry.
Overrides fields of this item's feature for customers on this plan (e.g. a credit system's credit\_schema).
For credit system features: replaces the feature's credit\_schema entirely for customers on this plan.
ID of the metered feature that draws from this credit system.
Number of metered-feature units priced together. Defaults to one when omitted.
Named rates chosen by event properties. The most specific match sets the rate; with no match the item's own rate applies.
Event properties this entry applies to. Every key must equal the tracked property, compared as strings.
Breaks ties between dimensions that match the same number of keys. Higher wins.
Inclusive upper usage boundary for this graduated tier. The final tier must be 'inf'.
Credits consumed per billing-unit group within this tier.
Named adjustments chosen by event properties. Every match applies: factors multiply, then adds are summed.
Event properties this entry applies to. Every key must equal the tracked property, compared as strings.
Multiplies the matched rate. All matching multipliers stack.
Added to the rate after every factor is applied, in credits per billing-unit group.
Inclusive upper usage boundary for this graduated tier. The final tier must be 'inf'.
Credits consumed per billing-unit group within this tier.
Credits consumed per billing-unit group.
For AI credit system features: replaces the feature's markup chain entirely for customers on this plan. An unset level means no markup at that level rather than inheriting the feature's.
Default percentage markup for customers on this plan. Use -100 to make usage free.
Per-provider markup percentages for customers on this plan.
Per-model markup overrides for customers on this plan.
Match items linked to this feature.
Match items with this billing method (prepaid or usage\_based).
Match items with this interval. Accepts either a BillingInterval (price-side) or a ResetInterval (reset-side, includes day/hour/minute) so price-less items keyed by reset.interval can be disambiguated.
Match items with this interval\_count. Disambiguates between items that share an interval but differ in count.
Match items whose grant equals this included usage. Omitted is a wildcard.
License links to drop, keyed by license\_plan\_id. Parallel to remove\_items.
The unique identifier of the purchased plan.
Timestamp when the purchase expires, or null for lifetime access.
Timestamp when the purchase was made.
Number of units purchased.
Whether this purchase is attached at the customer level or entity level.
License seat pools granted by the customer's plans, with seat counts.
The plan offered as an assignable license.
The plan that offers this license.
Display name of the license plan.
Total seats the customer has for this license, included plus paid.
Seats currently assigned to entities.
Seats still available to assign.
Paid seats purchased on top of the plan's included amount.
Feature balances keyed by feature ID, showing usage limits and remaining amounts.
The feature ID this balance is for.
The full feature object if expanded.
The unique identifier for this feature, used in /check and /track calls.
Human-readable name displayed in the dashboard and billing UI.
Feature type: 'boolean' for on/off access, 'metered' for usage-tracked features, 'credit\_system' for unified credit pools, 'ai\_credit\_system' for model-based token pricing.
For metered features: true if usage resets periodically (API calls, credits), false if allocated persistently (seats, storage).
Event names that trigger this feature's balance. Allows multiple features to respond to a single event.
For classic credit systems: maps metered features to flat or graduated credit costs.
ID of the metered feature that draws from this credit system.
Number of metered-feature units priced together. Defaults to one when omitted.
Named rates chosen by event properties. The most specific match sets the rate; with no match the item's own rate applies.
Event properties this entry applies to. Every key must equal the tracked property, compared as strings.
Breaks ties between dimensions that match the same number of keys. Higher wins.
Inclusive upper usage boundary for this graduated tier. The final tier must be 'inf'.
Credits consumed per billing-unit group within this tier.
Named adjustments chosen by event properties. Every match applies: factors multiply, then adds are summed.
Event properties this entry applies to. Every key must equal the tracked property, compared as strings.
Multiplies the matched rate. All matching multipliers stack.
Added to the rate after every factor is applied, in credits per billing-unit group.
Inclusive upper usage boundary for this graduated tier. The final tier must be 'inf'.
Credits consumed per billing-unit group within this tier.
Credits consumed per billing-unit group.
Whether usage of this classic credit system should be itemized as invoice credits.
Per-model markup overrides for AI credit systems.
Default percentage markup for AI credit systems. Use -100 to make usage free.
Per-provider default markup percentages for AI credit systems.
Display names for the feature in billing UI and customer-facing components.
Singular form for UI display (e.g., 'API call', 'seat').
Plural form for UI display (e.g., 'API calls', 'seats').
Whether the feature is archived and hidden from the dashboard.
Processor mappings for this feature. Present when a Stripe product or meter is set.
Stripe product ID this feature's usage prices bill under.
Stripe meter ID used to create this feature's metered price.
Total balance granted (included + prepaid).
Remaining balance available for use.
Total usage consumed in the current period.
Whether this feature has unlimited usage.
Whether usage beyond the granted balance is allowed (with overage charges).
Maximum quantity that can be purchased as a top-up, or null for unlimited.
Timestamp when the balance will reset, or null for no reset.
Detailed breakdown of balance sources when stacking multiple plans or grants.
The unique identifier for this balance breakdown.
The plan ID this balance originates from, or null for standalone balances.
Amount granted from the plan's included usage.
Amount granted from prepaid purchases or top-ups.
Remaining balance available for use.
Amount consumed in the current period.
Whether this balance has unlimited usage.
Reset configuration for this balance, or null if no reset.
The reset interval (hour, day, week, month, etc.) or 'multiple' if combined from different intervals.
Number of intervals between resets (eg. 2 for bi-monthly).
Timestamp when the balance will next reset.
Pricing configuration if this balance has usage-based pricing.
The per-unit price amount.
Tiered pricing configuration if applicable.
How tiers are applied: graduated (split across bands) or volume (flat rate for the matched tier).
The number of units per billing increment (eg. \$9 / 250 units).
Whether usage is prepaid or billed pay-per-use.
Maximum quantity that can be purchased, or null for unlimited.
Timestamp when this balance expires, or null for no expiration.
Rollover balances carried over from previous periods.
Amount originally rolled over from a previous period, before any of it was consumed.
Amount of balance rolled over from a previous period.
Timestamp when the rollover balance expires.
Boolean feature flags keyed by feature ID, showing enabled access for on/off features.
The unique identifier for this flag.
The plan ID this flag originates from, or null for standalone flags.
Timestamp when this flag expires, or null for no expiration.
The feature ID this flag is for.
The full feature object if expanded.
The unique identifier for this feature, used in /check and /track calls.
Human-readable name displayed in the dashboard and billing UI.
Feature type: 'boolean' for on/off access, 'metered' for usage-tracked features, 'credit\_system' for unified credit pools, 'ai\_credit\_system' for model-based token pricing.
For metered features: true if usage resets periodically (API calls, credits), false if allocated persistently (seats, storage).
Event names that trigger this feature's balance. Allows multiple features to respond to a single event.
For classic credit systems: maps metered features to flat or graduated credit costs.
ID of the metered feature that draws from this credit system.
Number of metered-feature units priced together. Defaults to one when omitted.
Named rates chosen by event properties. The most specific match sets the rate; with no match the item's own rate applies.
Event properties this entry applies to. Every key must equal the tracked property, compared as strings.
Breaks ties between dimensions that match the same number of keys. Higher wins.
Inclusive upper usage boundary for this graduated tier. The final tier must be 'inf'.
Credits consumed per billing-unit group within this tier.
Named adjustments chosen by event properties. Every match applies: factors multiply, then adds are summed.
Event properties this entry applies to. Every key must equal the tracked property, compared as strings.
Multiplies the matched rate. All matching multipliers stack.
Added to the rate after every factor is applied, in credits per billing-unit group.
Inclusive upper usage boundary for this graduated tier. The final tier must be 'inf'.
Credits consumed per billing-unit group within this tier.
Credits consumed per billing-unit group.
Whether usage of this classic credit system should be itemized as invoice credits.
Per-model markup overrides for AI credit systems.
Default percentage markup for AI credit systems. Use -100 to make usage free.
Per-provider default markup percentages for AI credit systems.
Display names for the feature in billing UI and customer-facing components.
Singular form for UI display (e.g., 'API call', 'seat').
Plural form for UI display (e.g., 'API calls', 'seats').
Whether the feature is archived and hidden from the dashboard.
Processor mappings for this feature. Present when a Stripe product or meter is set.
Stripe product ID this feature's usage prices bill under.
Stripe meter ID used to create this feature's metered price.
Configuration for the customer.
Whether to disable the shared customer-level pool for entities.
Stops Autumn from posting usage-overage line items to Stripe for this customer. Check/track and balance resets still behave normally. When set, this overrides the organization-level disable\_overage\_billing setting.
Payment processors this customer is connected to (Stripe, Vercel, RevenueCat). Omitted entirely when the customer has not been created in any processor.
Stripe processor connection for the customer.
Stripe customer ID.
Vercel processor connection for the customer (public-safe subset).
Vercel marketplace installation ID for this customer.
Vercel account ID associated with the installation.
RevenueCat processor connection for the customer.
Customer's external ID, used as the RevenueCat app user ID. Null if the customer has no external ID set.
Invoices for this customer.
Array of plan IDs included in this invoice
The Stripe invoice ID
The billing processor that owns this invoice.
The status of the invoice
The total amount of the invoice
The currency code for the invoice
Timestamp when the invoice was created
URL to the Stripe-hosted invoice page
Upcoming invoice for each of this customer's Stripe subscriptions.
Plan IDs contributing line items to this invoice.
Unix timestamp (milliseconds) when this invoice will be created.
The three-letter ISO currency code. All amounts are in the currency's major unit (e.g., dollars for USD).
The total before discounts.
The total after discounts.
The line items this invoice will contain: usage accrued in the closing cycle, plus recurring charges for the opening cycle.
The name of the line item to display to the customer if you're building a UI. It will either be the plan name or the feature name.
A detailed description of the line item.
The amount before discounts and tax for this line item.
The final amount after discounts and tax for this line item.
List of discounts applied to this line item.
The ID of the plan that this line item belongs to.
The ID of the feature that this line item belongs to.
The period of time that this line item is being charged for.
The start of the period in milliseconds since the Unix epoch.
The end of the period in milliseconds since the Unix epoch.
The quantity of the line item.
Entities associated with this customer.
The unique identifier of the entity
The name of the entity
The customer ID this entity belongs to
The feature ID this entity belongs to
Unix timestamp when the entity was created
The environment (sandbox/live)
Trial usage history for this customer.
Rewards earned or applied for this customer.
Array of active discounts applied to the customer
The unique identifier for this discount
The name of the discount or coupon
The type of reward
The discount value (percentage or fixed amount)
How long the discount lasts
Number of billing periods the discount applies for repeating durations
The currency code for fixed amount discounts
Timestamp when the discount becomes active
Timestamp when the discount expires
The Stripe subscription ID this discount is applied to
Total amount saved from this discount
Referral records for this customer.
The customer's default payment method.
```json 200 theme={null}
{
"customer_id": "cus_123",
"flashed": [
{
"plan_id": "pro",
"processor": "stripe",
"customer_product_id": "cus_prod_123",
"status": "active",
"skipped": false
}
],
"customer": {
"id": "cus_123",
"name": "Jane Doe",
"email": "jane@example.com",
"createdAt": 1771409161016,
"fingerprint": null,
"stripeId": "cus_stripe_123",
"processors": {
"stripe": {
"id": "cus_stripe_123"
}
},
"env": "sandbox",
"metadata": {},
"sendEmailReceipts": false,
"billingControls": {
"autoTopups": []
},
"subscriptions": [
{
"planId": "pro",
"autoEnable": false,
"addOn": false,
"status": "active",
"pastDue": false,
"canceledAt": null,
"expiresAt": null,
"trialEndsAt": null,
"startedAt": 1771431921437,
"currentPeriodStart": 1771431921437,
"currentPeriodEnd": 1771999921437,
"quantity": 1
}
],
"purchases": [],
"balances": {
"messages": {
"featureId": "messages",
"granted": 100,
"remaining": 90,
"usage": 10,
"unlimited": false,
"overageAllowed": false,
"maxPurchase": null,
"nextResetAt": 1773851121437,
"breakdown": [
{
"id": "cus_ent_39qmLooixXLAqMywgXywjAz96rV",
"planId": "pro",
"includedGrant": 100,
"prepaidGrant": 0,
"remaining": 90,
"usage": 10,
"unlimited": false,
"reset": {
"interval": "month",
"resetsAt": 1773851121437
},
"price": null,
"expiresAt": null
}
]
}
},
"flags": {},
"config": {
"disable_pooled_balance": false,
"disable_overage_billing": false
}
}
}
```
# Multi Attach
Source: https://docs.useautumn.com/api-reference/billing/multiAttach
openapi POST /v1/billing.multi_attach
Attaches multiple plans to a customer in a single request. Creates a single Stripe subscription with all plans consolidated.
Use this endpoint when you need to subscribe a customer to multiple plans at once, such as a base plan plus add-ons, or to create a bundle of products.
### Body Parameters
The ID of the customer to attach the plans to.
The ID of the entity to attach the plans to.
The list of plans to attach to the customer.
The ID of the plan to attach.
Customize the plan to attach. Can override its price or items.
Base price configuration for a plan.
Base price amount for the plan, in major currency units (e.g. dollars).
Billing interval (e.g. 'month', 'year').
Number of intervals per billing cycle. Defaults to 1.
Base price amounts in additional currencies. The base 'amount' is in the org's default currency.
Three-letter Stripe-supported currency code (e.g. 'eur', 'gbp').
Price amount in this currency. Set explicitly per currency, not converted from the base amount.
Override the items in the plan.
Bills this many feature units when outstanding overage reaches it.
The ID of the feature to configure.
Number of free units included. Balance resets to this each interval for consumable features.
If true, customer has unlimited access to this feature.
Whether entity-level grants contribute to a shared customer balance.
Reset configuration for consumable features. Omit for non-consumable features like seats.
Interval at which balance resets (e.g. 'month', 'year'). For consumable features only.
Number of intervals between resets. Defaults to 1.
Pricing for usage beyond included units. Omit for free features.
Price per billing\_units after included usage. Either 'amount' or 'tiers' is required.
Amounts in additional currencies for this flat price. The base 'amount' is in the org's default currency. Only valid with 'amount', not 'tiers'.
Three-letter Stripe-supported currency code (e.g. 'eur', 'gbp').
Price amount in this currency. Set explicitly per currency, not converted from the base amount.
Tiered pricing. Either 'amount' or 'tiers' is required.
Per-currency amounts for this tier. Tier boundaries ('to') are shared across all currencies.
Three-letter Stripe-supported currency code (e.g. 'eur', 'gbp').
Per-unit amount for this tier in this currency.
Flat amount for this tier in this currency, if the tier uses one.
Billing interval. For consumable features, should match reset.interval.
Number of intervals per billing cycle. Defaults to 1.
Units per price increment. Usage is rounded UP when billed (e.g. billing\_units=100 means 101 rounds to 200).
'prepaid' for upfront payment (seats), 'usage\_based' for pay-as-you-go.
Max units purchasable beyond included. E.g. included=100, max\_purchase=300 allows 400 total. Null for no limit.
Proration settings for prepaid features. Controls mid-cycle quantity change billing.
Billing behavior when quantity increases mid-cycle.
Credit behavior when quantity decreases mid-cycle.
Rollover config for unused units. If set, unused included units carry over.
Max rollover units. Omit for unlimited rollover.
Maximum rollover as a percentage (0-100) of included + prepaid grant. Mutually exclusive with max.
When rolled over units expire.
Number of periods before expiry.
Overrides fields of this item's feature for customers on this plan (e.g. a credit system's credit\_schema).
For credit system features: replaces the feature's credit\_schema entirely for customers on this plan.
ID of the metered feature that draws from this credit system.
Number of metered-feature units priced together. Defaults to one when omitted.
Named rates chosen by event properties. The most specific match sets the rate; with no match the item's own rate applies.
Event properties this entry applies to. Every key must equal the tracked property, compared as strings.
Breaks ties between dimensions that match the same number of keys. Higher wins.
Inclusive upper usage boundary for this graduated tier. The final tier must be 'inf'.
Credits consumed per billing-unit group within this tier.
Named adjustments chosen by event properties. Every match applies: factors multiply, then adds are summed.
Event properties this entry applies to. Every key must equal the tracked property, compared as strings.
Multiplies the matched rate. All matching multipliers stack.
Added to the rate after every factor is applied, in credits per billing-unit group.
Inclusive upper usage boundary for this graduated tier. The final tier must be 'inf'.
Credits consumed per billing-unit group within this tier.
Credits consumed per billing-unit group.
For AI credit system features: replaces the feature's markup chain entirely for customers on this plan. An unset level means no markup at that level rather than inheriting the feature's.
Default percentage markup for customers on this plan. Use -100 to make usage free.
Per-provider markup percentages for customers on this plan.
Per-model markup overrides for customers on this plan.
If this plan contains prepaid features, use this field to specify the quantity of each prepaid feature.
The ID of the feature to set quantity for.
The quantity of the feature.
Whether the customer can adjust the quantity.
The version of the plan to attach.
A unique ID to identify this subscription. Useful when attaching the same plan multiple times.
The entity scope for this plan. Omit to inherit the request scope, or pass null for customer-level.
Free trial configuration for a plan.
Number of duration\_type periods the trial lasts.
Unit of time for the trial ('day', 'month', 'year').
If true, a payment method is required to start the trial and the customer is charged when it ends. Defaults to false.
Behavior when the trial ends. 'bill' charges the customer (default). 'revert' expires the trial and restores the customer's previous plan.
Unix timestamp in milliseconds for backdating every plan in this multi-attach.
Currency to bill this multi-attach in (e.g. usd, eur). Must match the customer's currency if they are already locked to one, and every plan must offer a paid price in it. Defaults to the customer's currency, then the org default.
Invoice mode creates a draft or open invoice and sends it to the customer, instead of charging their card immediately.
When true, creates an invoice and sends it to the customer instead of charging their card immediately. Uses Stripe's send\_invoice collection method.
If true, enables the plan immediately even though the invoice is not paid yet.
If true, finalizes the invoice so it can be sent to the customer. If false, keeps it as a draft for manual review.
ID of an invoice template (configured in billing settings) whose footer (e.g. bank details) is applied to the invoice.
Number of days the customer has to pay the invoice before it is due (Stripe days\_until\_due).
List of discounts to apply. Each discount can be an Autumn reward ID, Stripe coupon ID, or Stripe promotion code.
The ID of the reward to apply as a discount.
The promotion code to apply as a discount.
How to handle billing. 'prorate\_immediately' charges/credits prorated amounts now, 'none' does not charge/credit anything.
Pass 'now' to reset the billing cycle of every plan on the subscription to the time of this request.
URL to redirect to after successful checkout.
Additional parameters to pass into the creation of the Stripe checkout session.
Controls when to return a checkout URL. 'always' returns a URL even if payment succeeds, 'if\_required' only when payment action is needed, 'never' disables redirects.
Only applicable when the customer has an existing Stripe subscription. If true, creates a new separate subscription instead of merging into the existing one.
If true, the cusProducts are activated immediately even when payment is pending via Stripe checkout.
Customer details to set when creating a customer
Customer's name
Customer's email address
Unique identifier (eg, serial number) to detect duplicate customers and prevent free trial abuse
Additional metadata for the customer
Stripe customer ID if you already have one
Whether to create the customer in Stripe
The ID of the free plan to auto-enable for the customer
Whether to send email receipts to this customer
Currency to bill this customer in (e.g. usd, eur). Defaults to the organization's default currency.
Billing controls for the customer (auto top-ups, etc.)
List of auto top-up configurations per feature.
The ID of the feature (credit balance) to auto top-up.
Whether auto top-up is enabled.
When the balance drops below this threshold, an auto top-up will be purchased.
Amount of credits to add per auto top-up.
Optional rate limit to cap how often auto top-ups occur. Pass count to set the current window's consumed top-ups.
The time interval for the purchase limit window.
Number of intervals in the purchase limit window.
Maximum number of auto top-ups allowed within the interval.
Set the current window's consumed auto top-up count. Omit to leave runtime state unchanged.
When true, auto top-up creates a send\_invoice invoice instead of auto-charging.
List of overage spend limits per feature (caps overage spend).
Optional feature ID this spend limit applies to.
Whether the overage spend limit is enabled.
How overage\_limit is interpreted: an absolute overage cap (default) or a percentage of the main-plan allowance.
Overage cap for the feature: absolute units, or a percent (e.g. 120) when limit\_type is usage\_percentage.
When true, overage for this feature is not posted to Stripe. Usage tracking and balance resets still behave normally.
List of hard usage caps per feature (max units per interval).
The feature this usage limit applies to.
Whether this usage limit is enabled.
Maximum units allowed per interval.
Interval for the cap, aligned to the customer's billing cycle.
Window alignment. 'billing\_cycle' phases the interval to the customer's renewal time; 'utc' aligns to the UTC calendar.
When set, only usage from events whose properties match counts toward this cap. Omit to count all usage of the feature.
List of usage alert configurations per feature.
The feature ID this alert applies to.
Whether this usage alert is enabled.
The threshold value that triggers the alert. For usage or remaining, this is an absolute count. For usage\_percentage or remaining\_percentage, this is a percentage (0-100).
Whether the threshold is an absolute count or a percentage of the usage allowance or remaining balance.
What 100% means. balance: every grant on the feature. included: the plan allowance only. recurring: grants that reset. usage\_limit: the cap of the usage limit with the same feature and filter.
Only valid with basis usage\_limit. Points the alert at the usage limit carrying the same filter.
Optional user-defined label to distinguish multiple alerts on the same feature.
List of overage allowed controls per feature. When enabled, usage can exceed balance.
The feature ID this overage allowed control applies to.
Whether overage is allowed for this feature.
Miscellaneous configurations for the customer.
Whether to disable the shared customer-level pool for entities.
Stops Autumn from posting usage-overage line items to Stripe for this customer. Check/track and balance resets still behave normally. When set, this overrides the organization-level disable\_overage\_billing setting.
The feature ID that this entity is associated with
Name of the entity
Billing controls for the entity.
List of spend limits per feature. Each entry caps overage (overage\_limit) and/or per-interval usage (usage\_limit).
Optional feature ID this spend limit applies to.
Whether the overage spend limit is enabled.
How overage\_limit is interpreted: an absolute overage cap (default) or a percentage of the main-plan allowance.
Overage cap for the feature: absolute units, or a percent (e.g. 120) when limit\_type is usage\_percentage.
When true, overage for this feature is not posted to Stripe. Usage tracking and balance resets still behave normally.
List of hard usage caps per feature for this entity. An entity entry overrides the customer's for that feature.
The feature this usage limit applies to.
Whether this usage limit is enabled.
Maximum units allowed per interval.
Interval for the cap, aligned to the customer's billing cycle.
Window alignment. 'billing\_cycle' phases the interval to the customer's renewal time; 'utc' aligns to the UTC calendar.
When set, only usage from events whose properties match counts toward this cap. Omit to count all usage of the feature.
List of usage alert configurations per feature.
The feature ID this alert applies to.
Whether this usage alert is enabled.
The threshold value that triggers the alert. For usage or remaining, this is an absolute count. For usage\_percentage or remaining\_percentage, this is a percentage (0-100).
Whether the threshold is an absolute count or a percentage of the usage allowance or remaining balance.
What 100% means. balance: every grant on the feature. included: the plan allowance only. recurring: grants that reset. usage\_limit: the cap of the usage limit with the same feature and filter.
Only valid with basis usage\_limit. Points the alert at the usage limit carrying the same filter.
Optional user-defined label to distinguish multiple alerts on the same feature.
List of overage allowed controls per feature. When enabled, usage can exceed balance.
The feature ID this overage allowed control applies to.
Whether overage is allowed for this feature.
### Response
The ID of the customer.
The ID of the entity, if the plan was attached to an entity.
Invoice details if an invoice was created. Only present when a charge was made.
The status of the invoice (e.g., 'paid', 'open', 'draft').
The Stripe invoice ID.
The total amount of the invoice in cents.
The three-letter ISO currency code (e.g., 'usd').
URL to the hosted invoice page where the customer can view and pay the invoice.
URL to redirect the customer to complete payment. Null if no payment action is required.
Details about any action required to complete the payment. Present when the payment could not be processed automatically.
The type of action required to complete the payment.
A human-readable explanation of why this action is required.
```json 200 theme={null}
{
"customer_id": "cus_123",
"invoice": {
"status": "paid",
"stripe_id": "in_1234",
"total": 4900,
"currency": "usd",
"hosted_invoice_url": "https://invoice.stripe.com/..."
},
"payment_url": null
}
```
# Multi Update
Source: https://docs.useautumn.com/api-reference/billing/multiUpdate
openapi POST /v1/billing.multi_update
Updates multiple plans on a customer in a single request. Currently supports cancel actions (immediately, end of cycle, or uncancel) across one or more subscriptions.
Use this endpoint to cancel or uncancel several plans atomically in one call — for example canceling a main plan together with its add-ons, or plans across multiple entities.
The multi update endpoint applies updates to multiple plans in a single,
atomic request. It currently supports cancel actions. For updating a single
plan (like changing quantities or customizing items), use
[update](/api-reference/billing/billingUpdate) instead.
### Common Use Cases
```typescript Cancel a plan and its add-on theme={null}
const response = await autumn.billing.multiUpdate({
customerId: "cus_123",
updates: [
{ planId: "pro_plan", cancelAction: "cancel_end_of_cycle" },
{ planId: "addon_seats", cancelAction: "cancel_end_of_cycle" },
],
});
```
```typescript Cancel immediately with a refund and Stripe reason theme={null}
const response = await autumn.billing.multiUpdate({
customerId: "cus_123",
updates: [
{
planId: "pro_plan",
cancelAction: "cancel_immediately",
refundLastPayment: "full",
subscriptionParams: {
cancellation_details: {
feedback: "too_expensive",
comment: "Switching to a competitor",
},
},
},
],
});
```
### Body Parameters
The ID of the customer to update plans for.
The ID of the entity to update plans for. Individual updates can override this with their own entity\_id.
Controls how the last payment is refunded on immediate cancellation. 'prorated' refunds the unused portion, 'full' refunds the entire last payment.
Additional parameters to pass into the Stripe subscription update or cancel call.
The list of plan updates to apply to the customer.
The ID of the plan to update. Optional if subscription\_id is provided.
A unique ID to identify the subscription to update. Useful when a customer has multiple products with the same plan.
The ID of the entity this update targets. Overrides the top-level entity\_id for this update.
Action to perform for cancellation. 'cancel\_immediately' cancels now with prorated refund, 'cancel\_end\_of\_cycle' cancels at period end, 'uncancel' reverses a pending cancellation.
How to handle proration for this update. 'prorate\_immediately' charges/credits prorated amounts now, 'none' skips creating any charges.
### Response
The ID of the customer.
The ID of the entity, if the plan was attached to an entity.
Invoice details if an invoice was created. Only present when a charge was made.
The status of the invoice (e.g., 'paid', 'open', 'draft').
The Stripe invoice ID.
The total amount of the invoice in cents.
The three-letter ISO currency code (e.g., 'usd').
URL to the hosted invoice page where the customer can view and pay the invoice.
URL to redirect the customer to complete payment. Null if no payment action is required.
Details about any action required to complete the payment. Present when the payment could not be processed automatically.
The type of action required to complete the payment.
A human-readable explanation of why this action is required.
```json 200 theme={null}
{
"customer_id": "cus_123",
"invoice": {
"status": "paid",
"stripe_id": "in_1234",
"total": -20,
"currency": "usd",
"hosted_invoice_url": "https://invoice.stripe.com/..."
},
"payment_url": null
}
```
# Open Customer Portal
Source: https://docs.useautumn.com/api-reference/billing/openCustomerPortal
openapi POST /v1/billing.open_customer_portal
Create a billing portal session for a customer to manage their subscription.
### Body Parameters
The ID of the customer to open the billing portal for.
Stripe billing portal configuration ID. Create configurations in your Stripe dashboard.
URL to redirect to when back button is clicked in the billing portal
### Response
The ID of the billing portal session
URL to the billing portal
```json 200 theme={null}
{
"customer_id": "cus_123",
"url": "https://billing.stripe.com/session/..."
}
```
# Preview Attach
Source: https://docs.useautumn.com/api-reference/billing/previewAttach
openapi POST /v1/billing.preview_attach
Previews the billing changes that would occur when attaching a plan, without actually making any changes.
Use this endpoint to show customers what they will be charged before confirming a subscription change.
### Body Parameters
The ID of the customer to attach the plan to.
The ID of the entity to attach the plan to.
The ID of the plan.
If this plan contains prepaid features, use this field to specify the quantity of each prepaid feature. This quantity includes the included amount and billing units defined when setting up the plan.
The ID of the feature to set quantity for.
The quantity of the feature.
Whether the customer can adjust the quantity.
The version of the plan to attach.
Free trial configuration for a plan.
Number of duration\_type periods the trial lasts.
Unit of time for the trial ('day', 'month', 'year').
If true, a payment method is required to start the trial and the customer is charged when it ends. Defaults to false.
Behavior when the trial ends. 'bill' charges the customer (default). 'revert' expires the trial and restores the customer's previous plan.
Customize the plan to attach. Can override the price, items, licenses, free trial, or a combination.
Base price configuration for a plan.
Base price amount for the plan, in major currency units (e.g. dollars).
Billing interval (e.g. 'month', 'year').
Number of intervals per billing cycle. Defaults to 1.
Base price amounts in additional currencies. The base 'amount' is in the org's default currency.
Three-letter Stripe-supported currency code (e.g. 'eur', 'gbp').
Price amount in this currency. Set explicitly per currency, not converted from the base amount.
Override the items in the plan (PUT-style — replaces all existing items). Mutually exclusive with add\_items / remove\_items / deprecated update\_items.
Bills this many feature units when outstanding overage reaches it.
The ID of the feature to configure.
Number of free units included. Balance resets to this each interval for consumable features.
If true, customer has unlimited access to this feature.
Whether entity-level grants contribute to a shared customer balance.
Reset configuration for consumable features. Omit for non-consumable features like seats.
Interval at which balance resets (e.g. 'month', 'year'). For consumable features only.
Number of intervals between resets. Defaults to 1.
Pricing for usage beyond included units. Omit for free features.
Price per billing\_units after included usage. Either 'amount' or 'tiers' is required.
Amounts in additional currencies for this flat price. The base 'amount' is in the org's default currency. Only valid with 'amount', not 'tiers'.
Three-letter Stripe-supported currency code (e.g. 'eur', 'gbp').
Price amount in this currency. Set explicitly per currency, not converted from the base amount.
Tiered pricing. Either 'amount' or 'tiers' is required.
Per-currency amounts for this tier. Tier boundaries ('to') are shared across all currencies.
Three-letter Stripe-supported currency code (e.g. 'eur', 'gbp').
Per-unit amount for this tier in this currency.
Flat amount for this tier in this currency, if the tier uses one.
Billing interval. For consumable features, should match reset.interval.
Number of intervals per billing cycle. Defaults to 1.
Units per price increment. Usage is rounded UP when billed (e.g. billing\_units=100 means 101 rounds to 200).
'prepaid' for upfront payment (seats), 'usage\_based' for pay-as-you-go.
Max units purchasable beyond included. E.g. included=100, max\_purchase=300 allows 400 total. Null for no limit.
Proration settings for prepaid features. Controls mid-cycle quantity change billing.
Billing behavior when quantity increases mid-cycle.
Credit behavior when quantity decreases mid-cycle.
Rollover config for unused units. If set, unused included units carry over.
Max rollover units. Omit for unlimited rollover.
Maximum rollover as a percentage (0-100) of included + prepaid grant. Mutually exclusive with max.
When rolled over units expire.
Number of periods before expiry.
Overrides fields of this item's feature for customers on this plan (e.g. a credit system's credit\_schema).
For credit system features: replaces the feature's credit\_schema entirely for customers on this plan.
ID of the metered feature that draws from this credit system.
Number of metered-feature units priced together. Defaults to one when omitted.
Named rates chosen by event properties. The most specific match sets the rate; with no match the item's own rate applies.
Event properties this entry applies to. Every key must equal the tracked property, compared as strings.
Breaks ties between dimensions that match the same number of keys. Higher wins.
Inclusive upper usage boundary for this graduated tier. The final tier must be 'inf'.
Credits consumed per billing-unit group within this tier.
Named adjustments chosen by event properties. Every match applies: factors multiply, then adds are summed.
Event properties this entry applies to. Every key must equal the tracked property, compared as strings.
Multiplies the matched rate. All matching multipliers stack.
Added to the rate after every factor is applied, in credits per billing-unit group.
Inclusive upper usage boundary for this graduated tier. The final tier must be 'inf'.
Credits consumed per billing-unit group within this tier.
Credits consumed per billing-unit group.
For AI credit system features: replaces the feature's markup chain entirely for customers on this plan. An unset level means no markup at that level rather than inheriting the feature's.
Default percentage markup for customers on this plan. Use -100 to make usage free.
Per-provider markup percentages for customers on this plan.
Per-model markup overrides for customers on this plan.
Items to add to the plan.
Bills this many feature units when outstanding overage reaches it.
The ID of the feature to configure.
Number of free units included. Balance resets to this each interval for consumable features.
If true, customer has unlimited access to this feature.
Whether entity-level grants contribute to a shared customer balance.
Reset configuration for consumable features. Omit for non-consumable features like seats.
Interval at which balance resets (e.g. 'month', 'year'). For consumable features only.
Number of intervals between resets. Defaults to 1.
Pricing for usage beyond included units. Omit for free features.
Price per billing\_units after included usage. Either 'amount' or 'tiers' is required.
Amounts in additional currencies for this flat price. The base 'amount' is in the org's default currency. Only valid with 'amount', not 'tiers'.
Three-letter Stripe-supported currency code (e.g. 'eur', 'gbp').
Price amount in this currency. Set explicitly per currency, not converted from the base amount.
Tiered pricing. Either 'amount' or 'tiers' is required.
Per-currency amounts for this tier. Tier boundaries ('to') are shared across all currencies.
Three-letter Stripe-supported currency code (e.g. 'eur', 'gbp').
Per-unit amount for this tier in this currency.
Flat amount for this tier in this currency, if the tier uses one.
Billing interval. For consumable features, should match reset.interval.
Number of intervals per billing cycle. Defaults to 1.
Units per price increment. Usage is rounded UP when billed (e.g. billing\_units=100 means 101 rounds to 200).
'prepaid' for upfront payment (seats), 'usage\_based' for pay-as-you-go.
Max units purchasable beyond included. E.g. included=100, max\_purchase=300 allows 400 total. Null for no limit.
Proration settings for prepaid features. Controls mid-cycle quantity change billing.
Billing behavior when quantity increases mid-cycle.
Credit behavior when quantity decreases mid-cycle.
Rollover config for unused units. If set, unused included units carry over.
Max rollover units. Omit for unlimited rollover.
Maximum rollover as a percentage (0-100) of included + prepaid grant. Mutually exclusive with max.
When rolled over units expire.
Number of periods before expiry.
Overrides fields of this item's feature for customers on this plan (e.g. a credit system's credit\_schema).
For credit system features: replaces the feature's credit\_schema entirely for customers on this plan.
ID of the metered feature that draws from this credit system.
Number of metered-feature units priced together. Defaults to one when omitted.
Named rates chosen by event properties. The most specific match sets the rate; with no match the item's own rate applies.
Event properties this entry applies to. Every key must equal the tracked property, compared as strings.
Breaks ties between dimensions that match the same number of keys. Higher wins.
Inclusive upper usage boundary for this graduated tier. The final tier must be 'inf'.
Credits consumed per billing-unit group within this tier.
Named adjustments chosen by event properties. Every match applies: factors multiply, then adds are summed.
Event properties this entry applies to. Every key must equal the tracked property, compared as strings.
Multiplies the matched rate. All matching multipliers stack.
Added to the rate after every factor is applied, in credits per billing-unit group.
Inclusive upper usage boundary for this graduated tier. The final tier must be 'inf'.
Credits consumed per billing-unit group within this tier.
Credits consumed per billing-unit group.
For AI credit system features: replaces the feature's markup chain entirely for customers on this plan. An unset level means no markup at that level rather than inheriting the feature's.
Default percentage markup for customers on this plan. Use -100 to make usage free.
Per-provider markup percentages for customers on this plan.
Per-model markup overrides for customers on this plan.
Filters selecting items to remove from the plan.
Match items linked to this feature.
Match items with this billing method (prepaid or usage\_based).
Match items with this interval. Accepts either a BillingInterval (price-side) or a ResetInterval (reset-side, includes day/hour/minute) so price-less items keyed by reset.interval can be disambiguated.
Match items with this interval\_count. Disambiguates between items that share an interval but differ in count.
Match items whose grant equals this included usage. Omitted is a wildcard.
Free trial configuration for a plan.
Number of duration\_type periods the trial lasts.
Unit of time for the trial ('day', 'month', 'year').
If true, a payment method is required to start the trial and the customer is charged when it ends. Defaults to false.
Behavior when the trial ends. 'bill' charges the customer (default). 'revert' expires the trial and restores the customer's previous plan.
Override the plan's billing controls (auto top-ups, spend limits, usage limits, usage alerts, overage allowed) for this customer.
List of auto top-up configurations per feature.
The ID of the feature (credit balance) to auto top-up.
Whether auto top-up is enabled.
When the balance drops below this threshold, an auto top-up will be purchased.
Amount of credits to add per auto top-up.
Optional rate limit to cap how often auto top-ups occur. Pass count to set the current window's consumed top-ups.
The time interval for the purchase limit window.
Number of intervals in the purchase limit window.
Maximum number of auto top-ups allowed within the interval.
Set the current window's consumed auto top-up count. Omit to leave runtime state unchanged.
When true, auto top-up creates a send\_invoice invoice instead of auto-charging.
List of overage spend limits per feature (caps overage spend).
Optional feature ID this spend limit applies to.
Whether the overage spend limit is enabled.
How overage\_limit is interpreted: an absolute overage cap (default) or a percentage of the main-plan allowance.
Overage cap for the feature: absolute units, or a percent (e.g. 120) when limit\_type is usage\_percentage.
When true, overage for this feature is not posted to Stripe. Usage tracking and balance resets still behave normally.
List of hard usage caps per feature (max units per interval).
The feature this usage limit applies to.
Whether this usage limit is enabled.
Maximum units allowed per interval.
Interval for the cap, aligned to the customer's billing cycle.
Window alignment. 'billing\_cycle' phases the interval to the customer's renewal time; 'utc' aligns to the UTC calendar.
When set, only usage from events whose properties match counts toward this cap. Omit to count all usage of the feature.
List of usage alert configurations per feature.
The feature ID this alert applies to.
Whether this usage alert is enabled.
The threshold value that triggers the alert. For usage or remaining, this is an absolute count. For usage\_percentage or remaining\_percentage, this is a percentage (0-100).
Whether the threshold is an absolute count or a percentage of the usage allowance or remaining balance.
What 100% means. balance: every grant on the feature. included: the plan allowance only. recurring: grants that reset. usage\_limit: the cap of the usage limit with the same feature and filter.
Only valid with basis usage\_limit. Points the alert at the usage limit carrying the same filter.
Optional user-defined label to distinguish multiple alerts on the same feature.
List of overage allowed controls per feature. When enabled, usage can exceed balance.
The feature ID this overage allowed control applies to.
Whether overage is allowed for this feature.
License links to add or override for this customer, keyed by license\_plan\_id. Omitted fields inherit the plan catalog link (included defaults to 1 when the license is not in the catalog). A bare entry restores the license to pure catalog inheritance.
Base price configuration for a plan.
Base price amount for the plan, in major currency units (e.g. dollars).
Billing interval (e.g. 'month', 'year').
Number of intervals per billing cycle. Defaults to 1.
Base price amounts in additional currencies. The base 'amount' is in the org's default currency.
Three-letter Stripe-supported currency code (e.g. 'eur', 'gbp').
Price amount in this currency. Set explicitly per currency, not converted from the base amount.
Bills this many feature units when outstanding overage reaches it.
The ID of the feature to configure.
Number of free units included. Balance resets to this each interval for consumable features.
If true, customer has unlimited access to this feature.
Whether entity-level grants contribute to a shared customer balance.
Reset configuration for consumable features. Omit for non-consumable features like seats.
Interval at which balance resets (e.g. 'month', 'year'). For consumable features only.
Number of intervals between resets. Defaults to 1.
Pricing for usage beyond included units. Omit for free features.
Price per billing\_units after included usage. Either 'amount' or 'tiers' is required.
Amounts in additional currencies for this flat price. The base 'amount' is in the org's default currency. Only valid with 'amount', not 'tiers'.
Three-letter Stripe-supported currency code (e.g. 'eur', 'gbp').
Price amount in this currency. Set explicitly per currency, not converted from the base amount.
Tiered pricing. Either 'amount' or 'tiers' is required.
Per-currency amounts for this tier. Tier boundaries ('to') are shared across all currencies.
Three-letter Stripe-supported currency code (e.g. 'eur', 'gbp').
Per-unit amount for this tier in this currency.
Flat amount for this tier in this currency, if the tier uses one.
Billing interval. For consumable features, should match reset.interval.
Number of intervals per billing cycle. Defaults to 1.
Units per price increment. Usage is rounded UP when billed (e.g. billing\_units=100 means 101 rounds to 200).
'prepaid' for upfront payment (seats), 'usage\_based' for pay-as-you-go.
Max units purchasable beyond included. E.g. included=100, max\_purchase=300 allows 400 total. Null for no limit.
Proration settings for prepaid features. Controls mid-cycle quantity change billing.
Billing behavior when quantity increases mid-cycle.
Credit behavior when quantity decreases mid-cycle.
Rollover config for unused units. If set, unused included units carry over.
Max rollover units. Omit for unlimited rollover.
Maximum rollover as a percentage (0-100) of included + prepaid grant. Mutually exclusive with max.
When rolled over units expire.
Number of periods before expiry.
Overrides fields of this item's feature for customers on this plan (e.g. a credit system's credit\_schema).
For credit system features: replaces the feature's credit\_schema entirely for customers on this plan.
ID of the metered feature that draws from this credit system.
Number of metered-feature units priced together. Defaults to one when omitted.
Named rates chosen by event properties. The most specific match sets the rate; with no match the item's own rate applies.
Event properties this entry applies to. Every key must equal the tracked property, compared as strings.
Breaks ties between dimensions that match the same number of keys. Higher wins.
Inclusive upper usage boundary for this graduated tier. The final tier must be 'inf'.
Credits consumed per billing-unit group within this tier.
Named adjustments chosen by event properties. Every match applies: factors multiply, then adds are summed.
Event properties this entry applies to. Every key must equal the tracked property, compared as strings.
Multiplies the matched rate. All matching multipliers stack.
Added to the rate after every factor is applied, in credits per billing-unit group.
Inclusive upper usage boundary for this graduated tier. The final tier must be 'inf'.
Credits consumed per billing-unit group within this tier.
Credits consumed per billing-unit group.
For AI credit system features: replaces the feature's markup chain entirely for customers on this plan. An unset level means no markup at that level rather than inheriting the feature's.
Default percentage markup for customers on this plan. Use -100 to make usage free.
Per-provider markup percentages for customers on this plan.
Per-model markup overrides for customers on this plan.
Match items linked to this feature.
Match items with this billing method (prepaid or usage\_based).
Match items with this interval. Accepts either a BillingInterval (price-side) or a ResetInterval (reset-side, includes day/hour/minute) so price-less items keyed by reset.interval can be disambiguated.
Match items with this interval\_count. Disambiguates between items that share an interval but differ in count.
Match items whose grant equals this included usage. Omitted is a wildcard.
License links to drop, keyed by license\_plan\_id. Parallel to remove\_items.
Invoice mode creates a draft or open invoice and sends it to the customer, instead of charging their card immediately. This uses Stripe's send\_invoice collection method.
When true, creates an invoice and sends it to the customer instead of charging their card immediately. Uses Stripe's send\_invoice collection method.
If true, enables the plan immediately even though the invoice is not paid yet.
If true, finalizes the invoice so it can be sent to the customer. If false, keeps it as a draft for manual review.
ID of an invoice template (configured in billing settings) whose footer (e.g. bank details) is applied to the invoice.
Number of days the customer has to pay the invoice before it is due (Stripe days\_until\_due).
How to handle proration when updating an existing subscription. 'prorate\_immediately' charges/credits prorated amounts now, 'none' skips creating any charges.
Controls when to return a checkout URL. 'always' returns a URL even if payment succeeds, 'if\_required' only when payment action is needed, 'never' disables redirects.
A unique ID to identify this subscription. Can be used to target specific subscriptions in update operations when a customer has multiple products with the same plan.
List of discounts to apply. Each discount can be an Autumn reward ID, Stripe coupon ID, or Stripe promotion code.
The ID of the reward to apply as a discount.
The promotion code to apply as a discount.
URL to redirect to after successful checkout.
Only applicable when the customer has an existing Stripe subscription. If true, creates a new separate subscription instead of merging into the existing one.
Reset the billing cycle immediately with 'now', or schedule a reset at a future Unix timestamp in milliseconds.
When the plan change should take effect. 'immediate' applies now, 'end\_of\_cycle' schedules for the end of the current billing cycle. By default, upgrades are immediate and downgrades are scheduled.
Unix timestamp in milliseconds for when the attached plan should start. Future dates create a scheduled subscription.
Unix timestamp in milliseconds for when the attached plan should end.
Additional parameters to pass into the creation of the Stripe checkout session.
If true, returns an Autumn-hosted checkout link that can create a fresh Stripe checkout session when opened.
Custom line items that override the auto-generated proration invoice. Only valid for immediate plan changes (eg. upgrades or one off plans).
Amount in dollars for this line item (e.g. 10.50). Can be negative for credits.
Description for the line item.
The processor subscription ID to link. Use this to attach an existing Stripe subscription instead of creating a new one.
Whether to carry over balances from the previous plan.
Whether to carry over balances from the previous plan.
The IDs of the features to carry over balances from. If left undefined, all features will be carried over.
Whether to carry over usages from the previous plan.
Whether to carry over usages from the previous plan.
The IDs of the features to carry over usages for. If left undefined, all consumable features will be carried over.
Seat quantities for the plan's licenses, keyed by license plan.
The license plan to set seat quantity for.
Total seats for the license, inclusive of the plan's included amount — seats beyond it are paid.
Key-value metadata to attach to the Stripe subscription, invoice, and checkout session created during this attach flow. Keys prefixed with 'autumn\_' are reserved and will be stripped.
If true, skips any billing changes for the attach operation.
If true, the customer's plan is activated immediately even when payment is deferred (invoice mode) or pending (Stripe checkout). For Stripe checkout, the customer\_product is inserted before the customer completes the hosted form. Set it here rather than on `invoice_mode`, which only covers the invoice-unpaid case.
Stripe tax rate ID (txr\_...) to apply as the default tax rate on the created subscription, invoice, or checkout session line items.
Currency to bill this attach in (e.g. usd, eur). Must match the customer's currency if they are already locked to one, and the plan must offer a paid price in it. Defaults to the customer's currency, then the org default.
Plan IDs to expire on the customer as part of this attach. Each must be an active plan billed on the same subscription as the attach (or a free plan); plans on a separate subscription are rejected.
### Response
The ID of the customer.
The name of the line item to display to the customer if you're building a UI. It will either be the plan name or the feature name.
A detailed description of the line item.
The amount before discounts and tax for this line item.
The final amount after discounts and tax for this line item.
List of discounts applied to this line item.
The ID of the plan that this line item belongs to.
The ID of the feature that this line item belongs to.
The period of time that this line item is being charged for.
The start of the period in milliseconds since the Unix epoch.
The end of the period in milliseconds since the Unix epoch.
The quantity of the line item.
The total amount before discounts and tax for the current billing period.
The final amount after discounts and tax for the current billing period.
The three-letter ISO currency code. All amounts are in the currency's major unit (e.g., dollars for USD).
True when this change clears the customer's usage balances, so the approver can see usage will reset.
Preview of the next billing cycle, if applicable. This shows what the customer will be charged in subsequent cycles.
Unix timestamp (milliseconds) when the next billing cycle starts.
The total amount before discounts and tax for the next cycle.
The final amount after discounts and tax for the next cycle.
List of line items for the next billing cycle.
The name of the line item to display to the customer if you're building a UI. It will either be the plan name or the feature name.
A detailed description of the line item.
The amount before discounts and tax for this line item.
The final amount after discounts and tax for this line item.
List of discounts applied to this line item.
The ID of the plan that this line item belongs to.
The ID of the feature that this line item belongs to.
The period of time that this line item is being charged for.
The start of the period in milliseconds since the Unix epoch.
The end of the period in milliseconds since the Unix epoch.
The quantity of the line item.
List of line items for usage-based features in the next cycle.
The name of the line item to display to the customer if you're building a UI. It will either be the plan name or the feature name.
The ID of the plan that this line item belongs to.
The ID of the feature that this line item belongs to.
The period of time that this line item is being charged for.
The start of the period in milliseconds since the Unix epoch.
The end of the period in milliseconds since the Unix epoch.
Expand the response with additional data.
Products or subscription changes being added or updated.
The ID of the plan affected by this preview change.
The full plan object if it was expanded in the response.
Unique identifier for the plan.
Display name of the plan.
Optional description of the plan.
Group identifier for organizing related plans. Plans in the same group are mutually exclusive.
Version number of the plan. Incremented when plan configuration changes.
User-facing version identity. Defaults to v\{n} when the version is minted.
Whether this is the active version of the plan. At most one version is active.
Whether this is an add-on plan that can be attached alongside a main plan.
If true, this plan is automatically attached when a customer is created. Used for free plans.
Base recurring price for the plan. Null for free plans or usage-only plans.
Base price amount for the plan, in major currency units (e.g. dollars).
Base price amounts in additional currencies. The base 'amount' is in the org's default currency.
Three-letter Stripe-supported currency code (e.g. 'eur', 'gbp').
Price amount in this currency. Set explicitly per currency, not converted from the base amount.
Billing interval (e.g. 'month', 'year').
Number of intervals per billing cycle. Defaults to 1.
Display text for showing this price in pricing pages.
Main display text (e.g. '\$10' or '100 messages').
Secondary display text (e.g. 'per month' or 'then \$0.5 per 100').
Payment processors this base price is connected to. Omitted when unset.
Stripe price ID. For prepaid with included > 0 this is the V2 price.
Feature configurations included in this plan. Each item defines included units, pricing, and reset behavior for a feature.
Bills this many feature units when outstanding overage reaches it.
The ID of the feature this item configures.
The full feature object if expanded.
The ID of the feature, used to refer to it in other API calls like /track or /check.
The name of the feature.
The type of the feature
Singular and plural display names for the feature.
The singular display name for the feature.
The plural display name for the feature.
Credit cost schema for credit system features.
The ID of the metered feature (should be a single\_use feature).
The credit cost of the metered feature.
Whether or not the feature is archived.
Number of free units included. For consumable features, balance resets to this number each interval.
Whether the customer has unlimited access to this feature.
Whether entity-level grants contribute to a shared customer balance.
Reset configuration for consumable features. Null for non-consumable features like seats where usage persists across billing cycles.
The interval at which the feature balance resets (e.g. 'month', 'year'). For consumable features, usage resets to 0 and included units are restored.
Number of intervals between resets. Defaults to 1.
Pricing configuration for usage beyond included units. Null if feature is entirely free.
Price per billing\_units after included usage is consumed. Mutually exclusive with tiers.
Amounts in additional currencies for this flat price. The base 'amount' is in the org's default currency. Only valid with 'amount', not 'tiers' (tiered prices carry per-currency amounts on each tier).
Three-letter Stripe-supported currency code (e.g. 'eur', 'gbp').
Price amount in this currency. Set explicitly per currency, not converted from the base amount.
Tiered pricing configuration. Each tier's 'to' INCLUDES the included amount. Either 'tiers' or 'amount' is required.
Three-letter Stripe-supported currency code (e.g. 'eur', 'gbp').
Per-unit amount for this tier in this currency.
Flat amount for this tier in this currency, if the tier uses one.
Billing interval for this price. For consumable features, should match reset.interval.
Number of intervals per billing cycle. Defaults to 1.
Number of units per price increment. Usage is rounded UP to the nearest billing\_units when billed (e.g. billing\_units=100 means 101 usage rounds to 200).
'prepaid' for features like seats where customers pay upfront, 'usage\_based' for pay-as-you-go after included usage.
Maximum units a customer can purchase beyond included. E.g. if included=100 and max\_purchase=300, customer can use up to 400 total before usage is capped. Null for no limit.
Payment processors this item price is connected to. Omitted when unset.
Stripe price ID. For prepaid with included > 0 this is the V2 price.
Display text for showing this item in pricing pages.
Main display text (e.g. '\$10' or '100 messages').
Secondary display text (e.g. 'per month' or 'then \$0.5 per 100').
Rollover configuration for unused units. If set, unused included units roll over to the next period.
Maximum rollover units. Null for unlimited rollover.
Maximum rollover as a percentage (0-100) of included + prepaid grant. Mutually exclusive with max.
When rolled over units expire.
Number of periods before expiry.
Overrides fields of this item's feature for customers on this plan (e.g. a credit system's credit\_schema).
For credit system features: replaces the feature's credit\_schema entirely for customers on this plan.
ID of the metered feature that draws from this credit system.
Number of metered-feature units priced together. Defaults to one when omitted.
Named rates chosen by event properties. The most specific match sets the rate; with no match the item's own rate applies.
Event properties this entry applies to. Every key must equal the tracked property, compared as strings.
Breaks ties between dimensions that match the same number of keys. Higher wins.
Inclusive upper usage boundary for this graduated tier. The final tier must be 'inf'.
Credits consumed per billing-unit group within this tier.
Named adjustments chosen by event properties. Every match applies: factors multiply, then adds are summed.
Event properties this entry applies to. Every key must equal the tracked property, compared as strings.
Multiplies the matched rate. All matching multipliers stack.
Added to the rate after every factor is applied, in credits per billing-unit group.
Inclusive upper usage boundary for this graduated tier. The final tier must be 'inf'.
Credits consumed per billing-unit group within this tier.
Credits consumed per billing-unit group.
For AI credit system features: replaces the feature's markup chain entirely for customers on this plan. An unset level means no markup at that level rather than inheriting the feature's.
Default percentage markup for customers on this plan. Use -100 to make usage free.
Per-provider markup percentages for customers on this plan.
Per-model markup overrides for customers on this plan.
Payment processors this plan is connected to. Omitted when unset.
Stripe product ID this plan is billed under.
Extra Stripe product IDs aliased to this plan.
Every RevenueCat product that maps to this plan. Replaces the current set.
RevenueCat product ID that grants this plan when purchased.
Prepaid quantities granted when this specific RevenueCat product is purchased, in feature units.
Free trial configuration. If set, new customers can try this plan before being charged.
Number of duration\_type periods the trial lasts.
Unit of time for the trial duration ('day', 'month', 'year').
Whether a payment method is required to start the trial. If true, customer will be charged after trial ends.
Behavior when the trial ends. 'bill' charges the customer (default). 'revert' expires the trial and restores the customer's previous plan.
Unix timestamp (ms) when the plan was created.
Environment this plan belongs to ('sandbox' or 'live').
Whether the plan is archived. Archived plans cannot be attached to new customers.
Miscellaneous plan-level configuration flags.
If true, entitlements attached to this plan will still reset on schedule even when the customer's product is in a past\_due state.
Plan-level billing controls used as customer defaults.
List of auto top-up configurations per feature.
The ID of the feature (credit balance) to auto top-up.
Whether auto top-up is enabled.
When the balance drops below this threshold, an auto top-up will be purchased.
Amount of credits to add per auto top-up.
Optional rate limit to cap how often auto top-ups occur.
The time interval for the purchase limit window.
Number of intervals in the purchase limit window.
Maximum number of auto top-ups allowed within the interval.
When true, auto top-up creates a send\_invoice invoice instead of auto-charging.
List of overage spend limits per feature (caps overage spend).
Optional feature ID this spend limit applies to.
Whether the overage spend limit is enabled.
How overage\_limit is interpreted: an absolute overage cap (default) or a percentage of the main-plan allowance.
Overage cap for the feature: absolute units, or a percent (e.g. 120) when limit\_type is usage\_percentage.
When true, overage for this feature is not posted to Stripe. Usage tracking and balance resets still behave normally.
List of hard usage caps per feature (max units per interval).
The feature this usage limit applies to.
Whether this usage limit is enabled.
Maximum units allowed per interval.
Interval for the cap, aligned to the customer's billing cycle.
Window alignment. 'billing\_cycle' phases the interval to the customer's renewal time; 'utc' aligns to the UTC calendar.
When set, only usage from events whose properties match counts toward this cap. Omit to count all usage of the feature.
List of usage alert configurations per feature.
The feature ID this alert applies to.
Whether this usage alert is enabled.
The threshold value that triggers the alert. For usage or remaining, this is an absolute count. For usage\_percentage or remaining\_percentage, this is a percentage (0-100).
Whether the threshold is an absolute count or a percentage of the usage allowance or remaining balance.
What 100% means. balance: every grant on the feature. included: the plan allowance only. recurring: grants that reset. usage\_limit: the cap of the usage limit with the same feature and filter.
Only valid with basis usage\_limit. Points the alert at the usage limit carrying the same filter.
Optional user-defined label to distinguish multiple alerts on the same feature.
List of overage allowed controls per feature. When enabled, usage can exceed balance.
The feature ID this overage allowed control applies to.
Whether overage is allowed for this feature.
Arbitrary key-value metadata defined by you for your own use. Shared across all versions of the plan.
Whether the trial on this plan is available to this customer. For example, if the customer used the trial in the past, this will be false.
The customer's current status with this plan. 'active' if attached, 'scheduled' if pending activation.
Whether the customer's active instance of this plan is set to cancel.
Whether the customer is currently on a free trial of this plan.
The action that would occur if this plan were attached to the customer.
Deprecated. Use variant\_details.base\_plan\_id instead. If this is a variant, the ID of the base plan it was created from.
Details about how this variant relates to its latest base plan.
The ID of the base plan this variant was derived from.
The customization that transforms the base plan into this variant.
Base price configuration for a plan.
Base price amount for the plan, in major currency units (e.g. dollars).
Billing interval (e.g. 'month', 'year').
Number of intervals per billing cycle. Defaults to 1.
Base price amounts in additional currencies. The base 'amount' is in the org's default currency.
Three-letter Stripe-supported currency code (e.g. 'eur', 'gbp').
Price amount in this currency. Set explicitly per currency, not converted from the base amount.
Items to add to the plan.
Bills this many feature units when outstanding overage reaches it.
The ID of the feature to configure.
Number of free units included. Balance resets to this each interval for consumable features.
If true, customer has unlimited access to this feature.
Whether entity-level grants contribute to a shared customer balance.
Reset configuration for consumable features. Omit for non-consumable features like seats.
Interval at which balance resets (e.g. 'month', 'year'). For consumable features only.
Number of intervals between resets. Defaults to 1.
Pricing for usage beyond included units. Omit for free features.
Price per billing\_units after included usage. Either 'amount' or 'tiers' is required.
Amounts in additional currencies for this flat price. The base 'amount' is in the org's default currency. Only valid with 'amount', not 'tiers'.
Three-letter Stripe-supported currency code (e.g. 'eur', 'gbp').
Price amount in this currency. Set explicitly per currency, not converted from the base amount.
Tiered pricing. Either 'amount' or 'tiers' is required.
Three-letter Stripe-supported currency code (e.g. 'eur', 'gbp').
Per-unit amount for this tier in this currency.
Flat amount for this tier in this currency, if the tier uses one.
Billing interval. For consumable features, should match reset.interval.
Number of intervals per billing cycle. Defaults to 1.
Units per price increment. Usage is rounded UP when billed (e.g. billing\_units=100 means 101 rounds to 200).
'prepaid' for upfront payment (seats), 'usage\_based' for pay-as-you-go.
Max units purchasable beyond included. E.g. included=100, max\_purchase=300 allows 400 total. Null for no limit.
Proration settings for prepaid features. Controls mid-cycle quantity change billing.
Billing behavior when quantity increases mid-cycle.
Credit behavior when quantity decreases mid-cycle.
Rollover config for unused units. If set, unused included units carry over.
Max rollover units. Omit for unlimited rollover.
Maximum rollover as a percentage (0-100) of included + prepaid grant. Mutually exclusive with max.
When rolled over units expire.
Number of periods before expiry.
Overrides fields of this item's feature for customers on this plan (e.g. a credit system's credit\_schema).
For credit system features: replaces the feature's credit\_schema entirely for customers on this plan.
ID of the metered feature that draws from this credit system.
Number of metered-feature units priced together. Defaults to one when omitted.
Named rates chosen by event properties. The most specific match sets the rate; with no match the item's own rate applies.
Event properties this entry applies to. Every key must equal the tracked property, compared as strings.
Breaks ties between dimensions that match the same number of keys. Higher wins.
Inclusive upper usage boundary for this graduated tier. The final tier must be 'inf'.
Credits consumed per billing-unit group within this tier.
Named adjustments chosen by event properties. Every match applies: factors multiply, then adds are summed.
Event properties this entry applies to. Every key must equal the tracked property, compared as strings.
Multiplies the matched rate. All matching multipliers stack.
Added to the rate after every factor is applied, in credits per billing-unit group.
Inclusive upper usage boundary for this graduated tier. The final tier must be 'inf'.
Credits consumed per billing-unit group within this tier.
Credits consumed per billing-unit group.
For AI credit system features: replaces the feature's markup chain entirely for customers on this plan. An unset level means no markup at that level rather than inheriting the feature's.
Default percentage markup for customers on this plan. Use -100 to make usage free.
Per-provider markup percentages for customers on this plan.
Per-model markup overrides for customers on this plan.
Filters selecting items to remove from the plan.
Match items linked to this feature.
Match items with this billing method (prepaid or usage\_based).
Match items with this interval. Accepts either a BillingInterval (price-side) or a ResetInterval (reset-side, includes day/hour/minute) so price-less items keyed by reset.interval can be disambiguated.
Match items with this interval\_count. Disambiguates between items that share an interval but differ in count.
Match items whose grant equals this included usage. Omitted is a wildcard.
Free trial configuration for a plan.
Number of duration\_type periods the trial lasts.
Unit of time for the trial ('day', 'month', 'year').
If true, a payment method is required to start the trial and the customer is charged when it ends. Defaults to false.
Behavior when the trial ends. 'bill' charges the customer (default). 'revert' expires the trial and restores the customer's previous plan.
Override the plan's billing controls (auto top-ups, spend limits, usage limits, usage alerts, overage allowed) for this customer.
List of auto top-up configurations per feature.
The ID of the feature (credit balance) to auto top-up.
Whether auto top-up is enabled.
When the balance drops below this threshold, an auto top-up will be purchased.
Amount of credits to add per auto top-up.
Optional rate limit to cap how often auto top-ups occur. Pass count to set the current window's consumed top-ups.
The time interval for the purchase limit window.
Number of intervals in the purchase limit window.
Maximum number of auto top-ups allowed within the interval.
Set the current window's consumed auto top-up count. Omit to leave runtime state unchanged.
When true, auto top-up creates a send\_invoice invoice instead of auto-charging.
List of overage spend limits per feature (caps overage spend).
Optional feature ID this spend limit applies to.
Whether the overage spend limit is enabled.
How overage\_limit is interpreted: an absolute overage cap (default) or a percentage of the main-plan allowance.
Overage cap for the feature: absolute units, or a percent (e.g. 120) when limit\_type is usage\_percentage.
When true, overage for this feature is not posted to Stripe. Usage tracking and balance resets still behave normally.
List of hard usage caps per feature (max units per interval).
The feature this usage limit applies to.
Whether this usage limit is enabled.
Maximum units allowed per interval.
Interval for the cap, aligned to the customer's billing cycle.
Window alignment. 'billing\_cycle' phases the interval to the customer's renewal time; 'utc' aligns to the UTC calendar.
When set, only usage from events whose properties match counts toward this cap. Omit to count all usage of the feature.
List of usage alert configurations per feature.
The feature ID this alert applies to.
Whether this usage alert is enabled.
The threshold value that triggers the alert. For usage or remaining, this is an absolute count. For usage\_percentage or remaining\_percentage, this is a percentage (0-100).
Whether the threshold is an absolute count or a percentage of the usage allowance or remaining balance.
What 100% means. balance: every grant on the feature. included: the plan allowance only. recurring: grants that reset. usage\_limit: the cap of the usage limit with the same feature and filter.
Only valid with basis usage\_limit. Points the alert at the usage limit carrying the same filter.
Optional user-defined label to distinguish multiple alerts on the same feature.
List of overage allowed controls per feature. When enabled, usage can exceed balance.
The feature ID this overage allowed control applies to.
Whether overage is allowed for this feature.
License links to add or override for this customer, keyed by license\_plan\_id. Omitted fields inherit the plan catalog link (included defaults to 1 when the license is not in the catalog). A bare entry restores the license to pure catalog inheritance.
Base price configuration for a plan.
Base price amount for the plan, in major currency units (e.g. dollars).
Billing interval (e.g. 'month', 'year').
Number of intervals per billing cycle. Defaults to 1.
Base price amounts in additional currencies. The base 'amount' is in the org's default currency.
Three-letter Stripe-supported currency code (e.g. 'eur', 'gbp').
Price amount in this currency. Set explicitly per currency, not converted from the base amount.
Bills this many feature units when outstanding overage reaches it.
The ID of the feature to configure.
Number of free units included. Balance resets to this each interval for consumable features.
If true, customer has unlimited access to this feature.
Whether entity-level grants contribute to a shared customer balance.
Reset configuration for consumable features. Omit for non-consumable features like seats.
Interval at which balance resets (e.g. 'month', 'year'). For consumable features only.
Number of intervals between resets. Defaults to 1.
Pricing for usage beyond included units. Omit for free features.
Price per billing\_units after included usage. Either 'amount' or 'tiers' is required.
Amounts in additional currencies for this flat price. The base 'amount' is in the org's default currency. Only valid with 'amount', not 'tiers'.
Three-letter Stripe-supported currency code (e.g. 'eur', 'gbp').
Price amount in this currency. Set explicitly per currency, not converted from the base amount.
Tiered pricing. Either 'amount' or 'tiers' is required.
Three-letter Stripe-supported currency code (e.g. 'eur', 'gbp').
Per-unit amount for this tier in this currency.
Flat amount for this tier in this currency, if the tier uses one.
Billing interval. For consumable features, should match reset.interval.
Number of intervals per billing cycle. Defaults to 1.
Units per price increment. Usage is rounded UP when billed (e.g. billing\_units=100 means 101 rounds to 200).
'prepaid' for upfront payment (seats), 'usage\_based' for pay-as-you-go.
Max units purchasable beyond included. E.g. included=100, max\_purchase=300 allows 400 total. Null for no limit.
Proration settings for prepaid features. Controls mid-cycle quantity change billing.
Billing behavior when quantity increases mid-cycle.
Credit behavior when quantity decreases mid-cycle.
Rollover config for unused units. If set, unused included units carry over.
Max rollover units. Omit for unlimited rollover.
Maximum rollover as a percentage (0-100) of included + prepaid grant. Mutually exclusive with max.
When rolled over units expire.
Number of periods before expiry.
Overrides fields of this item's feature for customers on this plan (e.g. a credit system's credit\_schema).
For credit system features: replaces the feature's credit\_schema entirely for customers on this plan.
ID of the metered feature that draws from this credit system.
Number of metered-feature units priced together. Defaults to one when omitted.
Named rates chosen by event properties. The most specific match sets the rate; with no match the item's own rate applies.
Event properties this entry applies to. Every key must equal the tracked property, compared as strings.
Breaks ties between dimensions that match the same number of keys. Higher wins.
Inclusive upper usage boundary for this graduated tier. The final tier must be 'inf'.
Credits consumed per billing-unit group within this tier.
Named adjustments chosen by event properties. Every match applies: factors multiply, then adds are summed.
Event properties this entry applies to. Every key must equal the tracked property, compared as strings.
Multiplies the matched rate. All matching multipliers stack.
Added to the rate after every factor is applied, in credits per billing-unit group.
Inclusive upper usage boundary for this graduated tier. The final tier must be 'inf'.
Credits consumed per billing-unit group within this tier.
Credits consumed per billing-unit group.
For AI credit system features: replaces the feature's markup chain entirely for customers on this plan. An unset level means no markup at that level rather than inheriting the feature's.
Default percentage markup for customers on this plan. Use -100 to make usage free.
Per-provider markup percentages for customers on this plan.
Per-model markup overrides for customers on this plan.
Match items linked to this feature.
Match items with this billing method (prepaid or usage\_based).
Match items with this interval. Accepts either a BillingInterval (price-side) or a ResetInterval (reset-side, includes day/hour/minute) so price-less items keyed by reset.interval can be disambiguated.
Match items with this interval\_count. Disambiguates between items that share an interval but differ in count.
Match items whose grant equals this included usage. Omitted is a wildcard.
License links to drop, keyed by license\_plan\_id. Parallel to remove\_items.
The feature quantity selections associated with this plan change.
The ID of the adjustable feature included in this change.
The quantity that will apply for this feature in the change.
When this change takes effect, in milliseconds since the Unix epoch, or null if it applies immediately.
When this plan was canceled, in milliseconds since the Unix epoch, or null if it is not canceled.
When this plan expires, in milliseconds since the Unix epoch, or null if it does not expire.
Products or subscription changes being removed or ended.
The ID of the plan affected by this preview change.
The full plan object if it was expanded in the response.
Unique identifier for the plan.
Display name of the plan.
Optional description of the plan.
Group identifier for organizing related plans. Plans in the same group are mutually exclusive.
Version number of the plan. Incremented when plan configuration changes.
User-facing version identity. Defaults to v\{n} when the version is minted.
Whether this is the active version of the plan. At most one version is active.
Whether this is an add-on plan that can be attached alongside a main plan.
If true, this plan is automatically attached when a customer is created. Used for free plans.
Base recurring price for the plan. Null for free plans or usage-only plans.
Base price amount for the plan, in major currency units (e.g. dollars).
Base price amounts in additional currencies. The base 'amount' is in the org's default currency.
Three-letter Stripe-supported currency code (e.g. 'eur', 'gbp').
Price amount in this currency. Set explicitly per currency, not converted from the base amount.
Billing interval (e.g. 'month', 'year').
Number of intervals per billing cycle. Defaults to 1.
Display text for showing this price in pricing pages.
Main display text (e.g. '\$10' or '100 messages').
Secondary display text (e.g. 'per month' or 'then \$0.5 per 100').
Payment processors this base price is connected to. Omitted when unset.
Stripe price ID. For prepaid with included > 0 this is the V2 price.
Feature configurations included in this plan. Each item defines included units, pricing, and reset behavior for a feature.
Bills this many feature units when outstanding overage reaches it.
The ID of the feature this item configures.
The full feature object if expanded.
The ID of the feature, used to refer to it in other API calls like /track or /check.
The name of the feature.
The type of the feature
Singular and plural display names for the feature.
The singular display name for the feature.
The plural display name for the feature.
Credit cost schema for credit system features.
The ID of the metered feature (should be a single\_use feature).
The credit cost of the metered feature.
Whether or not the feature is archived.
Number of free units included. For consumable features, balance resets to this number each interval.
Whether the customer has unlimited access to this feature.
Whether entity-level grants contribute to a shared customer balance.
Reset configuration for consumable features. Null for non-consumable features like seats where usage persists across billing cycles.
The interval at which the feature balance resets (e.g. 'month', 'year'). For consumable features, usage resets to 0 and included units are restored.
Number of intervals between resets. Defaults to 1.
Pricing configuration for usage beyond included units. Null if feature is entirely free.
Price per billing\_units after included usage is consumed. Mutually exclusive with tiers.
Amounts in additional currencies for this flat price. The base 'amount' is in the org's default currency. Only valid with 'amount', not 'tiers' (tiered prices carry per-currency amounts on each tier).
Three-letter Stripe-supported currency code (e.g. 'eur', 'gbp').
Price amount in this currency. Set explicitly per currency, not converted from the base amount.
Tiered pricing configuration. Each tier's 'to' INCLUDES the included amount. Either 'tiers' or 'amount' is required.
Three-letter Stripe-supported currency code (e.g. 'eur', 'gbp').
Per-unit amount for this tier in this currency.
Flat amount for this tier in this currency, if the tier uses one.
Billing interval for this price. For consumable features, should match reset.interval.
Number of intervals per billing cycle. Defaults to 1.
Number of units per price increment. Usage is rounded UP to the nearest billing\_units when billed (e.g. billing\_units=100 means 101 usage rounds to 200).
'prepaid' for features like seats where customers pay upfront, 'usage\_based' for pay-as-you-go after included usage.
Maximum units a customer can purchase beyond included. E.g. if included=100 and max\_purchase=300, customer can use up to 400 total before usage is capped. Null for no limit.
Payment processors this item price is connected to. Omitted when unset.
Stripe price ID. For prepaid with included > 0 this is the V2 price.
Display text for showing this item in pricing pages.
Main display text (e.g. '\$10' or '100 messages').
Secondary display text (e.g. 'per month' or 'then \$0.5 per 100').
Rollover configuration for unused units. If set, unused included units roll over to the next period.
Maximum rollover units. Null for unlimited rollover.
Maximum rollover as a percentage (0-100) of included + prepaid grant. Mutually exclusive with max.
When rolled over units expire.
Number of periods before expiry.
Overrides fields of this item's feature for customers on this plan (e.g. a credit system's credit\_schema).
For credit system features: replaces the feature's credit\_schema entirely for customers on this plan.
ID of the metered feature that draws from this credit system.
Number of metered-feature units priced together. Defaults to one when omitted.
Named rates chosen by event properties. The most specific match sets the rate; with no match the item's own rate applies.
Event properties this entry applies to. Every key must equal the tracked property, compared as strings.
Breaks ties between dimensions that match the same number of keys. Higher wins.
Inclusive upper usage boundary for this graduated tier. The final tier must be 'inf'.
Credits consumed per billing-unit group within this tier.
Named adjustments chosen by event properties. Every match applies: factors multiply, then adds are summed.
Event properties this entry applies to. Every key must equal the tracked property, compared as strings.
Multiplies the matched rate. All matching multipliers stack.
Added to the rate after every factor is applied, in credits per billing-unit group.
Inclusive upper usage boundary for this graduated tier. The final tier must be 'inf'.
Credits consumed per billing-unit group within this tier.
Credits consumed per billing-unit group.
For AI credit system features: replaces the feature's markup chain entirely for customers on this plan. An unset level means no markup at that level rather than inheriting the feature's.
Default percentage markup for customers on this plan. Use -100 to make usage free.
Per-provider markup percentages for customers on this plan.
Per-model markup overrides for customers on this plan.
Payment processors this plan is connected to. Omitted when unset.
Stripe product ID this plan is billed under.
Extra Stripe product IDs aliased to this plan.
Every RevenueCat product that maps to this plan. Replaces the current set.
RevenueCat product ID that grants this plan when purchased.
Prepaid quantities granted when this specific RevenueCat product is purchased, in feature units.
Free trial configuration. If set, new customers can try this plan before being charged.
Number of duration\_type periods the trial lasts.
Unit of time for the trial duration ('day', 'month', 'year').
Whether a payment method is required to start the trial. If true, customer will be charged after trial ends.
Behavior when the trial ends. 'bill' charges the customer (default). 'revert' expires the trial and restores the customer's previous plan.
Unix timestamp (ms) when the plan was created.
Environment this plan belongs to ('sandbox' or 'live').
Whether the plan is archived. Archived plans cannot be attached to new customers.
Miscellaneous plan-level configuration flags.
If true, entitlements attached to this plan will still reset on schedule even when the customer's product is in a past\_due state.
Plan-level billing controls used as customer defaults.
List of auto top-up configurations per feature.
The ID of the feature (credit balance) to auto top-up.
Whether auto top-up is enabled.
When the balance drops below this threshold, an auto top-up will be purchased.
Amount of credits to add per auto top-up.
Optional rate limit to cap how often auto top-ups occur.
The time interval for the purchase limit window.
Number of intervals in the purchase limit window.
Maximum number of auto top-ups allowed within the interval.
When true, auto top-up creates a send\_invoice invoice instead of auto-charging.
List of overage spend limits per feature (caps overage spend).
Optional feature ID this spend limit applies to.
Whether the overage spend limit is enabled.
How overage\_limit is interpreted: an absolute overage cap (default) or a percentage of the main-plan allowance.
Overage cap for the feature: absolute units, or a percent (e.g. 120) when limit\_type is usage\_percentage.
When true, overage for this feature is not posted to Stripe. Usage tracking and balance resets still behave normally.
List of hard usage caps per feature (max units per interval).
The feature this usage limit applies to.
Whether this usage limit is enabled.
Maximum units allowed per interval.
Interval for the cap, aligned to the customer's billing cycle.
Window alignment. 'billing\_cycle' phases the interval to the customer's renewal time; 'utc' aligns to the UTC calendar.
When set, only usage from events whose properties match counts toward this cap. Omit to count all usage of the feature.
List of usage alert configurations per feature.
The feature ID this alert applies to.
Whether this usage alert is enabled.
The threshold value that triggers the alert. For usage or remaining, this is an absolute count. For usage\_percentage or remaining\_percentage, this is a percentage (0-100).
Whether the threshold is an absolute count or a percentage of the usage allowance or remaining balance.
What 100% means. balance: every grant on the feature. included: the plan allowance only. recurring: grants that reset. usage\_limit: the cap of the usage limit with the same feature and filter.
Only valid with basis usage\_limit. Points the alert at the usage limit carrying the same filter.
Optional user-defined label to distinguish multiple alerts on the same feature.
List of overage allowed controls per feature. When enabled, usage can exceed balance.
The feature ID this overage allowed control applies to.
Whether overage is allowed for this feature.
Arbitrary key-value metadata defined by you for your own use. Shared across all versions of the plan.
Whether the trial on this plan is available to this customer. For example, if the customer used the trial in the past, this will be false.
The customer's current status with this plan. 'active' if attached, 'scheduled' if pending activation.
Whether the customer's active instance of this plan is set to cancel.
Whether the customer is currently on a free trial of this plan.
The action that would occur if this plan were attached to the customer.
Deprecated. Use variant\_details.base\_plan\_id instead. If this is a variant, the ID of the base plan it was created from.
Details about how this variant relates to its latest base plan.
The ID of the base plan this variant was derived from.
The customization that transforms the base plan into this variant.
Base price configuration for a plan.
Base price amount for the plan, in major currency units (e.g. dollars).
Billing interval (e.g. 'month', 'year').
Number of intervals per billing cycle. Defaults to 1.
Base price amounts in additional currencies. The base 'amount' is in the org's default currency.
Three-letter Stripe-supported currency code (e.g. 'eur', 'gbp').
Price amount in this currency. Set explicitly per currency, not converted from the base amount.
Items to add to the plan.
Bills this many feature units when outstanding overage reaches it.
The ID of the feature to configure.
Number of free units included. Balance resets to this each interval for consumable features.
If true, customer has unlimited access to this feature.
Whether entity-level grants contribute to a shared customer balance.
Reset configuration for consumable features. Omit for non-consumable features like seats.
Interval at which balance resets (e.g. 'month', 'year'). For consumable features only.
Number of intervals between resets. Defaults to 1.
Pricing for usage beyond included units. Omit for free features.
Price per billing\_units after included usage. Either 'amount' or 'tiers' is required.
Amounts in additional currencies for this flat price. The base 'amount' is in the org's default currency. Only valid with 'amount', not 'tiers'.
Three-letter Stripe-supported currency code (e.g. 'eur', 'gbp').
Price amount in this currency. Set explicitly per currency, not converted from the base amount.
Tiered pricing. Either 'amount' or 'tiers' is required.
Three-letter Stripe-supported currency code (e.g. 'eur', 'gbp').
Per-unit amount for this tier in this currency.
Flat amount for this tier in this currency, if the tier uses one.
Billing interval. For consumable features, should match reset.interval.
Number of intervals per billing cycle. Defaults to 1.
Units per price increment. Usage is rounded UP when billed (e.g. billing\_units=100 means 101 rounds to 200).
'prepaid' for upfront payment (seats), 'usage\_based' for pay-as-you-go.
Max units purchasable beyond included. E.g. included=100, max\_purchase=300 allows 400 total. Null for no limit.
Proration settings for prepaid features. Controls mid-cycle quantity change billing.
Billing behavior when quantity increases mid-cycle.
Credit behavior when quantity decreases mid-cycle.
Rollover config for unused units. If set, unused included units carry over.
Max rollover units. Omit for unlimited rollover.
Maximum rollover as a percentage (0-100) of included + prepaid grant. Mutually exclusive with max.
When rolled over units expire.
Number of periods before expiry.
Overrides fields of this item's feature for customers on this plan (e.g. a credit system's credit\_schema).
For credit system features: replaces the feature's credit\_schema entirely for customers on this plan.
ID of the metered feature that draws from this credit system.
Number of metered-feature units priced together. Defaults to one when omitted.
Named rates chosen by event properties. The most specific match sets the rate; with no match the item's own rate applies.
Event properties this entry applies to. Every key must equal the tracked property, compared as strings.
Breaks ties between dimensions that match the same number of keys. Higher wins.
Inclusive upper usage boundary for this graduated tier. The final tier must be 'inf'.
Credits consumed per billing-unit group within this tier.
Named adjustments chosen by event properties. Every match applies: factors multiply, then adds are summed.
Event properties this entry applies to. Every key must equal the tracked property, compared as strings.
Multiplies the matched rate. All matching multipliers stack.
Added to the rate after every factor is applied, in credits per billing-unit group.
Inclusive upper usage boundary for this graduated tier. The final tier must be 'inf'.
Credits consumed per billing-unit group within this tier.
Credits consumed per billing-unit group.
For AI credit system features: replaces the feature's markup chain entirely for customers on this plan. An unset level means no markup at that level rather than inheriting the feature's.
Default percentage markup for customers on this plan. Use -100 to make usage free.
Per-provider markup percentages for customers on this plan.
Per-model markup overrides for customers on this plan.
Filters selecting items to remove from the plan.
Match items linked to this feature.
Match items with this billing method (prepaid or usage\_based).
Match items with this interval. Accepts either a BillingInterval (price-side) or a ResetInterval (reset-side, includes day/hour/minute) so price-less items keyed by reset.interval can be disambiguated.
Match items with this interval\_count. Disambiguates between items that share an interval but differ in count.
Match items whose grant equals this included usage. Omitted is a wildcard.
Free trial configuration for a plan.
Number of duration\_type periods the trial lasts.
Unit of time for the trial ('day', 'month', 'year').
If true, a payment method is required to start the trial and the customer is charged when it ends. Defaults to false.
Behavior when the trial ends. 'bill' charges the customer (default). 'revert' expires the trial and restores the customer's previous plan.
Override the plan's billing controls (auto top-ups, spend limits, usage limits, usage alerts, overage allowed) for this customer.
List of auto top-up configurations per feature.
The ID of the feature (credit balance) to auto top-up.
Whether auto top-up is enabled.
When the balance drops below this threshold, an auto top-up will be purchased.
Amount of credits to add per auto top-up.
Optional rate limit to cap how often auto top-ups occur. Pass count to set the current window's consumed top-ups.
The time interval for the purchase limit window.
Number of intervals in the purchase limit window.
Maximum number of auto top-ups allowed within the interval.
Set the current window's consumed auto top-up count. Omit to leave runtime state unchanged.
When true, auto top-up creates a send\_invoice invoice instead of auto-charging.
List of overage spend limits per feature (caps overage spend).
Optional feature ID this spend limit applies to.
Whether the overage spend limit is enabled.
How overage\_limit is interpreted: an absolute overage cap (default) or a percentage of the main-plan allowance.
Overage cap for the feature: absolute units, or a percent (e.g. 120) when limit\_type is usage\_percentage.
When true, overage for this feature is not posted to Stripe. Usage tracking and balance resets still behave normally.
List of hard usage caps per feature (max units per interval).
The feature this usage limit applies to.
Whether this usage limit is enabled.
Maximum units allowed per interval.
Interval for the cap, aligned to the customer's billing cycle.
Window alignment. 'billing\_cycle' phases the interval to the customer's renewal time; 'utc' aligns to the UTC calendar.
When set, only usage from events whose properties match counts toward this cap. Omit to count all usage of the feature.
List of usage alert configurations per feature.
The feature ID this alert applies to.
Whether this usage alert is enabled.
The threshold value that triggers the alert. For usage or remaining, this is an absolute count. For usage\_percentage or remaining\_percentage, this is a percentage (0-100).
Whether the threshold is an absolute count or a percentage of the usage allowance or remaining balance.
What 100% means. balance: every grant on the feature. included: the plan allowance only. recurring: grants that reset. usage\_limit: the cap of the usage limit with the same feature and filter.
Only valid with basis usage\_limit. Points the alert at the usage limit carrying the same filter.
Optional user-defined label to distinguish multiple alerts on the same feature.
List of overage allowed controls per feature. When enabled, usage can exceed balance.
The feature ID this overage allowed control applies to.
Whether overage is allowed for this feature.
License links to add or override for this customer, keyed by license\_plan\_id. Omitted fields inherit the plan catalog link (included defaults to 1 when the license is not in the catalog). A bare entry restores the license to pure catalog inheritance.
Base price configuration for a plan.
Base price amount for the plan, in major currency units (e.g. dollars).
Billing interval (e.g. 'month', 'year').
Number of intervals per billing cycle. Defaults to 1.
Base price amounts in additional currencies. The base 'amount' is in the org's default currency.
Three-letter Stripe-supported currency code (e.g. 'eur', 'gbp').
Price amount in this currency. Set explicitly per currency, not converted from the base amount.
Bills this many feature units when outstanding overage reaches it.
The ID of the feature to configure.
Number of free units included. Balance resets to this each interval for consumable features.
If true, customer has unlimited access to this feature.
Whether entity-level grants contribute to a shared customer balance.
Reset configuration for consumable features. Omit for non-consumable features like seats.
Interval at which balance resets (e.g. 'month', 'year'). For consumable features only.
Number of intervals between resets. Defaults to 1.
Pricing for usage beyond included units. Omit for free features.
Price per billing\_units after included usage. Either 'amount' or 'tiers' is required.
Amounts in additional currencies for this flat price. The base 'amount' is in the org's default currency. Only valid with 'amount', not 'tiers'.
Three-letter Stripe-supported currency code (e.g. 'eur', 'gbp').
Price amount in this currency. Set explicitly per currency, not converted from the base amount.
Tiered pricing. Either 'amount' or 'tiers' is required.
Three-letter Stripe-supported currency code (e.g. 'eur', 'gbp').
Per-unit amount for this tier in this currency.
Flat amount for this tier in this currency, if the tier uses one.
Billing interval. For consumable features, should match reset.interval.
Number of intervals per billing cycle. Defaults to 1.
Units per price increment. Usage is rounded UP when billed (e.g. billing\_units=100 means 101 rounds to 200).
'prepaid' for upfront payment (seats), 'usage\_based' for pay-as-you-go.
Max units purchasable beyond included. E.g. included=100, max\_purchase=300 allows 400 total. Null for no limit.
Proration settings for prepaid features. Controls mid-cycle quantity change billing.
Billing behavior when quantity increases mid-cycle.
Credit behavior when quantity decreases mid-cycle.
Rollover config for unused units. If set, unused included units carry over.
Max rollover units. Omit for unlimited rollover.
Maximum rollover as a percentage (0-100) of included + prepaid grant. Mutually exclusive with max.
When rolled over units expire.
Number of periods before expiry.
Overrides fields of this item's feature for customers on this plan (e.g. a credit system's credit\_schema).
For credit system features: replaces the feature's credit\_schema entirely for customers on this plan.
ID of the metered feature that draws from this credit system.
Number of metered-feature units priced together. Defaults to one when omitted.
Named rates chosen by event properties. The most specific match sets the rate; with no match the item's own rate applies.
Event properties this entry applies to. Every key must equal the tracked property, compared as strings.
Breaks ties between dimensions that match the same number of keys. Higher wins.
Inclusive upper usage boundary for this graduated tier. The final tier must be 'inf'.
Credits consumed per billing-unit group within this tier.
Named adjustments chosen by event properties. Every match applies: factors multiply, then adds are summed.
Event properties this entry applies to. Every key must equal the tracked property, compared as strings.
Multiplies the matched rate. All matching multipliers stack.
Added to the rate after every factor is applied, in credits per billing-unit group.
Inclusive upper usage boundary for this graduated tier. The final tier must be 'inf'.
Credits consumed per billing-unit group within this tier.
Credits consumed per billing-unit group.
For AI credit system features: replaces the feature's markup chain entirely for customers on this plan. An unset level means no markup at that level rather than inheriting the feature's.
Default percentage markup for customers on this plan. Use -100 to make usage free.
Per-provider markup percentages for customers on this plan.
Per-model markup overrides for customers on this plan.
Match items linked to this feature.
Match items with this billing method (prepaid or usage\_based).
Match items with this interval. Accepts either a BillingInterval (price-side) or a ResetInterval (reset-side, includes day/hour/minute) so price-less items keyed by reset.interval can be disambiguated.
Match items with this interval\_count. Disambiguates between items that share an interval but differ in count.
Match items whose grant equals this included usage. Omitted is a wildcard.
License links to drop, keyed by license\_plan\_id. Parallel to remove\_items.
The feature quantity selections associated with this plan change.
The ID of the adjustable feature included in this change.
The quantity that will apply for this feature in the change.
When this change takes effect, in milliseconds since the Unix epoch, or null if it applies immediately.
When this plan was canceled, in milliseconds since the Unix epoch, or null if it is not canceled.
When this plan expires, in milliseconds since the Unix epoch, or null if it does not expire.
Whether the customer will be redirected to a checkout page if attach is called.
The type of checkout that will be used if the customer is redirected to a checkout page.
Tax preview for the immediate charge. Contact us to enable the tax flag on your organisation. Shows only with flag enabled, a Stripe customer exists and has a location.
Total tax amount in major currency units.
Tax included in line item subtotals.
Tax added on top of subtotals.
Three-letter currency code.
Calculation status ('complete' when Stripe Tax succeeds or 'incomplete' when Stripe Tax returned 0 or errored).
Stripe customer invoice credits preview.
Stripe customer credit balance available, expressed as a positive number in major currency units.
Three-letter currency code.
```json 200 theme={null}
{
"customerId": "charles",
"lineItems": [
{
"display_name": "Pro seed",
"description": "Pro seed - Base Price (from 18 Feb 2026 to 18 Mar 2026)",
"subtotal": 20,
"total": 20,
"discounts": []
}
],
"subtotal": 20,
"total": 20,
"currency": "usd"
}
```
# Preview Multi Attach
Source: https://docs.useautumn.com/api-reference/billing/previewMultiAttach
openapi POST /v1/billing.preview_multi_attach
Previews the billing changes that would occur when attaching multiple plans, without actually making any changes.
Use this endpoint to show customers what they will be charged before confirming a multi-plan subscription.
### Body Parameters
The ID of the customer to attach the plans to.
The ID of the entity to attach the plans to.
The list of plans to attach to the customer.
The ID of the plan to attach.
Customize the plan to attach. Can override its price or items.
Base price configuration for a plan.
Base price amount for the plan, in major currency units (e.g. dollars).
Billing interval (e.g. 'month', 'year').
Number of intervals per billing cycle. Defaults to 1.
Base price amounts in additional currencies. The base 'amount' is in the org's default currency.
Three-letter Stripe-supported currency code (e.g. 'eur', 'gbp').
Price amount in this currency. Set explicitly per currency, not converted from the base amount.
Override the items in the plan.
Bills this many feature units when outstanding overage reaches it.
The ID of the feature to configure.
Number of free units included. Balance resets to this each interval for consumable features.
If true, customer has unlimited access to this feature.
Whether entity-level grants contribute to a shared customer balance.
Reset configuration for consumable features. Omit for non-consumable features like seats.
Interval at which balance resets (e.g. 'month', 'year'). For consumable features only.
Number of intervals between resets. Defaults to 1.
Pricing for usage beyond included units. Omit for free features.
Price per billing\_units after included usage. Either 'amount' or 'tiers' is required.
Amounts in additional currencies for this flat price. The base 'amount' is in the org's default currency. Only valid with 'amount', not 'tiers'.
Three-letter Stripe-supported currency code (e.g. 'eur', 'gbp').
Price amount in this currency. Set explicitly per currency, not converted from the base amount.
Tiered pricing. Either 'amount' or 'tiers' is required.
Per-currency amounts for this tier. Tier boundaries ('to') are shared across all currencies.
Three-letter Stripe-supported currency code (e.g. 'eur', 'gbp').
Per-unit amount for this tier in this currency.
Flat amount for this tier in this currency, if the tier uses one.
Billing interval. For consumable features, should match reset.interval.
Number of intervals per billing cycle. Defaults to 1.
Units per price increment. Usage is rounded UP when billed (e.g. billing\_units=100 means 101 rounds to 200).
'prepaid' for upfront payment (seats), 'usage\_based' for pay-as-you-go.
Max units purchasable beyond included. E.g. included=100, max\_purchase=300 allows 400 total. Null for no limit.
Proration settings for prepaid features. Controls mid-cycle quantity change billing.
Billing behavior when quantity increases mid-cycle.
Credit behavior when quantity decreases mid-cycle.
Rollover config for unused units. If set, unused included units carry over.
Max rollover units. Omit for unlimited rollover.
Maximum rollover as a percentage (0-100) of included + prepaid grant. Mutually exclusive with max.
When rolled over units expire.
Number of periods before expiry.
Overrides fields of this item's feature for customers on this plan (e.g. a credit system's credit\_schema).
For credit system features: replaces the feature's credit\_schema entirely for customers on this plan.
ID of the metered feature that draws from this credit system.
Number of metered-feature units priced together. Defaults to one when omitted.
Named rates chosen by event properties. The most specific match sets the rate; with no match the item's own rate applies.
Event properties this entry applies to. Every key must equal the tracked property, compared as strings.
Breaks ties between dimensions that match the same number of keys. Higher wins.
Inclusive upper usage boundary for this graduated tier. The final tier must be 'inf'.
Credits consumed per billing-unit group within this tier.
Named adjustments chosen by event properties. Every match applies: factors multiply, then adds are summed.
Event properties this entry applies to. Every key must equal the tracked property, compared as strings.
Multiplies the matched rate. All matching multipliers stack.
Added to the rate after every factor is applied, in credits per billing-unit group.
Inclusive upper usage boundary for this graduated tier. The final tier must be 'inf'.
Credits consumed per billing-unit group within this tier.
Credits consumed per billing-unit group.
For AI credit system features: replaces the feature's markup chain entirely for customers on this plan. An unset level means no markup at that level rather than inheriting the feature's.
Default percentage markup for customers on this plan. Use -100 to make usage free.
Per-provider markup percentages for customers on this plan.
Per-model markup overrides for customers on this plan.
If this plan contains prepaid features, use this field to specify the quantity of each prepaid feature.
The ID of the feature to set quantity for.
The quantity of the feature.
Whether the customer can adjust the quantity.
The version of the plan to attach.
A unique ID to identify this subscription. Useful when attaching the same plan multiple times.
The entity scope for this plan. Omit to inherit the request scope, or pass null for customer-level.
Free trial configuration for a plan.
Number of duration\_type periods the trial lasts.
Unit of time for the trial ('day', 'month', 'year').
If true, a payment method is required to start the trial and the customer is charged when it ends. Defaults to false.
Behavior when the trial ends. 'bill' charges the customer (default). 'revert' expires the trial and restores the customer's previous plan.
Unix timestamp in milliseconds for backdating every plan in this multi-attach.
Currency to bill this multi-attach in (e.g. usd, eur). Must match the customer's currency if they are already locked to one, and every plan must offer a paid price in it. Defaults to the customer's currency, then the org default.
Invoice mode creates a draft or open invoice and sends it to the customer, instead of charging their card immediately.
When true, creates an invoice and sends it to the customer instead of charging their card immediately. Uses Stripe's send\_invoice collection method.
If true, enables the plan immediately even though the invoice is not paid yet.
If true, finalizes the invoice so it can be sent to the customer. If false, keeps it as a draft for manual review.
ID of an invoice template (configured in billing settings) whose footer (e.g. bank details) is applied to the invoice.
Number of days the customer has to pay the invoice before it is due (Stripe days\_until\_due).
List of discounts to apply. Each discount can be an Autumn reward ID, Stripe coupon ID, or Stripe promotion code.
The ID of the reward to apply as a discount.
The promotion code to apply as a discount.
How to handle billing. 'prorate\_immediately' charges/credits prorated amounts now, 'none' does not charge/credit anything.
Pass 'now' to reset the billing cycle of every plan on the subscription to the time of this request.
URL to redirect to after successful checkout.
Additional parameters to pass into the creation of the Stripe checkout session.
Controls when to return a checkout URL. 'always' returns a URL even if payment succeeds, 'if\_required' only when payment action is needed, 'never' disables redirects.
Only applicable when the customer has an existing Stripe subscription. If true, creates a new separate subscription instead of merging into the existing one.
If true, the cusProducts are activated immediately even when payment is pending via Stripe checkout.
Customer details to set when creating a customer
Customer's name
Customer's email address
Unique identifier (eg, serial number) to detect duplicate customers and prevent free trial abuse
Additional metadata for the customer
Stripe customer ID if you already have one
Whether to create the customer in Stripe
The ID of the free plan to auto-enable for the customer
Whether to send email receipts to this customer
Currency to bill this customer in (e.g. usd, eur). Defaults to the organization's default currency.
Billing controls for the customer (auto top-ups, etc.)
List of auto top-up configurations per feature.
The ID of the feature (credit balance) to auto top-up.
Whether auto top-up is enabled.
When the balance drops below this threshold, an auto top-up will be purchased.
Amount of credits to add per auto top-up.
Optional rate limit to cap how often auto top-ups occur. Pass count to set the current window's consumed top-ups.
The time interval for the purchase limit window.
Number of intervals in the purchase limit window.
Maximum number of auto top-ups allowed within the interval.
Set the current window's consumed auto top-up count. Omit to leave runtime state unchanged.
When true, auto top-up creates a send\_invoice invoice instead of auto-charging.
List of overage spend limits per feature (caps overage spend).
Optional feature ID this spend limit applies to.
Whether the overage spend limit is enabled.
How overage\_limit is interpreted: an absolute overage cap (default) or a percentage of the main-plan allowance.
Overage cap for the feature: absolute units, or a percent (e.g. 120) when limit\_type is usage\_percentage.
When true, overage for this feature is not posted to Stripe. Usage tracking and balance resets still behave normally.
List of hard usage caps per feature (max units per interval).
The feature this usage limit applies to.
Whether this usage limit is enabled.
Maximum units allowed per interval.
Interval for the cap, aligned to the customer's billing cycle.
Window alignment. 'billing\_cycle' phases the interval to the customer's renewal time; 'utc' aligns to the UTC calendar.
When set, only usage from events whose properties match counts toward this cap. Omit to count all usage of the feature.
List of usage alert configurations per feature.
The feature ID this alert applies to.
Whether this usage alert is enabled.
The threshold value that triggers the alert. For usage or remaining, this is an absolute count. For usage\_percentage or remaining\_percentage, this is a percentage (0-100).
Whether the threshold is an absolute count or a percentage of the usage allowance or remaining balance.
What 100% means. balance: every grant on the feature. included: the plan allowance only. recurring: grants that reset. usage\_limit: the cap of the usage limit with the same feature and filter.
Only valid with basis usage\_limit. Points the alert at the usage limit carrying the same filter.
Optional user-defined label to distinguish multiple alerts on the same feature.
List of overage allowed controls per feature. When enabled, usage can exceed balance.
The feature ID this overage allowed control applies to.
Whether overage is allowed for this feature.
Miscellaneous configurations for the customer.
Whether to disable the shared customer-level pool for entities.
Stops Autumn from posting usage-overage line items to Stripe for this customer. Check/track and balance resets still behave normally. When set, this overrides the organization-level disable\_overage\_billing setting.
The feature ID that this entity is associated with
Name of the entity
Billing controls for the entity.
List of spend limits per feature. Each entry caps overage (overage\_limit) and/or per-interval usage (usage\_limit).
Optional feature ID this spend limit applies to.
Whether the overage spend limit is enabled.
How overage\_limit is interpreted: an absolute overage cap (default) or a percentage of the main-plan allowance.
Overage cap for the feature: absolute units, or a percent (e.g. 120) when limit\_type is usage\_percentage.
When true, overage for this feature is not posted to Stripe. Usage tracking and balance resets still behave normally.
List of hard usage caps per feature for this entity. An entity entry overrides the customer's for that feature.
The feature this usage limit applies to.
Whether this usage limit is enabled.
Maximum units allowed per interval.
Interval for the cap, aligned to the customer's billing cycle.
Window alignment. 'billing\_cycle' phases the interval to the customer's renewal time; 'utc' aligns to the UTC calendar.
When set, only usage from events whose properties match counts toward this cap. Omit to count all usage of the feature.
List of usage alert configurations per feature.
The feature ID this alert applies to.
Whether this usage alert is enabled.
The threshold value that triggers the alert. For usage or remaining, this is an absolute count. For usage\_percentage or remaining\_percentage, this is a percentage (0-100).
Whether the threshold is an absolute count or a percentage of the usage allowance or remaining balance.
What 100% means. balance: every grant on the feature. included: the plan allowance only. recurring: grants that reset. usage\_limit: the cap of the usage limit with the same feature and filter.
Only valid with basis usage\_limit. Points the alert at the usage limit carrying the same filter.
Optional user-defined label to distinguish multiple alerts on the same feature.
List of overage allowed controls per feature. When enabled, usage can exceed balance.
The feature ID this overage allowed control applies to.
Whether overage is allowed for this feature.
### Response
The ID of the customer.
The name of the line item to display to the customer if you're building a UI. It will either be the plan name or the feature name.
A detailed description of the line item.
The amount before discounts and tax for this line item.
The final amount after discounts and tax for this line item.
List of discounts applied to this line item.
The ID of the plan that this line item belongs to.
The ID of the feature that this line item belongs to.
The period of time that this line item is being charged for.
The start of the period in milliseconds since the Unix epoch.
The end of the period in milliseconds since the Unix epoch.
The quantity of the line item.
The total amount before discounts and tax for the current billing period.
The final amount after discounts and tax for the current billing period.
The three-letter ISO currency code. All amounts are in the currency's major unit (e.g., dollars for USD).
True when this change clears the customer's usage balances, so the approver can see usage will reset.
Preview of the next billing cycle, if applicable. This shows what the customer will be charged in subsequent cycles.
Unix timestamp (milliseconds) when the next billing cycle starts.
The total amount before discounts and tax for the next cycle.
The final amount after discounts and tax for the next cycle.
List of line items for the next billing cycle.
The name of the line item to display to the customer if you're building a UI. It will either be the plan name or the feature name.
A detailed description of the line item.
The amount before discounts and tax for this line item.
The final amount after discounts and tax for this line item.
List of discounts applied to this line item.
The ID of the plan that this line item belongs to.
The ID of the feature that this line item belongs to.
The period of time that this line item is being charged for.
The start of the period in milliseconds since the Unix epoch.
The end of the period in milliseconds since the Unix epoch.
The quantity of the line item.
List of line items for usage-based features in the next cycle.
The name of the line item to display to the customer if you're building a UI. It will either be the plan name or the feature name.
The ID of the plan that this line item belongs to.
The ID of the feature that this line item belongs to.
The period of time that this line item is being charged for.
The start of the period in milliseconds since the Unix epoch.
The end of the period in milliseconds since the Unix epoch.
Expand the response with additional data.
Products or subscription changes being added or updated.
The ID of the plan affected by this preview change.
The full plan object if it was expanded in the response.
Unique identifier for the plan.
Display name of the plan.
Optional description of the plan.
Group identifier for organizing related plans. Plans in the same group are mutually exclusive.
Version number of the plan. Incremented when plan configuration changes.
User-facing version identity. Defaults to v\{n} when the version is minted.
Whether this is the active version of the plan. At most one version is active.
Whether this is an add-on plan that can be attached alongside a main plan.
If true, this plan is automatically attached when a customer is created. Used for free plans.
Base recurring price for the plan. Null for free plans or usage-only plans.
Base price amount for the plan, in major currency units (e.g. dollars).
Base price amounts in additional currencies. The base 'amount' is in the org's default currency.
Three-letter Stripe-supported currency code (e.g. 'eur', 'gbp').
Price amount in this currency. Set explicitly per currency, not converted from the base amount.
Billing interval (e.g. 'month', 'year').
Number of intervals per billing cycle. Defaults to 1.
Display text for showing this price in pricing pages.
Main display text (e.g. '\$10' or '100 messages').
Secondary display text (e.g. 'per month' or 'then \$0.5 per 100').
Payment processors this base price is connected to. Omitted when unset.
Stripe price ID. For prepaid with included > 0 this is the V2 price.
Feature configurations included in this plan. Each item defines included units, pricing, and reset behavior for a feature.
Bills this many feature units when outstanding overage reaches it.
The ID of the feature this item configures.
The full feature object if expanded.
The ID of the feature, used to refer to it in other API calls like /track or /check.
The name of the feature.
The type of the feature
Singular and plural display names for the feature.
The singular display name for the feature.
The plural display name for the feature.
Credit cost schema for credit system features.
The ID of the metered feature (should be a single\_use feature).
The credit cost of the metered feature.
Whether or not the feature is archived.
Number of free units included. For consumable features, balance resets to this number each interval.
Whether the customer has unlimited access to this feature.
Whether entity-level grants contribute to a shared customer balance.
Reset configuration for consumable features. Null for non-consumable features like seats where usage persists across billing cycles.
The interval at which the feature balance resets (e.g. 'month', 'year'). For consumable features, usage resets to 0 and included units are restored.
Number of intervals between resets. Defaults to 1.
Pricing configuration for usage beyond included units. Null if feature is entirely free.
Price per billing\_units after included usage is consumed. Mutually exclusive with tiers.
Amounts in additional currencies for this flat price. The base 'amount' is in the org's default currency. Only valid with 'amount', not 'tiers' (tiered prices carry per-currency amounts on each tier).
Three-letter Stripe-supported currency code (e.g. 'eur', 'gbp').
Price amount in this currency. Set explicitly per currency, not converted from the base amount.
Tiered pricing configuration. Each tier's 'to' INCLUDES the included amount. Either 'tiers' or 'amount' is required.
Three-letter Stripe-supported currency code (e.g. 'eur', 'gbp').
Per-unit amount for this tier in this currency.
Flat amount for this tier in this currency, if the tier uses one.
Billing interval for this price. For consumable features, should match reset.interval.
Number of intervals per billing cycle. Defaults to 1.
Number of units per price increment. Usage is rounded UP to the nearest billing\_units when billed (e.g. billing\_units=100 means 101 usage rounds to 200).
'prepaid' for features like seats where customers pay upfront, 'usage\_based' for pay-as-you-go after included usage.
Maximum units a customer can purchase beyond included. E.g. if included=100 and max\_purchase=300, customer can use up to 400 total before usage is capped. Null for no limit.
Payment processors this item price is connected to. Omitted when unset.
Stripe price ID. For prepaid with included > 0 this is the V2 price.
Display text for showing this item in pricing pages.
Main display text (e.g. '\$10' or '100 messages').
Secondary display text (e.g. 'per month' or 'then \$0.5 per 100').
Rollover configuration for unused units. If set, unused included units roll over to the next period.
Maximum rollover units. Null for unlimited rollover.
Maximum rollover as a percentage (0-100) of included + prepaid grant. Mutually exclusive with max.
When rolled over units expire.
Number of periods before expiry.
Overrides fields of this item's feature for customers on this plan (e.g. a credit system's credit\_schema).
For credit system features: replaces the feature's credit\_schema entirely for customers on this plan.
ID of the metered feature that draws from this credit system.
Number of metered-feature units priced together. Defaults to one when omitted.
Named rates chosen by event properties. The most specific match sets the rate; with no match the item's own rate applies.
Event properties this entry applies to. Every key must equal the tracked property, compared as strings.
Breaks ties between dimensions that match the same number of keys. Higher wins.
Inclusive upper usage boundary for this graduated tier. The final tier must be 'inf'.
Credits consumed per billing-unit group within this tier.
Named adjustments chosen by event properties. Every match applies: factors multiply, then adds are summed.
Event properties this entry applies to. Every key must equal the tracked property, compared as strings.
Multiplies the matched rate. All matching multipliers stack.
Added to the rate after every factor is applied, in credits per billing-unit group.
Inclusive upper usage boundary for this graduated tier. The final tier must be 'inf'.
Credits consumed per billing-unit group within this tier.
Credits consumed per billing-unit group.
For AI credit system features: replaces the feature's markup chain entirely for customers on this plan. An unset level means no markup at that level rather than inheriting the feature's.
Default percentage markup for customers on this plan. Use -100 to make usage free.
Per-provider markup percentages for customers on this plan.
Per-model markup overrides for customers on this plan.
Payment processors this plan is connected to. Omitted when unset.
Stripe product ID this plan is billed under.
Extra Stripe product IDs aliased to this plan.
Every RevenueCat product that maps to this plan. Replaces the current set.
RevenueCat product ID that grants this plan when purchased.
Prepaid quantities granted when this specific RevenueCat product is purchased, in feature units.
Free trial configuration. If set, new customers can try this plan before being charged.
Number of duration\_type periods the trial lasts.
Unit of time for the trial duration ('day', 'month', 'year').
Whether a payment method is required to start the trial. If true, customer will be charged after trial ends.
Behavior when the trial ends. 'bill' charges the customer (default). 'revert' expires the trial and restores the customer's previous plan.
Unix timestamp (ms) when the plan was created.
Environment this plan belongs to ('sandbox' or 'live').
Whether the plan is archived. Archived plans cannot be attached to new customers.
Miscellaneous plan-level configuration flags.
If true, entitlements attached to this plan will still reset on schedule even when the customer's product is in a past\_due state.
Plan-level billing controls used as customer defaults.
List of auto top-up configurations per feature.
The ID of the feature (credit balance) to auto top-up.
Whether auto top-up is enabled.
When the balance drops below this threshold, an auto top-up will be purchased.
Amount of credits to add per auto top-up.
Optional rate limit to cap how often auto top-ups occur.
The time interval for the purchase limit window.
Number of intervals in the purchase limit window.
Maximum number of auto top-ups allowed within the interval.
When true, auto top-up creates a send\_invoice invoice instead of auto-charging.
List of overage spend limits per feature (caps overage spend).
Optional feature ID this spend limit applies to.
Whether the overage spend limit is enabled.
How overage\_limit is interpreted: an absolute overage cap (default) or a percentage of the main-plan allowance.
Overage cap for the feature: absolute units, or a percent (e.g. 120) when limit\_type is usage\_percentage.
When true, overage for this feature is not posted to Stripe. Usage tracking and balance resets still behave normally.
List of hard usage caps per feature (max units per interval).
The feature this usage limit applies to.
Whether this usage limit is enabled.
Maximum units allowed per interval.
Interval for the cap, aligned to the customer's billing cycle.
Window alignment. 'billing\_cycle' phases the interval to the customer's renewal time; 'utc' aligns to the UTC calendar.
When set, only usage from events whose properties match counts toward this cap. Omit to count all usage of the feature.
List of usage alert configurations per feature.
The feature ID this alert applies to.
Whether this usage alert is enabled.
The threshold value that triggers the alert. For usage or remaining, this is an absolute count. For usage\_percentage or remaining\_percentage, this is a percentage (0-100).
Whether the threshold is an absolute count or a percentage of the usage allowance or remaining balance.
What 100% means. balance: every grant on the feature. included: the plan allowance only. recurring: grants that reset. usage\_limit: the cap of the usage limit with the same feature and filter.
Only valid with basis usage\_limit. Points the alert at the usage limit carrying the same filter.
Optional user-defined label to distinguish multiple alerts on the same feature.
List of overage allowed controls per feature. When enabled, usage can exceed balance.
The feature ID this overage allowed control applies to.
Whether overage is allowed for this feature.
Arbitrary key-value metadata defined by you for your own use. Shared across all versions of the plan.
Whether the trial on this plan is available to this customer. For example, if the customer used the trial in the past, this will be false.
The customer's current status with this plan. 'active' if attached, 'scheduled' if pending activation.
Whether the customer's active instance of this plan is set to cancel.
Whether the customer is currently on a free trial of this plan.
The action that would occur if this plan were attached to the customer.
Deprecated. Use variant\_details.base\_plan\_id instead. If this is a variant, the ID of the base plan it was created from.
Details about how this variant relates to its latest base plan.
The ID of the base plan this variant was derived from.
The customization that transforms the base plan into this variant.
Base price configuration for a plan.
Base price amount for the plan, in major currency units (e.g. dollars).
Billing interval (e.g. 'month', 'year').
Number of intervals per billing cycle. Defaults to 1.
Base price amounts in additional currencies. The base 'amount' is in the org's default currency.
Three-letter Stripe-supported currency code (e.g. 'eur', 'gbp').
Price amount in this currency. Set explicitly per currency, not converted from the base amount.
Items to add to the plan.
Bills this many feature units when outstanding overage reaches it.
The ID of the feature to configure.
Number of free units included. Balance resets to this each interval for consumable features.
If true, customer has unlimited access to this feature.
Whether entity-level grants contribute to a shared customer balance.
Reset configuration for consumable features. Omit for non-consumable features like seats.
Interval at which balance resets (e.g. 'month', 'year'). For consumable features only.
Number of intervals between resets. Defaults to 1.
Pricing for usage beyond included units. Omit for free features.
Price per billing\_units after included usage. Either 'amount' or 'tiers' is required.
Amounts in additional currencies for this flat price. The base 'amount' is in the org's default currency. Only valid with 'amount', not 'tiers'.
Three-letter Stripe-supported currency code (e.g. 'eur', 'gbp').
Price amount in this currency. Set explicitly per currency, not converted from the base amount.
Tiered pricing. Either 'amount' or 'tiers' is required.
Three-letter Stripe-supported currency code (e.g. 'eur', 'gbp').
Per-unit amount for this tier in this currency.
Flat amount for this tier in this currency, if the tier uses one.
Billing interval. For consumable features, should match reset.interval.
Number of intervals per billing cycle. Defaults to 1.
Units per price increment. Usage is rounded UP when billed (e.g. billing\_units=100 means 101 rounds to 200).
'prepaid' for upfront payment (seats), 'usage\_based' for pay-as-you-go.
Max units purchasable beyond included. E.g. included=100, max\_purchase=300 allows 400 total. Null for no limit.
Proration settings for prepaid features. Controls mid-cycle quantity change billing.
Billing behavior when quantity increases mid-cycle.
Credit behavior when quantity decreases mid-cycle.
Rollover config for unused units. If set, unused included units carry over.
Max rollover units. Omit for unlimited rollover.
Maximum rollover as a percentage (0-100) of included + prepaid grant. Mutually exclusive with max.
When rolled over units expire.
Number of periods before expiry.
Overrides fields of this item's feature for customers on this plan (e.g. a credit system's credit\_schema).
For credit system features: replaces the feature's credit\_schema entirely for customers on this plan.
ID of the metered feature that draws from this credit system.
Number of metered-feature units priced together. Defaults to one when omitted.
Named rates chosen by event properties. The most specific match sets the rate; with no match the item's own rate applies.
Event properties this entry applies to. Every key must equal the tracked property, compared as strings.
Breaks ties between dimensions that match the same number of keys. Higher wins.
Inclusive upper usage boundary for this graduated tier. The final tier must be 'inf'.
Credits consumed per billing-unit group within this tier.
Named adjustments chosen by event properties. Every match applies: factors multiply, then adds are summed.
Event properties this entry applies to. Every key must equal the tracked property, compared as strings.
Multiplies the matched rate. All matching multipliers stack.
Added to the rate after every factor is applied, in credits per billing-unit group.
Inclusive upper usage boundary for this graduated tier. The final tier must be 'inf'.
Credits consumed per billing-unit group within this tier.
Credits consumed per billing-unit group.
For AI credit system features: replaces the feature's markup chain entirely for customers on this plan. An unset level means no markup at that level rather than inheriting the feature's.
Default percentage markup for customers on this plan. Use -100 to make usage free.
Per-provider markup percentages for customers on this plan.
Per-model markup overrides for customers on this plan.
Filters selecting items to remove from the plan.
Match items linked to this feature.
Match items with this billing method (prepaid or usage\_based).
Match items with this interval. Accepts either a BillingInterval (price-side) or a ResetInterval (reset-side, includes day/hour/minute) so price-less items keyed by reset.interval can be disambiguated.
Match items with this interval\_count. Disambiguates between items that share an interval but differ in count.
Match items whose grant equals this included usage. Omitted is a wildcard.
Free trial configuration for a plan.
Number of duration\_type periods the trial lasts.
Unit of time for the trial ('day', 'month', 'year').
If true, a payment method is required to start the trial and the customer is charged when it ends. Defaults to false.
Behavior when the trial ends. 'bill' charges the customer (default). 'revert' expires the trial and restores the customer's previous plan.
Override the plan's billing controls (auto top-ups, spend limits, usage limits, usage alerts, overage allowed) for this customer.
List of auto top-up configurations per feature.
The ID of the feature (credit balance) to auto top-up.
Whether auto top-up is enabled.
When the balance drops below this threshold, an auto top-up will be purchased.
Amount of credits to add per auto top-up.
Optional rate limit to cap how often auto top-ups occur. Pass count to set the current window's consumed top-ups.
The time interval for the purchase limit window.
Number of intervals in the purchase limit window.
Maximum number of auto top-ups allowed within the interval.
Set the current window's consumed auto top-up count. Omit to leave runtime state unchanged.
When true, auto top-up creates a send\_invoice invoice instead of auto-charging.
List of overage spend limits per feature (caps overage spend).
Optional feature ID this spend limit applies to.
Whether the overage spend limit is enabled.
How overage\_limit is interpreted: an absolute overage cap (default) or a percentage of the main-plan allowance.
Overage cap for the feature: absolute units, or a percent (e.g. 120) when limit\_type is usage\_percentage.
When true, overage for this feature is not posted to Stripe. Usage tracking and balance resets still behave normally.
List of hard usage caps per feature (max units per interval).
The feature this usage limit applies to.
Whether this usage limit is enabled.
Maximum units allowed per interval.
Interval for the cap, aligned to the customer's billing cycle.
Window alignment. 'billing\_cycle' phases the interval to the customer's renewal time; 'utc' aligns to the UTC calendar.
When set, only usage from events whose properties match counts toward this cap. Omit to count all usage of the feature.
List of usage alert configurations per feature.
The feature ID this alert applies to.
Whether this usage alert is enabled.
The threshold value that triggers the alert. For usage or remaining, this is an absolute count. For usage\_percentage or remaining\_percentage, this is a percentage (0-100).
Whether the threshold is an absolute count or a percentage of the usage allowance or remaining balance.
What 100% means. balance: every grant on the feature. included: the plan allowance only. recurring: grants that reset. usage\_limit: the cap of the usage limit with the same feature and filter.
Only valid with basis usage\_limit. Points the alert at the usage limit carrying the same filter.
Optional user-defined label to distinguish multiple alerts on the same feature.
List of overage allowed controls per feature. When enabled, usage can exceed balance.
The feature ID this overage allowed control applies to.
Whether overage is allowed for this feature.
License links to add or override for this customer, keyed by license\_plan\_id. Omitted fields inherit the plan catalog link (included defaults to 1 when the license is not in the catalog). A bare entry restores the license to pure catalog inheritance.
Base price configuration for a plan.
Base price amount for the plan, in major currency units (e.g. dollars).
Billing interval (e.g. 'month', 'year').
Number of intervals per billing cycle. Defaults to 1.
Base price amounts in additional currencies. The base 'amount' is in the org's default currency.
Three-letter Stripe-supported currency code (e.g. 'eur', 'gbp').
Price amount in this currency. Set explicitly per currency, not converted from the base amount.
Bills this many feature units when outstanding overage reaches it.
The ID of the feature to configure.
Number of free units included. Balance resets to this each interval for consumable features.
If true, customer has unlimited access to this feature.
Whether entity-level grants contribute to a shared customer balance.
Reset configuration for consumable features. Omit for non-consumable features like seats.
Interval at which balance resets (e.g. 'month', 'year'). For consumable features only.
Number of intervals between resets. Defaults to 1.
Pricing for usage beyond included units. Omit for free features.
Price per billing\_units after included usage. Either 'amount' or 'tiers' is required.
Amounts in additional currencies for this flat price. The base 'amount' is in the org's default currency. Only valid with 'amount', not 'tiers'.
Three-letter Stripe-supported currency code (e.g. 'eur', 'gbp').
Price amount in this currency. Set explicitly per currency, not converted from the base amount.
Tiered pricing. Either 'amount' or 'tiers' is required.
Three-letter Stripe-supported currency code (e.g. 'eur', 'gbp').
Per-unit amount for this tier in this currency.
Flat amount for this tier in this currency, if the tier uses one.
Billing interval. For consumable features, should match reset.interval.
Number of intervals per billing cycle. Defaults to 1.
Units per price increment. Usage is rounded UP when billed (e.g. billing\_units=100 means 101 rounds to 200).
'prepaid' for upfront payment (seats), 'usage\_based' for pay-as-you-go.
Max units purchasable beyond included. E.g. included=100, max\_purchase=300 allows 400 total. Null for no limit.
Proration settings for prepaid features. Controls mid-cycle quantity change billing.
Billing behavior when quantity increases mid-cycle.
Credit behavior when quantity decreases mid-cycle.
Rollover config for unused units. If set, unused included units carry over.
Max rollover units. Omit for unlimited rollover.
Maximum rollover as a percentage (0-100) of included + prepaid grant. Mutually exclusive with max.
When rolled over units expire.
Number of periods before expiry.
Overrides fields of this item's feature for customers on this plan (e.g. a credit system's credit\_schema).
For credit system features: replaces the feature's credit\_schema entirely for customers on this plan.
ID of the metered feature that draws from this credit system.
Number of metered-feature units priced together. Defaults to one when omitted.
Named rates chosen by event properties. The most specific match sets the rate; with no match the item's own rate applies.
Event properties this entry applies to. Every key must equal the tracked property, compared as strings.
Breaks ties between dimensions that match the same number of keys. Higher wins.
Inclusive upper usage boundary for this graduated tier. The final tier must be 'inf'.
Credits consumed per billing-unit group within this tier.
Named adjustments chosen by event properties. Every match applies: factors multiply, then adds are summed.
Event properties this entry applies to. Every key must equal the tracked property, compared as strings.
Multiplies the matched rate. All matching multipliers stack.
Added to the rate after every factor is applied, in credits per billing-unit group.
Inclusive upper usage boundary for this graduated tier. The final tier must be 'inf'.
Credits consumed per billing-unit group within this tier.
Credits consumed per billing-unit group.
For AI credit system features: replaces the feature's markup chain entirely for customers on this plan. An unset level means no markup at that level rather than inheriting the feature's.
Default percentage markup for customers on this plan. Use -100 to make usage free.
Per-provider markup percentages for customers on this plan.
Per-model markup overrides for customers on this plan.
Match items linked to this feature.
Match items with this billing method (prepaid or usage\_based).
Match items with this interval. Accepts either a BillingInterval (price-side) or a ResetInterval (reset-side, includes day/hour/minute) so price-less items keyed by reset.interval can be disambiguated.
Match items with this interval\_count. Disambiguates between items that share an interval but differ in count.
Match items whose grant equals this included usage. Omitted is a wildcard.
License links to drop, keyed by license\_plan\_id. Parallel to remove\_items.
The feature quantity selections associated with this plan change.
The ID of the adjustable feature included in this change.
The quantity that will apply for this feature in the change.
When this change takes effect, in milliseconds since the Unix epoch, or null if it applies immediately.
When this plan was canceled, in milliseconds since the Unix epoch, or null if it is not canceled.
When this plan expires, in milliseconds since the Unix epoch, or null if it does not expire.
Products or subscription changes being removed or ended.
The ID of the plan affected by this preview change.
The full plan object if it was expanded in the response.
Unique identifier for the plan.
Display name of the plan.
Optional description of the plan.
Group identifier for organizing related plans. Plans in the same group are mutually exclusive.
Version number of the plan. Incremented when plan configuration changes.
User-facing version identity. Defaults to v\{n} when the version is minted.
Whether this is the active version of the plan. At most one version is active.
Whether this is an add-on plan that can be attached alongside a main plan.
If true, this plan is automatically attached when a customer is created. Used for free plans.
Base recurring price for the plan. Null for free plans or usage-only plans.
Base price amount for the plan, in major currency units (e.g. dollars).
Base price amounts in additional currencies. The base 'amount' is in the org's default currency.
Three-letter Stripe-supported currency code (e.g. 'eur', 'gbp').
Price amount in this currency. Set explicitly per currency, not converted from the base amount.
Billing interval (e.g. 'month', 'year').
Number of intervals per billing cycle. Defaults to 1.
Display text for showing this price in pricing pages.
Main display text (e.g. '\$10' or '100 messages').
Secondary display text (e.g. 'per month' or 'then \$0.5 per 100').
Payment processors this base price is connected to. Omitted when unset.
Stripe price ID. For prepaid with included > 0 this is the V2 price.
Feature configurations included in this plan. Each item defines included units, pricing, and reset behavior for a feature.
Bills this many feature units when outstanding overage reaches it.
The ID of the feature this item configures.
The full feature object if expanded.
The ID of the feature, used to refer to it in other API calls like /track or /check.
The name of the feature.
The type of the feature
Singular and plural display names for the feature.
The singular display name for the feature.
The plural display name for the feature.
Credit cost schema for credit system features.
The ID of the metered feature (should be a single\_use feature).
The credit cost of the metered feature.
Whether or not the feature is archived.
Number of free units included. For consumable features, balance resets to this number each interval.
Whether the customer has unlimited access to this feature.
Whether entity-level grants contribute to a shared customer balance.
Reset configuration for consumable features. Null for non-consumable features like seats where usage persists across billing cycles.
The interval at which the feature balance resets (e.g. 'month', 'year'). For consumable features, usage resets to 0 and included units are restored.
Number of intervals between resets. Defaults to 1.
Pricing configuration for usage beyond included units. Null if feature is entirely free.
Price per billing\_units after included usage is consumed. Mutually exclusive with tiers.
Amounts in additional currencies for this flat price. The base 'amount' is in the org's default currency. Only valid with 'amount', not 'tiers' (tiered prices carry per-currency amounts on each tier).
Three-letter Stripe-supported currency code (e.g. 'eur', 'gbp').
Price amount in this currency. Set explicitly per currency, not converted from the base amount.
Tiered pricing configuration. Each tier's 'to' INCLUDES the included amount. Either 'tiers' or 'amount' is required.
Three-letter Stripe-supported currency code (e.g. 'eur', 'gbp').
Per-unit amount for this tier in this currency.
Flat amount for this tier in this currency, if the tier uses one.
Billing interval for this price. For consumable features, should match reset.interval.
Number of intervals per billing cycle. Defaults to 1.
Number of units per price increment. Usage is rounded UP to the nearest billing\_units when billed (e.g. billing\_units=100 means 101 usage rounds to 200).
'prepaid' for features like seats where customers pay upfront, 'usage\_based' for pay-as-you-go after included usage.
Maximum units a customer can purchase beyond included. E.g. if included=100 and max\_purchase=300, customer can use up to 400 total before usage is capped. Null for no limit.
Payment processors this item price is connected to. Omitted when unset.
Stripe price ID. For prepaid with included > 0 this is the V2 price.
Display text for showing this item in pricing pages.
Main display text (e.g. '\$10' or '100 messages').
Secondary display text (e.g. 'per month' or 'then \$0.5 per 100').
Rollover configuration for unused units. If set, unused included units roll over to the next period.
Maximum rollover units. Null for unlimited rollover.
Maximum rollover as a percentage (0-100) of included + prepaid grant. Mutually exclusive with max.
When rolled over units expire.
Number of periods before expiry.
Overrides fields of this item's feature for customers on this plan (e.g. a credit system's credit\_schema).
For credit system features: replaces the feature's credit\_schema entirely for customers on this plan.
ID of the metered feature that draws from this credit system.
Number of metered-feature units priced together. Defaults to one when omitted.
Named rates chosen by event properties. The most specific match sets the rate; with no match the item's own rate applies.
Event properties this entry applies to. Every key must equal the tracked property, compared as strings.
Breaks ties between dimensions that match the same number of keys. Higher wins.
Inclusive upper usage boundary for this graduated tier. The final tier must be 'inf'.
Credits consumed per billing-unit group within this tier.
Named adjustments chosen by event properties. Every match applies: factors multiply, then adds are summed.
Event properties this entry applies to. Every key must equal the tracked property, compared as strings.
Multiplies the matched rate. All matching multipliers stack.
Added to the rate after every factor is applied, in credits per billing-unit group.
Inclusive upper usage boundary for this graduated tier. The final tier must be 'inf'.
Credits consumed per billing-unit group within this tier.
Credits consumed per billing-unit group.
For AI credit system features: replaces the feature's markup chain entirely for customers on this plan. An unset level means no markup at that level rather than inheriting the feature's.
Default percentage markup for customers on this plan. Use -100 to make usage free.
Per-provider markup percentages for customers on this plan.
Per-model markup overrides for customers on this plan.
Payment processors this plan is connected to. Omitted when unset.
Stripe product ID this plan is billed under.
Extra Stripe product IDs aliased to this plan.
Every RevenueCat product that maps to this plan. Replaces the current set.
RevenueCat product ID that grants this plan when purchased.
Prepaid quantities granted when this specific RevenueCat product is purchased, in feature units.
Free trial configuration. If set, new customers can try this plan before being charged.
Number of duration\_type periods the trial lasts.
Unit of time for the trial duration ('day', 'month', 'year').
Whether a payment method is required to start the trial. If true, customer will be charged after trial ends.
Behavior when the trial ends. 'bill' charges the customer (default). 'revert' expires the trial and restores the customer's previous plan.
Unix timestamp (ms) when the plan was created.
Environment this plan belongs to ('sandbox' or 'live').
Whether the plan is archived. Archived plans cannot be attached to new customers.
Miscellaneous plan-level configuration flags.
If true, entitlements attached to this plan will still reset on schedule even when the customer's product is in a past\_due state.
Plan-level billing controls used as customer defaults.
List of auto top-up configurations per feature.
The ID of the feature (credit balance) to auto top-up.
Whether auto top-up is enabled.
When the balance drops below this threshold, an auto top-up will be purchased.
Amount of credits to add per auto top-up.
Optional rate limit to cap how often auto top-ups occur.
The time interval for the purchase limit window.
Number of intervals in the purchase limit window.
Maximum number of auto top-ups allowed within the interval.
When true, auto top-up creates a send\_invoice invoice instead of auto-charging.
List of overage spend limits per feature (caps overage spend).
Optional feature ID this spend limit applies to.
Whether the overage spend limit is enabled.
How overage\_limit is interpreted: an absolute overage cap (default) or a percentage of the main-plan allowance.
Overage cap for the feature: absolute units, or a percent (e.g. 120) when limit\_type is usage\_percentage.
When true, overage for this feature is not posted to Stripe. Usage tracking and balance resets still behave normally.
List of hard usage caps per feature (max units per interval).
The feature this usage limit applies to.
Whether this usage limit is enabled.
Maximum units allowed per interval.
Interval for the cap, aligned to the customer's billing cycle.
Window alignment. 'billing\_cycle' phases the interval to the customer's renewal time; 'utc' aligns to the UTC calendar.
When set, only usage from events whose properties match counts toward this cap. Omit to count all usage of the feature.
List of usage alert configurations per feature.
The feature ID this alert applies to.
Whether this usage alert is enabled.
The threshold value that triggers the alert. For usage or remaining, this is an absolute count. For usage\_percentage or remaining\_percentage, this is a percentage (0-100).
Whether the threshold is an absolute count or a percentage of the usage allowance or remaining balance.
What 100% means. balance: every grant on the feature. included: the plan allowance only. recurring: grants that reset. usage\_limit: the cap of the usage limit with the same feature and filter.
Only valid with basis usage\_limit. Points the alert at the usage limit carrying the same filter.
Optional user-defined label to distinguish multiple alerts on the same feature.
List of overage allowed controls per feature. When enabled, usage can exceed balance.
The feature ID this overage allowed control applies to.
Whether overage is allowed for this feature.
Arbitrary key-value metadata defined by you for your own use. Shared across all versions of the plan.
Whether the trial on this plan is available to this customer. For example, if the customer used the trial in the past, this will be false.
The customer's current status with this plan. 'active' if attached, 'scheduled' if pending activation.
Whether the customer's active instance of this plan is set to cancel.
Whether the customer is currently on a free trial of this plan.
The action that would occur if this plan were attached to the customer.
Deprecated. Use variant\_details.base\_plan\_id instead. If this is a variant, the ID of the base plan it was created from.
Details about how this variant relates to its latest base plan.
The ID of the base plan this variant was derived from.
The customization that transforms the base plan into this variant.
Base price configuration for a plan.
Base price amount for the plan, in major currency units (e.g. dollars).
Billing interval (e.g. 'month', 'year').
Number of intervals per billing cycle. Defaults to 1.
Base price amounts in additional currencies. The base 'amount' is in the org's default currency.
Three-letter Stripe-supported currency code (e.g. 'eur', 'gbp').
Price amount in this currency. Set explicitly per currency, not converted from the base amount.
Items to add to the plan.
Bills this many feature units when outstanding overage reaches it.
The ID of the feature to configure.
Number of free units included. Balance resets to this each interval for consumable features.
If true, customer has unlimited access to this feature.
Whether entity-level grants contribute to a shared customer balance.
Reset configuration for consumable features. Omit for non-consumable features like seats.
Interval at which balance resets (e.g. 'month', 'year'). For consumable features only.
Number of intervals between resets. Defaults to 1.
Pricing for usage beyond included units. Omit for free features.
Price per billing\_units after included usage. Either 'amount' or 'tiers' is required.
Amounts in additional currencies for this flat price. The base 'amount' is in the org's default currency. Only valid with 'amount', not 'tiers'.
Three-letter Stripe-supported currency code (e.g. 'eur', 'gbp').
Price amount in this currency. Set explicitly per currency, not converted from the base amount.
Tiered pricing. Either 'amount' or 'tiers' is required.
Three-letter Stripe-supported currency code (e.g. 'eur', 'gbp').
Per-unit amount for this tier in this currency.
Flat amount for this tier in this currency, if the tier uses one.
Billing interval. For consumable features, should match reset.interval.
Number of intervals per billing cycle. Defaults to 1.
Units per price increment. Usage is rounded UP when billed (e.g. billing\_units=100 means 101 rounds to 200).
'prepaid' for upfront payment (seats), 'usage\_based' for pay-as-you-go.
Max units purchasable beyond included. E.g. included=100, max\_purchase=300 allows 400 total. Null for no limit.
Proration settings for prepaid features. Controls mid-cycle quantity change billing.
Billing behavior when quantity increases mid-cycle.
Credit behavior when quantity decreases mid-cycle.
Rollover config for unused units. If set, unused included units carry over.
Max rollover units. Omit for unlimited rollover.
Maximum rollover as a percentage (0-100) of included + prepaid grant. Mutually exclusive with max.
When rolled over units expire.
Number of periods before expiry.
Overrides fields of this item's feature for customers on this plan (e.g. a credit system's credit\_schema).
For credit system features: replaces the feature's credit\_schema entirely for customers on this plan.
ID of the metered feature that draws from this credit system.
Number of metered-feature units priced together. Defaults to one when omitted.
Named rates chosen by event properties. The most specific match sets the rate; with no match the item's own rate applies.
Event properties this entry applies to. Every key must equal the tracked property, compared as strings.
Breaks ties between dimensions that match the same number of keys. Higher wins.
Inclusive upper usage boundary for this graduated tier. The final tier must be 'inf'.
Credits consumed per billing-unit group within this tier.
Named adjustments chosen by event properties. Every match applies: factors multiply, then adds are summed.
Event properties this entry applies to. Every key must equal the tracked property, compared as strings.
Multiplies the matched rate. All matching multipliers stack.
Added to the rate after every factor is applied, in credits per billing-unit group.
Inclusive upper usage boundary for this graduated tier. The final tier must be 'inf'.
Credits consumed per billing-unit group within this tier.
Credits consumed per billing-unit group.
For AI credit system features: replaces the feature's markup chain entirely for customers on this plan. An unset level means no markup at that level rather than inheriting the feature's.
Default percentage markup for customers on this plan. Use -100 to make usage free.
Per-provider markup percentages for customers on this plan.
Per-model markup overrides for customers on this plan.
Filters selecting items to remove from the plan.
Match items linked to this feature.
Match items with this billing method (prepaid or usage\_based).
Match items with this interval. Accepts either a BillingInterval (price-side) or a ResetInterval (reset-side, includes day/hour/minute) so price-less items keyed by reset.interval can be disambiguated.
Match items with this interval\_count. Disambiguates between items that share an interval but differ in count.
Match items whose grant equals this included usage. Omitted is a wildcard.
Free trial configuration for a plan.
Number of duration\_type periods the trial lasts.
Unit of time for the trial ('day', 'month', 'year').
If true, a payment method is required to start the trial and the customer is charged when it ends. Defaults to false.
Behavior when the trial ends. 'bill' charges the customer (default). 'revert' expires the trial and restores the customer's previous plan.
Override the plan's billing controls (auto top-ups, spend limits, usage limits, usage alerts, overage allowed) for this customer.
List of auto top-up configurations per feature.
The ID of the feature (credit balance) to auto top-up.
Whether auto top-up is enabled.
When the balance drops below this threshold, an auto top-up will be purchased.
Amount of credits to add per auto top-up.
Optional rate limit to cap how often auto top-ups occur. Pass count to set the current window's consumed top-ups.
The time interval for the purchase limit window.
Number of intervals in the purchase limit window.
Maximum number of auto top-ups allowed within the interval.
Set the current window's consumed auto top-up count. Omit to leave runtime state unchanged.
When true, auto top-up creates a send\_invoice invoice instead of auto-charging.
List of overage spend limits per feature (caps overage spend).
Optional feature ID this spend limit applies to.
Whether the overage spend limit is enabled.
How overage\_limit is interpreted: an absolute overage cap (default) or a percentage of the main-plan allowance.
Overage cap for the feature: absolute units, or a percent (e.g. 120) when limit\_type is usage\_percentage.
When true, overage for this feature is not posted to Stripe. Usage tracking and balance resets still behave normally.
List of hard usage caps per feature (max units per interval).
The feature this usage limit applies to.
Whether this usage limit is enabled.
Maximum units allowed per interval.
Interval for the cap, aligned to the customer's billing cycle.
Window alignment. 'billing\_cycle' phases the interval to the customer's renewal time; 'utc' aligns to the UTC calendar.
When set, only usage from events whose properties match counts toward this cap. Omit to count all usage of the feature.
List of usage alert configurations per feature.
The feature ID this alert applies to.
Whether this usage alert is enabled.
The threshold value that triggers the alert. For usage or remaining, this is an absolute count. For usage\_percentage or remaining\_percentage, this is a percentage (0-100).
Whether the threshold is an absolute count or a percentage of the usage allowance or remaining balance.
What 100% means. balance: every grant on the feature. included: the plan allowance only. recurring: grants that reset. usage\_limit: the cap of the usage limit with the same feature and filter.
Only valid with basis usage\_limit. Points the alert at the usage limit carrying the same filter.
Optional user-defined label to distinguish multiple alerts on the same feature.
List of overage allowed controls per feature. When enabled, usage can exceed balance.
The feature ID this overage allowed control applies to.
Whether overage is allowed for this feature.
License links to add or override for this customer, keyed by license\_plan\_id. Omitted fields inherit the plan catalog link (included defaults to 1 when the license is not in the catalog). A bare entry restores the license to pure catalog inheritance.
Base price configuration for a plan.
Base price amount for the plan, in major currency units (e.g. dollars).
Billing interval (e.g. 'month', 'year').
Number of intervals per billing cycle. Defaults to 1.
Base price amounts in additional currencies. The base 'amount' is in the org's default currency.
Three-letter Stripe-supported currency code (e.g. 'eur', 'gbp').
Price amount in this currency. Set explicitly per currency, not converted from the base amount.
Bills this many feature units when outstanding overage reaches it.
The ID of the feature to configure.
Number of free units included. Balance resets to this each interval for consumable features.
If true, customer has unlimited access to this feature.
Whether entity-level grants contribute to a shared customer balance.
Reset configuration for consumable features. Omit for non-consumable features like seats.
Interval at which balance resets (e.g. 'month', 'year'). For consumable features only.
Number of intervals between resets. Defaults to 1.
Pricing for usage beyond included units. Omit for free features.
Price per billing\_units after included usage. Either 'amount' or 'tiers' is required.
Amounts in additional currencies for this flat price. The base 'amount' is in the org's default currency. Only valid with 'amount', not 'tiers'.
Three-letter Stripe-supported currency code (e.g. 'eur', 'gbp').
Price amount in this currency. Set explicitly per currency, not converted from the base amount.
Tiered pricing. Either 'amount' or 'tiers' is required.
Three-letter Stripe-supported currency code (e.g. 'eur', 'gbp').
Per-unit amount for this tier in this currency.
Flat amount for this tier in this currency, if the tier uses one.
Billing interval. For consumable features, should match reset.interval.
Number of intervals per billing cycle. Defaults to 1.
Units per price increment. Usage is rounded UP when billed (e.g. billing\_units=100 means 101 rounds to 200).
'prepaid' for upfront payment (seats), 'usage\_based' for pay-as-you-go.
Max units purchasable beyond included. E.g. included=100, max\_purchase=300 allows 400 total. Null for no limit.
Proration settings for prepaid features. Controls mid-cycle quantity change billing.
Billing behavior when quantity increases mid-cycle.
Credit behavior when quantity decreases mid-cycle.
Rollover config for unused units. If set, unused included units carry over.
Max rollover units. Omit for unlimited rollover.
Maximum rollover as a percentage (0-100) of included + prepaid grant. Mutually exclusive with max.
When rolled over units expire.
Number of periods before expiry.
Overrides fields of this item's feature for customers on this plan (e.g. a credit system's credit\_schema).
For credit system features: replaces the feature's credit\_schema entirely for customers on this plan.
ID of the metered feature that draws from this credit system.
Number of metered-feature units priced together. Defaults to one when omitted.
Named rates chosen by event properties. The most specific match sets the rate; with no match the item's own rate applies.
Event properties this entry applies to. Every key must equal the tracked property, compared as strings.
Breaks ties between dimensions that match the same number of keys. Higher wins.
Inclusive upper usage boundary for this graduated tier. The final tier must be 'inf'.
Credits consumed per billing-unit group within this tier.
Named adjustments chosen by event properties. Every match applies: factors multiply, then adds are summed.
Event properties this entry applies to. Every key must equal the tracked property, compared as strings.
Multiplies the matched rate. All matching multipliers stack.
Added to the rate after every factor is applied, in credits per billing-unit group.
Inclusive upper usage boundary for this graduated tier. The final tier must be 'inf'.
Credits consumed per billing-unit group within this tier.
Credits consumed per billing-unit group.
For AI credit system features: replaces the feature's markup chain entirely for customers on this plan. An unset level means no markup at that level rather than inheriting the feature's.
Default percentage markup for customers on this plan. Use -100 to make usage free.
Per-provider markup percentages for customers on this plan.
Per-model markup overrides for customers on this plan.
Match items linked to this feature.
Match items with this billing method (prepaid or usage\_based).
Match items with this interval. Accepts either a BillingInterval (price-side) or a ResetInterval (reset-side, includes day/hour/minute) so price-less items keyed by reset.interval can be disambiguated.
Match items with this interval\_count. Disambiguates between items that share an interval but differ in count.
Match items whose grant equals this included usage. Omitted is a wildcard.
License links to drop, keyed by license\_plan\_id. Parallel to remove\_items.
The feature quantity selections associated with this plan change.
The ID of the adjustable feature included in this change.
The quantity that will apply for this feature in the change.
When this change takes effect, in milliseconds since the Unix epoch, or null if it applies immediately.
When this plan was canceled, in milliseconds since the Unix epoch, or null if it is not canceled.
When this plan expires, in milliseconds since the Unix epoch, or null if it does not expire.
Whether the customer will be redirected to a checkout page if attach is called.
The type of checkout that will be used if the customer is redirected to a checkout page.
Tax preview for the immediate charge. Contact us to enable the tax flag on your organisation. Shows only with flag enabled, a Stripe customer exists and has a location.
Total tax amount in major currency units.
Tax included in line item subtotals.
Tax added on top of subtotals.
Three-letter currency code.
Calculation status ('complete' when Stripe Tax succeeds or 'incomplete' when Stripe Tax returned 0 or errored).
Stripe customer invoice credits preview.
Stripe customer credit balance available, expressed as a positive number in major currency units.
Three-letter currency code.
```json 200 theme={null}
{
"customerId": "charles",
"lineItems": [
{
"display_name": "Pro seed",
"description": "Pro seed - Base Price (from 18 Feb 2026 to 18 Mar 2026)",
"subtotal": 20,
"total": 20,
"discounts": []
}
],
"subtotal": 20,
"total": 20,
"currency": "usd"
}
```
# Preview Multi Update
Source: https://docs.useautumn.com/api-reference/billing/previewMultiUpdate
openapi POST /v1/billing.preview_multi_update
Previews the billing changes of a multi-plan update without making any changes. Returns one core preview per affected subscription.
Use this endpoint to show customers the credits and next-cycle changes of canceling multiple plans before confirming.
### Body Parameters
The ID of the customer to update plans for.
The ID of the entity to update plans for. Individual updates can override this with their own entity\_id.
Controls how the last payment is refunded on immediate cancellation. 'prorated' refunds the unused portion, 'full' refunds the entire last payment.
Additional parameters to pass into the Stripe subscription update or cancel call.
The list of plan updates to apply to the customer.
The ID of the plan to update. Optional if subscription\_id is provided.
A unique ID to identify the subscription to update. Useful when a customer has multiple products with the same plan.
The ID of the entity this update targets. Overrides the top-level entity\_id for this update.
Action to perform for cancellation. 'cancel\_immediately' cancels now with prorated refund, 'cancel\_end\_of\_cycle' cancels at period end, 'uncancel' reverses a pending cancellation.
How to handle proration for this update. 'prorate\_immediately' charges/credits prorated amounts now, 'none' skips creating any charges.
### Response
The ID of the customer the preview applies to.
The three-letter ISO currency code. All amounts are in the currency's major unit (e.g., dollars for USD).
The combined amount due today across all subscriptions (sum of subscriptions\[].total).
One preview per affected Stripe subscription. Updates to plans without a subscription (free plans) produce no entry.
The ID of the customer.
List of line items for the current billing period.
The name of the line item to display to the customer if you're building a UI. It will either be the plan name or the feature name.
A detailed description of the line item.
The amount before discounts and tax for this line item.
The final amount after discounts and tax for this line item.
List of discounts applied to this line item.
The ID of the plan that this line item belongs to.
The ID of the feature that this line item belongs to.
The period of time that this line item is being charged for.
The start of the period in milliseconds since the Unix epoch.
The end of the period in milliseconds since the Unix epoch.
The quantity of the line item.
The total amount before discounts and tax for the current billing period.
The final amount after discounts and tax for the current billing period.
The three-letter ISO currency code. All amounts are in the currency's major unit (e.g., dollars for USD).
True when this change clears the customer's usage balances, so the approver can see usage will reset.
Preview of the next billing cycle, if applicable. This shows what the customer will be charged in subsequent cycles.
Unix timestamp (milliseconds) when the next billing cycle starts.
The total amount before discounts and tax for the next cycle.
The final amount after discounts and tax for the next cycle.
List of line items for the next billing cycle.
The name of the line item to display to the customer if you're building a UI. It will either be the plan name or the feature name.
A detailed description of the line item.
The amount before discounts and tax for this line item.
The final amount after discounts and tax for this line item.
List of discounts applied to this line item.
The ID of the plan that this line item belongs to.
The ID of the feature that this line item belongs to.
The period of time that this line item is being charged for.
The start of the period in milliseconds since the Unix epoch.
The end of the period in milliseconds since the Unix epoch.
The quantity of the line item.
List of line items for usage-based features in the next cycle.
The name of the line item to display to the customer if you're building a UI. It will either be the plan name or the feature name.
The ID of the plan that this line item belongs to.
The ID of the feature that this line item belongs to.
The period of time that this line item is being charged for.
The start of the period in milliseconds since the Unix epoch.
The end of the period in milliseconds since the Unix epoch.
Expand the response with additional data.
Products or subscription changes being added or updated.
The ID of the plan affected by this preview change.
The full plan object if it was expanded in the response.
Unique identifier for the plan.
Display name of the plan.
Optional description of the plan.
Group identifier for organizing related plans. Plans in the same group are mutually exclusive.
Version number of the plan. Incremented when plan configuration changes.
User-facing version identity. Defaults to v\{n} when the version is minted.
Whether this is the active version of the plan. At most one version is active.
Whether this is an add-on plan that can be attached alongside a main plan.
If true, this plan is automatically attached when a customer is created. Used for free plans.
Base recurring price for the plan. Null for free plans or usage-only plans.
Base price amount for the plan, in major currency units (e.g. dollars).
Base price amounts in additional currencies. The base 'amount' is in the org's default currency.
Three-letter Stripe-supported currency code (e.g. 'eur', 'gbp').
Price amount in this currency. Set explicitly per currency, not converted from the base amount.
Billing interval (e.g. 'month', 'year').
Number of intervals per billing cycle. Defaults to 1.
Display text for showing this price in pricing pages.
Main display text (e.g. '\$10' or '100 messages').
Secondary display text (e.g. 'per month' or 'then \$0.5 per 100').
Payment processors this base price is connected to. Omitted when unset.
Stripe price ID. For prepaid with included > 0 this is the V2 price.
Feature configurations included in this plan. Each item defines included units, pricing, and reset behavior for a feature.
Bills this many feature units when outstanding overage reaches it.
The ID of the feature this item configures.
The full feature object if expanded.
The ID of the feature, used to refer to it in other API calls like /track or /check.
The name of the feature.
The type of the feature
Singular and plural display names for the feature.
The singular display name for the feature.
The plural display name for the feature.
Credit cost schema for credit system features.
The ID of the metered feature (should be a single\_use feature).
The credit cost of the metered feature.
Whether or not the feature is archived.
Number of free units included. For consumable features, balance resets to this number each interval.
Whether the customer has unlimited access to this feature.
Whether entity-level grants contribute to a shared customer balance.
Reset configuration for consumable features. Null for non-consumable features like seats where usage persists across billing cycles.
The interval at which the feature balance resets (e.g. 'month', 'year'). For consumable features, usage resets to 0 and included units are restored.
Number of intervals between resets. Defaults to 1.
Pricing configuration for usage beyond included units. Null if feature is entirely free.
Price per billing\_units after included usage is consumed. Mutually exclusive with tiers.
Amounts in additional currencies for this flat price. The base 'amount' is in the org's default currency. Only valid with 'amount', not 'tiers' (tiered prices carry per-currency amounts on each tier).
Three-letter Stripe-supported currency code (e.g. 'eur', 'gbp').
Price amount in this currency. Set explicitly per currency, not converted from the base amount.
Tiered pricing configuration. Each tier's 'to' INCLUDES the included amount. Either 'tiers' or 'amount' is required.
Three-letter Stripe-supported currency code (e.g. 'eur', 'gbp').
Per-unit amount for this tier in this currency.
Flat amount for this tier in this currency, if the tier uses one.
Billing interval for this price. For consumable features, should match reset.interval.
Number of intervals per billing cycle. Defaults to 1.
Number of units per price increment. Usage is rounded UP to the nearest billing\_units when billed (e.g. billing\_units=100 means 101 usage rounds to 200).
'prepaid' for features like seats where customers pay upfront, 'usage\_based' for pay-as-you-go after included usage.
Maximum units a customer can purchase beyond included. E.g. if included=100 and max\_purchase=300, customer can use up to 400 total before usage is capped. Null for no limit.
Payment processors this item price is connected to. Omitted when unset.
Stripe price ID. For prepaid with included > 0 this is the V2 price.
Display text for showing this item in pricing pages.
Main display text (e.g. '\$10' or '100 messages').
Secondary display text (e.g. 'per month' or 'then \$0.5 per 100').
Rollover configuration for unused units. If set, unused included units roll over to the next period.
Maximum rollover units. Null for unlimited rollover.
Maximum rollover as a percentage (0-100) of included + prepaid grant. Mutually exclusive with max.
When rolled over units expire.
Number of periods before expiry.
Overrides fields of this item's feature for customers on this plan (e.g. a credit system's credit\_schema).
For credit system features: replaces the feature's credit\_schema entirely for customers on this plan.
ID of the metered feature that draws from this credit system.
Number of metered-feature units priced together. Defaults to one when omitted.
Named rates chosen by event properties. The most specific match sets the rate; with no match the item's own rate applies.
Event properties this entry applies to. Every key must equal the tracked property, compared as strings.
Breaks ties between dimensions that match the same number of keys. Higher wins.
Inclusive upper usage boundary for this graduated tier. The final tier must be 'inf'.
Credits consumed per billing-unit group within this tier.
Named adjustments chosen by event properties. Every match applies: factors multiply, then adds are summed.
Event properties this entry applies to. Every key must equal the tracked property, compared as strings.
Multiplies the matched rate. All matching multipliers stack.
Added to the rate after every factor is applied, in credits per billing-unit group.
Inclusive upper usage boundary for this graduated tier. The final tier must be 'inf'.
Credits consumed per billing-unit group within this tier.
Credits consumed per billing-unit group.
For AI credit system features: replaces the feature's markup chain entirely for customers on this plan. An unset level means no markup at that level rather than inheriting the feature's.
Default percentage markup for customers on this plan. Use -100 to make usage free.
Per-provider markup percentages for customers on this plan.
Per-model markup overrides for customers on this plan.
Payment processors this plan is connected to. Omitted when unset.
Stripe product ID this plan is billed under.
Extra Stripe product IDs aliased to this plan.
Every RevenueCat product that maps to this plan. Replaces the current set.
RevenueCat product ID that grants this plan when purchased.
Prepaid quantities granted when this specific RevenueCat product is purchased, in feature units.
Free trial configuration. If set, new customers can try this plan before being charged.
Number of duration\_type periods the trial lasts.
Unit of time for the trial duration ('day', 'month', 'year').
Whether a payment method is required to start the trial. If true, customer will be charged after trial ends.
Behavior when the trial ends. 'bill' charges the customer (default). 'revert' expires the trial and restores the customer's previous plan.
Unix timestamp (ms) when the plan was created.
Environment this plan belongs to ('sandbox' or 'live').
Whether the plan is archived. Archived plans cannot be attached to new customers.
Miscellaneous plan-level configuration flags.
If true, entitlements attached to this plan will still reset on schedule even when the customer's product is in a past\_due state.
Plan-level billing controls used as customer defaults.
List of auto top-up configurations per feature.
The ID of the feature (credit balance) to auto top-up.
Whether auto top-up is enabled.
When the balance drops below this threshold, an auto top-up will be purchased.
Amount of credits to add per auto top-up.
Optional rate limit to cap how often auto top-ups occur.
The time interval for the purchase limit window.
Number of intervals in the purchase limit window.
Maximum number of auto top-ups allowed within the interval.
When true, auto top-up creates a send\_invoice invoice instead of auto-charging.
List of overage spend limits per feature (caps overage spend).
Optional feature ID this spend limit applies to.
Whether the overage spend limit is enabled.
How overage\_limit is interpreted: an absolute overage cap (default) or a percentage of the main-plan allowance.
Overage cap for the feature: absolute units, or a percent (e.g. 120) when limit\_type is usage\_percentage.
When true, overage for this feature is not posted to Stripe. Usage tracking and balance resets still behave normally.
List of hard usage caps per feature (max units per interval).
The feature this usage limit applies to.
Whether this usage limit is enabled.
Maximum units allowed per interval.
Interval for the cap, aligned to the customer's billing cycle.
Window alignment. 'billing\_cycle' phases the interval to the customer's renewal time; 'utc' aligns to the UTC calendar.
When set, only usage from events whose properties match counts toward this cap. Omit to count all usage of the feature.
List of usage alert configurations per feature.
The feature ID this alert applies to.
Whether this usage alert is enabled.
The threshold value that triggers the alert. For usage or remaining, this is an absolute count. For usage\_percentage or remaining\_percentage, this is a percentage (0-100).
Whether the threshold is an absolute count or a percentage of the usage allowance or remaining balance.
What 100% means. balance: every grant on the feature. included: the plan allowance only. recurring: grants that reset. usage\_limit: the cap of the usage limit with the same feature and filter.
Only valid with basis usage\_limit. Points the alert at the usage limit carrying the same filter.
Optional user-defined label to distinguish multiple alerts on the same feature.
List of overage allowed controls per feature. When enabled, usage can exceed balance.
The feature ID this overage allowed control applies to.
Whether overage is allowed for this feature.
Arbitrary key-value metadata defined by you for your own use. Shared across all versions of the plan.
Whether the trial on this plan is available to this customer. For example, if the customer used the trial in the past, this will be false.
The customer's current status with this plan. 'active' if attached, 'scheduled' if pending activation.
Whether the customer's active instance of this plan is set to cancel.
Whether the customer is currently on a free trial of this plan.
The action that would occur if this plan were attached to the customer.
Deprecated. Use variant\_details.base\_plan\_id instead. If this is a variant, the ID of the base plan it was created from.
Details about how this variant relates to its latest base plan.
The ID of the base plan this variant was derived from.
The customization that transforms the base plan into this variant.
Base price configuration for a plan.
Base price amount for the plan, in major currency units (e.g. dollars).
Billing interval (e.g. 'month', 'year').
Number of intervals per billing cycle. Defaults to 1.
Base price amounts in additional currencies. The base 'amount' is in the org's default currency.
Three-letter Stripe-supported currency code (e.g. 'eur', 'gbp').
Price amount in this currency. Set explicitly per currency, not converted from the base amount.
Items to add to the plan.
Bills this many feature units when outstanding overage reaches it.
The ID of the feature to configure.
Number of free units included. Balance resets to this each interval for consumable features.
If true, customer has unlimited access to this feature.
Whether entity-level grants contribute to a shared customer balance.
Reset configuration for consumable features. Omit for non-consumable features like seats.
Interval at which balance resets (e.g. 'month', 'year'). For consumable features only.
Number of intervals between resets. Defaults to 1.
Pricing for usage beyond included units. Omit for free features.
Price per billing\_units after included usage. Either 'amount' or 'tiers' is required.
Amounts in additional currencies for this flat price. The base 'amount' is in the org's default currency. Only valid with 'amount', not 'tiers'.
Three-letter Stripe-supported currency code (e.g. 'eur', 'gbp').
Price amount in this currency. Set explicitly per currency, not converted from the base amount.
Tiered pricing. Either 'amount' or 'tiers' is required.
Three-letter Stripe-supported currency code (e.g. 'eur', 'gbp').
Per-unit amount for this tier in this currency.
Flat amount for this tier in this currency, if the tier uses one.
Billing interval. For consumable features, should match reset.interval.
Number of intervals per billing cycle. Defaults to 1.
Units per price increment. Usage is rounded UP when billed (e.g. billing\_units=100 means 101 rounds to 200).
'prepaid' for upfront payment (seats), 'usage\_based' for pay-as-you-go.
Max units purchasable beyond included. E.g. included=100, max\_purchase=300 allows 400 total. Null for no limit.
Proration settings for prepaid features. Controls mid-cycle quantity change billing.
Billing behavior when quantity increases mid-cycle.
Credit behavior when quantity decreases mid-cycle.
Rollover config for unused units. If set, unused included units carry over.
Max rollover units. Omit for unlimited rollover.
Maximum rollover as a percentage (0-100) of included + prepaid grant. Mutually exclusive with max.
When rolled over units expire.
Number of periods before expiry.
Overrides fields of this item's feature for customers on this plan (e.g. a credit system's credit\_schema).
For credit system features: replaces the feature's credit\_schema entirely for customers on this plan.
ID of the metered feature that draws from this credit system.
Number of metered-feature units priced together. Defaults to one when omitted.
Named rates chosen by event properties. The most specific match sets the rate; with no match the item's own rate applies.
Event properties this entry applies to. Every key must equal the tracked property, compared as strings.
Breaks ties between dimensions that match the same number of keys. Higher wins.
Inclusive upper usage boundary for this graduated tier. The final tier must be 'inf'.
Credits consumed per billing-unit group within this tier.
Named adjustments chosen by event properties. Every match applies: factors multiply, then adds are summed.
Event properties this entry applies to. Every key must equal the tracked property, compared as strings.
Multiplies the matched rate. All matching multipliers stack.
Added to the rate after every factor is applied, in credits per billing-unit group.
Inclusive upper usage boundary for this graduated tier. The final tier must be 'inf'.
Credits consumed per billing-unit group within this tier.
Credits consumed per billing-unit group.
For AI credit system features: replaces the feature's markup chain entirely for customers on this plan. An unset level means no markup at that level rather than inheriting the feature's.
Default percentage markup for customers on this plan. Use -100 to make usage free.
Per-provider markup percentages for customers on this plan.
Per-model markup overrides for customers on this plan.
Filters selecting items to remove from the plan.
Match items linked to this feature.
Match items with this billing method (prepaid or usage\_based).
Match items with this interval. Accepts either a BillingInterval (price-side) or a ResetInterval (reset-side, includes day/hour/minute) so price-less items keyed by reset.interval can be disambiguated.
Match items with this interval\_count. Disambiguates between items that share an interval but differ in count.
Match items whose grant equals this included usage. Omitted is a wildcard.
Free trial configuration for a plan.
Number of duration\_type periods the trial lasts.
Unit of time for the trial ('day', 'month', 'year').
If true, a payment method is required to start the trial and the customer is charged when it ends. Defaults to false.
Behavior when the trial ends. 'bill' charges the customer (default). 'revert' expires the trial and restores the customer's previous plan.
Override the plan's billing controls (auto top-ups, spend limits, usage limits, usage alerts, overage allowed) for this customer.
List of auto top-up configurations per feature.
The ID of the feature (credit balance) to auto top-up.
Whether auto top-up is enabled.
When the balance drops below this threshold, an auto top-up will be purchased.
Amount of credits to add per auto top-up.
Optional rate limit to cap how often auto top-ups occur. Pass count to set the current window's consumed top-ups.
The time interval for the purchase limit window.
Number of intervals in the purchase limit window.
Maximum number of auto top-ups allowed within the interval.
Set the current window's consumed auto top-up count. Omit to leave runtime state unchanged.
When true, auto top-up creates a send\_invoice invoice instead of auto-charging.
List of overage spend limits per feature (caps overage spend).
Optional feature ID this spend limit applies to.
Whether the overage spend limit is enabled.
How overage\_limit is interpreted: an absolute overage cap (default) or a percentage of the main-plan allowance.
Overage cap for the feature: absolute units, or a percent (e.g. 120) when limit\_type is usage\_percentage.
When true, overage for this feature is not posted to Stripe. Usage tracking and balance resets still behave normally.
List of hard usage caps per feature (max units per interval).
The feature this usage limit applies to.
Whether this usage limit is enabled.
Maximum units allowed per interval.
Interval for the cap, aligned to the customer's billing cycle.
Window alignment. 'billing\_cycle' phases the interval to the customer's renewal time; 'utc' aligns to the UTC calendar.
When set, only usage from events whose properties match counts toward this cap. Omit to count all usage of the feature.
List of usage alert configurations per feature.
The feature ID this alert applies to.
Whether this usage alert is enabled.
The threshold value that triggers the alert. For usage or remaining, this is an absolute count. For usage\_percentage or remaining\_percentage, this is a percentage (0-100).
Whether the threshold is an absolute count or a percentage of the usage allowance or remaining balance.
What 100% means. balance: every grant on the feature. included: the plan allowance only. recurring: grants that reset. usage\_limit: the cap of the usage limit with the same feature and filter.
Only valid with basis usage\_limit. Points the alert at the usage limit carrying the same filter.
Optional user-defined label to distinguish multiple alerts on the same feature.
List of overage allowed controls per feature. When enabled, usage can exceed balance.
The feature ID this overage allowed control applies to.
Whether overage is allowed for this feature.
License links to add or override for this customer, keyed by license\_plan\_id. Omitted fields inherit the plan catalog link (included defaults to 1 when the license is not in the catalog). A bare entry restores the license to pure catalog inheritance.
Base price configuration for a plan.
Base price amount for the plan, in major currency units (e.g. dollars).
Billing interval (e.g. 'month', 'year').
Number of intervals per billing cycle. Defaults to 1.
Base price amounts in additional currencies. The base 'amount' is in the org's default currency.
Three-letter Stripe-supported currency code (e.g. 'eur', 'gbp').
Price amount in this currency. Set explicitly per currency, not converted from the base amount.
Bills this many feature units when outstanding overage reaches it.
The ID of the feature to configure.
Number of free units included. Balance resets to this each interval for consumable features.
If true, customer has unlimited access to this feature.
Whether entity-level grants contribute to a shared customer balance.
Reset configuration for consumable features. Omit for non-consumable features like seats.
Interval at which balance resets (e.g. 'month', 'year'). For consumable features only.
Number of intervals between resets. Defaults to 1.
Pricing for usage beyond included units. Omit for free features.
Price per billing\_units after included usage. Either 'amount' or 'tiers' is required.
Amounts in additional currencies for this flat price. The base 'amount' is in the org's default currency. Only valid with 'amount', not 'tiers'.
Three-letter Stripe-supported currency code (e.g. 'eur', 'gbp').
Price amount in this currency. Set explicitly per currency, not converted from the base amount.
Tiered pricing. Either 'amount' or 'tiers' is required.
Three-letter Stripe-supported currency code (e.g. 'eur', 'gbp').
Per-unit amount for this tier in this currency.
Flat amount for this tier in this currency, if the tier uses one.
Billing interval. For consumable features, should match reset.interval.
Number of intervals per billing cycle. Defaults to 1.
Units per price increment. Usage is rounded UP when billed (e.g. billing\_units=100 means 101 rounds to 200).
'prepaid' for upfront payment (seats), 'usage\_based' for pay-as-you-go.
Max units purchasable beyond included. E.g. included=100, max\_purchase=300 allows 400 total. Null for no limit.
Proration settings for prepaid features. Controls mid-cycle quantity change billing.
Billing behavior when quantity increases mid-cycle.
Credit behavior when quantity decreases mid-cycle.
Rollover config for unused units. If set, unused included units carry over.
Max rollover units. Omit for unlimited rollover.
Maximum rollover as a percentage (0-100) of included + prepaid grant. Mutually exclusive with max.
When rolled over units expire.
Number of periods before expiry.
Overrides fields of this item's feature for customers on this plan (e.g. a credit system's credit\_schema).
For credit system features: replaces the feature's credit\_schema entirely for customers on this plan.
ID of the metered feature that draws from this credit system.
Number of metered-feature units priced together. Defaults to one when omitted.
Named rates chosen by event properties. The most specific match sets the rate; with no match the item's own rate applies.
Event properties this entry applies to. Every key must equal the tracked property, compared as strings.
Breaks ties between dimensions that match the same number of keys. Higher wins.
Inclusive upper usage boundary for this graduated tier. The final tier must be 'inf'.
Credits consumed per billing-unit group within this tier.
Named adjustments chosen by event properties. Every match applies: factors multiply, then adds are summed.
Event properties this entry applies to. Every key must equal the tracked property, compared as strings.
Multiplies the matched rate. All matching multipliers stack.
Added to the rate after every factor is applied, in credits per billing-unit group.
Inclusive upper usage boundary for this graduated tier. The final tier must be 'inf'.
Credits consumed per billing-unit group within this tier.
Credits consumed per billing-unit group.
For AI credit system features: replaces the feature's markup chain entirely for customers on this plan. An unset level means no markup at that level rather than inheriting the feature's.
Default percentage markup for customers on this plan. Use -100 to make usage free.
Per-provider markup percentages for customers on this plan.
Per-model markup overrides for customers on this plan.
Match items linked to this feature.
Match items with this billing method (prepaid or usage\_based).
Match items with this interval. Accepts either a BillingInterval (price-side) or a ResetInterval (reset-side, includes day/hour/minute) so price-less items keyed by reset.interval can be disambiguated.
Match items with this interval\_count. Disambiguates between items that share an interval but differ in count.
Match items whose grant equals this included usage. Omitted is a wildcard.
License links to drop, keyed by license\_plan\_id. Parallel to remove\_items.
The feature quantity selections associated with this plan change.
The ID of the adjustable feature included in this change.
The quantity that will apply for this feature in the change.
When this change takes effect, in milliseconds since the Unix epoch, or null if it applies immediately.
When this plan was canceled, in milliseconds since the Unix epoch, or null if it is not canceled.
When this plan expires, in milliseconds since the Unix epoch, or null if it does not expire.
Products or subscription changes being removed or ended.
The ID of the plan affected by this preview change.
The full plan object if it was expanded in the response.
Unique identifier for the plan.
Display name of the plan.
Optional description of the plan.
Group identifier for organizing related plans. Plans in the same group are mutually exclusive.
Version number of the plan. Incremented when plan configuration changes.
User-facing version identity. Defaults to v\{n} when the version is minted.
Whether this is the active version of the plan. At most one version is active.
Whether this is an add-on plan that can be attached alongside a main plan.
If true, this plan is automatically attached when a customer is created. Used for free plans.
Base recurring price for the plan. Null for free plans or usage-only plans.
Base price amount for the plan, in major currency units (e.g. dollars).
Base price amounts in additional currencies. The base 'amount' is in the org's default currency.
Three-letter Stripe-supported currency code (e.g. 'eur', 'gbp').
Price amount in this currency. Set explicitly per currency, not converted from the base amount.
Billing interval (e.g. 'month', 'year').
Number of intervals per billing cycle. Defaults to 1.
Display text for showing this price in pricing pages.
Main display text (e.g. '\$10' or '100 messages').
Secondary display text (e.g. 'per month' or 'then \$0.5 per 100').
Payment processors this base price is connected to. Omitted when unset.
Stripe price ID. For prepaid with included > 0 this is the V2 price.
Feature configurations included in this plan. Each item defines included units, pricing, and reset behavior for a feature.
Bills this many feature units when outstanding overage reaches it.
The ID of the feature this item configures.
The full feature object if expanded.
The ID of the feature, used to refer to it in other API calls like /track or /check.
The name of the feature.
The type of the feature
Singular and plural display names for the feature.
The singular display name for the feature.
The plural display name for the feature.
Credit cost schema for credit system features.
The ID of the metered feature (should be a single\_use feature).
The credit cost of the metered feature.
Whether or not the feature is archived.
Number of free units included. For consumable features, balance resets to this number each interval.
Whether the customer has unlimited access to this feature.
Whether entity-level grants contribute to a shared customer balance.
Reset configuration for consumable features. Null for non-consumable features like seats where usage persists across billing cycles.
The interval at which the feature balance resets (e.g. 'month', 'year'). For consumable features, usage resets to 0 and included units are restored.
Number of intervals between resets. Defaults to 1.
Pricing configuration for usage beyond included units. Null if feature is entirely free.
Price per billing\_units after included usage is consumed. Mutually exclusive with tiers.
Amounts in additional currencies for this flat price. The base 'amount' is in the org's default currency. Only valid with 'amount', not 'tiers' (tiered prices carry per-currency amounts on each tier).
Three-letter Stripe-supported currency code (e.g. 'eur', 'gbp').
Price amount in this currency. Set explicitly per currency, not converted from the base amount.
Tiered pricing configuration. Each tier's 'to' INCLUDES the included amount. Either 'tiers' or 'amount' is required.
Three-letter Stripe-supported currency code (e.g. 'eur', 'gbp').
Per-unit amount for this tier in this currency.
Flat amount for this tier in this currency, if the tier uses one.
Billing interval for this price. For consumable features, should match reset.interval.
Number of intervals per billing cycle. Defaults to 1.
Number of units per price increment. Usage is rounded UP to the nearest billing\_units when billed (e.g. billing\_units=100 means 101 usage rounds to 200).
'prepaid' for features like seats where customers pay upfront, 'usage\_based' for pay-as-you-go after included usage.
Maximum units a customer can purchase beyond included. E.g. if included=100 and max\_purchase=300, customer can use up to 400 total before usage is capped. Null for no limit.
Payment processors this item price is connected to. Omitted when unset.
Stripe price ID. For prepaid with included > 0 this is the V2 price.
Display text for showing this item in pricing pages.
Main display text (e.g. '\$10' or '100 messages').
Secondary display text (e.g. 'per month' or 'then \$0.5 per 100').
Rollover configuration for unused units. If set, unused included units roll over to the next period.
Maximum rollover units. Null for unlimited rollover.
Maximum rollover as a percentage (0-100) of included + prepaid grant. Mutually exclusive with max.
When rolled over units expire.
Number of periods before expiry.
Overrides fields of this item's feature for customers on this plan (e.g. a credit system's credit\_schema).
For credit system features: replaces the feature's credit\_schema entirely for customers on this plan.
ID of the metered feature that draws from this credit system.
Number of metered-feature units priced together. Defaults to one when omitted.
Named rates chosen by event properties. The most specific match sets the rate; with no match the item's own rate applies.
Event properties this entry applies to. Every key must equal the tracked property, compared as strings.
Breaks ties between dimensions that match the same number of keys. Higher wins.
Inclusive upper usage boundary for this graduated tier. The final tier must be 'inf'.
Credits consumed per billing-unit group within this tier.
Named adjustments chosen by event properties. Every match applies: factors multiply, then adds are summed.
Event properties this entry applies to. Every key must equal the tracked property, compared as strings.
Multiplies the matched rate. All matching multipliers stack.
Added to the rate after every factor is applied, in credits per billing-unit group.
Inclusive upper usage boundary for this graduated tier. The final tier must be 'inf'.
Credits consumed per billing-unit group within this tier.
Credits consumed per billing-unit group.
For AI credit system features: replaces the feature's markup chain entirely for customers on this plan. An unset level means no markup at that level rather than inheriting the feature's.
Default percentage markup for customers on this plan. Use -100 to make usage free.
Per-provider markup percentages for customers on this plan.
Per-model markup overrides for customers on this plan.
Payment processors this plan is connected to. Omitted when unset.
Stripe product ID this plan is billed under.
Extra Stripe product IDs aliased to this plan.
Every RevenueCat product that maps to this plan. Replaces the current set.
RevenueCat product ID that grants this plan when purchased.
Prepaid quantities granted when this specific RevenueCat product is purchased, in feature units.
Free trial configuration. If set, new customers can try this plan before being charged.
Number of duration\_type periods the trial lasts.
Unit of time for the trial duration ('day', 'month', 'year').
Whether a payment method is required to start the trial. If true, customer will be charged after trial ends.
Behavior when the trial ends. 'bill' charges the customer (default). 'revert' expires the trial and restores the customer's previous plan.
Unix timestamp (ms) when the plan was created.
Environment this plan belongs to ('sandbox' or 'live').
Whether the plan is archived. Archived plans cannot be attached to new customers.
Miscellaneous plan-level configuration flags.
If true, entitlements attached to this plan will still reset on schedule even when the customer's product is in a past\_due state.
Plan-level billing controls used as customer defaults.
List of auto top-up configurations per feature.
The ID of the feature (credit balance) to auto top-up.
Whether auto top-up is enabled.
When the balance drops below this threshold, an auto top-up will be purchased.
Amount of credits to add per auto top-up.
Optional rate limit to cap how often auto top-ups occur.
The time interval for the purchase limit window.
Number of intervals in the purchase limit window.
Maximum number of auto top-ups allowed within the interval.
When true, auto top-up creates a send\_invoice invoice instead of auto-charging.
List of overage spend limits per feature (caps overage spend).
Optional feature ID this spend limit applies to.
Whether the overage spend limit is enabled.
How overage\_limit is interpreted: an absolute overage cap (default) or a percentage of the main-plan allowance.
Overage cap for the feature: absolute units, or a percent (e.g. 120) when limit\_type is usage\_percentage.
When true, overage for this feature is not posted to Stripe. Usage tracking and balance resets still behave normally.
List of hard usage caps per feature (max units per interval).
The feature this usage limit applies to.
Whether this usage limit is enabled.
Maximum units allowed per interval.
Interval for the cap, aligned to the customer's billing cycle.
Window alignment. 'billing\_cycle' phases the interval to the customer's renewal time; 'utc' aligns to the UTC calendar.
When set, only usage from events whose properties match counts toward this cap. Omit to count all usage of the feature.
List of usage alert configurations per feature.
The feature ID this alert applies to.
Whether this usage alert is enabled.
The threshold value that triggers the alert. For usage or remaining, this is an absolute count. For usage\_percentage or remaining\_percentage, this is a percentage (0-100).
Whether the threshold is an absolute count or a percentage of the usage allowance or remaining balance.
What 100% means. balance: every grant on the feature. included: the plan allowance only. recurring: grants that reset. usage\_limit: the cap of the usage limit with the same feature and filter.
Only valid with basis usage\_limit. Points the alert at the usage limit carrying the same filter.
Optional user-defined label to distinguish multiple alerts on the same feature.
List of overage allowed controls per feature. When enabled, usage can exceed balance.
The feature ID this overage allowed control applies to.
Whether overage is allowed for this feature.
Arbitrary key-value metadata defined by you for your own use. Shared across all versions of the plan.
Whether the trial on this plan is available to this customer. For example, if the customer used the trial in the past, this will be false.
The customer's current status with this plan. 'active' if attached, 'scheduled' if pending activation.
Whether the customer's active instance of this plan is set to cancel.
Whether the customer is currently on a free trial of this plan.
The action that would occur if this plan were attached to the customer.
Deprecated. Use variant\_details.base\_plan\_id instead. If this is a variant, the ID of the base plan it was created from.
Details about how this variant relates to its latest base plan.
The ID of the base plan this variant was derived from.
The customization that transforms the base plan into this variant.
Base price configuration for a plan.
Base price amount for the plan, in major currency units (e.g. dollars).
Billing interval (e.g. 'month', 'year').
Number of intervals per billing cycle. Defaults to 1.
Base price amounts in additional currencies. The base 'amount' is in the org's default currency.
Three-letter Stripe-supported currency code (e.g. 'eur', 'gbp').
Price amount in this currency. Set explicitly per currency, not converted from the base amount.
Items to add to the plan.
Bills this many feature units when outstanding overage reaches it.
The ID of the feature to configure.
Number of free units included. Balance resets to this each interval for consumable features.
If true, customer has unlimited access to this feature.
Whether entity-level grants contribute to a shared customer balance.
Reset configuration for consumable features. Omit for non-consumable features like seats.
Interval at which balance resets (e.g. 'month', 'year'). For consumable features only.
Number of intervals between resets. Defaults to 1.
Pricing for usage beyond included units. Omit for free features.
Price per billing\_units after included usage. Either 'amount' or 'tiers' is required.
Amounts in additional currencies for this flat price. The base 'amount' is in the org's default currency. Only valid with 'amount', not 'tiers'.
Three-letter Stripe-supported currency code (e.g. 'eur', 'gbp').
Price amount in this currency. Set explicitly per currency, not converted from the base amount.
Tiered pricing. Either 'amount' or 'tiers' is required.
Three-letter Stripe-supported currency code (e.g. 'eur', 'gbp').
Per-unit amount for this tier in this currency.
Flat amount for this tier in this currency, if the tier uses one.
Billing interval. For consumable features, should match reset.interval.
Number of intervals per billing cycle. Defaults to 1.
Units per price increment. Usage is rounded UP when billed (e.g. billing\_units=100 means 101 rounds to 200).
'prepaid' for upfront payment (seats), 'usage\_based' for pay-as-you-go.
Max units purchasable beyond included. E.g. included=100, max\_purchase=300 allows 400 total. Null for no limit.
Proration settings for prepaid features. Controls mid-cycle quantity change billing.
Billing behavior when quantity increases mid-cycle.
Credit behavior when quantity decreases mid-cycle.
Rollover config for unused units. If set, unused included units carry over.
Max rollover units. Omit for unlimited rollover.
Maximum rollover as a percentage (0-100) of included + prepaid grant. Mutually exclusive with max.
When rolled over units expire.
Number of periods before expiry.
Overrides fields of this item's feature for customers on this plan (e.g. a credit system's credit\_schema).
For credit system features: replaces the feature's credit\_schema entirely for customers on this plan.
ID of the metered feature that draws from this credit system.
Number of metered-feature units priced together. Defaults to one when omitted.
Named rates chosen by event properties. The most specific match sets the rate; with no match the item's own rate applies.
Event properties this entry applies to. Every key must equal the tracked property, compared as strings.
Breaks ties between dimensions that match the same number of keys. Higher wins.
Inclusive upper usage boundary for this graduated tier. The final tier must be 'inf'.
Credits consumed per billing-unit group within this tier.
Named adjustments chosen by event properties. Every match applies: factors multiply, then adds are summed.
Event properties this entry applies to. Every key must equal the tracked property, compared as strings.
Multiplies the matched rate. All matching multipliers stack.
Added to the rate after every factor is applied, in credits per billing-unit group.
Inclusive upper usage boundary for this graduated tier. The final tier must be 'inf'.
Credits consumed per billing-unit group within this tier.
Credits consumed per billing-unit group.
For AI credit system features: replaces the feature's markup chain entirely for customers on this plan. An unset level means no markup at that level rather than inheriting the feature's.
Default percentage markup for customers on this plan. Use -100 to make usage free.
Per-provider markup percentages for customers on this plan.
Per-model markup overrides for customers on this plan.
Filters selecting items to remove from the plan.
Match items linked to this feature.
Match items with this billing method (prepaid or usage\_based).
Match items with this interval. Accepts either a BillingInterval (price-side) or a ResetInterval (reset-side, includes day/hour/minute) so price-less items keyed by reset.interval can be disambiguated.
Match items with this interval\_count. Disambiguates between items that share an interval but differ in count.
Match items whose grant equals this included usage. Omitted is a wildcard.
Free trial configuration for a plan.
Number of duration\_type periods the trial lasts.
Unit of time for the trial ('day', 'month', 'year').
If true, a payment method is required to start the trial and the customer is charged when it ends. Defaults to false.
Behavior when the trial ends. 'bill' charges the customer (default). 'revert' expires the trial and restores the customer's previous plan.
Override the plan's billing controls (auto top-ups, spend limits, usage limits, usage alerts, overage allowed) for this customer.
List of auto top-up configurations per feature.
The ID of the feature (credit balance) to auto top-up.
Whether auto top-up is enabled.
When the balance drops below this threshold, an auto top-up will be purchased.
Amount of credits to add per auto top-up.
Optional rate limit to cap how often auto top-ups occur. Pass count to set the current window's consumed top-ups.
The time interval for the purchase limit window.
Number of intervals in the purchase limit window.
Maximum number of auto top-ups allowed within the interval.
Set the current window's consumed auto top-up count. Omit to leave runtime state unchanged.
When true, auto top-up creates a send\_invoice invoice instead of auto-charging.
List of overage spend limits per feature (caps overage spend).
Optional feature ID this spend limit applies to.
Whether the overage spend limit is enabled.
How overage\_limit is interpreted: an absolute overage cap (default) or a percentage of the main-plan allowance.
Overage cap for the feature: absolute units, or a percent (e.g. 120) when limit\_type is usage\_percentage.
When true, overage for this feature is not posted to Stripe. Usage tracking and balance resets still behave normally.
List of hard usage caps per feature (max units per interval).
The feature this usage limit applies to.
Whether this usage limit is enabled.
Maximum units allowed per interval.
Interval for the cap, aligned to the customer's billing cycle.
Window alignment. 'billing\_cycle' phases the interval to the customer's renewal time; 'utc' aligns to the UTC calendar.
When set, only usage from events whose properties match counts toward this cap. Omit to count all usage of the feature.
List of usage alert configurations per feature.
The feature ID this alert applies to.
Whether this usage alert is enabled.
The threshold value that triggers the alert. For usage or remaining, this is an absolute count. For usage\_percentage or remaining\_percentage, this is a percentage (0-100).
Whether the threshold is an absolute count or a percentage of the usage allowance or remaining balance.
What 100% means. balance: every grant on the feature. included: the plan allowance only. recurring: grants that reset. usage\_limit: the cap of the usage limit with the same feature and filter.
Only valid with basis usage\_limit. Points the alert at the usage limit carrying the same filter.
Optional user-defined label to distinguish multiple alerts on the same feature.
List of overage allowed controls per feature. When enabled, usage can exceed balance.
The feature ID this overage allowed control applies to.
Whether overage is allowed for this feature.
License links to add or override for this customer, keyed by license\_plan\_id. Omitted fields inherit the plan catalog link (included defaults to 1 when the license is not in the catalog). A bare entry restores the license to pure catalog inheritance.
Base price configuration for a plan.
Base price amount for the plan, in major currency units (e.g. dollars).
Billing interval (e.g. 'month', 'year').
Number of intervals per billing cycle. Defaults to 1.
Base price amounts in additional currencies. The base 'amount' is in the org's default currency.
Three-letter Stripe-supported currency code (e.g. 'eur', 'gbp').
Price amount in this currency. Set explicitly per currency, not converted from the base amount.
Bills this many feature units when outstanding overage reaches it.
The ID of the feature to configure.
Number of free units included. Balance resets to this each interval for consumable features.
If true, customer has unlimited access to this feature.
Whether entity-level grants contribute to a shared customer balance.
Reset configuration for consumable features. Omit for non-consumable features like seats.
Interval at which balance resets (e.g. 'month', 'year'). For consumable features only.
Number of intervals between resets. Defaults to 1.
Pricing for usage beyond included units. Omit for free features.
Price per billing\_units after included usage. Either 'amount' or 'tiers' is required.
Amounts in additional currencies for this flat price. The base 'amount' is in the org's default currency. Only valid with 'amount', not 'tiers'.
Three-letter Stripe-supported currency code (e.g. 'eur', 'gbp').
Price amount in this currency. Set explicitly per currency, not converted from the base amount.
Tiered pricing. Either 'amount' or 'tiers' is required.
Three-letter Stripe-supported currency code (e.g. 'eur', 'gbp').
Per-unit amount for this tier in this currency.
Flat amount for this tier in this currency, if the tier uses one.
Billing interval. For consumable features, should match reset.interval.
Number of intervals per billing cycle. Defaults to 1.
Units per price increment. Usage is rounded UP when billed (e.g. billing\_units=100 means 101 rounds to 200).
'prepaid' for upfront payment (seats), 'usage\_based' for pay-as-you-go.
Max units purchasable beyond included. E.g. included=100, max\_purchase=300 allows 400 total. Null for no limit.
Proration settings for prepaid features. Controls mid-cycle quantity change billing.
Billing behavior when quantity increases mid-cycle.
Credit behavior when quantity decreases mid-cycle.
Rollover config for unused units. If set, unused included units carry over.
Max rollover units. Omit for unlimited rollover.
Maximum rollover as a percentage (0-100) of included + prepaid grant. Mutually exclusive with max.
When rolled over units expire.
Number of periods before expiry.
Overrides fields of this item's feature for customers on this plan (e.g. a credit system's credit\_schema).
For credit system features: replaces the feature's credit\_schema entirely for customers on this plan.
ID of the metered feature that draws from this credit system.
Number of metered-feature units priced together. Defaults to one when omitted.
Named rates chosen by event properties. The most specific match sets the rate; with no match the item's own rate applies.
Event properties this entry applies to. Every key must equal the tracked property, compared as strings.
Breaks ties between dimensions that match the same number of keys. Higher wins.
Inclusive upper usage boundary for this graduated tier. The final tier must be 'inf'.
Credits consumed per billing-unit group within this tier.
Named adjustments chosen by event properties. Every match applies: factors multiply, then adds are summed.
Event properties this entry applies to. Every key must equal the tracked property, compared as strings.
Multiplies the matched rate. All matching multipliers stack.
Added to the rate after every factor is applied, in credits per billing-unit group.
Inclusive upper usage boundary for this graduated tier. The final tier must be 'inf'.
Credits consumed per billing-unit group within this tier.
Credits consumed per billing-unit group.
For AI credit system features: replaces the feature's markup chain entirely for customers on this plan. An unset level means no markup at that level rather than inheriting the feature's.
Default percentage markup for customers on this plan. Use -100 to make usage free.
Per-provider markup percentages for customers on this plan.
Per-model markup overrides for customers on this plan.
Match items linked to this feature.
Match items with this billing method (prepaid or usage\_based).
Match items with this interval. Accepts either a BillingInterval (price-side) or a ResetInterval (reset-side, includes day/hour/minute) so price-less items keyed by reset.interval can be disambiguated.
Match items with this interval\_count. Disambiguates between items that share an interval but differ in count.
Match items whose grant equals this included usage. Omitted is a wildcard.
License links to drop, keyed by license\_plan\_id. Parallel to remove\_items.
The feature quantity selections associated with this plan change.
The ID of the adjustable feature included in this change.
The quantity that will apply for this feature in the change.
When this change takes effect, in milliseconds since the Unix epoch, or null if it applies immediately.
When this plan was canceled, in milliseconds since the Unix epoch, or null if it is not canceled.
When this plan expires, in milliseconds since the Unix epoch, or null if it does not expire.
The IDs of the plans updated on this subscription.
```json 200 theme={null}
{
"customer_id": "cus_123",
"currency": "usd",
"total": -40,
"subscriptions": [
{
"customerId": "charles",
"lineItems": [
{
"display_name": "Pro seed",
"description": "Pro seed - Base Price (from 18 Feb 2026 to 18 Mar 2026)",
"subtotal": 20,
"total": 20,
"discounts": []
}
],
"subtotal": -20,
"total": -20,
"currency": "usd",
"plan_ids": [
"pro_plan"
]
},
{
"customerId": "charles",
"lineItems": [
{
"display_name": "Pro seed",
"description": "Pro seed - Base Price (from 18 Feb 2026 to 18 Mar 2026)",
"subtotal": 20,
"total": 20,
"discounts": []
}
],
"subtotal": -20,
"total": -20,
"currency": "usd",
"plan_ids": [
"addon_seats"
]
}
]
}
```
# Preview Update
Source: https://docs.useautumn.com/api-reference/billing/previewUpdate
openapi POST /v1/billing.preview_update
Previews the billing changes that would occur when updating a subscription, without actually making any changes.
Use this endpoint to show customers prorated charges or refunds before confirming subscription modifications.
### Body Parameters
The ID of the customer to attach the plan to.
The ID of the entity to attach the plan to.
The ID of the plan to update. Optional if subscription\_id is provided, or if the customer has only one product.
If this plan contains prepaid features, use this field to specify the quantity of each prepaid feature. This quantity includes the included amount and billing units defined when setting up the plan.
The ID of the feature to set quantity for.
The quantity of the feature.
Whether the customer can adjust the quantity.
The version of the plan to attach.
Free trial configuration for a plan.
Number of duration\_type periods the trial lasts.
Unit of time for the trial ('day', 'month', 'year').
If true, a payment method is required to start the trial and the customer is charged when it ends. Defaults to false.
Behavior when the trial ends. 'bill' charges the customer (default). 'revert' expires the trial and restores the customer's previous plan.
Customize the plan to attach. Can override the price, items, licenses, free trial, or a combination.
Base price configuration for a plan.
Base price amount for the plan, in major currency units (e.g. dollars).
Billing interval (e.g. 'month', 'year').
Number of intervals per billing cycle. Defaults to 1.
Base price amounts in additional currencies. The base 'amount' is in the org's default currency.
Three-letter Stripe-supported currency code (e.g. 'eur', 'gbp').
Price amount in this currency. Set explicitly per currency, not converted from the base amount.
Override the items in the plan (PUT-style — replaces all existing items). Mutually exclusive with add\_items / remove\_items / deprecated update\_items.
Bills this many feature units when outstanding overage reaches it.
The ID of the feature to configure.
Number of free units included. Balance resets to this each interval for consumable features.
If true, customer has unlimited access to this feature.
Whether entity-level grants contribute to a shared customer balance.
Reset configuration for consumable features. Omit for non-consumable features like seats.
Interval at which balance resets (e.g. 'month', 'year'). For consumable features only.
Number of intervals between resets. Defaults to 1.
Pricing for usage beyond included units. Omit for free features.
Price per billing\_units after included usage. Either 'amount' or 'tiers' is required.
Amounts in additional currencies for this flat price. The base 'amount' is in the org's default currency. Only valid with 'amount', not 'tiers'.
Three-letter Stripe-supported currency code (e.g. 'eur', 'gbp').
Price amount in this currency. Set explicitly per currency, not converted from the base amount.
Tiered pricing. Either 'amount' or 'tiers' is required.
Per-currency amounts for this tier. Tier boundaries ('to') are shared across all currencies.
Three-letter Stripe-supported currency code (e.g. 'eur', 'gbp').
Per-unit amount for this tier in this currency.
Flat amount for this tier in this currency, if the tier uses one.
Billing interval. For consumable features, should match reset.interval.
Number of intervals per billing cycle. Defaults to 1.
Units per price increment. Usage is rounded UP when billed (e.g. billing\_units=100 means 101 rounds to 200).
'prepaid' for upfront payment (seats), 'usage\_based' for pay-as-you-go.
Max units purchasable beyond included. E.g. included=100, max\_purchase=300 allows 400 total. Null for no limit.
Proration settings for prepaid features. Controls mid-cycle quantity change billing.
Billing behavior when quantity increases mid-cycle.
Credit behavior when quantity decreases mid-cycle.
Rollover config for unused units. If set, unused included units carry over.
Max rollover units. Omit for unlimited rollover.
Maximum rollover as a percentage (0-100) of included + prepaid grant. Mutually exclusive with max.
When rolled over units expire.
Number of periods before expiry.
Overrides fields of this item's feature for customers on this plan (e.g. a credit system's credit\_schema).
For credit system features: replaces the feature's credit\_schema entirely for customers on this plan.
ID of the metered feature that draws from this credit system.
Number of metered-feature units priced together. Defaults to one when omitted.
Named rates chosen by event properties. The most specific match sets the rate; with no match the item's own rate applies.
Event properties this entry applies to. Every key must equal the tracked property, compared as strings.
Breaks ties between dimensions that match the same number of keys. Higher wins.
Inclusive upper usage boundary for this graduated tier. The final tier must be 'inf'.
Credits consumed per billing-unit group within this tier.
Named adjustments chosen by event properties. Every match applies: factors multiply, then adds are summed.
Event properties this entry applies to. Every key must equal the tracked property, compared as strings.
Multiplies the matched rate. All matching multipliers stack.
Added to the rate after every factor is applied, in credits per billing-unit group.
Inclusive upper usage boundary for this graduated tier. The final tier must be 'inf'.
Credits consumed per billing-unit group within this tier.
Credits consumed per billing-unit group.
For AI credit system features: replaces the feature's markup chain entirely for customers on this plan. An unset level means no markup at that level rather than inheriting the feature's.
Default percentage markup for customers on this plan. Use -100 to make usage free.
Per-provider markup percentages for customers on this plan.
Per-model markup overrides for customers on this plan.
Items to add to the plan.
Bills this many feature units when outstanding overage reaches it.
The ID of the feature to configure.
Number of free units included. Balance resets to this each interval for consumable features.
If true, customer has unlimited access to this feature.
Whether entity-level grants contribute to a shared customer balance.
Reset configuration for consumable features. Omit for non-consumable features like seats.
Interval at which balance resets (e.g. 'month', 'year'). For consumable features only.
Number of intervals between resets. Defaults to 1.
Pricing for usage beyond included units. Omit for free features.
Price per billing\_units after included usage. Either 'amount' or 'tiers' is required.
Amounts in additional currencies for this flat price. The base 'amount' is in the org's default currency. Only valid with 'amount', not 'tiers'.
Three-letter Stripe-supported currency code (e.g. 'eur', 'gbp').
Price amount in this currency. Set explicitly per currency, not converted from the base amount.
Tiered pricing. Either 'amount' or 'tiers' is required.
Per-currency amounts for this tier. Tier boundaries ('to') are shared across all currencies.
Three-letter Stripe-supported currency code (e.g. 'eur', 'gbp').
Per-unit amount for this tier in this currency.
Flat amount for this tier in this currency, if the tier uses one.
Billing interval. For consumable features, should match reset.interval.
Number of intervals per billing cycle. Defaults to 1.
Units per price increment. Usage is rounded UP when billed (e.g. billing\_units=100 means 101 rounds to 200).
'prepaid' for upfront payment (seats), 'usage\_based' for pay-as-you-go.
Max units purchasable beyond included. E.g. included=100, max\_purchase=300 allows 400 total. Null for no limit.
Proration settings for prepaid features. Controls mid-cycle quantity change billing.
Billing behavior when quantity increases mid-cycle.
Credit behavior when quantity decreases mid-cycle.
Rollover config for unused units. If set, unused included units carry over.
Max rollover units. Omit for unlimited rollover.
Maximum rollover as a percentage (0-100) of included + prepaid grant. Mutually exclusive with max.
When rolled over units expire.
Number of periods before expiry.
Overrides fields of this item's feature for customers on this plan (e.g. a credit system's credit\_schema).
For credit system features: replaces the feature's credit\_schema entirely for customers on this plan.
ID of the metered feature that draws from this credit system.
Number of metered-feature units priced together. Defaults to one when omitted.
Named rates chosen by event properties. The most specific match sets the rate; with no match the item's own rate applies.
Event properties this entry applies to. Every key must equal the tracked property, compared as strings.
Breaks ties between dimensions that match the same number of keys. Higher wins.
Inclusive upper usage boundary for this graduated tier. The final tier must be 'inf'.
Credits consumed per billing-unit group within this tier.
Named adjustments chosen by event properties. Every match applies: factors multiply, then adds are summed.
Event properties this entry applies to. Every key must equal the tracked property, compared as strings.
Multiplies the matched rate. All matching multipliers stack.
Added to the rate after every factor is applied, in credits per billing-unit group.
Inclusive upper usage boundary for this graduated tier. The final tier must be 'inf'.
Credits consumed per billing-unit group within this tier.
Credits consumed per billing-unit group.
For AI credit system features: replaces the feature's markup chain entirely for customers on this plan. An unset level means no markup at that level rather than inheriting the feature's.
Default percentage markup for customers on this plan. Use -100 to make usage free.
Per-provider markup percentages for customers on this plan.
Per-model markup overrides for customers on this plan.
Filters selecting items to remove from the plan.
Match items linked to this feature.
Match items with this billing method (prepaid or usage\_based).
Match items with this interval. Accepts either a BillingInterval (price-side) or a ResetInterval (reset-side, includes day/hour/minute) so price-less items keyed by reset.interval can be disambiguated.
Match items with this interval\_count. Disambiguates between items that share an interval but differ in count.
Match items whose grant equals this included usage. Omitted is a wildcard.
Free trial configuration for a plan.
Number of duration\_type periods the trial lasts.
Unit of time for the trial ('day', 'month', 'year').
If true, a payment method is required to start the trial and the customer is charged when it ends. Defaults to false.
Behavior when the trial ends. 'bill' charges the customer (default). 'revert' expires the trial and restores the customer's previous plan.
Override the plan's billing controls (auto top-ups, spend limits, usage limits, usage alerts, overage allowed) for this customer.
List of auto top-up configurations per feature.
The ID of the feature (credit balance) to auto top-up.
Whether auto top-up is enabled.
When the balance drops below this threshold, an auto top-up will be purchased.
Amount of credits to add per auto top-up.
Optional rate limit to cap how often auto top-ups occur. Pass count to set the current window's consumed top-ups.
The time interval for the purchase limit window.
Number of intervals in the purchase limit window.
Maximum number of auto top-ups allowed within the interval.
Set the current window's consumed auto top-up count. Omit to leave runtime state unchanged.
When true, auto top-up creates a send\_invoice invoice instead of auto-charging.
List of overage spend limits per feature (caps overage spend).
Optional feature ID this spend limit applies to.
Whether the overage spend limit is enabled.
How overage\_limit is interpreted: an absolute overage cap (default) or a percentage of the main-plan allowance.
Overage cap for the feature: absolute units, or a percent (e.g. 120) when limit\_type is usage\_percentage.
When true, overage for this feature is not posted to Stripe. Usage tracking and balance resets still behave normally.
List of hard usage caps per feature (max units per interval).
The feature this usage limit applies to.
Whether this usage limit is enabled.
Maximum units allowed per interval.
Interval for the cap, aligned to the customer's billing cycle.
Window alignment. 'billing\_cycle' phases the interval to the customer's renewal time; 'utc' aligns to the UTC calendar.
When set, only usage from events whose properties match counts toward this cap. Omit to count all usage of the feature.
List of usage alert configurations per feature.
The feature ID this alert applies to.
Whether this usage alert is enabled.
The threshold value that triggers the alert. For usage or remaining, this is an absolute count. For usage\_percentage or remaining\_percentage, this is a percentage (0-100).
Whether the threshold is an absolute count or a percentage of the usage allowance or remaining balance.
What 100% means. balance: every grant on the feature. included: the plan allowance only. recurring: grants that reset. usage\_limit: the cap of the usage limit with the same feature and filter.
Only valid with basis usage\_limit. Points the alert at the usage limit carrying the same filter.
Optional user-defined label to distinguish multiple alerts on the same feature.
List of overage allowed controls per feature. When enabled, usage can exceed balance.
The feature ID this overage allowed control applies to.
Whether overage is allowed for this feature.
License links to add or override for this customer, keyed by license\_plan\_id. Omitted fields inherit the plan catalog link (included defaults to 1 when the license is not in the catalog). A bare entry restores the license to pure catalog inheritance.
Base price configuration for a plan.
Base price amount for the plan, in major currency units (e.g. dollars).
Billing interval (e.g. 'month', 'year').
Number of intervals per billing cycle. Defaults to 1.
Base price amounts in additional currencies. The base 'amount' is in the org's default currency.
Three-letter Stripe-supported currency code (e.g. 'eur', 'gbp').
Price amount in this currency. Set explicitly per currency, not converted from the base amount.
Bills this many feature units when outstanding overage reaches it.
The ID of the feature to configure.
Number of free units included. Balance resets to this each interval for consumable features.
If true, customer has unlimited access to this feature.
Whether entity-level grants contribute to a shared customer balance.
Reset configuration for consumable features. Omit for non-consumable features like seats.
Interval at which balance resets (e.g. 'month', 'year'). For consumable features only.
Number of intervals between resets. Defaults to 1.
Pricing for usage beyond included units. Omit for free features.
Price per billing\_units after included usage. Either 'amount' or 'tiers' is required.
Amounts in additional currencies for this flat price. The base 'amount' is in the org's default currency. Only valid with 'amount', not 'tiers'.
Three-letter Stripe-supported currency code (e.g. 'eur', 'gbp').
Price amount in this currency. Set explicitly per currency, not converted from the base amount.
Tiered pricing. Either 'amount' or 'tiers' is required.
Per-currency amounts for this tier. Tier boundaries ('to') are shared across all currencies.
Three-letter Stripe-supported currency code (e.g. 'eur', 'gbp').
Per-unit amount for this tier in this currency.
Flat amount for this tier in this currency, if the tier uses one.
Billing interval. For consumable features, should match reset.interval.
Number of intervals per billing cycle. Defaults to 1.
Units per price increment. Usage is rounded UP when billed (e.g. billing\_units=100 means 101 rounds to 200).
'prepaid' for upfront payment (seats), 'usage\_based' for pay-as-you-go.
Max units purchasable beyond included. E.g. included=100, max\_purchase=300 allows 400 total. Null for no limit.
Proration settings for prepaid features. Controls mid-cycle quantity change billing.
Billing behavior when quantity increases mid-cycle.
Credit behavior when quantity decreases mid-cycle.
Rollover config for unused units. If set, unused included units carry over.
Max rollover units. Omit for unlimited rollover.
Maximum rollover as a percentage (0-100) of included + prepaid grant. Mutually exclusive with max.
When rolled over units expire.
Number of periods before expiry.
Overrides fields of this item's feature for customers on this plan (e.g. a credit system's credit\_schema).
For credit system features: replaces the feature's credit\_schema entirely for customers on this plan.
ID of the metered feature that draws from this credit system.
Number of metered-feature units priced together. Defaults to one when omitted.
Named rates chosen by event properties. The most specific match sets the rate; with no match the item's own rate applies.
Event properties this entry applies to. Every key must equal the tracked property, compared as strings.
Breaks ties between dimensions that match the same number of keys. Higher wins.
Inclusive upper usage boundary for this graduated tier. The final tier must be 'inf'.
Credits consumed per billing-unit group within this tier.
Named adjustments chosen by event properties. Every match applies: factors multiply, then adds are summed.
Event properties this entry applies to. Every key must equal the tracked property, compared as strings.
Multiplies the matched rate. All matching multipliers stack.
Added to the rate after every factor is applied, in credits per billing-unit group.
Inclusive upper usage boundary for this graduated tier. The final tier must be 'inf'.
Credits consumed per billing-unit group within this tier.
Credits consumed per billing-unit group.
For AI credit system features: replaces the feature's markup chain entirely for customers on this plan. An unset level means no markup at that level rather than inheriting the feature's.
Default percentage markup for customers on this plan. Use -100 to make usage free.
Per-provider markup percentages for customers on this plan.
Per-model markup overrides for customers on this plan.
Match items linked to this feature.
Match items with this billing method (prepaid or usage\_based).
Match items with this interval. Accepts either a BillingInterval (price-side) or a ResetInterval (reset-side, includes day/hour/minute) so price-less items keyed by reset.interval can be disambiguated.
Match items with this interval\_count. Disambiguates between items that share an interval but differ in count.
Match items whose grant equals this included usage. Omitted is a wildcard.
License links to drop, keyed by license\_plan\_id. Parallel to remove\_items.
Invoice mode creates a draft or open invoice and sends it to the customer, instead of charging their card immediately. This uses Stripe's send\_invoice collection method.
When true, creates an invoice and sends it to the customer instead of charging their card immediately. Uses Stripe's send\_invoice collection method.
If true, enables the plan immediately even though the invoice is not paid yet.
If true, finalizes the invoice so it can be sent to the customer. If false, keeps it as a draft for manual review.
ID of an invoice template (configured in billing settings) whose footer (e.g. bank details) is applied to the invoice.
Number of days the customer has to pay the invoice before it is due (Stripe days\_until\_due).
How to handle proration when updating an existing subscription. 'prorate\_immediately' charges/credits prorated amounts now, 'none' skips creating any charges.
Controls when to return a checkout URL. 'always' returns a URL even if payment succeeds, 'if\_required' only when payment action is needed, 'never' disables redirects.
A unique ID to identify this subscription. Can be used to target specific subscriptions in update operations when a customer has multiple products with the same plan.
List of discounts to apply. Each discount can be an Autumn reward ID, Stripe coupon ID, or Stripe promotion code.
The ID of the reward to apply as a discount.
The promotion code to apply as a discount.
Action to perform for cancellation. 'cancel\_immediately' cancels now with prorated refund, 'cancel\_end\_of\_cycle' cancels at period end, 'uncancel' reverses a pending cancellation.
Reset the billing cycle immediately with 'now', or schedule a reset at a future Unix timestamp in milliseconds.
If true, the subscription is updated internally without applying billing changes in Stripe.
Controls how the last payment is refunded on immediate cancellation. 'prorated' refunds the unused portion, 'full' refunds the entire last payment.
Additional parameters to pass into the Stripe subscription update or cancel call.
Controls whether balances should be recalculated during the subscription update.
If true, recalculates balances during the subscription update. Only applicable when updating feature quantities.
Whether to carry over usages from the previous plan.
Whether to carry over usages from the previous plan.
The IDs of the features to carry over usages for. If left undefined, all consumable features will be carried over.
Total seat quantities (inclusive of the license's included count) per license plan offered by this plan. Licenses not listed keep their current paid quantity.
The license plan to set seat quantity for.
Total seats for the license, inclusive of the plan's included amount — seats beyond it are paid.
Custom line items that replace the auto-generated proration invoice, or bill a standalone invoice when nothing else changes. Only valid on an existing recurring subscription.
Amount in dollars for this line item (e.g. 10.50). Can be negative for credits.
Description for the line item.
### Response
The ID of the customer.
List of line items for the current billing period.
The name of the line item to display to the customer if you're building a UI. It will either be the plan name or the feature name.
A detailed description of the line item.
The amount before discounts and tax for this line item.
The final amount after discounts and tax for this line item.
List of discounts applied to this line item.
The ID of the plan that this line item belongs to.
The ID of the feature that this line item belongs to.
The period of time that this line item is being charged for.
The start of the period in milliseconds since the Unix epoch.
The end of the period in milliseconds since the Unix epoch.
The quantity of the line item.
The total amount before discounts and tax for the current billing period.
The final amount after discounts and tax for the current billing period.
The three-letter ISO currency code. All amounts are in the currency's major unit (e.g., dollars for USD).
True when this change clears the customer's usage balances, so the approver can see usage will reset.
Preview of the next billing cycle, if applicable. This shows what the customer will be charged in subsequent cycles.
Unix timestamp (milliseconds) when the next billing cycle starts.
The total amount before discounts and tax for the next cycle.
The final amount after discounts and tax for the next cycle.
List of line items for the next billing cycle.
The name of the line item to display to the customer if you're building a UI. It will either be the plan name or the feature name.
A detailed description of the line item.
The amount before discounts and tax for this line item.
The final amount after discounts and tax for this line item.
List of discounts applied to this line item.
The ID of the plan that this line item belongs to.
The ID of the feature that this line item belongs to.
The period of time that this line item is being charged for.
The start of the period in milliseconds since the Unix epoch.
The end of the period in milliseconds since the Unix epoch.
The quantity of the line item.
List of line items for usage-based features in the next cycle.
The name of the line item to display to the customer if you're building a UI. It will either be the plan name or the feature name.
The ID of the plan that this line item belongs to.
The ID of the feature that this line item belongs to.
The period of time that this line item is being charged for.
The start of the period in milliseconds since the Unix epoch.
The end of the period in milliseconds since the Unix epoch.
Expand the response with additional data.
Products or subscription changes being added or updated.
The ID of the plan affected by this preview change.
The full plan object if it was expanded in the response.
Unique identifier for the plan.
Display name of the plan.
Optional description of the plan.
Group identifier for organizing related plans. Plans in the same group are mutually exclusive.
Version number of the plan. Incremented when plan configuration changes.
User-facing version identity. Defaults to v\{n} when the version is minted.
Whether this is the active version of the plan. At most one version is active.
Whether this is an add-on plan that can be attached alongside a main plan.
If true, this plan is automatically attached when a customer is created. Used for free plans.
Base recurring price for the plan. Null for free plans or usage-only plans.
Base price amount for the plan, in major currency units (e.g. dollars).
Base price amounts in additional currencies. The base 'amount' is in the org's default currency.
Three-letter Stripe-supported currency code (e.g. 'eur', 'gbp').
Price amount in this currency. Set explicitly per currency, not converted from the base amount.
Billing interval (e.g. 'month', 'year').
Number of intervals per billing cycle. Defaults to 1.
Display text for showing this price in pricing pages.
Main display text (e.g. '\$10' or '100 messages').
Secondary display text (e.g. 'per month' or 'then \$0.5 per 100').
Payment processors this base price is connected to. Omitted when unset.
Stripe price ID. For prepaid with included > 0 this is the V2 price.
Feature configurations included in this plan. Each item defines included units, pricing, and reset behavior for a feature.
Bills this many feature units when outstanding overage reaches it.
The ID of the feature this item configures.
The full feature object if expanded.
The ID of the feature, used to refer to it in other API calls like /track or /check.
The name of the feature.
The type of the feature
Singular and plural display names for the feature.
The singular display name for the feature.
The plural display name for the feature.
Credit cost schema for credit system features.
The ID of the metered feature (should be a single\_use feature).
The credit cost of the metered feature.
Whether or not the feature is archived.
Number of free units included. For consumable features, balance resets to this number each interval.
Whether the customer has unlimited access to this feature.
Whether entity-level grants contribute to a shared customer balance.
Reset configuration for consumable features. Null for non-consumable features like seats where usage persists across billing cycles.
The interval at which the feature balance resets (e.g. 'month', 'year'). For consumable features, usage resets to 0 and included units are restored.
Number of intervals between resets. Defaults to 1.
Pricing configuration for usage beyond included units. Null if feature is entirely free.
Price per billing\_units after included usage is consumed. Mutually exclusive with tiers.
Amounts in additional currencies for this flat price. The base 'amount' is in the org's default currency. Only valid with 'amount', not 'tiers' (tiered prices carry per-currency amounts on each tier).
Three-letter Stripe-supported currency code (e.g. 'eur', 'gbp').
Price amount in this currency. Set explicitly per currency, not converted from the base amount.
Tiered pricing configuration. Each tier's 'to' INCLUDES the included amount. Either 'tiers' or 'amount' is required.
Three-letter Stripe-supported currency code (e.g. 'eur', 'gbp').
Per-unit amount for this tier in this currency.
Flat amount for this tier in this currency, if the tier uses one.
Billing interval for this price. For consumable features, should match reset.interval.
Number of intervals per billing cycle. Defaults to 1.
Number of units per price increment. Usage is rounded UP to the nearest billing\_units when billed (e.g. billing\_units=100 means 101 usage rounds to 200).
'prepaid' for features like seats where customers pay upfront, 'usage\_based' for pay-as-you-go after included usage.
Maximum units a customer can purchase beyond included. E.g. if included=100 and max\_purchase=300, customer can use up to 400 total before usage is capped. Null for no limit.
Payment processors this item price is connected to. Omitted when unset.
Stripe price ID. For prepaid with included > 0 this is the V2 price.
Display text for showing this item in pricing pages.
Main display text (e.g. '\$10' or '100 messages').
Secondary display text (e.g. 'per month' or 'then \$0.5 per 100').
Rollover configuration for unused units. If set, unused included units roll over to the next period.
Maximum rollover units. Null for unlimited rollover.
Maximum rollover as a percentage (0-100) of included + prepaid grant. Mutually exclusive with max.
When rolled over units expire.
Number of periods before expiry.
Overrides fields of this item's feature for customers on this plan (e.g. a credit system's credit\_schema).
For credit system features: replaces the feature's credit\_schema entirely for customers on this plan.
ID of the metered feature that draws from this credit system.
Number of metered-feature units priced together. Defaults to one when omitted.
Named rates chosen by event properties. The most specific match sets the rate; with no match the item's own rate applies.
Event properties this entry applies to. Every key must equal the tracked property, compared as strings.
Breaks ties between dimensions that match the same number of keys. Higher wins.
Inclusive upper usage boundary for this graduated tier. The final tier must be 'inf'.
Credits consumed per billing-unit group within this tier.
Named adjustments chosen by event properties. Every match applies: factors multiply, then adds are summed.
Event properties this entry applies to. Every key must equal the tracked property, compared as strings.
Multiplies the matched rate. All matching multipliers stack.
Added to the rate after every factor is applied, in credits per billing-unit group.
Inclusive upper usage boundary for this graduated tier. The final tier must be 'inf'.
Credits consumed per billing-unit group within this tier.
Credits consumed per billing-unit group.
For AI credit system features: replaces the feature's markup chain entirely for customers on this plan. An unset level means no markup at that level rather than inheriting the feature's.
Default percentage markup for customers on this plan. Use -100 to make usage free.
Per-provider markup percentages for customers on this plan.
Per-model markup overrides for customers on this plan.
Payment processors this plan is connected to. Omitted when unset.
Stripe product ID this plan is billed under.
Extra Stripe product IDs aliased to this plan.
Every RevenueCat product that maps to this plan. Replaces the current set.
RevenueCat product ID that grants this plan when purchased.
Prepaid quantities granted when this specific RevenueCat product is purchased, in feature units.
Free trial configuration. If set, new customers can try this plan before being charged.
Number of duration\_type periods the trial lasts.
Unit of time for the trial duration ('day', 'month', 'year').
Whether a payment method is required to start the trial. If true, customer will be charged after trial ends.
Behavior when the trial ends. 'bill' charges the customer (default). 'revert' expires the trial and restores the customer's previous plan.
Unix timestamp (ms) when the plan was created.
Environment this plan belongs to ('sandbox' or 'live').
Whether the plan is archived. Archived plans cannot be attached to new customers.
Miscellaneous plan-level configuration flags.
If true, entitlements attached to this plan will still reset on schedule even when the customer's product is in a past\_due state.
Plan-level billing controls used as customer defaults.
List of auto top-up configurations per feature.
The ID of the feature (credit balance) to auto top-up.
Whether auto top-up is enabled.
When the balance drops below this threshold, an auto top-up will be purchased.
Amount of credits to add per auto top-up.
Optional rate limit to cap how often auto top-ups occur.
The time interval for the purchase limit window.
Number of intervals in the purchase limit window.
Maximum number of auto top-ups allowed within the interval.
When true, auto top-up creates a send\_invoice invoice instead of auto-charging.
List of overage spend limits per feature (caps overage spend).
Optional feature ID this spend limit applies to.
Whether the overage spend limit is enabled.
How overage\_limit is interpreted: an absolute overage cap (default) or a percentage of the main-plan allowance.
Overage cap for the feature: absolute units, or a percent (e.g. 120) when limit\_type is usage\_percentage.
When true, overage for this feature is not posted to Stripe. Usage tracking and balance resets still behave normally.
List of hard usage caps per feature (max units per interval).
The feature this usage limit applies to.
Whether this usage limit is enabled.
Maximum units allowed per interval.
Interval for the cap, aligned to the customer's billing cycle.
Window alignment. 'billing\_cycle' phases the interval to the customer's renewal time; 'utc' aligns to the UTC calendar.
When set, only usage from events whose properties match counts toward this cap. Omit to count all usage of the feature.
List of usage alert configurations per feature.
The feature ID this alert applies to.
Whether this usage alert is enabled.
The threshold value that triggers the alert. For usage or remaining, this is an absolute count. For usage\_percentage or remaining\_percentage, this is a percentage (0-100).
Whether the threshold is an absolute count or a percentage of the usage allowance or remaining balance.
What 100% means. balance: every grant on the feature. included: the plan allowance only. recurring: grants that reset. usage\_limit: the cap of the usage limit with the same feature and filter.
Only valid with basis usage\_limit. Points the alert at the usage limit carrying the same filter.
Optional user-defined label to distinguish multiple alerts on the same feature.
List of overage allowed controls per feature. When enabled, usage can exceed balance.
The feature ID this overage allowed control applies to.
Whether overage is allowed for this feature.
Arbitrary key-value metadata defined by you for your own use. Shared across all versions of the plan.
Whether the trial on this plan is available to this customer. For example, if the customer used the trial in the past, this will be false.
The customer's current status with this plan. 'active' if attached, 'scheduled' if pending activation.
Whether the customer's active instance of this plan is set to cancel.
Whether the customer is currently on a free trial of this plan.
The action that would occur if this plan were attached to the customer.
Deprecated. Use variant\_details.base\_plan\_id instead. If this is a variant, the ID of the base plan it was created from.
Details about how this variant relates to its latest base plan.
The ID of the base plan this variant was derived from.
The customization that transforms the base plan into this variant.
Base price configuration for a plan.
Base price amount for the plan, in major currency units (e.g. dollars).
Billing interval (e.g. 'month', 'year').
Number of intervals per billing cycle. Defaults to 1.
Base price amounts in additional currencies. The base 'amount' is in the org's default currency.
Three-letter Stripe-supported currency code (e.g. 'eur', 'gbp').
Price amount in this currency. Set explicitly per currency, not converted from the base amount.
Items to add to the plan.
Bills this many feature units when outstanding overage reaches it.
The ID of the feature to configure.
Number of free units included. Balance resets to this each interval for consumable features.
If true, customer has unlimited access to this feature.
Whether entity-level grants contribute to a shared customer balance.
Reset configuration for consumable features. Omit for non-consumable features like seats.
Interval at which balance resets (e.g. 'month', 'year'). For consumable features only.
Number of intervals between resets. Defaults to 1.
Pricing for usage beyond included units. Omit for free features.
Price per billing\_units after included usage. Either 'amount' or 'tiers' is required.
Amounts in additional currencies for this flat price. The base 'amount' is in the org's default currency. Only valid with 'amount', not 'tiers'.
Three-letter Stripe-supported currency code (e.g. 'eur', 'gbp').
Price amount in this currency. Set explicitly per currency, not converted from the base amount.
Tiered pricing. Either 'amount' or 'tiers' is required.
Three-letter Stripe-supported currency code (e.g. 'eur', 'gbp').
Per-unit amount for this tier in this currency.
Flat amount for this tier in this currency, if the tier uses one.
Billing interval. For consumable features, should match reset.interval.
Number of intervals per billing cycle. Defaults to 1.
Units per price increment. Usage is rounded UP when billed (e.g. billing\_units=100 means 101 rounds to 200).
'prepaid' for upfront payment (seats), 'usage\_based' for pay-as-you-go.
Max units purchasable beyond included. E.g. included=100, max\_purchase=300 allows 400 total. Null for no limit.
Proration settings for prepaid features. Controls mid-cycle quantity change billing.
Billing behavior when quantity increases mid-cycle.
Credit behavior when quantity decreases mid-cycle.
Rollover config for unused units. If set, unused included units carry over.
Max rollover units. Omit for unlimited rollover.
Maximum rollover as a percentage (0-100) of included + prepaid grant. Mutually exclusive with max.
When rolled over units expire.
Number of periods before expiry.
Overrides fields of this item's feature for customers on this plan (e.g. a credit system's credit\_schema).
For credit system features: replaces the feature's credit\_schema entirely for customers on this plan.
ID of the metered feature that draws from this credit system.
Number of metered-feature units priced together. Defaults to one when omitted.
Named rates chosen by event properties. The most specific match sets the rate; with no match the item's own rate applies.
Event properties this entry applies to. Every key must equal the tracked property, compared as strings.
Breaks ties between dimensions that match the same number of keys. Higher wins.
Inclusive upper usage boundary for this graduated tier. The final tier must be 'inf'.
Credits consumed per billing-unit group within this tier.
Named adjustments chosen by event properties. Every match applies: factors multiply, then adds are summed.
Event properties this entry applies to. Every key must equal the tracked property, compared as strings.
Multiplies the matched rate. All matching multipliers stack.
Added to the rate after every factor is applied, in credits per billing-unit group.
Inclusive upper usage boundary for this graduated tier. The final tier must be 'inf'.
Credits consumed per billing-unit group within this tier.
Credits consumed per billing-unit group.
For AI credit system features: replaces the feature's markup chain entirely for customers on this plan. An unset level means no markup at that level rather than inheriting the feature's.
Default percentage markup for customers on this plan. Use -100 to make usage free.
Per-provider markup percentages for customers on this plan.
Per-model markup overrides for customers on this plan.
Filters selecting items to remove from the plan.
Match items linked to this feature.
Match items with this billing method (prepaid or usage\_based).
Match items with this interval. Accepts either a BillingInterval (price-side) or a ResetInterval (reset-side, includes day/hour/minute) so price-less items keyed by reset.interval can be disambiguated.
Match items with this interval\_count. Disambiguates between items that share an interval but differ in count.
Match items whose grant equals this included usage. Omitted is a wildcard.
Free trial configuration for a plan.
Number of duration\_type periods the trial lasts.
Unit of time for the trial ('day', 'month', 'year').
If true, a payment method is required to start the trial and the customer is charged when it ends. Defaults to false.
Behavior when the trial ends. 'bill' charges the customer (default). 'revert' expires the trial and restores the customer's previous plan.
Override the plan's billing controls (auto top-ups, spend limits, usage limits, usage alerts, overage allowed) for this customer.
List of auto top-up configurations per feature.
The ID of the feature (credit balance) to auto top-up.
Whether auto top-up is enabled.
When the balance drops below this threshold, an auto top-up will be purchased.
Amount of credits to add per auto top-up.
Optional rate limit to cap how often auto top-ups occur. Pass count to set the current window's consumed top-ups.
The time interval for the purchase limit window.
Number of intervals in the purchase limit window.
Maximum number of auto top-ups allowed within the interval.
Set the current window's consumed auto top-up count. Omit to leave runtime state unchanged.
When true, auto top-up creates a send\_invoice invoice instead of auto-charging.
List of overage spend limits per feature (caps overage spend).
Optional feature ID this spend limit applies to.
Whether the overage spend limit is enabled.
How overage\_limit is interpreted: an absolute overage cap (default) or a percentage of the main-plan allowance.
Overage cap for the feature: absolute units, or a percent (e.g. 120) when limit\_type is usage\_percentage.
When true, overage for this feature is not posted to Stripe. Usage tracking and balance resets still behave normally.
List of hard usage caps per feature (max units per interval).
The feature this usage limit applies to.
Whether this usage limit is enabled.
Maximum units allowed per interval.
Interval for the cap, aligned to the customer's billing cycle.
Window alignment. 'billing\_cycle' phases the interval to the customer's renewal time; 'utc' aligns to the UTC calendar.
When set, only usage from events whose properties match counts toward this cap. Omit to count all usage of the feature.
List of usage alert configurations per feature.
The feature ID this alert applies to.
Whether this usage alert is enabled.
The threshold value that triggers the alert. For usage or remaining, this is an absolute count. For usage\_percentage or remaining\_percentage, this is a percentage (0-100).
Whether the threshold is an absolute count or a percentage of the usage allowance or remaining balance.
What 100% means. balance: every grant on the feature. included: the plan allowance only. recurring: grants that reset. usage\_limit: the cap of the usage limit with the same feature and filter.
Only valid with basis usage\_limit. Points the alert at the usage limit carrying the same filter.
Optional user-defined label to distinguish multiple alerts on the same feature.
List of overage allowed controls per feature. When enabled, usage can exceed balance.
The feature ID this overage allowed control applies to.
Whether overage is allowed for this feature.
License links to add or override for this customer, keyed by license\_plan\_id. Omitted fields inherit the plan catalog link (included defaults to 1 when the license is not in the catalog). A bare entry restores the license to pure catalog inheritance.
Base price configuration for a plan.
Base price amount for the plan, in major currency units (e.g. dollars).
Billing interval (e.g. 'month', 'year').
Number of intervals per billing cycle. Defaults to 1.
Base price amounts in additional currencies. The base 'amount' is in the org's default currency.
Three-letter Stripe-supported currency code (e.g. 'eur', 'gbp').
Price amount in this currency. Set explicitly per currency, not converted from the base amount.
Bills this many feature units when outstanding overage reaches it.
The ID of the feature to configure.
Number of free units included. Balance resets to this each interval for consumable features.
If true, customer has unlimited access to this feature.
Whether entity-level grants contribute to a shared customer balance.
Reset configuration for consumable features. Omit for non-consumable features like seats.
Interval at which balance resets (e.g. 'month', 'year'). For consumable features only.
Number of intervals between resets. Defaults to 1.
Pricing for usage beyond included units. Omit for free features.
Price per billing\_units after included usage. Either 'amount' or 'tiers' is required.
Amounts in additional currencies for this flat price. The base 'amount' is in the org's default currency. Only valid with 'amount', not 'tiers'.
Three-letter Stripe-supported currency code (e.g. 'eur', 'gbp').
Price amount in this currency. Set explicitly per currency, not converted from the base amount.
Tiered pricing. Either 'amount' or 'tiers' is required.
Three-letter Stripe-supported currency code (e.g. 'eur', 'gbp').
Per-unit amount for this tier in this currency.
Flat amount for this tier in this currency, if the tier uses one.
Billing interval. For consumable features, should match reset.interval.
Number of intervals per billing cycle. Defaults to 1.
Units per price increment. Usage is rounded UP when billed (e.g. billing\_units=100 means 101 rounds to 200).
'prepaid' for upfront payment (seats), 'usage\_based' for pay-as-you-go.
Max units purchasable beyond included. E.g. included=100, max\_purchase=300 allows 400 total. Null for no limit.
Proration settings for prepaid features. Controls mid-cycle quantity change billing.
Billing behavior when quantity increases mid-cycle.
Credit behavior when quantity decreases mid-cycle.
Rollover config for unused units. If set, unused included units carry over.
Max rollover units. Omit for unlimited rollover.
Maximum rollover as a percentage (0-100) of included + prepaid grant. Mutually exclusive with max.
When rolled over units expire.
Number of periods before expiry.
Overrides fields of this item's feature for customers on this plan (e.g. a credit system's credit\_schema).
For credit system features: replaces the feature's credit\_schema entirely for customers on this plan.
ID of the metered feature that draws from this credit system.
Number of metered-feature units priced together. Defaults to one when omitted.
Named rates chosen by event properties. The most specific match sets the rate; with no match the item's own rate applies.
Event properties this entry applies to. Every key must equal the tracked property, compared as strings.
Breaks ties between dimensions that match the same number of keys. Higher wins.
Inclusive upper usage boundary for this graduated tier. The final tier must be 'inf'.
Credits consumed per billing-unit group within this tier.
Named adjustments chosen by event properties. Every match applies: factors multiply, then adds are summed.
Event properties this entry applies to. Every key must equal the tracked property, compared as strings.
Multiplies the matched rate. All matching multipliers stack.
Added to the rate after every factor is applied, in credits per billing-unit group.
Inclusive upper usage boundary for this graduated tier. The final tier must be 'inf'.
Credits consumed per billing-unit group within this tier.
Credits consumed per billing-unit group.
For AI credit system features: replaces the feature's markup chain entirely for customers on this plan. An unset level means no markup at that level rather than inheriting the feature's.
Default percentage markup for customers on this plan. Use -100 to make usage free.
Per-provider markup percentages for customers on this plan.
Per-model markup overrides for customers on this plan.
Match items linked to this feature.
Match items with this billing method (prepaid or usage\_based).
Match items with this interval. Accepts either a BillingInterval (price-side) or a ResetInterval (reset-side, includes day/hour/minute) so price-less items keyed by reset.interval can be disambiguated.
Match items with this interval\_count. Disambiguates between items that share an interval but differ in count.
Match items whose grant equals this included usage. Omitted is a wildcard.
License links to drop, keyed by license\_plan\_id. Parallel to remove\_items.
The feature quantity selections associated with this plan change.
The ID of the adjustable feature included in this change.
The quantity that will apply for this feature in the change.
When this change takes effect, in milliseconds since the Unix epoch, or null if it applies immediately.
When this plan was canceled, in milliseconds since the Unix epoch, or null if it is not canceled.
When this plan expires, in milliseconds since the Unix epoch, or null if it does not expire.
Products or subscription changes being removed or ended.
The ID of the plan affected by this preview change.
The full plan object if it was expanded in the response.
Unique identifier for the plan.
Display name of the plan.
Optional description of the plan.
Group identifier for organizing related plans. Plans in the same group are mutually exclusive.
Version number of the plan. Incremented when plan configuration changes.
User-facing version identity. Defaults to v\{n} when the version is minted.
Whether this is the active version of the plan. At most one version is active.
Whether this is an add-on plan that can be attached alongside a main plan.
If true, this plan is automatically attached when a customer is created. Used for free plans.
Base recurring price for the plan. Null for free plans or usage-only plans.
Base price amount for the plan, in major currency units (e.g. dollars).
Base price amounts in additional currencies. The base 'amount' is in the org's default currency.
Three-letter Stripe-supported currency code (e.g. 'eur', 'gbp').
Price amount in this currency. Set explicitly per currency, not converted from the base amount.
Billing interval (e.g. 'month', 'year').
Number of intervals per billing cycle. Defaults to 1.
Display text for showing this price in pricing pages.
Main display text (e.g. '\$10' or '100 messages').
Secondary display text (e.g. 'per month' or 'then \$0.5 per 100').
Payment processors this base price is connected to. Omitted when unset.
Stripe price ID. For prepaid with included > 0 this is the V2 price.
Feature configurations included in this plan. Each item defines included units, pricing, and reset behavior for a feature.
Bills this many feature units when outstanding overage reaches it.
The ID of the feature this item configures.
The full feature object if expanded.
The ID of the feature, used to refer to it in other API calls like /track or /check.
The name of the feature.
The type of the feature
Singular and plural display names for the feature.
The singular display name for the feature.
The plural display name for the feature.
Credit cost schema for credit system features.
The ID of the metered feature (should be a single\_use feature).
The credit cost of the metered feature.
Whether or not the feature is archived.
Number of free units included. For consumable features, balance resets to this number each interval.
Whether the customer has unlimited access to this feature.
Whether entity-level grants contribute to a shared customer balance.
Reset configuration for consumable features. Null for non-consumable features like seats where usage persists across billing cycles.
The interval at which the feature balance resets (e.g. 'month', 'year'). For consumable features, usage resets to 0 and included units are restored.
Number of intervals between resets. Defaults to 1.
Pricing configuration for usage beyond included units. Null if feature is entirely free.
Price per billing\_units after included usage is consumed. Mutually exclusive with tiers.
Amounts in additional currencies for this flat price. The base 'amount' is in the org's default currency. Only valid with 'amount', not 'tiers' (tiered prices carry per-currency amounts on each tier).
Three-letter Stripe-supported currency code (e.g. 'eur', 'gbp').
Price amount in this currency. Set explicitly per currency, not converted from the base amount.
Tiered pricing configuration. Each tier's 'to' INCLUDES the included amount. Either 'tiers' or 'amount' is required.
Three-letter Stripe-supported currency code (e.g. 'eur', 'gbp').
Per-unit amount for this tier in this currency.
Flat amount for this tier in this currency, if the tier uses one.
Billing interval for this price. For consumable features, should match reset.interval.
Number of intervals per billing cycle. Defaults to 1.
Number of units per price increment. Usage is rounded UP to the nearest billing\_units when billed (e.g. billing\_units=100 means 101 usage rounds to 200).
'prepaid' for features like seats where customers pay upfront, 'usage\_based' for pay-as-you-go after included usage.
Maximum units a customer can purchase beyond included. E.g. if included=100 and max\_purchase=300, customer can use up to 400 total before usage is capped. Null for no limit.
Payment processors this item price is connected to. Omitted when unset.
Stripe price ID. For prepaid with included > 0 this is the V2 price.
Display text for showing this item in pricing pages.
Main display text (e.g. '\$10' or '100 messages').
Secondary display text (e.g. 'per month' or 'then \$0.5 per 100').
Rollover configuration for unused units. If set, unused included units roll over to the next period.
Maximum rollover units. Null for unlimited rollover.
Maximum rollover as a percentage (0-100) of included + prepaid grant. Mutually exclusive with max.
When rolled over units expire.
Number of periods before expiry.
Overrides fields of this item's feature for customers on this plan (e.g. a credit system's credit\_schema).
For credit system features: replaces the feature's credit\_schema entirely for customers on this plan.
ID of the metered feature that draws from this credit system.
Number of metered-feature units priced together. Defaults to one when omitted.
Named rates chosen by event properties. The most specific match sets the rate; with no match the item's own rate applies.
Event properties this entry applies to. Every key must equal the tracked property, compared as strings.
Breaks ties between dimensions that match the same number of keys. Higher wins.
Inclusive upper usage boundary for this graduated tier. The final tier must be 'inf'.
Credits consumed per billing-unit group within this tier.
Named adjustments chosen by event properties. Every match applies: factors multiply, then adds are summed.
Event properties this entry applies to. Every key must equal the tracked property, compared as strings.
Multiplies the matched rate. All matching multipliers stack.
Added to the rate after every factor is applied, in credits per billing-unit group.
Inclusive upper usage boundary for this graduated tier. The final tier must be 'inf'.
Credits consumed per billing-unit group within this tier.
Credits consumed per billing-unit group.
For AI credit system features: replaces the feature's markup chain entirely for customers on this plan. An unset level means no markup at that level rather than inheriting the feature's.
Default percentage markup for customers on this plan. Use -100 to make usage free.
Per-provider markup percentages for customers on this plan.
Per-model markup overrides for customers on this plan.
Payment processors this plan is connected to. Omitted when unset.
Stripe product ID this plan is billed under.
Extra Stripe product IDs aliased to this plan.
Every RevenueCat product that maps to this plan. Replaces the current set.
RevenueCat product ID that grants this plan when purchased.
Prepaid quantities granted when this specific RevenueCat product is purchased, in feature units.
Free trial configuration. If set, new customers can try this plan before being charged.
Number of duration\_type periods the trial lasts.
Unit of time for the trial duration ('day', 'month', 'year').
Whether a payment method is required to start the trial. If true, customer will be charged after trial ends.
Behavior when the trial ends. 'bill' charges the customer (default). 'revert' expires the trial and restores the customer's previous plan.
Unix timestamp (ms) when the plan was created.
Environment this plan belongs to ('sandbox' or 'live').
Whether the plan is archived. Archived plans cannot be attached to new customers.
Miscellaneous plan-level configuration flags.
If true, entitlements attached to this plan will still reset on schedule even when the customer's product is in a past\_due state.
Plan-level billing controls used as customer defaults.
List of auto top-up configurations per feature.
The ID of the feature (credit balance) to auto top-up.
Whether auto top-up is enabled.
When the balance drops below this threshold, an auto top-up will be purchased.
Amount of credits to add per auto top-up.
Optional rate limit to cap how often auto top-ups occur.
The time interval for the purchase limit window.
Number of intervals in the purchase limit window.
Maximum number of auto top-ups allowed within the interval.
When true, auto top-up creates a send\_invoice invoice instead of auto-charging.
List of overage spend limits per feature (caps overage spend).
Optional feature ID this spend limit applies to.
Whether the overage spend limit is enabled.
How overage\_limit is interpreted: an absolute overage cap (default) or a percentage of the main-plan allowance.
Overage cap for the feature: absolute units, or a percent (e.g. 120) when limit\_type is usage\_percentage.
When true, overage for this feature is not posted to Stripe. Usage tracking and balance resets still behave normally.
List of hard usage caps per feature (max units per interval).
The feature this usage limit applies to.
Whether this usage limit is enabled.
Maximum units allowed per interval.
Interval for the cap, aligned to the customer's billing cycle.
Window alignment. 'billing\_cycle' phases the interval to the customer's renewal time; 'utc' aligns to the UTC calendar.
When set, only usage from events whose properties match counts toward this cap. Omit to count all usage of the feature.
List of usage alert configurations per feature.
The feature ID this alert applies to.
Whether this usage alert is enabled.
The threshold value that triggers the alert. For usage or remaining, this is an absolute count. For usage\_percentage or remaining\_percentage, this is a percentage (0-100).
Whether the threshold is an absolute count or a percentage of the usage allowance or remaining balance.
What 100% means. balance: every grant on the feature. included: the plan allowance only. recurring: grants that reset. usage\_limit: the cap of the usage limit with the same feature and filter.
Only valid with basis usage\_limit. Points the alert at the usage limit carrying the same filter.
Optional user-defined label to distinguish multiple alerts on the same feature.
List of overage allowed controls per feature. When enabled, usage can exceed balance.
The feature ID this overage allowed control applies to.
Whether overage is allowed for this feature.
Arbitrary key-value metadata defined by you for your own use. Shared across all versions of the plan.
Whether the trial on this plan is available to this customer. For example, if the customer used the trial in the past, this will be false.
The customer's current status with this plan. 'active' if attached, 'scheduled' if pending activation.
Whether the customer's active instance of this plan is set to cancel.
Whether the customer is currently on a free trial of this plan.
The action that would occur if this plan were attached to the customer.
Deprecated. Use variant\_details.base\_plan\_id instead. If this is a variant, the ID of the base plan it was created from.
Details about how this variant relates to its latest base plan.
The ID of the base plan this variant was derived from.
The customization that transforms the base plan into this variant.
Base price configuration for a plan.
Base price amount for the plan, in major currency units (e.g. dollars).
Billing interval (e.g. 'month', 'year').
Number of intervals per billing cycle. Defaults to 1.
Base price amounts in additional currencies. The base 'amount' is in the org's default currency.
Three-letter Stripe-supported currency code (e.g. 'eur', 'gbp').
Price amount in this currency. Set explicitly per currency, not converted from the base amount.
Items to add to the plan.
Bills this many feature units when outstanding overage reaches it.
The ID of the feature to configure.
Number of free units included. Balance resets to this each interval for consumable features.
If true, customer has unlimited access to this feature.
Whether entity-level grants contribute to a shared customer balance.
Reset configuration for consumable features. Omit for non-consumable features like seats.
Interval at which balance resets (e.g. 'month', 'year'). For consumable features only.
Number of intervals between resets. Defaults to 1.
Pricing for usage beyond included units. Omit for free features.
Price per billing\_units after included usage. Either 'amount' or 'tiers' is required.
Amounts in additional currencies for this flat price. The base 'amount' is in the org's default currency. Only valid with 'amount', not 'tiers'.
Three-letter Stripe-supported currency code (e.g. 'eur', 'gbp').
Price amount in this currency. Set explicitly per currency, not converted from the base amount.
Tiered pricing. Either 'amount' or 'tiers' is required.
Three-letter Stripe-supported currency code (e.g. 'eur', 'gbp').
Per-unit amount for this tier in this currency.
Flat amount for this tier in this currency, if the tier uses one.
Billing interval. For consumable features, should match reset.interval.
Number of intervals per billing cycle. Defaults to 1.
Units per price increment. Usage is rounded UP when billed (e.g. billing\_units=100 means 101 rounds to 200).
'prepaid' for upfront payment (seats), 'usage\_based' for pay-as-you-go.
Max units purchasable beyond included. E.g. included=100, max\_purchase=300 allows 400 total. Null for no limit.
Proration settings for prepaid features. Controls mid-cycle quantity change billing.
Billing behavior when quantity increases mid-cycle.
Credit behavior when quantity decreases mid-cycle.
Rollover config for unused units. If set, unused included units carry over.
Max rollover units. Omit for unlimited rollover.
Maximum rollover as a percentage (0-100) of included + prepaid grant. Mutually exclusive with max.
When rolled over units expire.
Number of periods before expiry.
Overrides fields of this item's feature for customers on this plan (e.g. a credit system's credit\_schema).
For credit system features: replaces the feature's credit\_schema entirely for customers on this plan.
ID of the metered feature that draws from this credit system.
Number of metered-feature units priced together. Defaults to one when omitted.
Named rates chosen by event properties. The most specific match sets the rate; with no match the item's own rate applies.
Event properties this entry applies to. Every key must equal the tracked property, compared as strings.
Breaks ties between dimensions that match the same number of keys. Higher wins.
Inclusive upper usage boundary for this graduated tier. The final tier must be 'inf'.
Credits consumed per billing-unit group within this tier.
Named adjustments chosen by event properties. Every match applies: factors multiply, then adds are summed.
Event properties this entry applies to. Every key must equal the tracked property, compared as strings.
Multiplies the matched rate. All matching multipliers stack.
Added to the rate after every factor is applied, in credits per billing-unit group.
Inclusive upper usage boundary for this graduated tier. The final tier must be 'inf'.
Credits consumed per billing-unit group within this tier.
Credits consumed per billing-unit group.
For AI credit system features: replaces the feature's markup chain entirely for customers on this plan. An unset level means no markup at that level rather than inheriting the feature's.
Default percentage markup for customers on this plan. Use -100 to make usage free.
Per-provider markup percentages for customers on this plan.
Per-model markup overrides for customers on this plan.
Filters selecting items to remove from the plan.
Match items linked to this feature.
Match items with this billing method (prepaid or usage\_based).
Match items with this interval. Accepts either a BillingInterval (price-side) or a ResetInterval (reset-side, includes day/hour/minute) so price-less items keyed by reset.interval can be disambiguated.
Match items with this interval\_count. Disambiguates between items that share an interval but differ in count.
Match items whose grant equals this included usage. Omitted is a wildcard.
Free trial configuration for a plan.
Number of duration\_type periods the trial lasts.
Unit of time for the trial ('day', 'month', 'year').
If true, a payment method is required to start the trial and the customer is charged when it ends. Defaults to false.
Behavior when the trial ends. 'bill' charges the customer (default). 'revert' expires the trial and restores the customer's previous plan.
Override the plan's billing controls (auto top-ups, spend limits, usage limits, usage alerts, overage allowed) for this customer.
List of auto top-up configurations per feature.
The ID of the feature (credit balance) to auto top-up.
Whether auto top-up is enabled.
When the balance drops below this threshold, an auto top-up will be purchased.
Amount of credits to add per auto top-up.
Optional rate limit to cap how often auto top-ups occur. Pass count to set the current window's consumed top-ups.
The time interval for the purchase limit window.
Number of intervals in the purchase limit window.
Maximum number of auto top-ups allowed within the interval.
Set the current window's consumed auto top-up count. Omit to leave runtime state unchanged.
When true, auto top-up creates a send\_invoice invoice instead of auto-charging.
List of overage spend limits per feature (caps overage spend).
Optional feature ID this spend limit applies to.
Whether the overage spend limit is enabled.
How overage\_limit is interpreted: an absolute overage cap (default) or a percentage of the main-plan allowance.
Overage cap for the feature: absolute units, or a percent (e.g. 120) when limit\_type is usage\_percentage.
When true, overage for this feature is not posted to Stripe. Usage tracking and balance resets still behave normally.
List of hard usage caps per feature (max units per interval).
The feature this usage limit applies to.
Whether this usage limit is enabled.
Maximum units allowed per interval.
Interval for the cap, aligned to the customer's billing cycle.
Window alignment. 'billing\_cycle' phases the interval to the customer's renewal time; 'utc' aligns to the UTC calendar.
When set, only usage from events whose properties match counts toward this cap. Omit to count all usage of the feature.
List of usage alert configurations per feature.
The feature ID this alert applies to.
Whether this usage alert is enabled.
The threshold value that triggers the alert. For usage or remaining, this is an absolute count. For usage\_percentage or remaining\_percentage, this is a percentage (0-100).
Whether the threshold is an absolute count or a percentage of the usage allowance or remaining balance.
What 100% means. balance: every grant on the feature. included: the plan allowance only. recurring: grants that reset. usage\_limit: the cap of the usage limit with the same feature and filter.
Only valid with basis usage\_limit. Points the alert at the usage limit carrying the same filter.
Optional user-defined label to distinguish multiple alerts on the same feature.
List of overage allowed controls per feature. When enabled, usage can exceed balance.
The feature ID this overage allowed control applies to.
Whether overage is allowed for this feature.
License links to add or override for this customer, keyed by license\_plan\_id. Omitted fields inherit the plan catalog link (included defaults to 1 when the license is not in the catalog). A bare entry restores the license to pure catalog inheritance.
Base price configuration for a plan.
Base price amount for the plan, in major currency units (e.g. dollars).
Billing interval (e.g. 'month', 'year').
Number of intervals per billing cycle. Defaults to 1.
Base price amounts in additional currencies. The base 'amount' is in the org's default currency.
Three-letter Stripe-supported currency code (e.g. 'eur', 'gbp').
Price amount in this currency. Set explicitly per currency, not converted from the base amount.
Bills this many feature units when outstanding overage reaches it.
The ID of the feature to configure.
Number of free units included. Balance resets to this each interval for consumable features.
If true, customer has unlimited access to this feature.
Whether entity-level grants contribute to a shared customer balance.
Reset configuration for consumable features. Omit for non-consumable features like seats.
Interval at which balance resets (e.g. 'month', 'year'). For consumable features only.
Number of intervals between resets. Defaults to 1.
Pricing for usage beyond included units. Omit for free features.
Price per billing\_units after included usage. Either 'amount' or 'tiers' is required.
Amounts in additional currencies for this flat price. The base 'amount' is in the org's default currency. Only valid with 'amount', not 'tiers'.
Three-letter Stripe-supported currency code (e.g. 'eur', 'gbp').
Price amount in this currency. Set explicitly per currency, not converted from the base amount.
Tiered pricing. Either 'amount' or 'tiers' is required.
Three-letter Stripe-supported currency code (e.g. 'eur', 'gbp').
Per-unit amount for this tier in this currency.
Flat amount for this tier in this currency, if the tier uses one.
Billing interval. For consumable features, should match reset.interval.
Number of intervals per billing cycle. Defaults to 1.
Units per price increment. Usage is rounded UP when billed (e.g. billing\_units=100 means 101 rounds to 200).
'prepaid' for upfront payment (seats), 'usage\_based' for pay-as-you-go.
Max units purchasable beyond included. E.g. included=100, max\_purchase=300 allows 400 total. Null for no limit.
Proration settings for prepaid features. Controls mid-cycle quantity change billing.
Billing behavior when quantity increases mid-cycle.
Credit behavior when quantity decreases mid-cycle.
Rollover config for unused units. If set, unused included units carry over.
Max rollover units. Omit for unlimited rollover.
Maximum rollover as a percentage (0-100) of included + prepaid grant. Mutually exclusive with max.
When rolled over units expire.
Number of periods before expiry.
Overrides fields of this item's feature for customers on this plan (e.g. a credit system's credit\_schema).
For credit system features: replaces the feature's credit\_schema entirely for customers on this plan.
ID of the metered feature that draws from this credit system.
Number of metered-feature units priced together. Defaults to one when omitted.
Named rates chosen by event properties. The most specific match sets the rate; with no match the item's own rate applies.
Event properties this entry applies to. Every key must equal the tracked property, compared as strings.
Breaks ties between dimensions that match the same number of keys. Higher wins.
Inclusive upper usage boundary for this graduated tier. The final tier must be 'inf'.
Credits consumed per billing-unit group within this tier.
Named adjustments chosen by event properties. Every match applies: factors multiply, then adds are summed.
Event properties this entry applies to. Every key must equal the tracked property, compared as strings.
Multiplies the matched rate. All matching multipliers stack.
Added to the rate after every factor is applied, in credits per billing-unit group.
Inclusive upper usage boundary for this graduated tier. The final tier must be 'inf'.
Credits consumed per billing-unit group within this tier.
Credits consumed per billing-unit group.
For AI credit system features: replaces the feature's markup chain entirely for customers on this plan. An unset level means no markup at that level rather than inheriting the feature's.
Default percentage markup for customers on this plan. Use -100 to make usage free.
Per-provider markup percentages for customers on this plan.
Per-model markup overrides for customers on this plan.
Match items linked to this feature.
Match items with this billing method (prepaid or usage\_based).
Match items with this interval. Accepts either a BillingInterval (price-side) or a ResetInterval (reset-side, includes day/hour/minute) so price-less items keyed by reset.interval can be disambiguated.
Match items with this interval\_count. Disambiguates between items that share an interval but differ in count.
Match items whose grant equals this included usage. Omitted is a wildcard.
License links to drop, keyed by license\_plan\_id. Parallel to remove\_items.
The feature quantity selections associated with this plan change.
The ID of the adjustable feature included in this change.
The quantity that will apply for this feature in the change.
When this change takes effect, in milliseconds since the Unix epoch, or null if it applies immediately.
When this plan was canceled, in milliseconds since the Unix epoch, or null if it is not canceled.
When this plan expires, in milliseconds since the Unix epoch, or null if it does not expire.
Tax preview for the immediate charge. Contact us to enable the tax flag on your organisation. Shows only with flag enabled, a Stripe customer exists and has a location.
Total tax amount in major currency units.
Tax included in line item subtotals.
Tax added on top of subtotals.
Three-letter currency code.
Calculation status ('complete' when Stripe Tax succeeds or 'incomplete' when Stripe Tax returned 0 or errored).
Stripe customer invoice credits preview.
Stripe customer credit balance available, expressed as a positive number in major currency units.
Three-letter currency code.
```json 200 theme={null}
{
"customerId": "charles",
"lineItems": [
{
"display_name": "Pro seed",
"description": "Pro seed - Base Price (from 18 Feb 2026 to 18 Mar 2026)",
"subtotal": 20,
"total": 20,
"discounts": []
}
],
"subtotal": 20,
"total": 20,
"currency": "usd"
}
```
# Setup Payment
Source: https://docs.useautumn.com/api-reference/billing/setupPayment
openapi POST /v1/billing.setup_payment
Create a payment setup session for a customer to add or update their payment method.
### Body Parameters
The ID of the customer to attach the plan to.
The ID of the entity to attach the plan to.
If specified, the plan will be attached to the customer after setup.
If this plan contains prepaid features, use this field to specify the quantity of each prepaid feature. This quantity includes the included amount and billing units defined when setting up the plan.
The ID of the feature to set quantity for.
The quantity of the feature.
Whether the customer can adjust the quantity.
The version of the plan to attach.
Free trial configuration for a plan.
Number of duration\_type periods the trial lasts.
Unit of time for the trial ('day', 'month', 'year').
If true, a payment method is required to start the trial and the customer is charged when it ends. Defaults to false.
Behavior when the trial ends. 'bill' charges the customer (default). 'revert' expires the trial and restores the customer's previous plan.
Customize the plan to attach. Can override the price, items, licenses, free trial, or a combination.
Base price configuration for a plan.
Base price amount for the plan, in major currency units (e.g. dollars).
Billing interval (e.g. 'month', 'year').
Number of intervals per billing cycle. Defaults to 1.
Base price amounts in additional currencies. The base 'amount' is in the org's default currency.
Three-letter Stripe-supported currency code (e.g. 'eur', 'gbp').
Price amount in this currency. Set explicitly per currency, not converted from the base amount.
Override the items in the plan (PUT-style — replaces all existing items). Mutually exclusive with add\_items / remove\_items / deprecated update\_items.
Bills this many feature units when outstanding overage reaches it.
The ID of the feature to configure.
Number of free units included. Balance resets to this each interval for consumable features.
If true, customer has unlimited access to this feature.
Whether entity-level grants contribute to a shared customer balance.
Reset configuration for consumable features. Omit for non-consumable features like seats.
Interval at which balance resets (e.g. 'month', 'year'). For consumable features only.
Number of intervals between resets. Defaults to 1.
Pricing for usage beyond included units. Omit for free features.
Price per billing\_units after included usage. Either 'amount' or 'tiers' is required.
Amounts in additional currencies for this flat price. The base 'amount' is in the org's default currency. Only valid with 'amount', not 'tiers'.
Three-letter Stripe-supported currency code (e.g. 'eur', 'gbp').
Price amount in this currency. Set explicitly per currency, not converted from the base amount.
Tiered pricing. Either 'amount' or 'tiers' is required.
Per-currency amounts for this tier. Tier boundaries ('to') are shared across all currencies.
Three-letter Stripe-supported currency code (e.g. 'eur', 'gbp').
Per-unit amount for this tier in this currency.
Flat amount for this tier in this currency, if the tier uses one.
Billing interval. For consumable features, should match reset.interval.
Number of intervals per billing cycle. Defaults to 1.
Units per price increment. Usage is rounded UP when billed (e.g. billing\_units=100 means 101 rounds to 200).
'prepaid' for upfront payment (seats), 'usage\_based' for pay-as-you-go.
Max units purchasable beyond included. E.g. included=100, max\_purchase=300 allows 400 total. Null for no limit.
Proration settings for prepaid features. Controls mid-cycle quantity change billing.
Billing behavior when quantity increases mid-cycle.
Credit behavior when quantity decreases mid-cycle.
Rollover config for unused units. If set, unused included units carry over.
Max rollover units. Omit for unlimited rollover.
Maximum rollover as a percentage (0-100) of included + prepaid grant. Mutually exclusive with max.
When rolled over units expire.
Number of periods before expiry.
Overrides fields of this item's feature for customers on this plan (e.g. a credit system's credit\_schema).
For credit system features: replaces the feature's credit\_schema entirely for customers on this plan.
ID of the metered feature that draws from this credit system.
Number of metered-feature units priced together. Defaults to one when omitted.
Named rates chosen by event properties. The most specific match sets the rate; with no match the item's own rate applies.
Event properties this entry applies to. Every key must equal the tracked property, compared as strings.
Breaks ties between dimensions that match the same number of keys. Higher wins.
Inclusive upper usage boundary for this graduated tier. The final tier must be 'inf'.
Credits consumed per billing-unit group within this tier.
Named adjustments chosen by event properties. Every match applies: factors multiply, then adds are summed.
Event properties this entry applies to. Every key must equal the tracked property, compared as strings.
Multiplies the matched rate. All matching multipliers stack.
Added to the rate after every factor is applied, in credits per billing-unit group.
Inclusive upper usage boundary for this graduated tier. The final tier must be 'inf'.
Credits consumed per billing-unit group within this tier.
Credits consumed per billing-unit group.
For AI credit system features: replaces the feature's markup chain entirely for customers on this plan. An unset level means no markup at that level rather than inheriting the feature's.
Default percentage markup for customers on this plan. Use -100 to make usage free.
Per-provider markup percentages for customers on this plan.
Per-model markup overrides for customers on this plan.
Items to add to the plan.
Bills this many feature units when outstanding overage reaches it.
The ID of the feature to configure.
Number of free units included. Balance resets to this each interval for consumable features.
If true, customer has unlimited access to this feature.
Whether entity-level grants contribute to a shared customer balance.
Reset configuration for consumable features. Omit for non-consumable features like seats.
Interval at which balance resets (e.g. 'month', 'year'). For consumable features only.
Number of intervals between resets. Defaults to 1.
Pricing for usage beyond included units. Omit for free features.
Price per billing\_units after included usage. Either 'amount' or 'tiers' is required.
Amounts in additional currencies for this flat price. The base 'amount' is in the org's default currency. Only valid with 'amount', not 'tiers'.
Three-letter Stripe-supported currency code (e.g. 'eur', 'gbp').
Price amount in this currency. Set explicitly per currency, not converted from the base amount.
Tiered pricing. Either 'amount' or 'tiers' is required.
Per-currency amounts for this tier. Tier boundaries ('to') are shared across all currencies.
Three-letter Stripe-supported currency code (e.g. 'eur', 'gbp').
Per-unit amount for this tier in this currency.
Flat amount for this tier in this currency, if the tier uses one.
Billing interval. For consumable features, should match reset.interval.
Number of intervals per billing cycle. Defaults to 1.
Units per price increment. Usage is rounded UP when billed (e.g. billing\_units=100 means 101 rounds to 200).
'prepaid' for upfront payment (seats), 'usage\_based' for pay-as-you-go.
Max units purchasable beyond included. E.g. included=100, max\_purchase=300 allows 400 total. Null for no limit.
Proration settings for prepaid features. Controls mid-cycle quantity change billing.
Billing behavior when quantity increases mid-cycle.
Credit behavior when quantity decreases mid-cycle.
Rollover config for unused units. If set, unused included units carry over.
Max rollover units. Omit for unlimited rollover.
Maximum rollover as a percentage (0-100) of included + prepaid grant. Mutually exclusive with max.
When rolled over units expire.
Number of periods before expiry.
Overrides fields of this item's feature for customers on this plan (e.g. a credit system's credit\_schema).
For credit system features: replaces the feature's credit\_schema entirely for customers on this plan.
ID of the metered feature that draws from this credit system.
Number of metered-feature units priced together. Defaults to one when omitted.
Named rates chosen by event properties. The most specific match sets the rate; with no match the item's own rate applies.
Event properties this entry applies to. Every key must equal the tracked property, compared as strings.
Breaks ties between dimensions that match the same number of keys. Higher wins.
Inclusive upper usage boundary for this graduated tier. The final tier must be 'inf'.
Credits consumed per billing-unit group within this tier.
Named adjustments chosen by event properties. Every match applies: factors multiply, then adds are summed.
Event properties this entry applies to. Every key must equal the tracked property, compared as strings.
Multiplies the matched rate. All matching multipliers stack.
Added to the rate after every factor is applied, in credits per billing-unit group.
Inclusive upper usage boundary for this graduated tier. The final tier must be 'inf'.
Credits consumed per billing-unit group within this tier.
Credits consumed per billing-unit group.
For AI credit system features: replaces the feature's markup chain entirely for customers on this plan. An unset level means no markup at that level rather than inheriting the feature's.
Default percentage markup for customers on this plan. Use -100 to make usage free.
Per-provider markup percentages for customers on this plan.
Per-model markup overrides for customers on this plan.
Filters selecting items to remove from the plan.
Match items linked to this feature.
Match items with this billing method (prepaid or usage\_based).
Match items with this interval. Accepts either a BillingInterval (price-side) or a ResetInterval (reset-side, includes day/hour/minute) so price-less items keyed by reset.interval can be disambiguated.
Match items with this interval\_count. Disambiguates between items that share an interval but differ in count.
Match items whose grant equals this included usage. Omitted is a wildcard.
Free trial configuration for a plan.
Number of duration\_type periods the trial lasts.
Unit of time for the trial ('day', 'month', 'year').
If true, a payment method is required to start the trial and the customer is charged when it ends. Defaults to false.
Behavior when the trial ends. 'bill' charges the customer (default). 'revert' expires the trial and restores the customer's previous plan.
Override the plan's billing controls (auto top-ups, spend limits, usage limits, usage alerts, overage allowed) for this customer.
List of auto top-up configurations per feature.
The ID of the feature (credit balance) to auto top-up.
Whether auto top-up is enabled.
When the balance drops below this threshold, an auto top-up will be purchased.
Amount of credits to add per auto top-up.
Optional rate limit to cap how often auto top-ups occur. Pass count to set the current window's consumed top-ups.
The time interval for the purchase limit window.
Number of intervals in the purchase limit window.
Maximum number of auto top-ups allowed within the interval.
Set the current window's consumed auto top-up count. Omit to leave runtime state unchanged.
When true, auto top-up creates a send\_invoice invoice instead of auto-charging.
List of overage spend limits per feature (caps overage spend).
Optional feature ID this spend limit applies to.
Whether the overage spend limit is enabled.
How overage\_limit is interpreted: an absolute overage cap (default) or a percentage of the main-plan allowance.
Overage cap for the feature: absolute units, or a percent (e.g. 120) when limit\_type is usage\_percentage.
When true, overage for this feature is not posted to Stripe. Usage tracking and balance resets still behave normally.
List of hard usage caps per feature (max units per interval).
The feature this usage limit applies to.
Whether this usage limit is enabled.
Maximum units allowed per interval.
Interval for the cap, aligned to the customer's billing cycle.
Window alignment. 'billing\_cycle' phases the interval to the customer's renewal time; 'utc' aligns to the UTC calendar.
When set, only usage from events whose properties match counts toward this cap. Omit to count all usage of the feature.
List of usage alert configurations per feature.
The feature ID this alert applies to.
Whether this usage alert is enabled.
The threshold value that triggers the alert. For usage or remaining, this is an absolute count. For usage\_percentage or remaining\_percentage, this is a percentage (0-100).
Whether the threshold is an absolute count or a percentage of the usage allowance or remaining balance.
What 100% means. balance: every grant on the feature. included: the plan allowance only. recurring: grants that reset. usage\_limit: the cap of the usage limit with the same feature and filter.
Only valid with basis usage\_limit. Points the alert at the usage limit carrying the same filter.
Optional user-defined label to distinguish multiple alerts on the same feature.
List of overage allowed controls per feature. When enabled, usage can exceed balance.
The feature ID this overage allowed control applies to.
Whether overage is allowed for this feature.
License links to add or override for this customer, keyed by license\_plan\_id. Omitted fields inherit the plan catalog link (included defaults to 1 when the license is not in the catalog). A bare entry restores the license to pure catalog inheritance.
Base price configuration for a plan.
Base price amount for the plan, in major currency units (e.g. dollars).
Billing interval (e.g. 'month', 'year').
Number of intervals per billing cycle. Defaults to 1.
Base price amounts in additional currencies. The base 'amount' is in the org's default currency.
Three-letter Stripe-supported currency code (e.g. 'eur', 'gbp').
Price amount in this currency. Set explicitly per currency, not converted from the base amount.
Bills this many feature units when outstanding overage reaches it.
The ID of the feature to configure.
Number of free units included. Balance resets to this each interval for consumable features.
If true, customer has unlimited access to this feature.
Whether entity-level grants contribute to a shared customer balance.
Reset configuration for consumable features. Omit for non-consumable features like seats.
Interval at which balance resets (e.g. 'month', 'year'). For consumable features only.
Number of intervals between resets. Defaults to 1.
Pricing for usage beyond included units. Omit for free features.
Price per billing\_units after included usage. Either 'amount' or 'tiers' is required.
Amounts in additional currencies for this flat price. The base 'amount' is in the org's default currency. Only valid with 'amount', not 'tiers'.
Three-letter Stripe-supported currency code (e.g. 'eur', 'gbp').
Price amount in this currency. Set explicitly per currency, not converted from the base amount.
Tiered pricing. Either 'amount' or 'tiers' is required.
Per-currency amounts for this tier. Tier boundaries ('to') are shared across all currencies.
Three-letter Stripe-supported currency code (e.g. 'eur', 'gbp').
Per-unit amount for this tier in this currency.
Flat amount for this tier in this currency, if the tier uses one.
Billing interval. For consumable features, should match reset.interval.
Number of intervals per billing cycle. Defaults to 1.
Units per price increment. Usage is rounded UP when billed (e.g. billing\_units=100 means 101 rounds to 200).
'prepaid' for upfront payment (seats), 'usage\_based' for pay-as-you-go.
Max units purchasable beyond included. E.g. included=100, max\_purchase=300 allows 400 total. Null for no limit.
Proration settings for prepaid features. Controls mid-cycle quantity change billing.
Billing behavior when quantity increases mid-cycle.
Credit behavior when quantity decreases mid-cycle.
Rollover config for unused units. If set, unused included units carry over.
Max rollover units. Omit for unlimited rollover.
Maximum rollover as a percentage (0-100) of included + prepaid grant. Mutually exclusive with max.
When rolled over units expire.
Number of periods before expiry.
Overrides fields of this item's feature for customers on this plan (e.g. a credit system's credit\_schema).
For credit system features: replaces the feature's credit\_schema entirely for customers on this plan.
ID of the metered feature that draws from this credit system.
Number of metered-feature units priced together. Defaults to one when omitted.
Named rates chosen by event properties. The most specific match sets the rate; with no match the item's own rate applies.
Event properties this entry applies to. Every key must equal the tracked property, compared as strings.
Breaks ties between dimensions that match the same number of keys. Higher wins.
Inclusive upper usage boundary for this graduated tier. The final tier must be 'inf'.
Credits consumed per billing-unit group within this tier.
Named adjustments chosen by event properties. Every match applies: factors multiply, then adds are summed.
Event properties this entry applies to. Every key must equal the tracked property, compared as strings.
Multiplies the matched rate. All matching multipliers stack.
Added to the rate after every factor is applied, in credits per billing-unit group.
Inclusive upper usage boundary for this graduated tier. The final tier must be 'inf'.
Credits consumed per billing-unit group within this tier.
Credits consumed per billing-unit group.
For AI credit system features: replaces the feature's markup chain entirely for customers on this plan. An unset level means no markup at that level rather than inheriting the feature's.
Default percentage markup for customers on this plan. Use -100 to make usage free.
Per-provider markup percentages for customers on this plan.
Per-model markup overrides for customers on this plan.
Match items linked to this feature.
Match items with this billing method (prepaid or usage\_based).
Match items with this interval. Accepts either a BillingInterval (price-side) or a ResetInterval (reset-side, includes day/hour/minute) so price-less items keyed by reset.interval can be disambiguated.
Match items with this interval\_count. Disambiguates between items that share an interval but differ in count.
Match items whose grant equals this included usage. Omitted is a wildcard.
License links to drop, keyed by license\_plan\_id. Parallel to remove\_items.
How to handle proration when updating an existing subscription. 'prorate\_immediately' charges/credits prorated amounts now, 'none' skips creating any charges.
A unique ID to identify this subscription. Can be used to target specific subscriptions in update operations when a customer has multiple products with the same plan.
List of discounts to apply. Each discount can be an Autumn reward ID, Stripe coupon ID, or Stripe promotion code.
The ID of the reward to apply as a discount.
The promotion code to apply as a discount.
URL to redirect to after successful checkout.
Reset the billing cycle immediately with 'now', or schedule a reset at a future Unix timestamp in milliseconds.
Unix timestamp in milliseconds for when the attached plan should start. Future dates create a scheduled subscription.
Unix timestamp in milliseconds for when the attached plan should end.
Additional parameters to pass into the creation of the Stripe checkout session.
Custom line items that override the auto-generated proration invoice. Only valid for immediate plan changes (eg. upgrades or one off plans).
Amount in dollars for this line item (e.g. 10.50). Can be negative for credits.
Description for the line item.
The processor subscription ID to link. Use this to attach an existing Stripe subscription instead of creating a new one.
Whether to carry over balances from the previous plan.
Whether to carry over balances from the previous plan.
The IDs of the features to carry over balances from. If left undefined, all features will be carried over.
Whether to carry over usages from the previous plan.
Whether to carry over usages from the previous plan.
The IDs of the features to carry over usages for. If left undefined, all consumable features will be carried over.
Seat quantities for the plan's licenses, keyed by license plan.
The license plan to set seat quantity for.
Total seats for the license, inclusive of the plan's included amount — seats beyond it are paid.
Key-value metadata to attach to the Stripe subscription, invoice, and checkout session created during this attach flow. Keys prefixed with 'autumn\_' are reserved and will be stripped.
If true, skips any billing changes for the attach operation.
If true, the customer's plan is activated immediately even when payment is deferred (invoice mode) or pending (Stripe checkout). For Stripe checkout, the customer\_product is inserted before the customer completes the hosted form. Set it here rather than on `invoice_mode`, which only covers the invoice-unpaid case.
Stripe tax rate ID (txr\_...) to apply as the default tax rate on the created subscription, invoice, or checkout session line items.
Currency to bill this attach in (e.g. usd, eur). Must match the customer's currency if they are already locked to one, and the plan must offer a paid price in it. Defaults to the customer's currency, then the org default.
Plan IDs to expire on the customer as part of this attach. Each must be an active plan billed on the same subscription as the attach (or a free plan); plans on a separate subscription are rejected.
### Response
The ID of the customer
The ID of the entity the plan (if specified) will be attached to after setup.
URL to redirect the customer to setup their payment.
```json 200 theme={null}
{
"customer_id": "cus_123",
"url": "https://checkout.stripe.com/..."
}
```
# Batch Track Usage
Source: https://docs.useautumn.com/api-reference/core/batchTrack
openapi POST /v1/balances.batch_track
Enqueue up to 1000 usage events for asynchronous processing. Items are validated synchronously up front; validated items are then enqueued via SQS for background deduction by workers. The response returns 202 immediately and does not include balance information. On partial enqueue failure (some items fail to enqueue, others succeed), the endpoint still returns 202 and logs the failures server-side; clients should NOT retry, because retrying re-enqueues the already-succeeded items. A 503 is returned only when zero items were successfully enqueued (queue entirely unavailable) — that case is safe to retry.
Batch track enqueues up to **1000 usage events** in a single request. Items are validated synchronously, then enqueued for asynchronous processing. The response returns **202 immediately** without balance information — balances are deducted by background workers.
Use this when you're sending high volumes of tracking events and don't need an immediate balance read for each one.
### Common Use Cases
```typescript Batch many customers theme={null}
await autumn.balances.batchTrack([
{ customerId: "cus_alice", featureId: "ai_messages", value: 1 },
{ customerId: "cus_bob", featureId: "ai_messages", value: 1 },
{ customerId: "cus_carol", featureId: "ai_messages", value: 3 },
]);
```
```typescript Mixed features and entities theme={null}
await autumn.balances.batchTrack([
{ customerId: "cus_123", featureId: "ai_messages", value: 5 },
{ customerId: "cus_123", featureId: "api_calls", value: 12 },
{ customerId: "cus_123", featureId: "seats", entityId: "team_a", value: 1 },
]);
```
### Partial-Failure Semantics
Batch track is designed for fire-and-forget metering. On partial failure, **the endpoint still returns 202** and logs the failed items server-side. Clients should NOT retry the batch — retrying re-enqueues the already-succeeded items, which causes double-deduction. The trade-off is silent loss of the small subset that didn't enqueue vs. duplicate processing of the much larger subset that did. For event-logging workloads, gaps are preferable to duplicates.
A 503 is returned only when **zero items were successfully enqueued** (the queue is entirely unavailable). In that case the whole request is safe to retry.
If your workload requires per-item delivery guarantees, use the [single-event track endpoint](/api-reference/core/track) with client-side retry semantics instead.
### Limits
* **Maximum batch size:** 1000 items per request
* **Minimum batch size:** 1 item
* **Rate limit:** 10 requests/second per organization (separate bucket from the single `/v1/balances.track` limiter)
### Body Parameters
Array item
The ID of the customer.
The ID of the feature to track usage for. Required if event\_name is not provided.
The ID of the entity for entity-scoped balances (e.g., per-seat limits).
Event name to track usage for. Use instead of feature\_id when multiple features should be tracked from a single event.
The amount of usage to record. Defaults to 1. Use negative values to credit balance (e.g., when removing a seat).
Additional properties to attach to this usage event.
Unix timestamp in milliseconds to use for the usage event. Defaults to the current time.
How to handle usage that exceeds the available balance. "cap" (default) deducts only what fits, stopping at zero. "overflow" deducts the full value: the balance can go negative and usage limits do not clamp the deduction, though spend limits still apply.
If true, enqueue the event for asynchronous processing and return 204 immediately. The response will not include balance information.
A unique identifier for this lock. Used to finalize the lock later via balances.finalize.
Must be true to enable locking.
Unix timestamp (ms) when the lock automatically expires and releases the held balance.
# Check Permissions
Source: https://docs.useautumn.com/api-reference/core/check
openapi POST /v1/balances.check
Checks whether a customer currently has enough balance to use a feature.
Use this to gate access before a feature action. Enable sendEvent when you want to check and consume balance atomically in one request.
Check determines if a customer has access to a feature based on their current balance. Returns `allowed: true` if they have sufficient balance, the feature is unlimited, or it's a boolean feature included in their plan.
### Common Use Cases
```typescript Check feature access theme={null}
const { allowed, balance } = await autumn.check({
customerId: "cus_123",
featureId: "ai_messages"
});
if (!allowed) {
// Show upgrade prompt or paywall
}
console.log(`You have ${balance.remaining} messages left`);
```
```typescript Check and track atomically theme={null}
const { allowed } = await autumn.check({
customerId: "cus_123",
featureId: "api_calls",
requiredBalance: 1,
sendEvent: true // Deducts usage if allowed
});
```
### Body Parameters
The ID of the customer.
The ID of the feature.
The ID of the entity for entity-scoped balances (e.g., per-seat limits).
Minimum balance required for access. Returns allowed: false if the customer's balance is below this value. Defaults to 1.
Additional properties to attach to the usage event if send\_event is true.
If true, atomically records a usage event while checking access. The required\_balance value is used as the usage amount. Combines check + track in one call.
Reserve units of a feature upfront by passing a lock\_id, then call balances.finalize to confirm or release the hold.
A unique identifier for this lock. Used to finalize the lock later via balances.finalize.
Must be true to enable locking.
Unix timestamp (ms) when the lock automatically expires and releases the held balance.
How to handle a lock that exceeds the available balance. "reject" (default) returns allowed: false and reserves nothing. "cap" reserves only what fits and returns allowed: true. "overflow" reserves the full value: the balance can go negative, though spend limits still apply. balances.finalize reuses the behavior chosen here.
If true, includes upgrade/upsell information in the response when access is denied. Useful for displaying paywalls.
### Response
Whether the customer is allowed to use the feature. True if they have sufficient balance or the feature is unlimited/boolean.
The ID of the customer that was checked.
The ID of the entity, if an entity-scoped check was performed.
The required balance that was checked against.
The customer's balance for this feature. Null if the customer has no balance for this feature.
The feature ID this balance is for.
The full feature object if expanded.
The unique identifier for this feature, used in /check and /track calls.
Human-readable name displayed in the dashboard and billing UI.
Feature type: 'boolean' for on/off access, 'metered' for usage-tracked features, 'credit\_system' for unified credit pools, 'ai\_credit\_system' for model-based token pricing.
For metered features: true if usage resets periodically (API calls, credits), false if allocated persistently (seats, storage).
Event names that trigger this feature's balance. Allows multiple features to respond to a single event.
For classic credit systems: maps metered features to flat or graduated credit costs.
ID of the metered feature that draws from this credit system.
Number of metered-feature units priced together. Defaults to one when omitted.
Named rates chosen by event properties. The most specific match sets the rate; with no match the item's own rate applies.
Event properties this entry applies to. Every key must equal the tracked property, compared as strings.
Breaks ties between dimensions that match the same number of keys. Higher wins.
Inclusive upper usage boundary for this graduated tier. The final tier must be 'inf'.
Credits consumed per billing-unit group within this tier.
Named adjustments chosen by event properties. Every match applies: factors multiply, then adds are summed.
Event properties this entry applies to. Every key must equal the tracked property, compared as strings.
Multiplies the matched rate. All matching multipliers stack.
Added to the rate after every factor is applied, in credits per billing-unit group.
Inclusive upper usage boundary for this graduated tier. The final tier must be 'inf'.
Credits consumed per billing-unit group within this tier.
Credits consumed per billing-unit group.
Whether usage of this classic credit system should be itemized as invoice credits.
Per-model markup overrides for AI credit systems.
Default percentage markup for AI credit systems. Use -100 to make usage free.
Per-provider default markup percentages for AI credit systems.
Display names for the feature in billing UI and customer-facing components.
Singular form for UI display (e.g., 'API call', 'seat').
Plural form for UI display (e.g., 'API calls', 'seats').
Whether the feature is archived and hidden from the dashboard.
Processor mappings for this feature. Present when a Stripe product or meter is set.
Stripe product ID this feature's usage prices bill under.
Stripe meter ID used to create this feature's metered price.
Total balance granted (included + prepaid).
Remaining balance available for use.
Total usage consumed in the current period.
Whether this feature has unlimited usage.
Whether usage beyond the granted balance is allowed (with overage charges).
Maximum quantity that can be purchased as a top-up, or null for unlimited.
Timestamp when the balance will reset, or null for no reset.
Detailed breakdown of balance sources when stacking multiple plans or grants.
The unique identifier for this balance breakdown.
The plan ID this balance originates from, or null for standalone balances.
Amount granted from the plan's included usage.
Amount granted from prepaid purchases or top-ups.
Remaining balance available for use.
Amount consumed in the current period.
Whether this balance has unlimited usage.
Reset configuration for this balance, or null if no reset.
The reset interval (hour, day, week, month, etc.) or 'multiple' if combined from different intervals.
Number of intervals between resets (eg. 2 for bi-monthly).
Timestamp when the balance will next reset.
Pricing configuration if this balance has usage-based pricing.
The per-unit price amount.
Tiered pricing configuration if applicable.
How tiers are applied: graduated (split across bands) or volume (flat rate for the matched tier).
The number of units per billing increment (eg. \$9 / 250 units).
Whether usage is prepaid or billed pay-per-use.
Maximum quantity that can be purchased, or null for unlimited.
Timestamp when this balance expires, or null for no expiration.
Rollover balances carried over from previous periods.
Amount originally rolled over from a previous period, before any of it was consumed.
Amount of balance rolled over from a previous period.
Timestamp when the rollover balance expires.
Map of feature\_id to balance for the checked feature and any related features (e.g. linked credit systems).
The feature ID this balance is for.
The full feature object if expanded.
The unique identifier for this feature, used in /check and /track calls.
Human-readable name displayed in the dashboard and billing UI.
Feature type: 'boolean' for on/off access, 'metered' for usage-tracked features, 'credit\_system' for unified credit pools, 'ai\_credit\_system' for model-based token pricing.
For metered features: true if usage resets periodically (API calls, credits), false if allocated persistently (seats, storage).
Event names that trigger this feature's balance. Allows multiple features to respond to a single event.
For classic credit systems: maps metered features to flat or graduated credit costs.
ID of the metered feature that draws from this credit system.
Number of metered-feature units priced together. Defaults to one when omitted.
Named rates chosen by event properties. The most specific match sets the rate; with no match the item's own rate applies.
Event properties this entry applies to. Every key must equal the tracked property, compared as strings.
Breaks ties between dimensions that match the same number of keys. Higher wins.
Inclusive upper usage boundary for this graduated tier. The final tier must be 'inf'.
Credits consumed per billing-unit group within this tier.
Named adjustments chosen by event properties. Every match applies: factors multiply, then adds are summed.
Event properties this entry applies to. Every key must equal the tracked property, compared as strings.
Multiplies the matched rate. All matching multipliers stack.
Added to the rate after every factor is applied, in credits per billing-unit group.
Inclusive upper usage boundary for this graduated tier. The final tier must be 'inf'.
Credits consumed per billing-unit group within this tier.
Credits consumed per billing-unit group.
Whether usage of this classic credit system should be itemized as invoice credits.
Per-model markup overrides for AI credit systems.
Default percentage markup for AI credit systems. Use -100 to make usage free.
Per-provider default markup percentages for AI credit systems.
Display names for the feature in billing UI and customer-facing components.
Singular form for UI display (e.g., 'API call', 'seat').
Plural form for UI display (e.g., 'API calls', 'seats').
Whether the feature is archived and hidden from the dashboard.
Processor mappings for this feature. Present when a Stripe product or meter is set.
Stripe product ID this feature's usage prices bill under.
Stripe meter ID used to create this feature's metered price.
Total balance granted (included + prepaid).
Remaining balance available for use.
Total usage consumed in the current period.
Whether this feature has unlimited usage.
Whether usage beyond the granted balance is allowed (with overage charges).
Maximum quantity that can be purchased as a top-up, or null for unlimited.
Timestamp when the balance will reset, or null for no reset.
Detailed breakdown of balance sources when stacking multiple plans or grants.
The unique identifier for this balance breakdown.
The plan ID this balance originates from, or null for standalone balances.
Amount granted from the plan's included usage.
Amount granted from prepaid purchases or top-ups.
Remaining balance available for use.
Amount consumed in the current period.
Whether this balance has unlimited usage.
Reset configuration for this balance, or null if no reset.
The reset interval (hour, day, week, month, etc.) or 'multiple' if combined from different intervals.
Number of intervals between resets (eg. 2 for bi-monthly).
Timestamp when the balance will next reset.
Pricing configuration if this balance has usage-based pricing.
The per-unit price amount.
Tiered pricing configuration if applicable.
How tiers are applied: graduated (split across bands) or volume (flat rate for the matched tier).
The number of units per billing increment (eg. \$9 / 250 units).
Whether usage is prepaid or billed pay-per-use.
Maximum quantity that can be purchased, or null for unlimited.
Timestamp when this balance expires, or null for no expiration.
Rollover balances carried over from previous periods.
Amount originally rolled over from a previous period, before any of it was consumed.
Amount of balance rolled over from a previous period.
Timestamp when the rollover balance expires.
The flag associated with this check, if any.
The unique identifier for this flag.
The plan ID this flag originates from, or null for standalone flags.
Timestamp when this flag expires, or null for no expiration.
The feature ID this flag is for.
The full feature object if expanded.
The unique identifier for this feature, used in /check and /track calls.
Human-readable name displayed in the dashboard and billing UI.
Feature type: 'boolean' for on/off access, 'metered' for usage-tracked features, 'credit\_system' for unified credit pools, 'ai\_credit\_system' for model-based token pricing.
For metered features: true if usage resets periodically (API calls, credits), false if allocated persistently (seats, storage).
Event names that trigger this feature's balance. Allows multiple features to respond to a single event.
For classic credit systems: maps metered features to flat or graduated credit costs.
ID of the metered feature that draws from this credit system.
Number of metered-feature units priced together. Defaults to one when omitted.
Named rates chosen by event properties. The most specific match sets the rate; with no match the item's own rate applies.
Event properties this entry applies to. Every key must equal the tracked property, compared as strings.
Breaks ties between dimensions that match the same number of keys. Higher wins.
Inclusive upper usage boundary for this graduated tier. The final tier must be 'inf'.
Credits consumed per billing-unit group within this tier.
Named adjustments chosen by event properties. Every match applies: factors multiply, then adds are summed.
Event properties this entry applies to. Every key must equal the tracked property, compared as strings.
Multiplies the matched rate. All matching multipliers stack.
Added to the rate after every factor is applied, in credits per billing-unit group.
Inclusive upper usage boundary for this graduated tier. The final tier must be 'inf'.
Credits consumed per billing-unit group within this tier.
Credits consumed per billing-unit group.
Whether usage of this classic credit system should be itemized as invoice credits.
Per-model markup overrides for AI credit systems.
Default percentage markup for AI credit systems. Use -100 to make usage free.
Per-provider default markup percentages for AI credit systems.
Display names for the feature in billing UI and customer-facing components.
Singular form for UI display (e.g., 'API call', 'seat').
Plural form for UI display (e.g., 'API calls', 'seats').
Whether the feature is archived and hidden from the dashboard.
Processor mappings for this feature. Present when a Stripe product or meter is set.
Stripe product ID this feature's usage prices bill under.
Stripe meter ID used to create this feature's metered price.
Upgrade/upsell information when access is denied. Only present if with\_preview was true and allowed is false.
The reason access was denied. 'usage\_limit' means the customer exceeded their balance, 'feature\_flag' means the feature is not included in their plan.
A title suitable for displaying in a paywall or upgrade modal.
A message explaining why access was denied.
The ID of the feature that was checked.
The display name of the feature.
Products that would grant access to this feature. Use to display upgrade options.
The ID of the product you set when creating the product
The name of the product
Product group which this product belongs to
The environment of the product
Whether the product is an add-on and can be purchased alongside other products
Whether the product is the default product
Whether this product has been archived and is no longer available
The current version of the product
The timestamp of when the product was created in milliseconds since epoch
Array of product items that define the product's features and pricing
The type of the product item
The feature ID of the product item. If the item is a fixed price, should be `null`
Single use features are used once and then depleted, like API calls or credits. Continuous use features are those being used on an ongoing-basis, like storage or seats.
The amount of usage included for this feature.
The reset or billing interval of the product item. If null, feature will have no reset date, and if there's a price, it will be billed one-off.
The interval count of the product item.
The price of the product item. Should be `null` if tiered pricing is set.
Tiered pricing for the product item. Not applicable for fixed price items.
How tiers are applied: graduated (split across bands) or volume (flat rate for the matched tier). Defaults to graduated.
Whether the feature should be prepaid upfront or billed for how much they use end of billing period.
The amount per billing unit (eg. \$9 / 250 units)
Whether the usage should be reset when the product is enabled.
The entity feature ID of the product item if applicable.
The display of the product item.
Used in customer context. Quantity of the feature the customer has prepaid for.
Used in customer context. Quantity of the feature the customer will prepay for in the next cycle.
Configuration for rollover and proration behavior of the feature.
Free trial configuration for this product, if available
The duration type of the free trial
The length of the duration type specified
Whether the free trial is limited to one per customer fingerprint
Whether the free trial requires a card. If false, the customer can attach the product without going through a checkout flow or having a card on file.
Behavior when the trial ends. 'bill' charges the customer (default). 'revert' expires the trial and restores the customer's previous plan.
Used in customer context. Whether the free trial is available for the customer if they were to attach the product.
ID of the base variant this product is derived from
Plan-level billing controls used as customer defaults
List of auto top-up configurations per feature.
The ID of the feature (credit balance) to auto top-up.
Whether auto top-up is enabled.
When the balance drops below this threshold, an auto top-up will be purchased.
Amount of credits to add per auto top-up.
Optional rate limit to cap how often auto top-ups occur.
The time interval for the purchase limit window.
Number of intervals in the purchase limit window.
Maximum number of auto top-ups allowed within the interval.
When true, auto top-up creates a send\_invoice invoice instead of auto-charging.
List of overage spend limits per feature (caps overage spend).
Optional feature ID this spend limit applies to.
Whether the overage spend limit is enabled.
How overage\_limit is interpreted: an absolute overage cap (default) or a percentage of the main-plan allowance.
Overage cap for the feature: absolute units, or a percent (e.g. 120) when limit\_type is usage\_percentage.
When true, overage for this feature is not posted to Stripe. Usage tracking and balance resets still behave normally.
List of hard usage caps per feature (max units per interval).
The feature this usage limit applies to.
Whether this usage limit is enabled.
Maximum units allowed per interval.
Interval for the cap, aligned to the customer's billing cycle.
Window alignment. 'billing\_cycle' phases the interval to the customer's renewal time; 'utc' aligns to the UTC calendar.
When set, only usage from events whose properties match counts toward this cap. Omit to count all usage of the feature.
List of usage alert configurations per feature.
The feature ID this alert applies to.
Whether this usage alert is enabled.
The threshold value that triggers the alert. For usage or remaining, this is an absolute count. For usage\_percentage or remaining\_percentage, this is a percentage (0-100).
Whether the threshold is an absolute count or a percentage of the usage allowance or remaining balance.
What 100% means. balance: every grant on the feature. included: the plan allowance only. recurring: grants that reset. usage\_limit: the cap of the usage limit with the same feature and filter.
Only valid with basis usage\_limit. Points the alert at the usage limit carrying the same filter.
Optional user-defined label to distinguish multiple alerts on the same feature.
List of overage allowed controls per feature. When enabled, usage can exceed balance.
The feature ID this overage allowed control applies to.
Whether overage is allowed for this feature.
Scenario for when this product is used in attach flows
True if the product has no base price or usage prices
True if the product only contains a one-time price
The billing interval group for recurring products (e.g., 'monthly', 'yearly')
True if the product includes a free trial
True if the product can be updated after creation (only applicable if there are prepaid recurring prices)
```json 200 theme={null}
{
"allowed": true,
"customer_id": "cus_123",
"entity_id": null,
"required_balance": 1,
"balance": {
"feature_id": "messages",
"granted": 100,
"remaining": 72,
"usage": 28,
"unlimited": false,
"overage_allowed": false,
"max_purchase": null,
"next_reset_at": 1773851121437,
"breakdown": [
{
"id": "cus_ent_39qmLooixXLAqMywgXywjAz96rV",
"plan_id": "pro_plan",
"included_grant": 100,
"prepaid_grant": 0,
"remaining": 72,
"usage": 28,
"unlimited": false,
"reset": {
"interval": "month",
"resets_at": 1773851121437
},
"price": null,
"expires_at": null
}
]
}
}
```
# Track Usage
Source: https://docs.useautumn.com/api-reference/core/track
openapi POST /v1/balances.track
Records usage for a customer feature and returns updated balances.
Use this after an action happens to decrement usage, or send a negative value to credit balance back.
Track records usage events to decrement a customer's balance. Use this to meter feature consumption like API calls, messages sent, or credits used.
### Common Use Cases
```typescript Track single usage theme={null}
await autumn.track({
customerId: "cus_123",
featureId: "ai_messages",
value: 1
});
```
```typescript Track with idempotency theme={null}
await autumn.track(
{
customerId: "cus_123",
featureId: "api_calls",
value: 1
},
{ headers: { "Idempotency-Key": "request_abc123" } } // Retries with the same key are rejected with a 409
);
```
```typescript Credit balance (negative value) theme={null}
await autumn.track({
customerId: "cus_123",
featureId: "seats",
value: -1 // Increases balance when removing a seat
});
```
```typescript Async (fire-and-forget) theme={null}
await autumn.track({
customerId: "cus_123",
featureId: "ai_messages",
value: 1,
async: true // Returns 202 immediately; usage processed in the background
});
```
### Body Parameters
The ID of the customer.
The ID of the feature to track usage for. Required if event\_name is not provided.
The ID of the entity for entity-scoped balances (e.g., per-seat limits).
Event name to track usage for. Use instead of feature\_id when multiple features should be tracked from a single event.
The amount of usage to record. Defaults to 1. Use negative values to credit balance (e.g., when removing a seat).
Additional properties to attach to this usage event.
Unix timestamp in milliseconds to use for the usage event. Defaults to the current time.
How to handle usage that exceeds the available balance. "cap" (default) deducts only what fits, stopping at zero. "overflow" deducts the full value: the balance can go negative and usage limits do not clamp the deduction, though spend limits still apply.
If true, enqueue the event for asynchronous processing and return 204 immediately. The response will not include balance information.
A unique identifier for this lock. Used to finalize the lock later via balances.finalize.
Must be true to enable locking.
Unix timestamp (ms) when the lock automatically expires and releases the held balance.
### Response
The ID of the customer whose usage was tracked.
The ID of the entity, if entity-scoped tracking was performed.
The event name that was tracked, if event\_name was used instead of feature\_id.
The amount of usage that was recorded.
The updated balance for the tracked feature. Null if tracking by event\_name that affects multiple features.
The feature ID this balance is for.
The full feature object if expanded.
The unique identifier for this feature, used in /check and /track calls.
Human-readable name displayed in the dashboard and billing UI.
Feature type: 'boolean' for on/off access, 'metered' for usage-tracked features, 'credit\_system' for unified credit pools, 'ai\_credit\_system' for model-based token pricing.
For metered features: true if usage resets periodically (API calls, credits), false if allocated persistently (seats, storage).
Event names that trigger this feature's balance. Allows multiple features to respond to a single event.
For classic credit systems: maps metered features to flat or graduated credit costs.
ID of the metered feature that draws from this credit system.
Number of metered-feature units priced together. Defaults to one when omitted.
Named rates chosen by event properties. The most specific match sets the rate; with no match the item's own rate applies.
Event properties this entry applies to. Every key must equal the tracked property, compared as strings.
Breaks ties between dimensions that match the same number of keys. Higher wins.
Inclusive upper usage boundary for this graduated tier. The final tier must be 'inf'.
Credits consumed per billing-unit group within this tier.
Named adjustments chosen by event properties. Every match applies: factors multiply, then adds are summed.
Event properties this entry applies to. Every key must equal the tracked property, compared as strings.
Multiplies the matched rate. All matching multipliers stack.
Added to the rate after every factor is applied, in credits per billing-unit group.
Inclusive upper usage boundary for this graduated tier. The final tier must be 'inf'.
Credits consumed per billing-unit group within this tier.
Credits consumed per billing-unit group.
Whether usage of this classic credit system should be itemized as invoice credits.
Per-model markup overrides for AI credit systems.
Default percentage markup for AI credit systems. Use -100 to make usage free.
Per-provider default markup percentages for AI credit systems.
Display names for the feature in billing UI and customer-facing components.
Singular form for UI display (e.g., 'API call', 'seat').
Plural form for UI display (e.g., 'API calls', 'seats').
Whether the feature is archived and hidden from the dashboard.
Processor mappings for this feature. Present when a Stripe product or meter is set.
Stripe product ID this feature's usage prices bill under.
Stripe meter ID used to create this feature's metered price.
Total balance granted (included + prepaid).
Remaining balance available for use.
Total usage consumed in the current period.
Whether this feature has unlimited usage.
Whether usage beyond the granted balance is allowed (with overage charges).
Maximum quantity that can be purchased as a top-up, or null for unlimited.
Timestamp when the balance will reset, or null for no reset.
Detailed breakdown of balance sources when stacking multiple plans or grants.
The unique identifier for this balance breakdown.
The plan ID this balance originates from, or null for standalone balances.
Amount granted from the plan's included usage.
Amount granted from prepaid purchases or top-ups.
Remaining balance available for use.
Amount consumed in the current period.
Whether this balance has unlimited usage.
Reset configuration for this balance, or null if no reset.
The reset interval (hour, day, week, month, etc.) or 'multiple' if combined from different intervals.
Number of intervals between resets (eg. 2 for bi-monthly).
Timestamp when the balance will next reset.
Pricing configuration if this balance has usage-based pricing.
The per-unit price amount.
Tiered pricing configuration if applicable.
How tiers are applied: graduated (split across bands) or volume (flat rate for the matched tier).
The number of units per billing increment (eg. \$9 / 250 units).
Whether usage is prepaid or billed pay-per-use.
Maximum quantity that can be purchased, or null for unlimited.
Timestamp when this balance expires, or null for no expiration.
Rollover balances carried over from previous periods.
Amount originally rolled over from a previous period, before any of it was consumed.
Amount of balance rolled over from a previous period.
Timestamp when the rollover balance expires.
Map of feature\_id to updated balance for the tracked feature and any related features (e.g. linked credit systems). Value is null when the customer has no balance for that feature.
The feature ID this balance is for.
The full feature object if expanded.
The unique identifier for this feature, used in /check and /track calls.
Human-readable name displayed in the dashboard and billing UI.
Feature type: 'boolean' for on/off access, 'metered' for usage-tracked features, 'credit\_system' for unified credit pools, 'ai\_credit\_system' for model-based token pricing.
For metered features: true if usage resets periodically (API calls, credits), false if allocated persistently (seats, storage).
Event names that trigger this feature's balance. Allows multiple features to respond to a single event.
For classic credit systems: maps metered features to flat or graduated credit costs.
ID of the metered feature that draws from this credit system.
Number of metered-feature units priced together. Defaults to one when omitted.
Named rates chosen by event properties. The most specific match sets the rate; with no match the item's own rate applies.
Event properties this entry applies to. Every key must equal the tracked property, compared as strings.
Breaks ties between dimensions that match the same number of keys. Higher wins.
Inclusive upper usage boundary for this graduated tier. The final tier must be 'inf'.
Credits consumed per billing-unit group within this tier.
Named adjustments chosen by event properties. Every match applies: factors multiply, then adds are summed.
Event properties this entry applies to. Every key must equal the tracked property, compared as strings.
Multiplies the matched rate. All matching multipliers stack.
Added to the rate after every factor is applied, in credits per billing-unit group.
Inclusive upper usage boundary for this graduated tier. The final tier must be 'inf'.
Credits consumed per billing-unit group within this tier.
Credits consumed per billing-unit group.
Whether usage of this classic credit system should be itemized as invoice credits.
Per-model markup overrides for AI credit systems.
Default percentage markup for AI credit systems. Use -100 to make usage free.
Per-provider default markup percentages for AI credit systems.
Display names for the feature in billing UI and customer-facing components.
Singular form for UI display (e.g., 'API call', 'seat').
Plural form for UI display (e.g., 'API calls', 'seats').
Whether the feature is archived and hidden from the dashboard.
Processor mappings for this feature. Present when a Stripe product or meter is set.
Stripe product ID this feature's usage prices bill under.
Stripe meter ID used to create this feature's metered price.
Total balance granted (included + prepaid).
Remaining balance available for use.
Total usage consumed in the current period.
Whether this feature has unlimited usage.
Whether usage beyond the granted balance is allowed (with overage charges).
Maximum quantity that can be purchased as a top-up, or null for unlimited.
Timestamp when the balance will reset, or null for no reset.
Detailed breakdown of balance sources when stacking multiple plans or grants.
The unique identifier for this balance breakdown.
The plan ID this balance originates from, or null for standalone balances.
Amount granted from the plan's included usage.
Amount granted from prepaid purchases or top-ups.
Remaining balance available for use.
Amount consumed in the current period.
Whether this balance has unlimited usage.
Reset configuration for this balance, or null if no reset.
The reset interval (hour, day, week, month, etc.) or 'multiple' if combined from different intervals.
Number of intervals between resets (eg. 2 for bi-monthly).
Timestamp when the balance will next reset.
Pricing configuration if this balance has usage-based pricing.
The per-unit price amount.
Tiered pricing configuration if applicable.
How tiers are applied: graduated (split across bands) or volume (flat rate for the matched tier).
The number of units per billing increment (eg. \$9 / 250 units).
Whether usage is prepaid or billed pay-per-use.
Maximum quantity that can be purchased, or null for unlimited.
Timestamp when this balance expires, or null for no expiration.
Rollover balances carried over from previous periods.
Amount originally rolled over from a previous period, before any of it was consumed.
Amount of balance rolled over from a previous period.
Timestamp when the rollover balance expires.
Per-balance breakdown of what this event deducted. A single event can consume from multiple balance rows when credit systems or rollovers are involved; this surfaces each one so callers can build per-feature usage views without polling.
ID of the underlying balance row that was deducted from (customer\_entitlement or rollover).
The feature this balance belongs to.
ID of the plan/product this balance belongs to. Null when the balance can't be attributed to a single plan (e.g. it spans multiple).
Reset configuration for the balance this deduction came from, or null if the balance doesn't reset.
The reset interval (hour, day, week, month, etc.) or 'multiple' if combined from different intervals.
Number of intervals between resets (eg. 2 for bi-monthly).
Timestamp when the balance will next reset.
Amount deducted from this balance. Positive when usage was consumed, negative when credit was restored (e.g. a refund via negative track value).
```json 200 theme={null}
{
"customer_id": "cus_123",
"value": 1,
"balance": {
"feature_id": "messages",
"granted": 100,
"remaining": 72,
"usage": 28,
"unlimited": false,
"overage_allowed": false,
"max_purchase": null,
"next_reset_at": 1773851121437,
"breakdown": [
{
"id": "cus_ent_39qmLooixXLAqMywgXywjAz96rV",
"plan_id": "pro_plan",
"included_grant": 100,
"prepaid_grant": 0,
"remaining": 72,
"usage": 28,
"unlimited": false,
"reset": {
"interval": "month",
"resets_at": 1773851121437
},
"price": null,
"expires_at": null
}
]
},
"deductions": [
{
"balance_id": "cus_ent_3DdSDoyFmoA9Neecl2a2Gc507X2",
"feature_id": "messages",
"plan_id": "pro",
"reset": {
"interval": "month",
"resets_at": 1781288736881
},
"value": 1
}
]
}
```
# Delete Customer
Source: https://docs.useautumn.com/api-reference/customers/deleteCustomer
openapi POST /v1/customers.delete
Deletes a customer by ID.
### Body Parameters
ID of the customer to delete
Whether to also delete the customer in Stripe
### Response
# Get Customer
Source: https://docs.useautumn.com/api-reference/customers/getCustomer
openapi POST /v1/customers.get
Fetches a customer by ID, optionally expanding related data such as invoices or entities.
Use this when you know the customer exists or assert they exist without creating them.
### Body Parameters
ID of the customer to fetch
Expand related customer data like invoices or entities, or expand nested objects like balances.feature, flags.feature, subscriptions.plan, and purchases.plan.
### Response
Your unique identifier for the customer.
The name of the customer.
The email address of the customer.
Timestamp of customer creation in milliseconds since epoch.
A unique identifier (eg. serial number) to de-duplicate customers across devices or browsers. For example: apple device ID.
Stripe customer ID.
The environment this customer was created in.
The metadata for the customer.
Whether to send email receipts to the customer.
Billing controls for the customer (auto top-ups, etc.)
List of auto top-up configurations per feature.
The ID of the feature (credit balance) to auto top-up.
Whether auto top-up is enabled.
When the balance drops below this threshold, an auto top-up will be purchased.
Amount of credits to add per auto top-up.
Optional rate limit to cap how often auto top-ups occur. Expand billing\_controls.auto\_topups.purchase\_limit for a count of top ups and the next\_reset\_at.
The time interval for the purchase limit window. Null when no purchase limit is configured.
Number of intervals in the purchase limit window. Null when no purchase limit is configured.
Maximum number of auto top-ups allowed within the interval. Null when no purchase limit is configured.
Number of auto top-ups already consumed in the current window.
Unix ms timestamp when the current purchase window ends and the count resets.
When true, auto top-up creates a send\_invoice invoice instead of auto-charging.
Response-only: whether the entry is a customer-level override or inherited from an attached plan's defaults.
List of overage spend limits per feature (caps overage spend).
Optional feature ID this spend limit applies to.
Whether the overage spend limit is enabled.
How overage\_limit is interpreted: an absolute overage cap (default) or a percentage of the main-plan allowance.
Overage cap for the feature: absolute units, or a percent (e.g. 120) when limit\_type is usage\_percentage.
When true, overage for this feature is not posted to Stripe. Usage tracking and balance resets still behave normally.
Response-only: whether the entry is a customer-level override or inherited from an attached plan's defaults.
List of hard usage caps per feature, with current interval usage.
The feature this usage limit applies to.
Whether this usage limit is enabled.
Maximum units allowed per interval.
Interval for the cap, aligned to the customer's billing cycle.
Window alignment. 'billing\_cycle' phases the interval to the customer's renewal time; 'utc' aligns to the UTC calendar.
When set, only usage from events whose properties match counts toward this cap. Omit to count all usage of the feature.
Usage consumed in the active interval, stored in the usage-window counter.
Response-only: whether the entry is a customer-level override or inherited from an attached plan's defaults.
List of usage alert configurations per feature.
The feature ID this alert applies to.
Whether this usage alert is enabled.
The threshold value that triggers the alert. For usage or remaining, this is an absolute count. For usage\_percentage or remaining\_percentage, this is a percentage (0-100).
Whether the threshold is an absolute count or a percentage of the usage allowance or remaining balance.
What 100% means. balance: every grant on the feature. included: the plan allowance only. recurring: grants that reset. usage\_limit: the cap of the usage limit with the same feature and filter.
Only valid with basis usage\_limit. Points the alert at the usage limit carrying the same filter.
Optional user-defined label to distinguish multiple alerts on the same feature.
Response-only: whether the entry is a customer-level override or inherited from an attached plan's defaults.
List of overage allowed controls per feature. When enabled, usage can exceed balance.
The feature ID this overage allowed control applies to.
Whether overage is allowed for this feature.
Response-only: whether the entry is a customer-level override or inherited from an attached plan's defaults.
Active and scheduled recurring plans that this customer has attached.
The unique identifier of this subscription. If a subscription\_id was provided at attach time, it is used; otherwise, falls back to the internal ID.
The full plan object if expanded.
Unique identifier for the plan.
Display name of the plan.
Optional description of the plan.
Group identifier for organizing related plans. Plans in the same group are mutually exclusive.
Version number of the plan. Incremented when plan configuration changes.
User-facing version identity. Defaults to v\{n} when the version is minted.
Whether this is the active version of the plan. At most one version is active.
Whether this is an add-on plan that can be attached alongside a main plan.
If true, this plan is automatically attached when a customer is created. Used for free plans.
Base recurring price for the plan. Null for free plans or usage-only plans.
Base price amount for the plan, in major currency units (e.g. dollars).
Base price amounts in additional currencies. The base 'amount' is in the org's default currency.
Three-letter Stripe-supported currency code (e.g. 'eur', 'gbp').
Price amount in this currency. Set explicitly per currency, not converted from the base amount.
Billing interval (e.g. 'month', 'year').
Number of intervals per billing cycle. Defaults to 1.
Display text for showing this price in pricing pages.
Main display text (e.g. '\$10' or '100 messages').
Secondary display text (e.g. 'per month' or 'then \$0.5 per 100').
Payment processors this base price is connected to. Omitted when unset.
Stripe price ID. For prepaid with included > 0 this is the V2 price.
Feature configurations included in this plan. Each item defines included units, pricing, and reset behavior for a feature.
Bills this many feature units when outstanding overage reaches it.
The ID of the feature this item configures.
The full feature object if expanded.
The ID of the feature, used to refer to it in other API calls like /track or /check.
The name of the feature.
The type of the feature
Singular and plural display names for the feature.
The singular display name for the feature.
The plural display name for the feature.
Credit cost schema for credit system features.
The ID of the metered feature (should be a single\_use feature).
The credit cost of the metered feature.
Whether or not the feature is archived.
Number of free units included. For consumable features, balance resets to this number each interval.
Whether the customer has unlimited access to this feature.
Whether entity-level grants contribute to a shared customer balance.
Reset configuration for consumable features. Null for non-consumable features like seats where usage persists across billing cycles.
The interval at which the feature balance resets (e.g. 'month', 'year'). For consumable features, usage resets to 0 and included units are restored.
Number of intervals between resets. Defaults to 1.
Pricing configuration for usage beyond included units. Null if feature is entirely free.
Price per billing\_units after included usage is consumed. Mutually exclusive with tiers.
Amounts in additional currencies for this flat price. The base 'amount' is in the org's default currency. Only valid with 'amount', not 'tiers' (tiered prices carry per-currency amounts on each tier).
Three-letter Stripe-supported currency code (e.g. 'eur', 'gbp').
Price amount in this currency. Set explicitly per currency, not converted from the base amount.
Tiered pricing configuration. Each tier's 'to' INCLUDES the included amount. Either 'tiers' or 'amount' is required.
Three-letter Stripe-supported currency code (e.g. 'eur', 'gbp').
Per-unit amount for this tier in this currency.
Flat amount for this tier in this currency, if the tier uses one.
Billing interval for this price. For consumable features, should match reset.interval.
Number of intervals per billing cycle. Defaults to 1.
Number of units per price increment. Usage is rounded UP to the nearest billing\_units when billed (e.g. billing\_units=100 means 101 usage rounds to 200).
'prepaid' for features like seats where customers pay upfront, 'usage\_based' for pay-as-you-go after included usage.
Maximum units a customer can purchase beyond included. E.g. if included=100 and max\_purchase=300, customer can use up to 400 total before usage is capped. Null for no limit.
Payment processors this item price is connected to. Omitted when unset.
Stripe price ID. For prepaid with included > 0 this is the V2 price.
Display text for showing this item in pricing pages.
Main display text (e.g. '\$10' or '100 messages').
Secondary display text (e.g. 'per month' or 'then \$0.5 per 100').
Rollover configuration for unused units. If set, unused included units roll over to the next period.
Maximum rollover units. Null for unlimited rollover.
Maximum rollover as a percentage (0-100) of included + prepaid grant. Mutually exclusive with max.
When rolled over units expire.
Number of periods before expiry.
Overrides fields of this item's feature for customers on this plan (e.g. a credit system's credit\_schema).
For credit system features: replaces the feature's credit\_schema entirely for customers on this plan.
ID of the metered feature that draws from this credit system.
Number of metered-feature units priced together. Defaults to one when omitted.
Named rates chosen by event properties. The most specific match sets the rate; with no match the item's own rate applies.
Event properties this entry applies to. Every key must equal the tracked property, compared as strings.
Breaks ties between dimensions that match the same number of keys. Higher wins.
Inclusive upper usage boundary for this graduated tier. The final tier must be 'inf'.
Credits consumed per billing-unit group within this tier.
Named adjustments chosen by event properties. Every match applies: factors multiply, then adds are summed.
Event properties this entry applies to. Every key must equal the tracked property, compared as strings.
Multiplies the matched rate. All matching multipliers stack.
Added to the rate after every factor is applied, in credits per billing-unit group.
Inclusive upper usage boundary for this graduated tier. The final tier must be 'inf'.
Credits consumed per billing-unit group within this tier.
Credits consumed per billing-unit group.
For AI credit system features: replaces the feature's markup chain entirely for customers on this plan. An unset level means no markup at that level rather than inheriting the feature's.
Default percentage markup for customers on this plan. Use -100 to make usage free.
Per-provider markup percentages for customers on this plan.
Per-model markup overrides for customers on this plan.
Payment processors this plan is connected to. Omitted when unset.
Stripe product ID this plan is billed under.
Extra Stripe product IDs aliased to this plan.
Every RevenueCat product that maps to this plan. Replaces the current set.
RevenueCat product ID that grants this plan when purchased.
Prepaid quantities granted when this specific RevenueCat product is purchased, in feature units.
Free trial configuration. If set, new customers can try this plan before being charged.
Number of duration\_type periods the trial lasts.
Unit of time for the trial duration ('day', 'month', 'year').
Whether a payment method is required to start the trial. If true, customer will be charged after trial ends.
Behavior when the trial ends. 'bill' charges the customer (default). 'revert' expires the trial and restores the customer's previous plan.
Unix timestamp (ms) when the plan was created.
Environment this plan belongs to ('sandbox' or 'live').
Whether the plan is archived. Archived plans cannot be attached to new customers.
Miscellaneous plan-level configuration flags.
If true, entitlements attached to this plan will still reset on schedule even when the customer's product is in a past\_due state.
Plan-level billing controls used as customer defaults.
List of auto top-up configurations per feature.
The ID of the feature (credit balance) to auto top-up.
Whether auto top-up is enabled.
When the balance drops below this threshold, an auto top-up will be purchased.
Amount of credits to add per auto top-up.
Optional rate limit to cap how often auto top-ups occur.
The time interval for the purchase limit window.
Number of intervals in the purchase limit window.
Maximum number of auto top-ups allowed within the interval.
When true, auto top-up creates a send\_invoice invoice instead of auto-charging.
List of overage spend limits per feature (caps overage spend).
Optional feature ID this spend limit applies to.
Whether the overage spend limit is enabled.
How overage\_limit is interpreted: an absolute overage cap (default) or a percentage of the main-plan allowance.
Overage cap for the feature: absolute units, or a percent (e.g. 120) when limit\_type is usage\_percentage.
When true, overage for this feature is not posted to Stripe. Usage tracking and balance resets still behave normally.
List of hard usage caps per feature (max units per interval).
The feature this usage limit applies to.
Whether this usage limit is enabled.
Maximum units allowed per interval.
Interval for the cap, aligned to the customer's billing cycle.
Window alignment. 'billing\_cycle' phases the interval to the customer's renewal time; 'utc' aligns to the UTC calendar.
When set, only usage from events whose properties match counts toward this cap. Omit to count all usage of the feature.
List of usage alert configurations per feature.
The feature ID this alert applies to.
Whether this usage alert is enabled.
The threshold value that triggers the alert. For usage or remaining, this is an absolute count. For usage\_percentage or remaining\_percentage, this is a percentage (0-100).
Whether the threshold is an absolute count or a percentage of the usage allowance or remaining balance.
What 100% means. balance: every grant on the feature. included: the plan allowance only. recurring: grants that reset. usage\_limit: the cap of the usage limit with the same feature and filter.
Only valid with basis usage\_limit. Points the alert at the usage limit carrying the same filter.
Optional user-defined label to distinguish multiple alerts on the same feature.
List of overage allowed controls per feature. When enabled, usage can exceed balance.
The feature ID this overage allowed control applies to.
Whether overage is allowed for this feature.
Arbitrary key-value metadata defined by you for your own use. Shared across all versions of the plan.
Whether the trial on this plan is available to this customer. For example, if the customer used the trial in the past, this will be false.
The customer's current status with this plan. 'active' if attached, 'scheduled' if pending activation.
Whether the customer's active instance of this plan is set to cancel.
Whether the customer is currently on a free trial of this plan.
The action that would occur if this plan were attached to the customer.
Deprecated. Use variant\_details.base\_plan\_id instead. If this is a variant, the ID of the base plan it was created from.
Details about how this variant relates to its latest base plan.
The ID of the base plan this variant was derived from.
The customization that transforms the base plan into this variant.
Base price configuration for a plan.
Base price amount for the plan, in major currency units (e.g. dollars).
Billing interval (e.g. 'month', 'year').
Number of intervals per billing cycle. Defaults to 1.
Base price amounts in additional currencies. The base 'amount' is in the org's default currency.
Three-letter Stripe-supported currency code (e.g. 'eur', 'gbp').
Price amount in this currency. Set explicitly per currency, not converted from the base amount.
Items to add to the plan.
Bills this many feature units when outstanding overage reaches it.
The ID of the feature to configure.
Number of free units included. Balance resets to this each interval for consumable features.
If true, customer has unlimited access to this feature.
Whether entity-level grants contribute to a shared customer balance.
Reset configuration for consumable features. Omit for non-consumable features like seats.
Interval at which balance resets (e.g. 'month', 'year'). For consumable features only.
Number of intervals between resets. Defaults to 1.
Pricing for usage beyond included units. Omit for free features.
Price per billing\_units after included usage. Either 'amount' or 'tiers' is required.
Amounts in additional currencies for this flat price. The base 'amount' is in the org's default currency. Only valid with 'amount', not 'tiers'.
Three-letter Stripe-supported currency code (e.g. 'eur', 'gbp').
Price amount in this currency. Set explicitly per currency, not converted from the base amount.
Tiered pricing. Either 'amount' or 'tiers' is required.
Three-letter Stripe-supported currency code (e.g. 'eur', 'gbp').
Per-unit amount for this tier in this currency.
Flat amount for this tier in this currency, if the tier uses one.
Billing interval. For consumable features, should match reset.interval.
Number of intervals per billing cycle. Defaults to 1.
Units per price increment. Usage is rounded UP when billed (e.g. billing\_units=100 means 101 rounds to 200).
'prepaid' for upfront payment (seats), 'usage\_based' for pay-as-you-go.
Max units purchasable beyond included. E.g. included=100, max\_purchase=300 allows 400 total. Null for no limit.
Proration settings for prepaid features. Controls mid-cycle quantity change billing.
Billing behavior when quantity increases mid-cycle.
Credit behavior when quantity decreases mid-cycle.
Rollover config for unused units. If set, unused included units carry over.
Max rollover units. Omit for unlimited rollover.
Maximum rollover as a percentage (0-100) of included + prepaid grant. Mutually exclusive with max.
When rolled over units expire.
Number of periods before expiry.
Overrides fields of this item's feature for customers on this plan (e.g. a credit system's credit\_schema).
For credit system features: replaces the feature's credit\_schema entirely for customers on this plan.
ID of the metered feature that draws from this credit system.
Number of metered-feature units priced together. Defaults to one when omitted.
Named rates chosen by event properties. The most specific match sets the rate; with no match the item's own rate applies.
Event properties this entry applies to. Every key must equal the tracked property, compared as strings.
Breaks ties between dimensions that match the same number of keys. Higher wins.
Inclusive upper usage boundary for this graduated tier. The final tier must be 'inf'.
Credits consumed per billing-unit group within this tier.
Named adjustments chosen by event properties. Every match applies: factors multiply, then adds are summed.
Event properties this entry applies to. Every key must equal the tracked property, compared as strings.
Multiplies the matched rate. All matching multipliers stack.
Added to the rate after every factor is applied, in credits per billing-unit group.
Inclusive upper usage boundary for this graduated tier. The final tier must be 'inf'.
Credits consumed per billing-unit group within this tier.
Credits consumed per billing-unit group.
For AI credit system features: replaces the feature's markup chain entirely for customers on this plan. An unset level means no markup at that level rather than inheriting the feature's.
Default percentage markup for customers on this plan. Use -100 to make usage free.
Per-provider markup percentages for customers on this plan.
Per-model markup overrides for customers on this plan.
Filters selecting items to remove from the plan.
Match items linked to this feature.
Match items with this billing method (prepaid or usage\_based).
Match items with this interval. Accepts either a BillingInterval (price-side) or a ResetInterval (reset-side, includes day/hour/minute) so price-less items keyed by reset.interval can be disambiguated.
Match items with this interval\_count. Disambiguates between items that share an interval but differ in count.
Match items whose grant equals this included usage. Omitted is a wildcard.
Free trial configuration for a plan.
Number of duration\_type periods the trial lasts.
Unit of time for the trial ('day', 'month', 'year').
If true, a payment method is required to start the trial and the customer is charged when it ends. Defaults to false.
Behavior when the trial ends. 'bill' charges the customer (default). 'revert' expires the trial and restores the customer's previous plan.
Override the plan's billing controls (auto top-ups, spend limits, usage limits, usage alerts, overage allowed) for this customer.
List of auto top-up configurations per feature.
The ID of the feature (credit balance) to auto top-up.
Whether auto top-up is enabled.
When the balance drops below this threshold, an auto top-up will be purchased.
Amount of credits to add per auto top-up.
Optional rate limit to cap how often auto top-ups occur. Pass count to set the current window's consumed top-ups.
The time interval for the purchase limit window.
Number of intervals in the purchase limit window.
Maximum number of auto top-ups allowed within the interval.
Set the current window's consumed auto top-up count. Omit to leave runtime state unchanged.
When true, auto top-up creates a send\_invoice invoice instead of auto-charging.
List of overage spend limits per feature (caps overage spend).
Optional feature ID this spend limit applies to.
Whether the overage spend limit is enabled.
How overage\_limit is interpreted: an absolute overage cap (default) or a percentage of the main-plan allowance.
Overage cap for the feature: absolute units, or a percent (e.g. 120) when limit\_type is usage\_percentage.
When true, overage for this feature is not posted to Stripe. Usage tracking and balance resets still behave normally.
List of hard usage caps per feature (max units per interval).
The feature this usage limit applies to.
Whether this usage limit is enabled.
Maximum units allowed per interval.
Interval for the cap, aligned to the customer's billing cycle.
Window alignment. 'billing\_cycle' phases the interval to the customer's renewal time; 'utc' aligns to the UTC calendar.
When set, only usage from events whose properties match counts toward this cap. Omit to count all usage of the feature.
List of usage alert configurations per feature.
The feature ID this alert applies to.
Whether this usage alert is enabled.
The threshold value that triggers the alert. For usage or remaining, this is an absolute count. For usage\_percentage or remaining\_percentage, this is a percentage (0-100).
Whether the threshold is an absolute count or a percentage of the usage allowance or remaining balance.
What 100% means. balance: every grant on the feature. included: the plan allowance only. recurring: grants that reset. usage\_limit: the cap of the usage limit with the same feature and filter.
Only valid with basis usage\_limit. Points the alert at the usage limit carrying the same filter.
Optional user-defined label to distinguish multiple alerts on the same feature.
List of overage allowed controls per feature. When enabled, usage can exceed balance.
The feature ID this overage allowed control applies to.
Whether overage is allowed for this feature.
License links to add or override for this customer, keyed by license\_plan\_id. Omitted fields inherit the plan catalog link (included defaults to 1 when the license is not in the catalog). A bare entry restores the license to pure catalog inheritance.
Base price configuration for a plan.
Base price amount for the plan, in major currency units (e.g. dollars).
Billing interval (e.g. 'month', 'year').
Number of intervals per billing cycle. Defaults to 1.
Base price amounts in additional currencies. The base 'amount' is in the org's default currency.
Three-letter Stripe-supported currency code (e.g. 'eur', 'gbp').
Price amount in this currency. Set explicitly per currency, not converted from the base amount.
Bills this many feature units when outstanding overage reaches it.
The ID of the feature to configure.
Number of free units included. Balance resets to this each interval for consumable features.
If true, customer has unlimited access to this feature.
Whether entity-level grants contribute to a shared customer balance.
Reset configuration for consumable features. Omit for non-consumable features like seats.
Interval at which balance resets (e.g. 'month', 'year'). For consumable features only.
Number of intervals between resets. Defaults to 1.
Pricing for usage beyond included units. Omit for free features.
Price per billing\_units after included usage. Either 'amount' or 'tiers' is required.
Amounts in additional currencies for this flat price. The base 'amount' is in the org's default currency. Only valid with 'amount', not 'tiers'.
Three-letter Stripe-supported currency code (e.g. 'eur', 'gbp').
Price amount in this currency. Set explicitly per currency, not converted from the base amount.
Tiered pricing. Either 'amount' or 'tiers' is required.
Three-letter Stripe-supported currency code (e.g. 'eur', 'gbp').
Per-unit amount for this tier in this currency.
Flat amount for this tier in this currency, if the tier uses one.
Billing interval. For consumable features, should match reset.interval.
Number of intervals per billing cycle. Defaults to 1.
Units per price increment. Usage is rounded UP when billed (e.g. billing\_units=100 means 101 rounds to 200).
'prepaid' for upfront payment (seats), 'usage\_based' for pay-as-you-go.
Max units purchasable beyond included. E.g. included=100, max\_purchase=300 allows 400 total. Null for no limit.
Proration settings for prepaid features. Controls mid-cycle quantity change billing.
Billing behavior when quantity increases mid-cycle.
Credit behavior when quantity decreases mid-cycle.
Rollover config for unused units. If set, unused included units carry over.
Max rollover units. Omit for unlimited rollover.
Maximum rollover as a percentage (0-100) of included + prepaid grant. Mutually exclusive with max.
When rolled over units expire.
Number of periods before expiry.
Overrides fields of this item's feature for customers on this plan (e.g. a credit system's credit\_schema).
For credit system features: replaces the feature's credit\_schema entirely for customers on this plan.
ID of the metered feature that draws from this credit system.
Number of metered-feature units priced together. Defaults to one when omitted.
Named rates chosen by event properties. The most specific match sets the rate; with no match the item's own rate applies.
Event properties this entry applies to. Every key must equal the tracked property, compared as strings.
Breaks ties between dimensions that match the same number of keys. Higher wins.
Inclusive upper usage boundary for this graduated tier. The final tier must be 'inf'.
Credits consumed per billing-unit group within this tier.
Named adjustments chosen by event properties. Every match applies: factors multiply, then adds are summed.
Event properties this entry applies to. Every key must equal the tracked property, compared as strings.
Multiplies the matched rate. All matching multipliers stack.
Added to the rate after every factor is applied, in credits per billing-unit group.
Inclusive upper usage boundary for this graduated tier. The final tier must be 'inf'.
Credits consumed per billing-unit group within this tier.
Credits consumed per billing-unit group.
For AI credit system features: replaces the feature's markup chain entirely for customers on this plan. An unset level means no markup at that level rather than inheriting the feature's.
Default percentage markup for customers on this plan. Use -100 to make usage free.
Per-provider markup percentages for customers on this plan.
Per-model markup overrides for customers on this plan.
Match items linked to this feature.
Match items with this billing method (prepaid or usage\_based).
Match items with this interval. Accepts either a BillingInterval (price-side) or a ResetInterval (reset-side, includes day/hour/minute) so price-less items keyed by reset.interval can be disambiguated.
Match items with this interval\_count. Disambiguates between items that share an interval but differ in count.
Match items whose grant equals this included usage. Omitted is a wildcard.
License links to drop, keyed by license\_plan\_id. Parallel to remove\_items.
The unique identifier of the subscribed plan.
Whether the plan was automatically enabled for the customer.
Whether this is an add-on plan rather than a base subscription.
Current status of the subscription.
Whether the subscription has overdue payments.
Timestamp when the subscription was canceled, or null if not canceled.
Timestamp when the subscription will expire, or null if no expiry set.
Timestamp when the trial period ends, or null if not on trial.
Timestamp when the subscription started.
Start timestamp of the current billing period.
End timestamp of the current billing period.
Number of units of this subscription (for per-seat plans).
Whether this subscription is attached at the customer level or entity level.
One-time purchases made by the customer.
The full plan object if expanded.
Unique identifier for the plan.
Display name of the plan.
Optional description of the plan.
Group identifier for organizing related plans. Plans in the same group are mutually exclusive.
Version number of the plan. Incremented when plan configuration changes.
User-facing version identity. Defaults to v\{n} when the version is minted.
Whether this is the active version of the plan. At most one version is active.
Whether this is an add-on plan that can be attached alongside a main plan.
If true, this plan is automatically attached when a customer is created. Used for free plans.
Base recurring price for the plan. Null for free plans or usage-only plans.
Base price amount for the plan, in major currency units (e.g. dollars).
Base price amounts in additional currencies. The base 'amount' is in the org's default currency.
Three-letter Stripe-supported currency code (e.g. 'eur', 'gbp').
Price amount in this currency. Set explicitly per currency, not converted from the base amount.
Billing interval (e.g. 'month', 'year').
Number of intervals per billing cycle. Defaults to 1.
Display text for showing this price in pricing pages.
Main display text (e.g. '\$10' or '100 messages').
Secondary display text (e.g. 'per month' or 'then \$0.5 per 100').
Payment processors this base price is connected to. Omitted when unset.
Stripe price ID. For prepaid with included > 0 this is the V2 price.
Feature configurations included in this plan. Each item defines included units, pricing, and reset behavior for a feature.
Bills this many feature units when outstanding overage reaches it.
The ID of the feature this item configures.
The full feature object if expanded.
The ID of the feature, used to refer to it in other API calls like /track or /check.
The name of the feature.
The type of the feature
Singular and plural display names for the feature.
The singular display name for the feature.
The plural display name for the feature.
Credit cost schema for credit system features.
The ID of the metered feature (should be a single\_use feature).
The credit cost of the metered feature.
Whether or not the feature is archived.
Number of free units included. For consumable features, balance resets to this number each interval.
Whether the customer has unlimited access to this feature.
Whether entity-level grants contribute to a shared customer balance.
Reset configuration for consumable features. Null for non-consumable features like seats where usage persists across billing cycles.
The interval at which the feature balance resets (e.g. 'month', 'year'). For consumable features, usage resets to 0 and included units are restored.
Number of intervals between resets. Defaults to 1.
Pricing configuration for usage beyond included units. Null if feature is entirely free.
Price per billing\_units after included usage is consumed. Mutually exclusive with tiers.
Amounts in additional currencies for this flat price. The base 'amount' is in the org's default currency. Only valid with 'amount', not 'tiers' (tiered prices carry per-currency amounts on each tier).
Three-letter Stripe-supported currency code (e.g. 'eur', 'gbp').
Price amount in this currency. Set explicitly per currency, not converted from the base amount.
Tiered pricing configuration. Each tier's 'to' INCLUDES the included amount. Either 'tiers' or 'amount' is required.
Three-letter Stripe-supported currency code (e.g. 'eur', 'gbp').
Per-unit amount for this tier in this currency.
Flat amount for this tier in this currency, if the tier uses one.
Billing interval for this price. For consumable features, should match reset.interval.
Number of intervals per billing cycle. Defaults to 1.
Number of units per price increment. Usage is rounded UP to the nearest billing\_units when billed (e.g. billing\_units=100 means 101 usage rounds to 200).
'prepaid' for features like seats where customers pay upfront, 'usage\_based' for pay-as-you-go after included usage.
Maximum units a customer can purchase beyond included. E.g. if included=100 and max\_purchase=300, customer can use up to 400 total before usage is capped. Null for no limit.
Payment processors this item price is connected to. Omitted when unset.
Stripe price ID. For prepaid with included > 0 this is the V2 price.
Display text for showing this item in pricing pages.
Main display text (e.g. '\$10' or '100 messages').
Secondary display text (e.g. 'per month' or 'then \$0.5 per 100').
Rollover configuration for unused units. If set, unused included units roll over to the next period.
Maximum rollover units. Null for unlimited rollover.
Maximum rollover as a percentage (0-100) of included + prepaid grant. Mutually exclusive with max.
When rolled over units expire.
Number of periods before expiry.
Overrides fields of this item's feature for customers on this plan (e.g. a credit system's credit\_schema).
For credit system features: replaces the feature's credit\_schema entirely for customers on this plan.
ID of the metered feature that draws from this credit system.
Number of metered-feature units priced together. Defaults to one when omitted.
Named rates chosen by event properties. The most specific match sets the rate; with no match the item's own rate applies.
Event properties this entry applies to. Every key must equal the tracked property, compared as strings.
Breaks ties between dimensions that match the same number of keys. Higher wins.
Inclusive upper usage boundary for this graduated tier. The final tier must be 'inf'.
Credits consumed per billing-unit group within this tier.
Named adjustments chosen by event properties. Every match applies: factors multiply, then adds are summed.
Event properties this entry applies to. Every key must equal the tracked property, compared as strings.
Multiplies the matched rate. All matching multipliers stack.
Added to the rate after every factor is applied, in credits per billing-unit group.
Inclusive upper usage boundary for this graduated tier. The final tier must be 'inf'.
Credits consumed per billing-unit group within this tier.
Credits consumed per billing-unit group.
For AI credit system features: replaces the feature's markup chain entirely for customers on this plan. An unset level means no markup at that level rather than inheriting the feature's.
Default percentage markup for customers on this plan. Use -100 to make usage free.
Per-provider markup percentages for customers on this plan.
Per-model markup overrides for customers on this plan.
Payment processors this plan is connected to. Omitted when unset.
Stripe product ID this plan is billed under.
Extra Stripe product IDs aliased to this plan.
Every RevenueCat product that maps to this plan. Replaces the current set.
RevenueCat product ID that grants this plan when purchased.
Prepaid quantities granted when this specific RevenueCat product is purchased, in feature units.
Free trial configuration. If set, new customers can try this plan before being charged.
Number of duration\_type periods the trial lasts.
Unit of time for the trial duration ('day', 'month', 'year').
Whether a payment method is required to start the trial. If true, customer will be charged after trial ends.
Behavior when the trial ends. 'bill' charges the customer (default). 'revert' expires the trial and restores the customer's previous plan.
Unix timestamp (ms) when the plan was created.
Environment this plan belongs to ('sandbox' or 'live').
Whether the plan is archived. Archived plans cannot be attached to new customers.
Miscellaneous plan-level configuration flags.
If true, entitlements attached to this plan will still reset on schedule even when the customer's product is in a past\_due state.
Plan-level billing controls used as customer defaults.
List of auto top-up configurations per feature.
The ID of the feature (credit balance) to auto top-up.
Whether auto top-up is enabled.
When the balance drops below this threshold, an auto top-up will be purchased.
Amount of credits to add per auto top-up.
Optional rate limit to cap how often auto top-ups occur.
The time interval for the purchase limit window.
Number of intervals in the purchase limit window.
Maximum number of auto top-ups allowed within the interval.
When true, auto top-up creates a send\_invoice invoice instead of auto-charging.
List of overage spend limits per feature (caps overage spend).
Optional feature ID this spend limit applies to.
Whether the overage spend limit is enabled.
How overage\_limit is interpreted: an absolute overage cap (default) or a percentage of the main-plan allowance.
Overage cap for the feature: absolute units, or a percent (e.g. 120) when limit\_type is usage\_percentage.
When true, overage for this feature is not posted to Stripe. Usage tracking and balance resets still behave normally.
List of hard usage caps per feature (max units per interval).
The feature this usage limit applies to.
Whether this usage limit is enabled.
Maximum units allowed per interval.
Interval for the cap, aligned to the customer's billing cycle.
Window alignment. 'billing\_cycle' phases the interval to the customer's renewal time; 'utc' aligns to the UTC calendar.
When set, only usage from events whose properties match counts toward this cap. Omit to count all usage of the feature.
List of usage alert configurations per feature.
The feature ID this alert applies to.
Whether this usage alert is enabled.
The threshold value that triggers the alert. For usage or remaining, this is an absolute count. For usage\_percentage or remaining\_percentage, this is a percentage (0-100).
Whether the threshold is an absolute count or a percentage of the usage allowance or remaining balance.
What 100% means. balance: every grant on the feature. included: the plan allowance only. recurring: grants that reset. usage\_limit: the cap of the usage limit with the same feature and filter.
Only valid with basis usage\_limit. Points the alert at the usage limit carrying the same filter.
Optional user-defined label to distinguish multiple alerts on the same feature.
List of overage allowed controls per feature. When enabled, usage can exceed balance.
The feature ID this overage allowed control applies to.
Whether overage is allowed for this feature.
Arbitrary key-value metadata defined by you for your own use. Shared across all versions of the plan.
Whether the trial on this plan is available to this customer. For example, if the customer used the trial in the past, this will be false.
The customer's current status with this plan. 'active' if attached, 'scheduled' if pending activation.
Whether the customer's active instance of this plan is set to cancel.
Whether the customer is currently on a free trial of this plan.
The action that would occur if this plan were attached to the customer.
Deprecated. Use variant\_details.base\_plan\_id instead. If this is a variant, the ID of the base plan it was created from.
Details about how this variant relates to its latest base plan.
The ID of the base plan this variant was derived from.
The customization that transforms the base plan into this variant.
Base price configuration for a plan.
Base price amount for the plan, in major currency units (e.g. dollars).
Billing interval (e.g. 'month', 'year').
Number of intervals per billing cycle. Defaults to 1.
Base price amounts in additional currencies. The base 'amount' is in the org's default currency.
Three-letter Stripe-supported currency code (e.g. 'eur', 'gbp').
Price amount in this currency. Set explicitly per currency, not converted from the base amount.
Items to add to the plan.
Bills this many feature units when outstanding overage reaches it.
The ID of the feature to configure.
Number of free units included. Balance resets to this each interval for consumable features.
If true, customer has unlimited access to this feature.
Whether entity-level grants contribute to a shared customer balance.
Reset configuration for consumable features. Omit for non-consumable features like seats.
Interval at which balance resets (e.g. 'month', 'year'). For consumable features only.
Number of intervals between resets. Defaults to 1.
Pricing for usage beyond included units. Omit for free features.
Price per billing\_units after included usage. Either 'amount' or 'tiers' is required.
Amounts in additional currencies for this flat price. The base 'amount' is in the org's default currency. Only valid with 'amount', not 'tiers'.
Three-letter Stripe-supported currency code (e.g. 'eur', 'gbp').
Price amount in this currency. Set explicitly per currency, not converted from the base amount.
Tiered pricing. Either 'amount' or 'tiers' is required.
Three-letter Stripe-supported currency code (e.g. 'eur', 'gbp').
Per-unit amount for this tier in this currency.
Flat amount for this tier in this currency, if the tier uses one.
Billing interval. For consumable features, should match reset.interval.
Number of intervals per billing cycle. Defaults to 1.
Units per price increment. Usage is rounded UP when billed (e.g. billing\_units=100 means 101 rounds to 200).
'prepaid' for upfront payment (seats), 'usage\_based' for pay-as-you-go.
Max units purchasable beyond included. E.g. included=100, max\_purchase=300 allows 400 total. Null for no limit.
Proration settings for prepaid features. Controls mid-cycle quantity change billing.
Billing behavior when quantity increases mid-cycle.
Credit behavior when quantity decreases mid-cycle.
Rollover config for unused units. If set, unused included units carry over.
Max rollover units. Omit for unlimited rollover.
Maximum rollover as a percentage (0-100) of included + prepaid grant. Mutually exclusive with max.
When rolled over units expire.
Number of periods before expiry.
Overrides fields of this item's feature for customers on this plan (e.g. a credit system's credit\_schema).
For credit system features: replaces the feature's credit\_schema entirely for customers on this plan.
ID of the metered feature that draws from this credit system.
Number of metered-feature units priced together. Defaults to one when omitted.
Named rates chosen by event properties. The most specific match sets the rate; with no match the item's own rate applies.
Event properties this entry applies to. Every key must equal the tracked property, compared as strings.
Breaks ties between dimensions that match the same number of keys. Higher wins.
Inclusive upper usage boundary for this graduated tier. The final tier must be 'inf'.
Credits consumed per billing-unit group within this tier.
Named adjustments chosen by event properties. Every match applies: factors multiply, then adds are summed.
Event properties this entry applies to. Every key must equal the tracked property, compared as strings.
Multiplies the matched rate. All matching multipliers stack.
Added to the rate after every factor is applied, in credits per billing-unit group.
Inclusive upper usage boundary for this graduated tier. The final tier must be 'inf'.
Credits consumed per billing-unit group within this tier.
Credits consumed per billing-unit group.
For AI credit system features: replaces the feature's markup chain entirely for customers on this plan. An unset level means no markup at that level rather than inheriting the feature's.
Default percentage markup for customers on this plan. Use -100 to make usage free.
Per-provider markup percentages for customers on this plan.
Per-model markup overrides for customers on this plan.
Filters selecting items to remove from the plan.
Match items linked to this feature.
Match items with this billing method (prepaid or usage\_based).
Match items with this interval. Accepts either a BillingInterval (price-side) or a ResetInterval (reset-side, includes day/hour/minute) so price-less items keyed by reset.interval can be disambiguated.
Match items with this interval\_count. Disambiguates between items that share an interval but differ in count.
Match items whose grant equals this included usage. Omitted is a wildcard.
Free trial configuration for a plan.
Number of duration\_type periods the trial lasts.
Unit of time for the trial ('day', 'month', 'year').
If true, a payment method is required to start the trial and the customer is charged when it ends. Defaults to false.
Behavior when the trial ends. 'bill' charges the customer (default). 'revert' expires the trial and restores the customer's previous plan.
Override the plan's billing controls (auto top-ups, spend limits, usage limits, usage alerts, overage allowed) for this customer.
List of auto top-up configurations per feature.
The ID of the feature (credit balance) to auto top-up.
Whether auto top-up is enabled.
When the balance drops below this threshold, an auto top-up will be purchased.
Amount of credits to add per auto top-up.
Optional rate limit to cap how often auto top-ups occur. Pass count to set the current window's consumed top-ups.
The time interval for the purchase limit window.
Number of intervals in the purchase limit window.
Maximum number of auto top-ups allowed within the interval.
Set the current window's consumed auto top-up count. Omit to leave runtime state unchanged.
When true, auto top-up creates a send\_invoice invoice instead of auto-charging.
List of overage spend limits per feature (caps overage spend).
Optional feature ID this spend limit applies to.
Whether the overage spend limit is enabled.
How overage\_limit is interpreted: an absolute overage cap (default) or a percentage of the main-plan allowance.
Overage cap for the feature: absolute units, or a percent (e.g. 120) when limit\_type is usage\_percentage.
When true, overage for this feature is not posted to Stripe. Usage tracking and balance resets still behave normally.
List of hard usage caps per feature (max units per interval).
The feature this usage limit applies to.
Whether this usage limit is enabled.
Maximum units allowed per interval.
Interval for the cap, aligned to the customer's billing cycle.
Window alignment. 'billing\_cycle' phases the interval to the customer's renewal time; 'utc' aligns to the UTC calendar.
When set, only usage from events whose properties match counts toward this cap. Omit to count all usage of the feature.
List of usage alert configurations per feature.
The feature ID this alert applies to.
Whether this usage alert is enabled.
The threshold value that triggers the alert. For usage or remaining, this is an absolute count. For usage\_percentage or remaining\_percentage, this is a percentage (0-100).
Whether the threshold is an absolute count or a percentage of the usage allowance or remaining balance.
What 100% means. balance: every grant on the feature. included: the plan allowance only. recurring: grants that reset. usage\_limit: the cap of the usage limit with the same feature and filter.
Only valid with basis usage\_limit. Points the alert at the usage limit carrying the same filter.
Optional user-defined label to distinguish multiple alerts on the same feature.
List of overage allowed controls per feature. When enabled, usage can exceed balance.
The feature ID this overage allowed control applies to.
Whether overage is allowed for this feature.
License links to add or override for this customer, keyed by license\_plan\_id. Omitted fields inherit the plan catalog link (included defaults to 1 when the license is not in the catalog). A bare entry restores the license to pure catalog inheritance.
Base price configuration for a plan.
Base price amount for the plan, in major currency units (e.g. dollars).
Billing interval (e.g. 'month', 'year').
Number of intervals per billing cycle. Defaults to 1.
Base price amounts in additional currencies. The base 'amount' is in the org's default currency.
Three-letter Stripe-supported currency code (e.g. 'eur', 'gbp').
Price amount in this currency. Set explicitly per currency, not converted from the base amount.
Bills this many feature units when outstanding overage reaches it.
The ID of the feature to configure.
Number of free units included. Balance resets to this each interval for consumable features.
If true, customer has unlimited access to this feature.
Whether entity-level grants contribute to a shared customer balance.
Reset configuration for consumable features. Omit for non-consumable features like seats.
Interval at which balance resets (e.g. 'month', 'year'). For consumable features only.
Number of intervals between resets. Defaults to 1.
Pricing for usage beyond included units. Omit for free features.
Price per billing\_units after included usage. Either 'amount' or 'tiers' is required.
Amounts in additional currencies for this flat price. The base 'amount' is in the org's default currency. Only valid with 'amount', not 'tiers'.
Three-letter Stripe-supported currency code (e.g. 'eur', 'gbp').
Price amount in this currency. Set explicitly per currency, not converted from the base amount.
Tiered pricing. Either 'amount' or 'tiers' is required.
Three-letter Stripe-supported currency code (e.g. 'eur', 'gbp').
Per-unit amount for this tier in this currency.
Flat amount for this tier in this currency, if the tier uses one.
Billing interval. For consumable features, should match reset.interval.
Number of intervals per billing cycle. Defaults to 1.
Units per price increment. Usage is rounded UP when billed (e.g. billing\_units=100 means 101 rounds to 200).
'prepaid' for upfront payment (seats), 'usage\_based' for pay-as-you-go.
Max units purchasable beyond included. E.g. included=100, max\_purchase=300 allows 400 total. Null for no limit.
Proration settings for prepaid features. Controls mid-cycle quantity change billing.
Billing behavior when quantity increases mid-cycle.
Credit behavior when quantity decreases mid-cycle.
Rollover config for unused units. If set, unused included units carry over.
Max rollover units. Omit for unlimited rollover.
Maximum rollover as a percentage (0-100) of included + prepaid grant. Mutually exclusive with max.
When rolled over units expire.
Number of periods before expiry.
Overrides fields of this item's feature for customers on this plan (e.g. a credit system's credit\_schema).
For credit system features: replaces the feature's credit\_schema entirely for customers on this plan.
ID of the metered feature that draws from this credit system.
Number of metered-feature units priced together. Defaults to one when omitted.
Named rates chosen by event properties. The most specific match sets the rate; with no match the item's own rate applies.
Event properties this entry applies to. Every key must equal the tracked property, compared as strings.
Breaks ties between dimensions that match the same number of keys. Higher wins.
Inclusive upper usage boundary for this graduated tier. The final tier must be 'inf'.
Credits consumed per billing-unit group within this tier.
Named adjustments chosen by event properties. Every match applies: factors multiply, then adds are summed.
Event properties this entry applies to. Every key must equal the tracked property, compared as strings.
Multiplies the matched rate. All matching multipliers stack.
Added to the rate after every factor is applied, in credits per billing-unit group.
Inclusive upper usage boundary for this graduated tier. The final tier must be 'inf'.
Credits consumed per billing-unit group within this tier.
Credits consumed per billing-unit group.
For AI credit system features: replaces the feature's markup chain entirely for customers on this plan. An unset level means no markup at that level rather than inheriting the feature's.
Default percentage markup for customers on this plan. Use -100 to make usage free.
Per-provider markup percentages for customers on this plan.
Per-model markup overrides for customers on this plan.
Match items linked to this feature.
Match items with this billing method (prepaid or usage\_based).
Match items with this interval. Accepts either a BillingInterval (price-side) or a ResetInterval (reset-side, includes day/hour/minute) so price-less items keyed by reset.interval can be disambiguated.
Match items with this interval\_count. Disambiguates between items that share an interval but differ in count.
Match items whose grant equals this included usage. Omitted is a wildcard.
License links to drop, keyed by license\_plan\_id. Parallel to remove\_items.
The unique identifier of the purchased plan.
Timestamp when the purchase expires, or null for lifetime access.
Timestamp when the purchase was made.
Number of units purchased.
Whether this purchase is attached at the customer level or entity level.
License seat pools granted by the customer's plans, with seat counts.
The plan offered as an assignable license.
The plan that offers this license.
Display name of the license plan.
Total seats the customer has for this license, included plus paid.
Seats currently assigned to entities.
Seats still available to assign.
Paid seats purchased on top of the plan's included amount.
Feature balances keyed by feature ID, showing usage limits and remaining amounts.
The feature ID this balance is for.
The full feature object if expanded.
The unique identifier for this feature, used in /check and /track calls.
Human-readable name displayed in the dashboard and billing UI.
Feature type: 'boolean' for on/off access, 'metered' for usage-tracked features, 'credit\_system' for unified credit pools, 'ai\_credit\_system' for model-based token pricing.
For metered features: true if usage resets periodically (API calls, credits), false if allocated persistently (seats, storage).
Event names that trigger this feature's balance. Allows multiple features to respond to a single event.
For classic credit systems: maps metered features to flat or graduated credit costs.
ID of the metered feature that draws from this credit system.
Number of metered-feature units priced together. Defaults to one when omitted.
Named rates chosen by event properties. The most specific match sets the rate; with no match the item's own rate applies.
Event properties this entry applies to. Every key must equal the tracked property, compared as strings.
Breaks ties between dimensions that match the same number of keys. Higher wins.
Inclusive upper usage boundary for this graduated tier. The final tier must be 'inf'.
Credits consumed per billing-unit group within this tier.
Named adjustments chosen by event properties. Every match applies: factors multiply, then adds are summed.
Event properties this entry applies to. Every key must equal the tracked property, compared as strings.
Multiplies the matched rate. All matching multipliers stack.
Added to the rate after every factor is applied, in credits per billing-unit group.
Inclusive upper usage boundary for this graduated tier. The final tier must be 'inf'.
Credits consumed per billing-unit group within this tier.
Credits consumed per billing-unit group.
Whether usage of this classic credit system should be itemized as invoice credits.
Per-model markup overrides for AI credit systems.
Default percentage markup for AI credit systems. Use -100 to make usage free.
Per-provider default markup percentages for AI credit systems.
Display names for the feature in billing UI and customer-facing components.
Singular form for UI display (e.g., 'API call', 'seat').
Plural form for UI display (e.g., 'API calls', 'seats').
Whether the feature is archived and hidden from the dashboard.
Processor mappings for this feature. Present when a Stripe product or meter is set.
Stripe product ID this feature's usage prices bill under.
Stripe meter ID used to create this feature's metered price.
Total balance granted (included + prepaid).
Remaining balance available for use.
Total usage consumed in the current period.
Whether this feature has unlimited usage.
Whether usage beyond the granted balance is allowed (with overage charges).
Maximum quantity that can be purchased as a top-up, or null for unlimited.
Timestamp when the balance will reset, or null for no reset.
Detailed breakdown of balance sources when stacking multiple plans or grants.
The unique identifier for this balance breakdown.
The plan ID this balance originates from, or null for standalone balances.
Amount granted from the plan's included usage.
Amount granted from prepaid purchases or top-ups.
Remaining balance available for use.
Amount consumed in the current period.
Whether this balance has unlimited usage.
Reset configuration for this balance, or null if no reset.
The reset interval (hour, day, week, month, etc.) or 'multiple' if combined from different intervals.
Number of intervals between resets (eg. 2 for bi-monthly).
Timestamp when the balance will next reset.
Pricing configuration if this balance has usage-based pricing.
The per-unit price amount.
Tiered pricing configuration if applicable.
How tiers are applied: graduated (split across bands) or volume (flat rate for the matched tier).
The number of units per billing increment (eg. \$9 / 250 units).
Whether usage is prepaid or billed pay-per-use.
Maximum quantity that can be purchased, or null for unlimited.
Timestamp when this balance expires, or null for no expiration.
Rollover balances carried over from previous periods.
Amount originally rolled over from a previous period, before any of it was consumed.
Amount of balance rolled over from a previous period.
Timestamp when the rollover balance expires.
Boolean feature flags keyed by feature ID, showing enabled access for on/off features.
The unique identifier for this flag.
The plan ID this flag originates from, or null for standalone flags.
Timestamp when this flag expires, or null for no expiration.
The feature ID this flag is for.
The full feature object if expanded.
The unique identifier for this feature, used in /check and /track calls.
Human-readable name displayed in the dashboard and billing UI.
Feature type: 'boolean' for on/off access, 'metered' for usage-tracked features, 'credit\_system' for unified credit pools, 'ai\_credit\_system' for model-based token pricing.
For metered features: true if usage resets periodically (API calls, credits), false if allocated persistently (seats, storage).
Event names that trigger this feature's balance. Allows multiple features to respond to a single event.
For classic credit systems: maps metered features to flat or graduated credit costs.
ID of the metered feature that draws from this credit system.
Number of metered-feature units priced together. Defaults to one when omitted.
Named rates chosen by event properties. The most specific match sets the rate; with no match the item's own rate applies.
Event properties this entry applies to. Every key must equal the tracked property, compared as strings.
Breaks ties between dimensions that match the same number of keys. Higher wins.
Inclusive upper usage boundary for this graduated tier. The final tier must be 'inf'.
Credits consumed per billing-unit group within this tier.
Named adjustments chosen by event properties. Every match applies: factors multiply, then adds are summed.
Event properties this entry applies to. Every key must equal the tracked property, compared as strings.
Multiplies the matched rate. All matching multipliers stack.
Added to the rate after every factor is applied, in credits per billing-unit group.
Inclusive upper usage boundary for this graduated tier. The final tier must be 'inf'.
Credits consumed per billing-unit group within this tier.
Credits consumed per billing-unit group.
Whether usage of this classic credit system should be itemized as invoice credits.
Per-model markup overrides for AI credit systems.
Default percentage markup for AI credit systems. Use -100 to make usage free.
Per-provider default markup percentages for AI credit systems.
Display names for the feature in billing UI and customer-facing components.
Singular form for UI display (e.g., 'API call', 'seat').
Plural form for UI display (e.g., 'API calls', 'seats').
Whether the feature is archived and hidden from the dashboard.
Processor mappings for this feature. Present when a Stripe product or meter is set.
Stripe product ID this feature's usage prices bill under.
Stripe meter ID used to create this feature's metered price.
Configuration for the customer.
Whether to disable the shared customer-level pool for entities.
Stops Autumn from posting usage-overage line items to Stripe for this customer. Check/track and balance resets still behave normally. When set, this overrides the organization-level disable\_overage\_billing setting.
Payment processors this customer is connected to (Stripe, Vercel, RevenueCat). Omitted entirely when the customer has not been created in any processor.
Stripe processor connection for the customer.
Stripe customer ID.
Vercel processor connection for the customer (public-safe subset).
Vercel marketplace installation ID for this customer.
Vercel account ID associated with the installation.
RevenueCat processor connection for the customer.
Customer's external ID, used as the RevenueCat app user ID. Null if the customer has no external ID set.
Invoices for this customer.
Array of plan IDs included in this invoice
The Stripe invoice ID
The billing processor that owns this invoice.
The status of the invoice
The total amount of the invoice
The currency code for the invoice
Timestamp when the invoice was created
URL to the Stripe-hosted invoice page
Upcoming invoice for each of this customer's Stripe subscriptions.
Plan IDs contributing line items to this invoice.
Unix timestamp (milliseconds) when this invoice will be created.
The three-letter ISO currency code. All amounts are in the currency's major unit (e.g., dollars for USD).
The total before discounts.
The total after discounts.
The line items this invoice will contain: usage accrued in the closing cycle, plus recurring charges for the opening cycle.
The name of the line item to display to the customer if you're building a UI. It will either be the plan name or the feature name.
A detailed description of the line item.
The amount before discounts and tax for this line item.
The final amount after discounts and tax for this line item.
List of discounts applied to this line item.
The ID of the plan that this line item belongs to.
The ID of the feature that this line item belongs to.
The period of time that this line item is being charged for.
The start of the period in milliseconds since the Unix epoch.
The end of the period in milliseconds since the Unix epoch.
The quantity of the line item.
Entities associated with this customer.
The unique identifier of the entity
The name of the entity
The customer ID this entity belongs to
The feature ID this entity belongs to
Unix timestamp when the entity was created
The environment (sandbox/live)
Trial usage history for this customer.
Rewards earned or applied for this customer.
Array of active discounts applied to the customer
The unique identifier for this discount
The name of the discount or coupon
The type of reward
The discount value (percentage or fixed amount)
How long the discount lasts
Number of billing periods the discount applies for repeating durations
The currency code for fixed amount discounts
Timestamp when the discount becomes active
Timestamp when the discount expires
The Stripe subscription ID this discount is applied to
Total amount saved from this discount
Referral records for this customer.
The customer's default payment method.
```json 200 theme={null}
{
"id": "2ee25a41-0d81-4ad2-8451-ec1aadaefe58",
"name": "Patrick",
"email": "patrick@useautumn.com",
"createdAt": 1771409161016,
"fingerprint": null,
"stripeId": "cus_U0BKxpq1mFhuJO",
"processors": {
"stripe": {
"id": "cus_U0BKxpq1mFhuJO"
}
},
"env": "sandbox",
"metadata": {},
"sendEmailReceipts": false,
"billingControls": {
"autoTopups": []
},
"subscriptions": [
{
"planId": "pro_plan",
"autoEnable": true,
"addOn": false,
"status": "active",
"pastDue": false,
"canceledAt": null,
"expiresAt": null,
"trialEndsAt": null,
"startedAt": 1771431921437,
"currentPeriodStart": 1771431921437,
"currentPeriodEnd": 1771999921437,
"quantity": 1
}
],
"purchases": [],
"licenses": [],
"balances": {
"messages": {
"featureId": "messages",
"granted": 100,
"remaining": 0,
"usage": 100,
"unlimited": false,
"overageAllowed": false,
"maxPurchase": null,
"nextResetAt": 1773851121437,
"breakdown": [
{
"id": "cus_ent_39qmLooixXLAqMywgXywjAz96rV",
"planId": "pro_plan",
"includedGrant": 100,
"prepaidGrant": 0,
"remaining": 0,
"usage": 100,
"unlimited": false,
"reset": {
"interval": "month",
"resetsAt": 1773851121437
},
"price": null,
"expiresAt": null
}
]
}
},
"flags": {
"advanced_workflows": {
"id": "cus_ent_abc123",
"plan_id": "pro_plan",
"expires_at": null,
"feature_id": "advanced_workflows"
}
},
"config": {
"disable_pooled_balance": false,
"disable_overage_billing": false
}
}
```
# Get or Create Customer
Source: https://docs.useautumn.com/api-reference/customers/getOrCreateCustomer
openapi POST /v1/customers.get_or_create
Creates a customer if they do not exist, or returns the existing customer by your external customer ID.
Use this as the primary entrypoint before billing operations so the customer record is always present and up to date.
If the customer already exists and you try to create it again, you will simply be returned the customer object (rather than an error being thrown).
### Currency
Pass `currency` to bill this customer in a currency other than your organization's default. Their plans must offer a price in that currency via [`additional_currencies`](/documentation/concepts/plans#multiple-currencies). If omitted, the customer's currency is set by their first paid attach.
### Body Parameters
Your unique identifier for the customer
Customer's name
Customer's email address
Unique identifier (eg, serial number) to detect duplicate customers and prevent free trial abuse
Additional metadata for the customer
Stripe customer ID if you already have one
Whether to create the customer in Stripe
The ID of the free plan to auto-enable for the customer
Whether to send email receipts to this customer
Currency to bill this customer in (e.g. usd, eur). Defaults to the organization's default currency.
Billing controls for the customer (auto top-ups, etc.)
List of auto top-up configurations per feature.
The ID of the feature (credit balance) to auto top-up.
Whether auto top-up is enabled.
When the balance drops below this threshold, an auto top-up will be purchased.
Amount of credits to add per auto top-up.
Optional rate limit to cap how often auto top-ups occur. Pass count to set the current window's consumed top-ups.
The time interval for the purchase limit window.
Number of intervals in the purchase limit window.
Maximum number of auto top-ups allowed within the interval.
Set the current window's consumed auto top-up count. Omit to leave runtime state unchanged.
When true, auto top-up creates a send\_invoice invoice instead of auto-charging.
List of overage spend limits per feature (caps overage spend).
Optional feature ID this spend limit applies to.
Whether the overage spend limit is enabled.
How overage\_limit is interpreted: an absolute overage cap (default) or a percentage of the main-plan allowance.
Overage cap for the feature: absolute units, or a percent (e.g. 120) when limit\_type is usage\_percentage.
When true, overage for this feature is not posted to Stripe. Usage tracking and balance resets still behave normally.
List of hard usage caps per feature (max units per interval).
The feature this usage limit applies to.
Whether this usage limit is enabled.
Maximum units allowed per interval.
Interval for the cap, aligned to the customer's billing cycle.
Window alignment. 'billing\_cycle' phases the interval to the customer's renewal time; 'utc' aligns to the UTC calendar.
When set, only usage from events whose properties match counts toward this cap. Omit to count all usage of the feature.
List of usage alert configurations per feature.
The feature ID this alert applies to.
Whether this usage alert is enabled.
The threshold value that triggers the alert. For usage or remaining, this is an absolute count. For usage\_percentage or remaining\_percentage, this is a percentage (0-100).
Whether the threshold is an absolute count or a percentage of the usage allowance or remaining balance.
What 100% means. balance: every grant on the feature. included: the plan allowance only. recurring: grants that reset. usage\_limit: the cap of the usage limit with the same feature and filter.
Only valid with basis usage\_limit. Points the alert at the usage limit carrying the same filter.
Optional user-defined label to distinguish multiple alerts on the same feature.
List of overage allowed controls per feature. When enabled, usage can exceed balance.
The feature ID this overage allowed control applies to.
Whether overage is allowed for this feature.
Miscellaneous configurations for the customer.
Whether to disable the shared customer-level pool for entities.
Stops Autumn from posting usage-overage line items to Stripe for this customer. Check/track and balance resets still behave normally. When set, this overrides the organization-level disable\_overage\_billing setting.
Fields to expand in the returned customer response, such as subscriptions.plan, purchases.plan, balances.feature, or flags.feature.
### Response
Your unique identifier for the customer.
The name of the customer.
The email address of the customer.
Timestamp of customer creation in milliseconds since epoch.
A unique identifier (eg. serial number) to de-duplicate customers across devices or browsers. For example: apple device ID.
Stripe customer ID.
The environment this customer was created in.
The metadata for the customer.
Whether to send email receipts to the customer.
Billing controls for the customer (auto top-ups, etc.)
List of auto top-up configurations per feature.
The ID of the feature (credit balance) to auto top-up.
Whether auto top-up is enabled.
When the balance drops below this threshold, an auto top-up will be purchased.
Amount of credits to add per auto top-up.
Optional rate limit to cap how often auto top-ups occur. Expand billing\_controls.auto\_topups.purchase\_limit for a count of top ups and the next\_reset\_at.
The time interval for the purchase limit window. Null when no purchase limit is configured.
Number of intervals in the purchase limit window. Null when no purchase limit is configured.
Maximum number of auto top-ups allowed within the interval. Null when no purchase limit is configured.
Number of auto top-ups already consumed in the current window.
Unix ms timestamp when the current purchase window ends and the count resets.
When true, auto top-up creates a send\_invoice invoice instead of auto-charging.
Response-only: whether the entry is a customer-level override or inherited from an attached plan's defaults.
List of overage spend limits per feature (caps overage spend).
Optional feature ID this spend limit applies to.
Whether the overage spend limit is enabled.
How overage\_limit is interpreted: an absolute overage cap (default) or a percentage of the main-plan allowance.
Overage cap for the feature: absolute units, or a percent (e.g. 120) when limit\_type is usage\_percentage.
When true, overage for this feature is not posted to Stripe. Usage tracking and balance resets still behave normally.
Response-only: whether the entry is a customer-level override or inherited from an attached plan's defaults.
List of hard usage caps per feature, with current interval usage.
The feature this usage limit applies to.
Whether this usage limit is enabled.
Maximum units allowed per interval.
Interval for the cap, aligned to the customer's billing cycle.
Window alignment. 'billing\_cycle' phases the interval to the customer's renewal time; 'utc' aligns to the UTC calendar.
When set, only usage from events whose properties match counts toward this cap. Omit to count all usage of the feature.
Usage consumed in the active interval, stored in the usage-window counter.
Response-only: whether the entry is a customer-level override or inherited from an attached plan's defaults.
List of usage alert configurations per feature.
The feature ID this alert applies to.
Whether this usage alert is enabled.
The threshold value that triggers the alert. For usage or remaining, this is an absolute count. For usage\_percentage or remaining\_percentage, this is a percentage (0-100).
Whether the threshold is an absolute count or a percentage of the usage allowance or remaining balance.
What 100% means. balance: every grant on the feature. included: the plan allowance only. recurring: grants that reset. usage\_limit: the cap of the usage limit with the same feature and filter.
Only valid with basis usage\_limit. Points the alert at the usage limit carrying the same filter.
Optional user-defined label to distinguish multiple alerts on the same feature.
Response-only: whether the entry is a customer-level override or inherited from an attached plan's defaults.
List of overage allowed controls per feature. When enabled, usage can exceed balance.
The feature ID this overage allowed control applies to.
Whether overage is allowed for this feature.
Response-only: whether the entry is a customer-level override or inherited from an attached plan's defaults.
Active and scheduled recurring plans that this customer has attached.
The unique identifier of this subscription. If a subscription\_id was provided at attach time, it is used; otherwise, falls back to the internal ID.
The full plan object if expanded.
Unique identifier for the plan.
Display name of the plan.
Optional description of the plan.
Group identifier for organizing related plans. Plans in the same group are mutually exclusive.
Version number of the plan. Incremented when plan configuration changes.
User-facing version identity. Defaults to v\{n} when the version is minted.
Whether this is the active version of the plan. At most one version is active.
Whether this is an add-on plan that can be attached alongside a main plan.
If true, this plan is automatically attached when a customer is created. Used for free plans.
Base recurring price for the plan. Null for free plans or usage-only plans.
Base price amount for the plan, in major currency units (e.g. dollars).
Base price amounts in additional currencies. The base 'amount' is in the org's default currency.
Three-letter Stripe-supported currency code (e.g. 'eur', 'gbp').
Price amount in this currency. Set explicitly per currency, not converted from the base amount.
Billing interval (e.g. 'month', 'year').
Number of intervals per billing cycle. Defaults to 1.
Display text for showing this price in pricing pages.
Main display text (e.g. '\$10' or '100 messages').
Secondary display text (e.g. 'per month' or 'then \$0.5 per 100').
Payment processors this base price is connected to. Omitted when unset.
Stripe price ID. For prepaid with included > 0 this is the V2 price.
Feature configurations included in this plan. Each item defines included units, pricing, and reset behavior for a feature.
Bills this many feature units when outstanding overage reaches it.
The ID of the feature this item configures.
The full feature object if expanded.
The ID of the feature, used to refer to it in other API calls like /track or /check.
The name of the feature.
The type of the feature
Singular and plural display names for the feature.
The singular display name for the feature.
The plural display name for the feature.
Credit cost schema for credit system features.
The ID of the metered feature (should be a single\_use feature).
The credit cost of the metered feature.
Whether or not the feature is archived.
Number of free units included. For consumable features, balance resets to this number each interval.
Whether the customer has unlimited access to this feature.
Whether entity-level grants contribute to a shared customer balance.
Reset configuration for consumable features. Null for non-consumable features like seats where usage persists across billing cycles.
The interval at which the feature balance resets (e.g. 'month', 'year'). For consumable features, usage resets to 0 and included units are restored.
Number of intervals between resets. Defaults to 1.
Pricing configuration for usage beyond included units. Null if feature is entirely free.
Price per billing\_units after included usage is consumed. Mutually exclusive with tiers.
Amounts in additional currencies for this flat price. The base 'amount' is in the org's default currency. Only valid with 'amount', not 'tiers' (tiered prices carry per-currency amounts on each tier).
Three-letter Stripe-supported currency code (e.g. 'eur', 'gbp').
Price amount in this currency. Set explicitly per currency, not converted from the base amount.
Tiered pricing configuration. Each tier's 'to' INCLUDES the included amount. Either 'tiers' or 'amount' is required.
Three-letter Stripe-supported currency code (e.g. 'eur', 'gbp').
Per-unit amount for this tier in this currency.
Flat amount for this tier in this currency, if the tier uses one.
Billing interval for this price. For consumable features, should match reset.interval.
Number of intervals per billing cycle. Defaults to 1.
Number of units per price increment. Usage is rounded UP to the nearest billing\_units when billed (e.g. billing\_units=100 means 101 usage rounds to 200).
'prepaid' for features like seats where customers pay upfront, 'usage\_based' for pay-as-you-go after included usage.
Maximum units a customer can purchase beyond included. E.g. if included=100 and max\_purchase=300, customer can use up to 400 total before usage is capped. Null for no limit.
Payment processors this item price is connected to. Omitted when unset.
Stripe price ID. For prepaid with included > 0 this is the V2 price.
Display text for showing this item in pricing pages.
Main display text (e.g. '\$10' or '100 messages').
Secondary display text (e.g. 'per month' or 'then \$0.5 per 100').
Rollover configuration for unused units. If set, unused included units roll over to the next period.
Maximum rollover units. Null for unlimited rollover.
Maximum rollover as a percentage (0-100) of included + prepaid grant. Mutually exclusive with max.
When rolled over units expire.
Number of periods before expiry.
Overrides fields of this item's feature for customers on this plan (e.g. a credit system's credit\_schema).
For credit system features: replaces the feature's credit\_schema entirely for customers on this plan.
ID of the metered feature that draws from this credit system.
Number of metered-feature units priced together. Defaults to one when omitted.
Named rates chosen by event properties. The most specific match sets the rate; with no match the item's own rate applies.
Event properties this entry applies to. Every key must equal the tracked property, compared as strings.
Breaks ties between dimensions that match the same number of keys. Higher wins.
Inclusive upper usage boundary for this graduated tier. The final tier must be 'inf'.
Credits consumed per billing-unit group within this tier.
Named adjustments chosen by event properties. Every match applies: factors multiply, then adds are summed.
Event properties this entry applies to. Every key must equal the tracked property, compared as strings.
Multiplies the matched rate. All matching multipliers stack.
Added to the rate after every factor is applied, in credits per billing-unit group.
Inclusive upper usage boundary for this graduated tier. The final tier must be 'inf'.
Credits consumed per billing-unit group within this tier.
Credits consumed per billing-unit group.
For AI credit system features: replaces the feature's markup chain entirely for customers on this plan. An unset level means no markup at that level rather than inheriting the feature's.
Default percentage markup for customers on this plan. Use -100 to make usage free.
Per-provider markup percentages for customers on this plan.
Per-model markup overrides for customers on this plan.
Payment processors this plan is connected to. Omitted when unset.
Stripe product ID this plan is billed under.
Extra Stripe product IDs aliased to this plan.
Every RevenueCat product that maps to this plan. Replaces the current set.
RevenueCat product ID that grants this plan when purchased.
Prepaid quantities granted when this specific RevenueCat product is purchased, in feature units.
Free trial configuration. If set, new customers can try this plan before being charged.
Number of duration\_type periods the trial lasts.
Unit of time for the trial duration ('day', 'month', 'year').
Whether a payment method is required to start the trial. If true, customer will be charged after trial ends.
Behavior when the trial ends. 'bill' charges the customer (default). 'revert' expires the trial and restores the customer's previous plan.
Unix timestamp (ms) when the plan was created.
Environment this plan belongs to ('sandbox' or 'live').
Whether the plan is archived. Archived plans cannot be attached to new customers.
Miscellaneous plan-level configuration flags.
If true, entitlements attached to this plan will still reset on schedule even when the customer's product is in a past\_due state.
Plan-level billing controls used as customer defaults.
List of auto top-up configurations per feature.
The ID of the feature (credit balance) to auto top-up.
Whether auto top-up is enabled.
When the balance drops below this threshold, an auto top-up will be purchased.
Amount of credits to add per auto top-up.
Optional rate limit to cap how often auto top-ups occur.
The time interval for the purchase limit window.
Number of intervals in the purchase limit window.
Maximum number of auto top-ups allowed within the interval.
When true, auto top-up creates a send\_invoice invoice instead of auto-charging.
List of overage spend limits per feature (caps overage spend).
Optional feature ID this spend limit applies to.
Whether the overage spend limit is enabled.
How overage\_limit is interpreted: an absolute overage cap (default) or a percentage of the main-plan allowance.
Overage cap for the feature: absolute units, or a percent (e.g. 120) when limit\_type is usage\_percentage.
When true, overage for this feature is not posted to Stripe. Usage tracking and balance resets still behave normally.
List of hard usage caps per feature (max units per interval).
The feature this usage limit applies to.
Whether this usage limit is enabled.
Maximum units allowed per interval.
Interval for the cap, aligned to the customer's billing cycle.
Window alignment. 'billing\_cycle' phases the interval to the customer's renewal time; 'utc' aligns to the UTC calendar.
When set, only usage from events whose properties match counts toward this cap. Omit to count all usage of the feature.
List of usage alert configurations per feature.
The feature ID this alert applies to.
Whether this usage alert is enabled.
The threshold value that triggers the alert. For usage or remaining, this is an absolute count. For usage\_percentage or remaining\_percentage, this is a percentage (0-100).
Whether the threshold is an absolute count or a percentage of the usage allowance or remaining balance.
What 100% means. balance: every grant on the feature. included: the plan allowance only. recurring: grants that reset. usage\_limit: the cap of the usage limit with the same feature and filter.
Only valid with basis usage\_limit. Points the alert at the usage limit carrying the same filter.
Optional user-defined label to distinguish multiple alerts on the same feature.
List of overage allowed controls per feature. When enabled, usage can exceed balance.
The feature ID this overage allowed control applies to.
Whether overage is allowed for this feature.
Arbitrary key-value metadata defined by you for your own use. Shared across all versions of the plan.
Whether the trial on this plan is available to this customer. For example, if the customer used the trial in the past, this will be false.
The customer's current status with this plan. 'active' if attached, 'scheduled' if pending activation.
Whether the customer's active instance of this plan is set to cancel.
Whether the customer is currently on a free trial of this plan.
The action that would occur if this plan were attached to the customer.
Deprecated. Use variant\_details.base\_plan\_id instead. If this is a variant, the ID of the base plan it was created from.
Details about how this variant relates to its latest base plan.
The ID of the base plan this variant was derived from.
The customization that transforms the base plan into this variant.
Base price configuration for a plan.
Base price amount for the plan, in major currency units (e.g. dollars).
Billing interval (e.g. 'month', 'year').
Number of intervals per billing cycle. Defaults to 1.
Base price amounts in additional currencies. The base 'amount' is in the org's default currency.
Three-letter Stripe-supported currency code (e.g. 'eur', 'gbp').
Price amount in this currency. Set explicitly per currency, not converted from the base amount.
Items to add to the plan.
Bills this many feature units when outstanding overage reaches it.
The ID of the feature to configure.
Number of free units included. Balance resets to this each interval for consumable features.
If true, customer has unlimited access to this feature.
Whether entity-level grants contribute to a shared customer balance.
Reset configuration for consumable features. Omit for non-consumable features like seats.
Interval at which balance resets (e.g. 'month', 'year'). For consumable features only.
Number of intervals between resets. Defaults to 1.
Pricing for usage beyond included units. Omit for free features.
Price per billing\_units after included usage. Either 'amount' or 'tiers' is required.
Amounts in additional currencies for this flat price. The base 'amount' is in the org's default currency. Only valid with 'amount', not 'tiers'.
Three-letter Stripe-supported currency code (e.g. 'eur', 'gbp').
Price amount in this currency. Set explicitly per currency, not converted from the base amount.
Tiered pricing. Either 'amount' or 'tiers' is required.
Three-letter Stripe-supported currency code (e.g. 'eur', 'gbp').
Per-unit amount for this tier in this currency.
Flat amount for this tier in this currency, if the tier uses one.
Billing interval. For consumable features, should match reset.interval.
Number of intervals per billing cycle. Defaults to 1.
Units per price increment. Usage is rounded UP when billed (e.g. billing\_units=100 means 101 rounds to 200).
'prepaid' for upfront payment (seats), 'usage\_based' for pay-as-you-go.
Max units purchasable beyond included. E.g. included=100, max\_purchase=300 allows 400 total. Null for no limit.
Proration settings for prepaid features. Controls mid-cycle quantity change billing.
Billing behavior when quantity increases mid-cycle.
Credit behavior when quantity decreases mid-cycle.
Rollover config for unused units. If set, unused included units carry over.
Max rollover units. Omit for unlimited rollover.
Maximum rollover as a percentage (0-100) of included + prepaid grant. Mutually exclusive with max.
When rolled over units expire.
Number of periods before expiry.
Overrides fields of this item's feature for customers on this plan (e.g. a credit system's credit\_schema).
For credit system features: replaces the feature's credit\_schema entirely for customers on this plan.
ID of the metered feature that draws from this credit system.
Number of metered-feature units priced together. Defaults to one when omitted.
Named rates chosen by event properties. The most specific match sets the rate; with no match the item's own rate applies.
Event properties this entry applies to. Every key must equal the tracked property, compared as strings.
Breaks ties between dimensions that match the same number of keys. Higher wins.
Inclusive upper usage boundary for this graduated tier. The final tier must be 'inf'.
Credits consumed per billing-unit group within this tier.
Named adjustments chosen by event properties. Every match applies: factors multiply, then adds are summed.
Event properties this entry applies to. Every key must equal the tracked property, compared as strings.
Multiplies the matched rate. All matching multipliers stack.
Added to the rate after every factor is applied, in credits per billing-unit group.
Inclusive upper usage boundary for this graduated tier. The final tier must be 'inf'.
Credits consumed per billing-unit group within this tier.
Credits consumed per billing-unit group.
For AI credit system features: replaces the feature's markup chain entirely for customers on this plan. An unset level means no markup at that level rather than inheriting the feature's.
Default percentage markup for customers on this plan. Use -100 to make usage free.
Per-provider markup percentages for customers on this plan.
Per-model markup overrides for customers on this plan.
Filters selecting items to remove from the plan.
Match items linked to this feature.
Match items with this billing method (prepaid or usage\_based).
Match items with this interval. Accepts either a BillingInterval (price-side) or a ResetInterval (reset-side, includes day/hour/minute) so price-less items keyed by reset.interval can be disambiguated.
Match items with this interval\_count. Disambiguates between items that share an interval but differ in count.
Match items whose grant equals this included usage. Omitted is a wildcard.
Free trial configuration for a plan.
Number of duration\_type periods the trial lasts.
Unit of time for the trial ('day', 'month', 'year').
If true, a payment method is required to start the trial and the customer is charged when it ends. Defaults to false.
Behavior when the trial ends. 'bill' charges the customer (default). 'revert' expires the trial and restores the customer's previous plan.
Override the plan's billing controls (auto top-ups, spend limits, usage limits, usage alerts, overage allowed) for this customer.
List of auto top-up configurations per feature.
The ID of the feature (credit balance) to auto top-up.
Whether auto top-up is enabled.
When the balance drops below this threshold, an auto top-up will be purchased.
Amount of credits to add per auto top-up.
Optional rate limit to cap how often auto top-ups occur. Pass count to set the current window's consumed top-ups.
The time interval for the purchase limit window.
Number of intervals in the purchase limit window.
Maximum number of auto top-ups allowed within the interval.
Set the current window's consumed auto top-up count. Omit to leave runtime state unchanged.
When true, auto top-up creates a send\_invoice invoice instead of auto-charging.
List of overage spend limits per feature (caps overage spend).
Optional feature ID this spend limit applies to.
Whether the overage spend limit is enabled.
How overage\_limit is interpreted: an absolute overage cap (default) or a percentage of the main-plan allowance.
Overage cap for the feature: absolute units, or a percent (e.g. 120) when limit\_type is usage\_percentage.
When true, overage for this feature is not posted to Stripe. Usage tracking and balance resets still behave normally.
List of hard usage caps per feature (max units per interval).
The feature this usage limit applies to.
Whether this usage limit is enabled.
Maximum units allowed per interval.
Interval for the cap, aligned to the customer's billing cycle.
Window alignment. 'billing\_cycle' phases the interval to the customer's renewal time; 'utc' aligns to the UTC calendar.
When set, only usage from events whose properties match counts toward this cap. Omit to count all usage of the feature.
List of usage alert configurations per feature.
The feature ID this alert applies to.
Whether this usage alert is enabled.
The threshold value that triggers the alert. For usage or remaining, this is an absolute count. For usage\_percentage or remaining\_percentage, this is a percentage (0-100).
Whether the threshold is an absolute count or a percentage of the usage allowance or remaining balance.
What 100% means. balance: every grant on the feature. included: the plan allowance only. recurring: grants that reset. usage\_limit: the cap of the usage limit with the same feature and filter.
Only valid with basis usage\_limit. Points the alert at the usage limit carrying the same filter.
Optional user-defined label to distinguish multiple alerts on the same feature.
List of overage allowed controls per feature. When enabled, usage can exceed balance.
The feature ID this overage allowed control applies to.
Whether overage is allowed for this feature.
License links to add or override for this customer, keyed by license\_plan\_id. Omitted fields inherit the plan catalog link (included defaults to 1 when the license is not in the catalog). A bare entry restores the license to pure catalog inheritance.
Base price configuration for a plan.
Base price amount for the plan, in major currency units (e.g. dollars).
Billing interval (e.g. 'month', 'year').
Number of intervals per billing cycle. Defaults to 1.
Base price amounts in additional currencies. The base 'amount' is in the org's default currency.
Three-letter Stripe-supported currency code (e.g. 'eur', 'gbp').
Price amount in this currency. Set explicitly per currency, not converted from the base amount.
Bills this many feature units when outstanding overage reaches it.
The ID of the feature to configure.
Number of free units included. Balance resets to this each interval for consumable features.
If true, customer has unlimited access to this feature.
Whether entity-level grants contribute to a shared customer balance.
Reset configuration for consumable features. Omit for non-consumable features like seats.
Interval at which balance resets (e.g. 'month', 'year'). For consumable features only.
Number of intervals between resets. Defaults to 1.
Pricing for usage beyond included units. Omit for free features.
Price per billing\_units after included usage. Either 'amount' or 'tiers' is required.
Amounts in additional currencies for this flat price. The base 'amount' is in the org's default currency. Only valid with 'amount', not 'tiers'.
Three-letter Stripe-supported currency code (e.g. 'eur', 'gbp').
Price amount in this currency. Set explicitly per currency, not converted from the base amount.
Tiered pricing. Either 'amount' or 'tiers' is required.
Three-letter Stripe-supported currency code (e.g. 'eur', 'gbp').
Per-unit amount for this tier in this currency.
Flat amount for this tier in this currency, if the tier uses one.
Billing interval. For consumable features, should match reset.interval.
Number of intervals per billing cycle. Defaults to 1.
Units per price increment. Usage is rounded UP when billed (e.g. billing\_units=100 means 101 rounds to 200).
'prepaid' for upfront payment (seats), 'usage\_based' for pay-as-you-go.
Max units purchasable beyond included. E.g. included=100, max\_purchase=300 allows 400 total. Null for no limit.
Proration settings for prepaid features. Controls mid-cycle quantity change billing.
Billing behavior when quantity increases mid-cycle.
Credit behavior when quantity decreases mid-cycle.
Rollover config for unused units. If set, unused included units carry over.
Max rollover units. Omit for unlimited rollover.
Maximum rollover as a percentage (0-100) of included + prepaid grant. Mutually exclusive with max.
When rolled over units expire.
Number of periods before expiry.
Overrides fields of this item's feature for customers on this plan (e.g. a credit system's credit\_schema).
For credit system features: replaces the feature's credit\_schema entirely for customers on this plan.
ID of the metered feature that draws from this credit system.
Number of metered-feature units priced together. Defaults to one when omitted.
Named rates chosen by event properties. The most specific match sets the rate; with no match the item's own rate applies.
Event properties this entry applies to. Every key must equal the tracked property, compared as strings.
Breaks ties between dimensions that match the same number of keys. Higher wins.
Inclusive upper usage boundary for this graduated tier. The final tier must be 'inf'.
Credits consumed per billing-unit group within this tier.
Named adjustments chosen by event properties. Every match applies: factors multiply, then adds are summed.
Event properties this entry applies to. Every key must equal the tracked property, compared as strings.
Multiplies the matched rate. All matching multipliers stack.
Added to the rate after every factor is applied, in credits per billing-unit group.
Inclusive upper usage boundary for this graduated tier. The final tier must be 'inf'.
Credits consumed per billing-unit group within this tier.
Credits consumed per billing-unit group.
For AI credit system features: replaces the feature's markup chain entirely for customers on this plan. An unset level means no markup at that level rather than inheriting the feature's.
Default percentage markup for customers on this plan. Use -100 to make usage free.
Per-provider markup percentages for customers on this plan.
Per-model markup overrides for customers on this plan.
Match items linked to this feature.
Match items with this billing method (prepaid or usage\_based).
Match items with this interval. Accepts either a BillingInterval (price-side) or a ResetInterval (reset-side, includes day/hour/minute) so price-less items keyed by reset.interval can be disambiguated.
Match items with this interval\_count. Disambiguates between items that share an interval but differ in count.
Match items whose grant equals this included usage. Omitted is a wildcard.
License links to drop, keyed by license\_plan\_id. Parallel to remove\_items.
The unique identifier of the subscribed plan.
Whether the plan was automatically enabled for the customer.
Whether this is an add-on plan rather than a base subscription.
Current status of the subscription.
Whether the subscription has overdue payments.
Timestamp when the subscription was canceled, or null if not canceled.
Timestamp when the subscription will expire, or null if no expiry set.
Timestamp when the trial period ends, or null if not on trial.
Timestamp when the subscription started.
Start timestamp of the current billing period.
End timestamp of the current billing period.
Number of units of this subscription (for per-seat plans).
Whether this subscription is attached at the customer level or entity level.
One-time purchases made by the customer.
The full plan object if expanded.
Unique identifier for the plan.
Display name of the plan.
Optional description of the plan.
Group identifier for organizing related plans. Plans in the same group are mutually exclusive.
Version number of the plan. Incremented when plan configuration changes.
User-facing version identity. Defaults to v\{n} when the version is minted.
Whether this is the active version of the plan. At most one version is active.
Whether this is an add-on plan that can be attached alongside a main plan.
If true, this plan is automatically attached when a customer is created. Used for free plans.
Base recurring price for the plan. Null for free plans or usage-only plans.
Base price amount for the plan, in major currency units (e.g. dollars).
Base price amounts in additional currencies. The base 'amount' is in the org's default currency.
Three-letter Stripe-supported currency code (e.g. 'eur', 'gbp').
Price amount in this currency. Set explicitly per currency, not converted from the base amount.
Billing interval (e.g. 'month', 'year').
Number of intervals per billing cycle. Defaults to 1.
Display text for showing this price in pricing pages.
Main display text (e.g. '\$10' or '100 messages').
Secondary display text (e.g. 'per month' or 'then \$0.5 per 100').
Payment processors this base price is connected to. Omitted when unset.
Stripe price ID. For prepaid with included > 0 this is the V2 price.
Feature configurations included in this plan. Each item defines included units, pricing, and reset behavior for a feature.
Bills this many feature units when outstanding overage reaches it.
The ID of the feature this item configures.
The full feature object if expanded.
The ID of the feature, used to refer to it in other API calls like /track or /check.
The name of the feature.
The type of the feature
Singular and plural display names for the feature.
The singular display name for the feature.
The plural display name for the feature.
Credit cost schema for credit system features.
The ID of the metered feature (should be a single\_use feature).
The credit cost of the metered feature.
Whether or not the feature is archived.
Number of free units included. For consumable features, balance resets to this number each interval.
Whether the customer has unlimited access to this feature.
Whether entity-level grants contribute to a shared customer balance.
Reset configuration for consumable features. Null for non-consumable features like seats where usage persists across billing cycles.
The interval at which the feature balance resets (e.g. 'month', 'year'). For consumable features, usage resets to 0 and included units are restored.
Number of intervals between resets. Defaults to 1.
Pricing configuration for usage beyond included units. Null if feature is entirely free.
Price per billing\_units after included usage is consumed. Mutually exclusive with tiers.
Amounts in additional currencies for this flat price. The base 'amount' is in the org's default currency. Only valid with 'amount', not 'tiers' (tiered prices carry per-currency amounts on each tier).
Three-letter Stripe-supported currency code (e.g. 'eur', 'gbp').
Price amount in this currency. Set explicitly per currency, not converted from the base amount.
Tiered pricing configuration. Each tier's 'to' INCLUDES the included amount. Either 'tiers' or 'amount' is required.
Three-letter Stripe-supported currency code (e.g. 'eur', 'gbp').
Per-unit amount for this tier in this currency.
Flat amount for this tier in this currency, if the tier uses one.
Billing interval for this price. For consumable features, should match reset.interval.
Number of intervals per billing cycle. Defaults to 1.
Number of units per price increment. Usage is rounded UP to the nearest billing\_units when billed (e.g. billing\_units=100 means 101 usage rounds to 200).
'prepaid' for features like seats where customers pay upfront, 'usage\_based' for pay-as-you-go after included usage.
Maximum units a customer can purchase beyond included. E.g. if included=100 and max\_purchase=300, customer can use up to 400 total before usage is capped. Null for no limit.
Payment processors this item price is connected to. Omitted when unset.
Stripe price ID. For prepaid with included > 0 this is the V2 price.
Display text for showing this item in pricing pages.
Main display text (e.g. '\$10' or '100 messages').
Secondary display text (e.g. 'per month' or 'then \$0.5 per 100').
Rollover configuration for unused units. If set, unused included units roll over to the next period.
Maximum rollover units. Null for unlimited rollover.
Maximum rollover as a percentage (0-100) of included + prepaid grant. Mutually exclusive with max.
When rolled over units expire.
Number of periods before expiry.
Overrides fields of this item's feature for customers on this plan (e.g. a credit system's credit\_schema).
For credit system features: replaces the feature's credit\_schema entirely for customers on this plan.
ID of the metered feature that draws from this credit system.
Number of metered-feature units priced together. Defaults to one when omitted.
Named rates chosen by event properties. The most specific match sets the rate; with no match the item's own rate applies.
Event properties this entry applies to. Every key must equal the tracked property, compared as strings.
Breaks ties between dimensions that match the same number of keys. Higher wins.
Inclusive upper usage boundary for this graduated tier. The final tier must be 'inf'.
Credits consumed per billing-unit group within this tier.
Named adjustments chosen by event properties. Every match applies: factors multiply, then adds are summed.
Event properties this entry applies to. Every key must equal the tracked property, compared as strings.
Multiplies the matched rate. All matching multipliers stack.
Added to the rate after every factor is applied, in credits per billing-unit group.
Inclusive upper usage boundary for this graduated tier. The final tier must be 'inf'.
Credits consumed per billing-unit group within this tier.
Credits consumed per billing-unit group.
For AI credit system features: replaces the feature's markup chain entirely for customers on this plan. An unset level means no markup at that level rather than inheriting the feature's.
Default percentage markup for customers on this plan. Use -100 to make usage free.
Per-provider markup percentages for customers on this plan.
Per-model markup overrides for customers on this plan.
Payment processors this plan is connected to. Omitted when unset.
Stripe product ID this plan is billed under.
Extra Stripe product IDs aliased to this plan.
Every RevenueCat product that maps to this plan. Replaces the current set.
RevenueCat product ID that grants this plan when purchased.
Prepaid quantities granted when this specific RevenueCat product is purchased, in feature units.
Free trial configuration. If set, new customers can try this plan before being charged.
Number of duration\_type periods the trial lasts.
Unit of time for the trial duration ('day', 'month', 'year').
Whether a payment method is required to start the trial. If true, customer will be charged after trial ends.
Behavior when the trial ends. 'bill' charges the customer (default). 'revert' expires the trial and restores the customer's previous plan.
Unix timestamp (ms) when the plan was created.
Environment this plan belongs to ('sandbox' or 'live').
Whether the plan is archived. Archived plans cannot be attached to new customers.
Miscellaneous plan-level configuration flags.
If true, entitlements attached to this plan will still reset on schedule even when the customer's product is in a past\_due state.
Plan-level billing controls used as customer defaults.
List of auto top-up configurations per feature.
The ID of the feature (credit balance) to auto top-up.
Whether auto top-up is enabled.
When the balance drops below this threshold, an auto top-up will be purchased.
Amount of credits to add per auto top-up.
Optional rate limit to cap how often auto top-ups occur.
The time interval for the purchase limit window.
Number of intervals in the purchase limit window.
Maximum number of auto top-ups allowed within the interval.
When true, auto top-up creates a send\_invoice invoice instead of auto-charging.
List of overage spend limits per feature (caps overage spend).
Optional feature ID this spend limit applies to.
Whether the overage spend limit is enabled.
How overage\_limit is interpreted: an absolute overage cap (default) or a percentage of the main-plan allowance.
Overage cap for the feature: absolute units, or a percent (e.g. 120) when limit\_type is usage\_percentage.
When true, overage for this feature is not posted to Stripe. Usage tracking and balance resets still behave normally.
List of hard usage caps per feature (max units per interval).
The feature this usage limit applies to.
Whether this usage limit is enabled.
Maximum units allowed per interval.
Interval for the cap, aligned to the customer's billing cycle.
Window alignment. 'billing\_cycle' phases the interval to the customer's renewal time; 'utc' aligns to the UTC calendar.
When set, only usage from events whose properties match counts toward this cap. Omit to count all usage of the feature.
List of usage alert configurations per feature.
The feature ID this alert applies to.
Whether this usage alert is enabled.
The threshold value that triggers the alert. For usage or remaining, this is an absolute count. For usage\_percentage or remaining\_percentage, this is a percentage (0-100).
Whether the threshold is an absolute count or a percentage of the usage allowance or remaining balance.
What 100% means. balance: every grant on the feature. included: the plan allowance only. recurring: grants that reset. usage\_limit: the cap of the usage limit with the same feature and filter.
Only valid with basis usage\_limit. Points the alert at the usage limit carrying the same filter.
Optional user-defined label to distinguish multiple alerts on the same feature.
List of overage allowed controls per feature. When enabled, usage can exceed balance.
The feature ID this overage allowed control applies to.
Whether overage is allowed for this feature.
Arbitrary key-value metadata defined by you for your own use. Shared across all versions of the plan.
Whether the trial on this plan is available to this customer. For example, if the customer used the trial in the past, this will be false.
The customer's current status with this plan. 'active' if attached, 'scheduled' if pending activation.
Whether the customer's active instance of this plan is set to cancel.
Whether the customer is currently on a free trial of this plan.
The action that would occur if this plan were attached to the customer.
Deprecated. Use variant\_details.base\_plan\_id instead. If this is a variant, the ID of the base plan it was created from.
Details about how this variant relates to its latest base plan.
The ID of the base plan this variant was derived from.
The customization that transforms the base plan into this variant.
Base price configuration for a plan.
Base price amount for the plan, in major currency units (e.g. dollars).
Billing interval (e.g. 'month', 'year').
Number of intervals per billing cycle. Defaults to 1.
Base price amounts in additional currencies. The base 'amount' is in the org's default currency.
Three-letter Stripe-supported currency code (e.g. 'eur', 'gbp').
Price amount in this currency. Set explicitly per currency, not converted from the base amount.
Items to add to the plan.
Bills this many feature units when outstanding overage reaches it.
The ID of the feature to configure.
Number of free units included. Balance resets to this each interval for consumable features.
If true, customer has unlimited access to this feature.
Whether entity-level grants contribute to a shared customer balance.
Reset configuration for consumable features. Omit for non-consumable features like seats.
Interval at which balance resets (e.g. 'month', 'year'). For consumable features only.
Number of intervals between resets. Defaults to 1.
Pricing for usage beyond included units. Omit for free features.
Price per billing\_units after included usage. Either 'amount' or 'tiers' is required.
Amounts in additional currencies for this flat price. The base 'amount' is in the org's default currency. Only valid with 'amount', not 'tiers'.
Three-letter Stripe-supported currency code (e.g. 'eur', 'gbp').
Price amount in this currency. Set explicitly per currency, not converted from the base amount.
Tiered pricing. Either 'amount' or 'tiers' is required.
Three-letter Stripe-supported currency code (e.g. 'eur', 'gbp').
Per-unit amount for this tier in this currency.
Flat amount for this tier in this currency, if the tier uses one.
Billing interval. For consumable features, should match reset.interval.
Number of intervals per billing cycle. Defaults to 1.
Units per price increment. Usage is rounded UP when billed (e.g. billing\_units=100 means 101 rounds to 200).
'prepaid' for upfront payment (seats), 'usage\_based' for pay-as-you-go.
Max units purchasable beyond included. E.g. included=100, max\_purchase=300 allows 400 total. Null for no limit.
Proration settings for prepaid features. Controls mid-cycle quantity change billing.
Billing behavior when quantity increases mid-cycle.
Credit behavior when quantity decreases mid-cycle.
Rollover config for unused units. If set, unused included units carry over.
Max rollover units. Omit for unlimited rollover.
Maximum rollover as a percentage (0-100) of included + prepaid grant. Mutually exclusive with max.
When rolled over units expire.
Number of periods before expiry.
Overrides fields of this item's feature for customers on this plan (e.g. a credit system's credit\_schema).
For credit system features: replaces the feature's credit\_schema entirely for customers on this plan.
ID of the metered feature that draws from this credit system.
Number of metered-feature units priced together. Defaults to one when omitted.
Named rates chosen by event properties. The most specific match sets the rate; with no match the item's own rate applies.
Event properties this entry applies to. Every key must equal the tracked property, compared as strings.
Breaks ties between dimensions that match the same number of keys. Higher wins.
Inclusive upper usage boundary for this graduated tier. The final tier must be 'inf'.
Credits consumed per billing-unit group within this tier.
Named adjustments chosen by event properties. Every match applies: factors multiply, then adds are summed.
Event properties this entry applies to. Every key must equal the tracked property, compared as strings.
Multiplies the matched rate. All matching multipliers stack.
Added to the rate after every factor is applied, in credits per billing-unit group.
Inclusive upper usage boundary for this graduated tier. The final tier must be 'inf'.
Credits consumed per billing-unit group within this tier.
Credits consumed per billing-unit group.
For AI credit system features: replaces the feature's markup chain entirely for customers on this plan. An unset level means no markup at that level rather than inheriting the feature's.
Default percentage markup for customers on this plan. Use -100 to make usage free.
Per-provider markup percentages for customers on this plan.
Per-model markup overrides for customers on this plan.
Filters selecting items to remove from the plan.
Match items linked to this feature.
Match items with this billing method (prepaid or usage\_based).
Match items with this interval. Accepts either a BillingInterval (price-side) or a ResetInterval (reset-side, includes day/hour/minute) so price-less items keyed by reset.interval can be disambiguated.
Match items with this interval\_count. Disambiguates between items that share an interval but differ in count.
Match items whose grant equals this included usage. Omitted is a wildcard.
Free trial configuration for a plan.
Number of duration\_type periods the trial lasts.
Unit of time for the trial ('day', 'month', 'year').
If true, a payment method is required to start the trial and the customer is charged when it ends. Defaults to false.
Behavior when the trial ends. 'bill' charges the customer (default). 'revert' expires the trial and restores the customer's previous plan.
Override the plan's billing controls (auto top-ups, spend limits, usage limits, usage alerts, overage allowed) for this customer.
List of auto top-up configurations per feature.
The ID of the feature (credit balance) to auto top-up.
Whether auto top-up is enabled.
When the balance drops below this threshold, an auto top-up will be purchased.
Amount of credits to add per auto top-up.
Optional rate limit to cap how often auto top-ups occur. Pass count to set the current window's consumed top-ups.
The time interval for the purchase limit window.
Number of intervals in the purchase limit window.
Maximum number of auto top-ups allowed within the interval.
Set the current window's consumed auto top-up count. Omit to leave runtime state unchanged.
When true, auto top-up creates a send\_invoice invoice instead of auto-charging.
List of overage spend limits per feature (caps overage spend).
Optional feature ID this spend limit applies to.
Whether the overage spend limit is enabled.
How overage\_limit is interpreted: an absolute overage cap (default) or a percentage of the main-plan allowance.
Overage cap for the feature: absolute units, or a percent (e.g. 120) when limit\_type is usage\_percentage.
When true, overage for this feature is not posted to Stripe. Usage tracking and balance resets still behave normally.
List of hard usage caps per feature (max units per interval).
The feature this usage limit applies to.
Whether this usage limit is enabled.
Maximum units allowed per interval.
Interval for the cap, aligned to the customer's billing cycle.
Window alignment. 'billing\_cycle' phases the interval to the customer's renewal time; 'utc' aligns to the UTC calendar.
When set, only usage from events whose properties match counts toward this cap. Omit to count all usage of the feature.
List of usage alert configurations per feature.
The feature ID this alert applies to.
Whether this usage alert is enabled.
The threshold value that triggers the alert. For usage or remaining, this is an absolute count. For usage\_percentage or remaining\_percentage, this is a percentage (0-100).
Whether the threshold is an absolute count or a percentage of the usage allowance or remaining balance.
What 100% means. balance: every grant on the feature. included: the plan allowance only. recurring: grants that reset. usage\_limit: the cap of the usage limit with the same feature and filter.
Only valid with basis usage\_limit. Points the alert at the usage limit carrying the same filter.
Optional user-defined label to distinguish multiple alerts on the same feature.
List of overage allowed controls per feature. When enabled, usage can exceed balance.
The feature ID this overage allowed control applies to.
Whether overage is allowed for this feature.
License links to add or override for this customer, keyed by license\_plan\_id. Omitted fields inherit the plan catalog link (included defaults to 1 when the license is not in the catalog). A bare entry restores the license to pure catalog inheritance.
Base price configuration for a plan.
Base price amount for the plan, in major currency units (e.g. dollars).
Billing interval (e.g. 'month', 'year').
Number of intervals per billing cycle. Defaults to 1.
Base price amounts in additional currencies. The base 'amount' is in the org's default currency.
Three-letter Stripe-supported currency code (e.g. 'eur', 'gbp').
Price amount in this currency. Set explicitly per currency, not converted from the base amount.
Bills this many feature units when outstanding overage reaches it.
The ID of the feature to configure.
Number of free units included. Balance resets to this each interval for consumable features.
If true, customer has unlimited access to this feature.
Whether entity-level grants contribute to a shared customer balance.
Reset configuration for consumable features. Omit for non-consumable features like seats.
Interval at which balance resets (e.g. 'month', 'year'). For consumable features only.
Number of intervals between resets. Defaults to 1.
Pricing for usage beyond included units. Omit for free features.
Price per billing\_units after included usage. Either 'amount' or 'tiers' is required.
Amounts in additional currencies for this flat price. The base 'amount' is in the org's default currency. Only valid with 'amount', not 'tiers'.
Three-letter Stripe-supported currency code (e.g. 'eur', 'gbp').
Price amount in this currency. Set explicitly per currency, not converted from the base amount.
Tiered pricing. Either 'amount' or 'tiers' is required.
Three-letter Stripe-supported currency code (e.g. 'eur', 'gbp').
Per-unit amount for this tier in this currency.
Flat amount for this tier in this currency, if the tier uses one.
Billing interval. For consumable features, should match reset.interval.
Number of intervals per billing cycle. Defaults to 1.
Units per price increment. Usage is rounded UP when billed (e.g. billing\_units=100 means 101 rounds to 200).
'prepaid' for upfront payment (seats), 'usage\_based' for pay-as-you-go.
Max units purchasable beyond included. E.g. included=100, max\_purchase=300 allows 400 total. Null for no limit.
Proration settings for prepaid features. Controls mid-cycle quantity change billing.
Billing behavior when quantity increases mid-cycle.
Credit behavior when quantity decreases mid-cycle.
Rollover config for unused units. If set, unused included units carry over.
Max rollover units. Omit for unlimited rollover.
Maximum rollover as a percentage (0-100) of included + prepaid grant. Mutually exclusive with max.
When rolled over units expire.
Number of periods before expiry.
Overrides fields of this item's feature for customers on this plan (e.g. a credit system's credit\_schema).
For credit system features: replaces the feature's credit\_schema entirely for customers on this plan.
ID of the metered feature that draws from this credit system.
Number of metered-feature units priced together. Defaults to one when omitted.
Named rates chosen by event properties. The most specific match sets the rate; with no match the item's own rate applies.
Event properties this entry applies to. Every key must equal the tracked property, compared as strings.
Breaks ties between dimensions that match the same number of keys. Higher wins.
Inclusive upper usage boundary for this graduated tier. The final tier must be 'inf'.
Credits consumed per billing-unit group within this tier.
Named adjustments chosen by event properties. Every match applies: factors multiply, then adds are summed.
Event properties this entry applies to. Every key must equal the tracked property, compared as strings.
Multiplies the matched rate. All matching multipliers stack.
Added to the rate after every factor is applied, in credits per billing-unit group.
Inclusive upper usage boundary for this graduated tier. The final tier must be 'inf'.
Credits consumed per billing-unit group within this tier.
Credits consumed per billing-unit group.
For AI credit system features: replaces the feature's markup chain entirely for customers on this plan. An unset level means no markup at that level rather than inheriting the feature's.
Default percentage markup for customers on this plan. Use -100 to make usage free.
Per-provider markup percentages for customers on this plan.
Per-model markup overrides for customers on this plan.
Match items linked to this feature.
Match items with this billing method (prepaid or usage\_based).
Match items with this interval. Accepts either a BillingInterval (price-side) or a ResetInterval (reset-side, includes day/hour/minute) so price-less items keyed by reset.interval can be disambiguated.
Match items with this interval\_count. Disambiguates between items that share an interval but differ in count.
Match items whose grant equals this included usage. Omitted is a wildcard.
License links to drop, keyed by license\_plan\_id. Parallel to remove\_items.
The unique identifier of the purchased plan.
Timestamp when the purchase expires, or null for lifetime access.
Timestamp when the purchase was made.
Number of units purchased.
Whether this purchase is attached at the customer level or entity level.
License seat pools granted by the customer's plans, with seat counts.
The plan offered as an assignable license.
The plan that offers this license.
Display name of the license plan.
Total seats the customer has for this license, included plus paid.
Seats currently assigned to entities.
Seats still available to assign.
Paid seats purchased on top of the plan's included amount.
Feature balances keyed by feature ID, showing usage limits and remaining amounts.
The feature ID this balance is for.
The full feature object if expanded.
The unique identifier for this feature, used in /check and /track calls.
Human-readable name displayed in the dashboard and billing UI.
Feature type: 'boolean' for on/off access, 'metered' for usage-tracked features, 'credit\_system' for unified credit pools, 'ai\_credit\_system' for model-based token pricing.
For metered features: true if usage resets periodically (API calls, credits), false if allocated persistently (seats, storage).
Event names that trigger this feature's balance. Allows multiple features to respond to a single event.
For classic credit systems: maps metered features to flat or graduated credit costs.
ID of the metered feature that draws from this credit system.
Number of metered-feature units priced together. Defaults to one when omitted.
Named rates chosen by event properties. The most specific match sets the rate; with no match the item's own rate applies.
Event properties this entry applies to. Every key must equal the tracked property, compared as strings.
Breaks ties between dimensions that match the same number of keys. Higher wins.
Inclusive upper usage boundary for this graduated tier. The final tier must be 'inf'.
Credits consumed per billing-unit group within this tier.
Named adjustments chosen by event properties. Every match applies: factors multiply, then adds are summed.
Event properties this entry applies to. Every key must equal the tracked property, compared as strings.
Multiplies the matched rate. All matching multipliers stack.
Added to the rate after every factor is applied, in credits per billing-unit group.
Inclusive upper usage boundary for this graduated tier. The final tier must be 'inf'.
Credits consumed per billing-unit group within this tier.
Credits consumed per billing-unit group.
Whether usage of this classic credit system should be itemized as invoice credits.
Per-model markup overrides for AI credit systems.
Default percentage markup for AI credit systems. Use -100 to make usage free.
Per-provider default markup percentages for AI credit systems.
Display names for the feature in billing UI and customer-facing components.
Singular form for UI display (e.g., 'API call', 'seat').
Plural form for UI display (e.g., 'API calls', 'seats').
Whether the feature is archived and hidden from the dashboard.
Processor mappings for this feature. Present when a Stripe product or meter is set.
Stripe product ID this feature's usage prices bill under.
Stripe meter ID used to create this feature's metered price.
Total balance granted (included + prepaid).
Remaining balance available for use.
Total usage consumed in the current period.
Whether this feature has unlimited usage.
Whether usage beyond the granted balance is allowed (with overage charges).
Maximum quantity that can be purchased as a top-up, or null for unlimited.
Timestamp when the balance will reset, or null for no reset.
Detailed breakdown of balance sources when stacking multiple plans or grants.
The unique identifier for this balance breakdown.
The plan ID this balance originates from, or null for standalone balances.
Amount granted from the plan's included usage.
Amount granted from prepaid purchases or top-ups.
Remaining balance available for use.
Amount consumed in the current period.
Whether this balance has unlimited usage.
Reset configuration for this balance, or null if no reset.
The reset interval (hour, day, week, month, etc.) or 'multiple' if combined from different intervals.
Number of intervals between resets (eg. 2 for bi-monthly).
Timestamp when the balance will next reset.
Pricing configuration if this balance has usage-based pricing.
The per-unit price amount.
Tiered pricing configuration if applicable.
How tiers are applied: graduated (split across bands) or volume (flat rate for the matched tier).
The number of units per billing increment (eg. \$9 / 250 units).
Whether usage is prepaid or billed pay-per-use.
Maximum quantity that can be purchased, or null for unlimited.
Timestamp when this balance expires, or null for no expiration.
Rollover balances carried over from previous periods.
Amount originally rolled over from a previous period, before any of it was consumed.
Amount of balance rolled over from a previous period.
Timestamp when the rollover balance expires.
Boolean feature flags keyed by feature ID, showing enabled access for on/off features.
The unique identifier for this flag.
The plan ID this flag originates from, or null for standalone flags.
Timestamp when this flag expires, or null for no expiration.
The feature ID this flag is for.
The full feature object if expanded.
The unique identifier for this feature, used in /check and /track calls.
Human-readable name displayed in the dashboard and billing UI.
Feature type: 'boolean' for on/off access, 'metered' for usage-tracked features, 'credit\_system' for unified credit pools, 'ai\_credit\_system' for model-based token pricing.
For metered features: true if usage resets periodically (API calls, credits), false if allocated persistently (seats, storage).
Event names that trigger this feature's balance. Allows multiple features to respond to a single event.
For classic credit systems: maps metered features to flat or graduated credit costs.
ID of the metered feature that draws from this credit system.
Number of metered-feature units priced together. Defaults to one when omitted.
Named rates chosen by event properties. The most specific match sets the rate; with no match the item's own rate applies.
Event properties this entry applies to. Every key must equal the tracked property, compared as strings.
Breaks ties between dimensions that match the same number of keys. Higher wins.
Inclusive upper usage boundary for this graduated tier. The final tier must be 'inf'.
Credits consumed per billing-unit group within this tier.
Named adjustments chosen by event properties. Every match applies: factors multiply, then adds are summed.
Event properties this entry applies to. Every key must equal the tracked property, compared as strings.
Multiplies the matched rate. All matching multipliers stack.
Added to the rate after every factor is applied, in credits per billing-unit group.
Inclusive upper usage boundary for this graduated tier. The final tier must be 'inf'.
Credits consumed per billing-unit group within this tier.
Credits consumed per billing-unit group.
Whether usage of this classic credit system should be itemized as invoice credits.
Per-model markup overrides for AI credit systems.
Default percentage markup for AI credit systems. Use -100 to make usage free.
Per-provider default markup percentages for AI credit systems.
Display names for the feature in billing UI and customer-facing components.
Singular form for UI display (e.g., 'API call', 'seat').
Plural form for UI display (e.g., 'API calls', 'seats').
Whether the feature is archived and hidden from the dashboard.
Processor mappings for this feature. Present when a Stripe product or meter is set.
Stripe product ID this feature's usage prices bill under.
Stripe meter ID used to create this feature's metered price.
Configuration for the customer.
Whether to disable the shared customer-level pool for entities.
Stops Autumn from posting usage-overage line items to Stripe for this customer. Check/track and balance resets still behave normally. When set, this overrides the organization-level disable\_overage\_billing setting.
Payment processors this customer is connected to (Stripe, Vercel, RevenueCat). Omitted entirely when the customer has not been created in any processor.
Stripe processor connection for the customer.
Stripe customer ID.
Vercel processor connection for the customer (public-safe subset).
Vercel marketplace installation ID for this customer.
Vercel account ID associated with the installation.
RevenueCat processor connection for the customer.
Customer's external ID, used as the RevenueCat app user ID. Null if the customer has no external ID set.
Invoices for this customer.
Array of plan IDs included in this invoice
The Stripe invoice ID
The billing processor that owns this invoice.
The status of the invoice
The total amount of the invoice
The currency code for the invoice
Timestamp when the invoice was created
URL to the Stripe-hosted invoice page
Upcoming invoice for each of this customer's Stripe subscriptions.
Plan IDs contributing line items to this invoice.
Unix timestamp (milliseconds) when this invoice will be created.
The three-letter ISO currency code. All amounts are in the currency's major unit (e.g., dollars for USD).
The total before discounts.
The total after discounts.
The line items this invoice will contain: usage accrued in the closing cycle, plus recurring charges for the opening cycle.
The name of the line item to display to the customer if you're building a UI. It will either be the plan name or the feature name.
A detailed description of the line item.
The amount before discounts and tax for this line item.
The final amount after discounts and tax for this line item.
List of discounts applied to this line item.
The ID of the plan that this line item belongs to.
The ID of the feature that this line item belongs to.
The period of time that this line item is being charged for.
The start of the period in milliseconds since the Unix epoch.
The end of the period in milliseconds since the Unix epoch.
The quantity of the line item.
Entities associated with this customer.
The unique identifier of the entity
The name of the entity
The customer ID this entity belongs to
The feature ID this entity belongs to
Unix timestamp when the entity was created
The environment (sandbox/live)
Trial usage history for this customer.
Rewards earned or applied for this customer.
Array of active discounts applied to the customer
The unique identifier for this discount
The name of the discount or coupon
The type of reward
The discount value (percentage or fixed amount)
How long the discount lasts
Number of billing periods the discount applies for repeating durations
The currency code for fixed amount discounts
Timestamp when the discount becomes active
Timestamp when the discount expires
The Stripe subscription ID this discount is applied to
Total amount saved from this discount
Referral records for this customer.
The customer's default payment method.
```json 200 theme={null}
{
"id": "2ee25a41-0d81-4ad2-8451-ec1aadaefe58",
"name": "Patrick",
"email": "patrick@useautumn.com",
"createdAt": 1771409161016,
"fingerprint": null,
"stripeId": "cus_U0BKxpq1mFhuJO",
"processors": {
"stripe": {
"id": "cus_U0BKxpq1mFhuJO"
}
},
"env": "sandbox",
"metadata": {},
"sendEmailReceipts": false,
"billingControls": {
"autoTopups": []
},
"subscriptions": [
{
"planId": "pro_plan",
"autoEnable": true,
"addOn": false,
"status": "active",
"pastDue": false,
"canceledAt": null,
"expiresAt": null,
"trialEndsAt": null,
"startedAt": 1771431921437,
"currentPeriodStart": 1771431921437,
"currentPeriodEnd": 1771999921437,
"quantity": 1
}
],
"purchases": [],
"licenses": [],
"balances": {
"messages": {
"featureId": "messages",
"granted": 100,
"remaining": 0,
"usage": 100,
"unlimited": false,
"overageAllowed": false,
"maxPurchase": null,
"nextResetAt": 1773851121437,
"breakdown": [
{
"id": "cus_ent_39qmLooixXLAqMywgXywjAz96rV",
"planId": "pro_plan",
"includedGrant": 100,
"prepaidGrant": 0,
"remaining": 0,
"usage": 100,
"unlimited": false,
"reset": {
"interval": "month",
"resetsAt": 1773851121437
},
"price": null,
"expiresAt": null
}
]
}
},
"flags": {
"advanced_workflows": {
"id": "cus_ent_abc123",
"plan_id": "pro_plan",
"expires_at": null,
"feature_id": "advanced_workflows"
}
},
"config": {
"disable_pooled_balance": false,
"disable_overage_billing": false
}
}
```
# List Customers
Source: https://docs.useautumn.com/api-reference/customers/listCustomers
openapi POST /v1/customers.list
Lists customers with cursor pagination and optional filters. Pass `start_cursor: ""` (or omit) for the first page; use `next_cursor` from a prior response for subsequent pages.
### Body Parameters
Opaque pagination cursor. Empty string (default) requests the first page; use next\_cursor from a prior response for subsequent pages.
Number of items to return. Default 50, hard ceiling 5000.
Filter by plan ID and version. Returns customers with active subscriptions to this plan.
Filter by customer product status. Defaults to active and scheduled.
Search customers by id, name, or email.
Filter by customer processor type (stripe, revenuecat, vercel).
Sort by customer creation time. Defaults to desc (newest first).
Filter by customer creation time (epoch milliseconds, inclusive bounds).
Include customers created at or after this timestamp (epoch milliseconds, inclusive)
Include customers created at or before this timestamp (epoch milliseconds, inclusive)
### Response
Items for current page.
Your unique identifier for the customer.
The name of the customer.
The email address of the customer.
Timestamp of customer creation in milliseconds since epoch.
A unique identifier (eg. serial number) to de-duplicate customers across devices or browsers. For example: apple device ID.
Stripe customer ID.
The environment this customer was created in.
The metadata for the customer.
Whether to send email receipts to the customer.
Billing controls for the customer (auto top-ups, etc.)
List of auto top-up configurations per feature.
The ID of the feature (credit balance) to auto top-up.
Whether auto top-up is enabled.
When the balance drops below this threshold, an auto top-up will be purchased.
Amount of credits to add per auto top-up.
Optional rate limit to cap how often auto top-ups occur. Expand billing\_controls.auto\_topups.purchase\_limit for a count of top ups and the next\_reset\_at.
The time interval for the purchase limit window. Null when no purchase limit is configured.
Number of intervals in the purchase limit window. Null when no purchase limit is configured.
Maximum number of auto top-ups allowed within the interval. Null when no purchase limit is configured.
Number of auto top-ups already consumed in the current window.
Unix ms timestamp when the current purchase window ends and the count resets.
When true, auto top-up creates a send\_invoice invoice instead of auto-charging.
Response-only: whether the entry is a customer-level override or inherited from an attached plan's defaults.
List of overage spend limits per feature (caps overage spend).
Optional feature ID this spend limit applies to.
Whether the overage spend limit is enabled.
How overage\_limit is interpreted: an absolute overage cap (default) or a percentage of the main-plan allowance.
Overage cap for the feature: absolute units, or a percent (e.g. 120) when limit\_type is usage\_percentage.
When true, overage for this feature is not posted to Stripe. Usage tracking and balance resets still behave normally.
Response-only: whether the entry is a customer-level override or inherited from an attached plan's defaults.
List of hard usage caps per feature, with current interval usage.
The feature this usage limit applies to.
Whether this usage limit is enabled.
Maximum units allowed per interval.
Interval for the cap, aligned to the customer's billing cycle.
Window alignment. 'billing\_cycle' phases the interval to the customer's renewal time; 'utc' aligns to the UTC calendar.
When set, only usage from events whose properties match counts toward this cap. Omit to count all usage of the feature.
Usage consumed in the active interval, stored in the usage-window counter.
Response-only: whether the entry is a customer-level override or inherited from an attached plan's defaults.
List of usage alert configurations per feature.
The feature ID this alert applies to.
Whether this usage alert is enabled.
The threshold value that triggers the alert. For usage or remaining, this is an absolute count. For usage\_percentage or remaining\_percentage, this is a percentage (0-100).
Whether the threshold is an absolute count or a percentage of the usage allowance or remaining balance.
What 100% means. balance: every grant on the feature. included: the plan allowance only. recurring: grants that reset. usage\_limit: the cap of the usage limit with the same feature and filter.
Only valid with basis usage\_limit. Points the alert at the usage limit carrying the same filter.
Optional user-defined label to distinguish multiple alerts on the same feature.
Response-only: whether the entry is a customer-level override or inherited from an attached plan's defaults.
List of overage allowed controls per feature. When enabled, usage can exceed balance.
The feature ID this overage allowed control applies to.
Whether overage is allowed for this feature.
Response-only: whether the entry is a customer-level override or inherited from an attached plan's defaults.
Active and scheduled recurring plans that this customer has attached.
The unique identifier of this subscription. If a subscription\_id was provided at attach time, it is used; otherwise, falls back to the internal ID.
The full plan object if expanded.
Unique identifier for the plan.
Display name of the plan.
Optional description of the plan.
Group identifier for organizing related plans. Plans in the same group are mutually exclusive.
Version number of the plan. Incremented when plan configuration changes.
User-facing version identity. Defaults to v\{n} when the version is minted.
Whether this is the active version of the plan. At most one version is active.
Whether this is an add-on plan that can be attached alongside a main plan.
If true, this plan is automatically attached when a customer is created. Used for free plans.
Base recurring price for the plan. Null for free plans or usage-only plans.
Base price amount for the plan, in major currency units (e.g. dollars).
Base price amounts in additional currencies. The base 'amount' is in the org's default currency.
Three-letter Stripe-supported currency code (e.g. 'eur', 'gbp').
Price amount in this currency. Set explicitly per currency, not converted from the base amount.
Billing interval (e.g. 'month', 'year').
Number of intervals per billing cycle. Defaults to 1.
Display text for showing this price in pricing pages.
Main display text (e.g. '\$10' or '100 messages').
Secondary display text (e.g. 'per month' or 'then \$0.5 per 100').
Payment processors this base price is connected to. Omitted when unset.
Stripe price ID. For prepaid with included > 0 this is the V2 price.
Feature configurations included in this plan. Each item defines included units, pricing, and reset behavior for a feature.
Bills this many feature units when outstanding overage reaches it.
The ID of the feature this item configures.
The full feature object if expanded.
The ID of the feature, used to refer to it in other API calls like /track or /check.
The name of the feature.
The type of the feature
Singular and plural display names for the feature.
The singular display name for the feature.
The plural display name for the feature.
Credit cost schema for credit system features.
The ID of the metered feature (should be a single\_use feature).
The credit cost of the metered feature.
Whether or not the feature is archived.
Number of free units included. For consumable features, balance resets to this number each interval.
Whether the customer has unlimited access to this feature.
Whether entity-level grants contribute to a shared customer balance.
Reset configuration for consumable features. Null for non-consumable features like seats where usage persists across billing cycles.
The interval at which the feature balance resets (e.g. 'month', 'year'). For consumable features, usage resets to 0 and included units are restored.
Number of intervals between resets. Defaults to 1.
Pricing configuration for usage beyond included units. Null if feature is entirely free.
Price per billing\_units after included usage is consumed. Mutually exclusive with tiers.
Amounts in additional currencies for this flat price. The base 'amount' is in the org's default currency. Only valid with 'amount', not 'tiers' (tiered prices carry per-currency amounts on each tier).
Three-letter Stripe-supported currency code (e.g. 'eur', 'gbp').
Price amount in this currency. Set explicitly per currency, not converted from the base amount.
Tiered pricing configuration. Each tier's 'to' INCLUDES the included amount. Either 'tiers' or 'amount' is required.
Three-letter Stripe-supported currency code (e.g. 'eur', 'gbp').
Per-unit amount for this tier in this currency.
Flat amount for this tier in this currency, if the tier uses one.
Billing interval for this price. For consumable features, should match reset.interval.
Number of intervals per billing cycle. Defaults to 1.
Number of units per price increment. Usage is rounded UP to the nearest billing\_units when billed (e.g. billing\_units=100 means 101 usage rounds to 200).
'prepaid' for features like seats where customers pay upfront, 'usage\_based' for pay-as-you-go after included usage.
Maximum units a customer can purchase beyond included. E.g. if included=100 and max\_purchase=300, customer can use up to 400 total before usage is capped. Null for no limit.
Payment processors this item price is connected to. Omitted when unset.
Stripe price ID. For prepaid with included > 0 this is the V2 price.
Display text for showing this item in pricing pages.
Main display text (e.g. '\$10' or '100 messages').
Secondary display text (e.g. 'per month' or 'then \$0.5 per 100').
Rollover configuration for unused units. If set, unused included units roll over to the next period.
Maximum rollover units. Null for unlimited rollover.
Maximum rollover as a percentage (0-100) of included + prepaid grant. Mutually exclusive with max.
When rolled over units expire.
Number of periods before expiry.
Overrides fields of this item's feature for customers on this plan (e.g. a credit system's credit\_schema).
For credit system features: replaces the feature's credit\_schema entirely for customers on this plan.
ID of the metered feature that draws from this credit system.
Number of metered-feature units priced together. Defaults to one when omitted.
Named rates chosen by event properties. The most specific match sets the rate; with no match the item's own rate applies.
Event properties this entry applies to. Every key must equal the tracked property, compared as strings.
Breaks ties between dimensions that match the same number of keys. Higher wins.
Inclusive upper usage boundary for this graduated tier. The final tier must be 'inf'.
Credits consumed per billing-unit group within this tier.
Named adjustments chosen by event properties. Every match applies: factors multiply, then adds are summed.
Event properties this entry applies to. Every key must equal the tracked property, compared as strings.
Multiplies the matched rate. All matching multipliers stack.
Added to the rate after every factor is applied, in credits per billing-unit group.
Inclusive upper usage boundary for this graduated tier. The final tier must be 'inf'.
Credits consumed per billing-unit group within this tier.
Credits consumed per billing-unit group.
For AI credit system features: replaces the feature's markup chain entirely for customers on this plan. An unset level means no markup at that level rather than inheriting the feature's.
Default percentage markup for customers on this plan. Use -100 to make usage free.
Per-provider markup percentages for customers on this plan.
Per-model markup overrides for customers on this plan.
Payment processors this plan is connected to. Omitted when unset.
Stripe product ID this plan is billed under.
Extra Stripe product IDs aliased to this plan.
Every RevenueCat product that maps to this plan. Replaces the current set.
RevenueCat product ID that grants this plan when purchased.
Prepaid quantities granted when this specific RevenueCat product is purchased, in feature units.
Free trial configuration. If set, new customers can try this plan before being charged.
Number of duration\_type periods the trial lasts.
Unit of time for the trial duration ('day', 'month', 'year').
Whether a payment method is required to start the trial. If true, customer will be charged after trial ends.
Behavior when the trial ends. 'bill' charges the customer (default). 'revert' expires the trial and restores the customer's previous plan.
Unix timestamp (ms) when the plan was created.
Environment this plan belongs to ('sandbox' or 'live').
Whether the plan is archived. Archived plans cannot be attached to new customers.
Miscellaneous plan-level configuration flags.
If true, entitlements attached to this plan will still reset on schedule even when the customer's product is in a past\_due state.
Plan-level billing controls used as customer defaults.
List of auto top-up configurations per feature.
The ID of the feature (credit balance) to auto top-up.
Whether auto top-up is enabled.
When the balance drops below this threshold, an auto top-up will be purchased.
Amount of credits to add per auto top-up.
Optional rate limit to cap how often auto top-ups occur.
The time interval for the purchase limit window.
Number of intervals in the purchase limit window.
Maximum number of auto top-ups allowed within the interval.
When true, auto top-up creates a send\_invoice invoice instead of auto-charging.
List of overage spend limits per feature (caps overage spend).
Optional feature ID this spend limit applies to.
Whether the overage spend limit is enabled.
How overage\_limit is interpreted: an absolute overage cap (default) or a percentage of the main-plan allowance.
Overage cap for the feature: absolute units, or a percent (e.g. 120) when limit\_type is usage\_percentage.
When true, overage for this feature is not posted to Stripe. Usage tracking and balance resets still behave normally.
List of hard usage caps per feature (max units per interval).
The feature this usage limit applies to.
Whether this usage limit is enabled.
Maximum units allowed per interval.
Interval for the cap, aligned to the customer's billing cycle.
Window alignment. 'billing\_cycle' phases the interval to the customer's renewal time; 'utc' aligns to the UTC calendar.
When set, only usage from events whose properties match counts toward this cap. Omit to count all usage of the feature.
List of usage alert configurations per feature.
The feature ID this alert applies to.
Whether this usage alert is enabled.
The threshold value that triggers the alert. For usage or remaining, this is an absolute count. For usage\_percentage or remaining\_percentage, this is a percentage (0-100).
Whether the threshold is an absolute count or a percentage of the usage allowance or remaining balance.
What 100% means. balance: every grant on the feature. included: the plan allowance only. recurring: grants that reset. usage\_limit: the cap of the usage limit with the same feature and filter.
Only valid with basis usage\_limit. Points the alert at the usage limit carrying the same filter.
Optional user-defined label to distinguish multiple alerts on the same feature.
List of overage allowed controls per feature. When enabled, usage can exceed balance.
The feature ID this overage allowed control applies to.
Whether overage is allowed for this feature.
Arbitrary key-value metadata defined by you for your own use. Shared across all versions of the plan.
Whether the trial on this plan is available to this customer. For example, if the customer used the trial in the past, this will be false.
The customer's current status with this plan. 'active' if attached, 'scheduled' if pending activation.
Whether the customer's active instance of this plan is set to cancel.
Whether the customer is currently on a free trial of this plan.
The action that would occur if this plan were attached to the customer.
Deprecated. Use variant\_details.base\_plan\_id instead. If this is a variant, the ID of the base plan it was created from.
Details about how this variant relates to its latest base plan.
The ID of the base plan this variant was derived from.
The customization that transforms the base plan into this variant.
Base price configuration for a plan.
Base price amount for the plan, in major currency units (e.g. dollars).
Billing interval (e.g. 'month', 'year').
Number of intervals per billing cycle. Defaults to 1.
Base price amounts in additional currencies. The base 'amount' is in the org's default currency.
Three-letter Stripe-supported currency code (e.g. 'eur', 'gbp').
Price amount in this currency. Set explicitly per currency, not converted from the base amount.
Items to add to the plan.
Bills this many feature units when outstanding overage reaches it.
The ID of the feature to configure.
Number of free units included. Balance resets to this each interval for consumable features.
If true, customer has unlimited access to this feature.
Whether entity-level grants contribute to a shared customer balance.
Reset configuration for consumable features. Omit for non-consumable features like seats.
Interval at which balance resets (e.g. 'month', 'year'). For consumable features only.
Number of intervals between resets. Defaults to 1.
Pricing for usage beyond included units. Omit for free features.
Price per billing\_units after included usage. Either 'amount' or 'tiers' is required.
Amounts in additional currencies for this flat price. The base 'amount' is in the org's default currency. Only valid with 'amount', not 'tiers'.
Three-letter Stripe-supported currency code (e.g. 'eur', 'gbp').
Price amount in this currency. Set explicitly per currency, not converted from the base amount.
Tiered pricing. Either 'amount' or 'tiers' is required.
Three-letter Stripe-supported currency code (e.g. 'eur', 'gbp').
Per-unit amount for this tier in this currency.
Flat amount for this tier in this currency, if the tier uses one.
Billing interval. For consumable features, should match reset.interval.
Number of intervals per billing cycle. Defaults to 1.
Units per price increment. Usage is rounded UP when billed (e.g. billing\_units=100 means 101 rounds to 200).
'prepaid' for upfront payment (seats), 'usage\_based' for pay-as-you-go.
Max units purchasable beyond included. E.g. included=100, max\_purchase=300 allows 400 total. Null for no limit.
Proration settings for prepaid features. Controls mid-cycle quantity change billing.
Billing behavior when quantity increases mid-cycle.
Credit behavior when quantity decreases mid-cycle.
Rollover config for unused units. If set, unused included units carry over.
Max rollover units. Omit for unlimited rollover.
Maximum rollover as a percentage (0-100) of included + prepaid grant. Mutually exclusive with max.
When rolled over units expire.
Number of periods before expiry.
Overrides fields of this item's feature for customers on this plan (e.g. a credit system's credit\_schema).
For credit system features: replaces the feature's credit\_schema entirely for customers on this plan.
ID of the metered feature that draws from this credit system.
Number of metered-feature units priced together. Defaults to one when omitted.
Named rates chosen by event properties. The most specific match sets the rate; with no match the item's own rate applies.
Event properties this entry applies to. Every key must equal the tracked property, compared as strings.
Breaks ties between dimensions that match the same number of keys. Higher wins.
Inclusive upper usage boundary for this graduated tier. The final tier must be 'inf'.
Credits consumed per billing-unit group within this tier.
Named adjustments chosen by event properties. Every match applies: factors multiply, then adds are summed.
Event properties this entry applies to. Every key must equal the tracked property, compared as strings.
Multiplies the matched rate. All matching multipliers stack.
Added to the rate after every factor is applied, in credits per billing-unit group.
Inclusive upper usage boundary for this graduated tier. The final tier must be 'inf'.
Credits consumed per billing-unit group within this tier.
Credits consumed per billing-unit group.
For AI credit system features: replaces the feature's markup chain entirely for customers on this plan. An unset level means no markup at that level rather than inheriting the feature's.
Default percentage markup for customers on this plan. Use -100 to make usage free.
Per-provider markup percentages for customers on this plan.
Per-model markup overrides for customers on this plan.
Filters selecting items to remove from the plan.
Match items linked to this feature.
Match items with this billing method (prepaid or usage\_based).
Match items with this interval. Accepts either a BillingInterval (price-side) or a ResetInterval (reset-side, includes day/hour/minute) so price-less items keyed by reset.interval can be disambiguated.
Match items with this interval\_count. Disambiguates between items that share an interval but differ in count.
Match items whose grant equals this included usage. Omitted is a wildcard.
Free trial configuration for a plan.
Number of duration\_type periods the trial lasts.
Unit of time for the trial ('day', 'month', 'year').
If true, a payment method is required to start the trial and the customer is charged when it ends. Defaults to false.
Behavior when the trial ends. 'bill' charges the customer (default). 'revert' expires the trial and restores the customer's previous plan.
Override the plan's billing controls (auto top-ups, spend limits, usage limits, usage alerts, overage allowed) for this customer.
List of auto top-up configurations per feature.
The ID of the feature (credit balance) to auto top-up.
Whether auto top-up is enabled.
When the balance drops below this threshold, an auto top-up will be purchased.
Amount of credits to add per auto top-up.
Optional rate limit to cap how often auto top-ups occur. Pass count to set the current window's consumed top-ups.
The time interval for the purchase limit window.
Number of intervals in the purchase limit window.
Maximum number of auto top-ups allowed within the interval.
Set the current window's consumed auto top-up count. Omit to leave runtime state unchanged.
When true, auto top-up creates a send\_invoice invoice instead of auto-charging.
List of overage spend limits per feature (caps overage spend).
Optional feature ID this spend limit applies to.
Whether the overage spend limit is enabled.
How overage\_limit is interpreted: an absolute overage cap (default) or a percentage of the main-plan allowance.
Overage cap for the feature: absolute units, or a percent (e.g. 120) when limit\_type is usage\_percentage.
When true, overage for this feature is not posted to Stripe. Usage tracking and balance resets still behave normally.
List of hard usage caps per feature (max units per interval).
The feature this usage limit applies to.
Whether this usage limit is enabled.
Maximum units allowed per interval.
Interval for the cap, aligned to the customer's billing cycle.
Window alignment. 'billing\_cycle' phases the interval to the customer's renewal time; 'utc' aligns to the UTC calendar.
When set, only usage from events whose properties match counts toward this cap. Omit to count all usage of the feature.
List of usage alert configurations per feature.
The feature ID this alert applies to.
Whether this usage alert is enabled.
The threshold value that triggers the alert. For usage or remaining, this is an absolute count. For usage\_percentage or remaining\_percentage, this is a percentage (0-100).
Whether the threshold is an absolute count or a percentage of the usage allowance or remaining balance.
What 100% means. balance: every grant on the feature. included: the plan allowance only. recurring: grants that reset. usage\_limit: the cap of the usage limit with the same feature and filter.
Only valid with basis usage\_limit. Points the alert at the usage limit carrying the same filter.
Optional user-defined label to distinguish multiple alerts on the same feature.
List of overage allowed controls per feature. When enabled, usage can exceed balance.
The feature ID this overage allowed control applies to.
Whether overage is allowed for this feature.
License links to add or override for this customer, keyed by license\_plan\_id. Omitted fields inherit the plan catalog link (included defaults to 1 when the license is not in the catalog). A bare entry restores the license to pure catalog inheritance.
Base price configuration for a plan.
Base price amount for the plan, in major currency units (e.g. dollars).
Billing interval (e.g. 'month', 'year').
Number of intervals per billing cycle. Defaults to 1.
Base price amounts in additional currencies. The base 'amount' is in the org's default currency.
Three-letter Stripe-supported currency code (e.g. 'eur', 'gbp').
Price amount in this currency. Set explicitly per currency, not converted from the base amount.
Bills this many feature units when outstanding overage reaches it.
The ID of the feature to configure.
Number of free units included. Balance resets to this each interval for consumable features.
If true, customer has unlimited access to this feature.
Whether entity-level grants contribute to a shared customer balance.
Reset configuration for consumable features. Omit for non-consumable features like seats.
Interval at which balance resets (e.g. 'month', 'year'). For consumable features only.
Number of intervals between resets. Defaults to 1.
Pricing for usage beyond included units. Omit for free features.
Price per billing\_units after included usage. Either 'amount' or 'tiers' is required.
Amounts in additional currencies for this flat price. The base 'amount' is in the org's default currency. Only valid with 'amount', not 'tiers'.
Three-letter Stripe-supported currency code (e.g. 'eur', 'gbp').
Price amount in this currency. Set explicitly per currency, not converted from the base amount.
Tiered pricing. Either 'amount' or 'tiers' is required.
Three-letter Stripe-supported currency code (e.g. 'eur', 'gbp').
Per-unit amount for this tier in this currency.
Flat amount for this tier in this currency, if the tier uses one.
Billing interval. For consumable features, should match reset.interval.
Number of intervals per billing cycle. Defaults to 1.
Units per price increment. Usage is rounded UP when billed (e.g. billing\_units=100 means 101 rounds to 200).
'prepaid' for upfront payment (seats), 'usage\_based' for pay-as-you-go.
Max units purchasable beyond included. E.g. included=100, max\_purchase=300 allows 400 total. Null for no limit.
Proration settings for prepaid features. Controls mid-cycle quantity change billing.
Billing behavior when quantity increases mid-cycle.
Credit behavior when quantity decreases mid-cycle.
Rollover config for unused units. If set, unused included units carry over.
Max rollover units. Omit for unlimited rollover.
Maximum rollover as a percentage (0-100) of included + prepaid grant. Mutually exclusive with max.
When rolled over units expire.
Number of periods before expiry.
Overrides fields of this item's feature for customers on this plan (e.g. a credit system's credit\_schema).
For credit system features: replaces the feature's credit\_schema entirely for customers on this plan.
ID of the metered feature that draws from this credit system.
Number of metered-feature units priced together. Defaults to one when omitted.
Named rates chosen by event properties. The most specific match sets the rate; with no match the item's own rate applies.
Event properties this entry applies to. Every key must equal the tracked property, compared as strings.
Breaks ties between dimensions that match the same number of keys. Higher wins.
Inclusive upper usage boundary for this graduated tier. The final tier must be 'inf'.
Credits consumed per billing-unit group within this tier.
Named adjustments chosen by event properties. Every match applies: factors multiply, then adds are summed.
Event properties this entry applies to. Every key must equal the tracked property, compared as strings.
Multiplies the matched rate. All matching multipliers stack.
Added to the rate after every factor is applied, in credits per billing-unit group.
Inclusive upper usage boundary for this graduated tier. The final tier must be 'inf'.
Credits consumed per billing-unit group within this tier.
Credits consumed per billing-unit group.
For AI credit system features: replaces the feature's markup chain entirely for customers on this plan. An unset level means no markup at that level rather than inheriting the feature's.
Default percentage markup for customers on this plan. Use -100 to make usage free.
Per-provider markup percentages for customers on this plan.
Per-model markup overrides for customers on this plan.
Match items linked to this feature.
Match items with this billing method (prepaid or usage\_based).
Match items with this interval. Accepts either a BillingInterval (price-side) or a ResetInterval (reset-side, includes day/hour/minute) so price-less items keyed by reset.interval can be disambiguated.
Match items with this interval\_count. Disambiguates between items that share an interval but differ in count.
Match items whose grant equals this included usage. Omitted is a wildcard.
License links to drop, keyed by license\_plan\_id. Parallel to remove\_items.
The unique identifier of the subscribed plan.
Whether the plan was automatically enabled for the customer.
Whether this is an add-on plan rather than a base subscription.
Current status of the subscription.
Whether the subscription has overdue payments.
Timestamp when the subscription was canceled, or null if not canceled.
Timestamp when the subscription will expire, or null if no expiry set.
Timestamp when the trial period ends, or null if not on trial.
Timestamp when the subscription started.
Start timestamp of the current billing period.
End timestamp of the current billing period.
Number of units of this subscription (for per-seat plans).
Whether this subscription is attached at the customer level or entity level.
One-time purchases made by the customer.
The full plan object if expanded.
Unique identifier for the plan.
Display name of the plan.
Optional description of the plan.
Group identifier for organizing related plans. Plans in the same group are mutually exclusive.
Version number of the plan. Incremented when plan configuration changes.
User-facing version identity. Defaults to v\{n} when the version is minted.
Whether this is the active version of the plan. At most one version is active.
Whether this is an add-on plan that can be attached alongside a main plan.
If true, this plan is automatically attached when a customer is created. Used for free plans.
Base recurring price for the plan. Null for free plans or usage-only plans.
Base price amount for the plan, in major currency units (e.g. dollars).
Base price amounts in additional currencies. The base 'amount' is in the org's default currency.
Three-letter Stripe-supported currency code (e.g. 'eur', 'gbp').
Price amount in this currency. Set explicitly per currency, not converted from the base amount.
Billing interval (e.g. 'month', 'year').
Number of intervals per billing cycle. Defaults to 1.
Display text for showing this price in pricing pages.
Main display text (e.g. '\$10' or '100 messages').
Secondary display text (e.g. 'per month' or 'then \$0.5 per 100').
Payment processors this base price is connected to. Omitted when unset.
Stripe price ID. For prepaid with included > 0 this is the V2 price.
Feature configurations included in this plan. Each item defines included units, pricing, and reset behavior for a feature.
Bills this many feature units when outstanding overage reaches it.
The ID of the feature this item configures.
The full feature object if expanded.
The ID of the feature, used to refer to it in other API calls like /track or /check.
The name of the feature.
The type of the feature
Singular and plural display names for the feature.
The singular display name for the feature.
The plural display name for the feature.
Credit cost schema for credit system features.
The ID of the metered feature (should be a single\_use feature).
The credit cost of the metered feature.
Whether or not the feature is archived.
Number of free units included. For consumable features, balance resets to this number each interval.
Whether the customer has unlimited access to this feature.
Whether entity-level grants contribute to a shared customer balance.
Reset configuration for consumable features. Null for non-consumable features like seats where usage persists across billing cycles.
The interval at which the feature balance resets (e.g. 'month', 'year'). For consumable features, usage resets to 0 and included units are restored.
Number of intervals between resets. Defaults to 1.
Pricing configuration for usage beyond included units. Null if feature is entirely free.
Price per billing\_units after included usage is consumed. Mutually exclusive with tiers.
Amounts in additional currencies for this flat price. The base 'amount' is in the org's default currency. Only valid with 'amount', not 'tiers' (tiered prices carry per-currency amounts on each tier).
Three-letter Stripe-supported currency code (e.g. 'eur', 'gbp').
Price amount in this currency. Set explicitly per currency, not converted from the base amount.
Tiered pricing configuration. Each tier's 'to' INCLUDES the included amount. Either 'tiers' or 'amount' is required.
Three-letter Stripe-supported currency code (e.g. 'eur', 'gbp').
Per-unit amount for this tier in this currency.
Flat amount for this tier in this currency, if the tier uses one.
Billing interval for this price. For consumable features, should match reset.interval.
Number of intervals per billing cycle. Defaults to 1.
Number of units per price increment. Usage is rounded UP to the nearest billing\_units when billed (e.g. billing\_units=100 means 101 usage rounds to 200).
'prepaid' for features like seats where customers pay upfront, 'usage\_based' for pay-as-you-go after included usage.
Maximum units a customer can purchase beyond included. E.g. if included=100 and max\_purchase=300, customer can use up to 400 total before usage is capped. Null for no limit.
Payment processors this item price is connected to. Omitted when unset.
Stripe price ID. For prepaid with included > 0 this is the V2 price.
Display text for showing this item in pricing pages.
Main display text (e.g. '\$10' or '100 messages').
Secondary display text (e.g. 'per month' or 'then \$0.5 per 100').
Rollover configuration for unused units. If set, unused included units roll over to the next period.
Maximum rollover units. Null for unlimited rollover.
Maximum rollover as a percentage (0-100) of included + prepaid grant. Mutually exclusive with max.
When rolled over units expire.
Number of periods before expiry.
Overrides fields of this item's feature for customers on this plan (e.g. a credit system's credit\_schema).
For credit system features: replaces the feature's credit\_schema entirely for customers on this plan.
ID of the metered feature that draws from this credit system.
Number of metered-feature units priced together. Defaults to one when omitted.
Named rates chosen by event properties. The most specific match sets the rate; with no match the item's own rate applies.
Event properties this entry applies to. Every key must equal the tracked property, compared as strings.
Breaks ties between dimensions that match the same number of keys. Higher wins.
Inclusive upper usage boundary for this graduated tier. The final tier must be 'inf'.
Credits consumed per billing-unit group within this tier.
Named adjustments chosen by event properties. Every match applies: factors multiply, then adds are summed.
Event properties this entry applies to. Every key must equal the tracked property, compared as strings.
Multiplies the matched rate. All matching multipliers stack.
Added to the rate after every factor is applied, in credits per billing-unit group.
Inclusive upper usage boundary for this graduated tier. The final tier must be 'inf'.
Credits consumed per billing-unit group within this tier.
Credits consumed per billing-unit group.
For AI credit system features: replaces the feature's markup chain entirely for customers on this plan. An unset level means no markup at that level rather than inheriting the feature's.
Default percentage markup for customers on this plan. Use -100 to make usage free.
Per-provider markup percentages for customers on this plan.
Per-model markup overrides for customers on this plan.
Payment processors this plan is connected to. Omitted when unset.
Stripe product ID this plan is billed under.
Extra Stripe product IDs aliased to this plan.
Every RevenueCat product that maps to this plan. Replaces the current set.
RevenueCat product ID that grants this plan when purchased.
Prepaid quantities granted when this specific RevenueCat product is purchased, in feature units.
Free trial configuration. If set, new customers can try this plan before being charged.
Number of duration\_type periods the trial lasts.
Unit of time for the trial duration ('day', 'month', 'year').
Whether a payment method is required to start the trial. If true, customer will be charged after trial ends.
Behavior when the trial ends. 'bill' charges the customer (default). 'revert' expires the trial and restores the customer's previous plan.
Unix timestamp (ms) when the plan was created.
Environment this plan belongs to ('sandbox' or 'live').
Whether the plan is archived. Archived plans cannot be attached to new customers.
Miscellaneous plan-level configuration flags.
If true, entitlements attached to this plan will still reset on schedule even when the customer's product is in a past\_due state.
Plan-level billing controls used as customer defaults.
List of auto top-up configurations per feature.
The ID of the feature (credit balance) to auto top-up.
Whether auto top-up is enabled.
When the balance drops below this threshold, an auto top-up will be purchased.
Amount of credits to add per auto top-up.
Optional rate limit to cap how often auto top-ups occur.
The time interval for the purchase limit window.
Number of intervals in the purchase limit window.
Maximum number of auto top-ups allowed within the interval.
When true, auto top-up creates a send\_invoice invoice instead of auto-charging.
List of overage spend limits per feature (caps overage spend).
Optional feature ID this spend limit applies to.
Whether the overage spend limit is enabled.
How overage\_limit is interpreted: an absolute overage cap (default) or a percentage of the main-plan allowance.
Overage cap for the feature: absolute units, or a percent (e.g. 120) when limit\_type is usage\_percentage.
When true, overage for this feature is not posted to Stripe. Usage tracking and balance resets still behave normally.
List of hard usage caps per feature (max units per interval).
The feature this usage limit applies to.
Whether this usage limit is enabled.
Maximum units allowed per interval.
Interval for the cap, aligned to the customer's billing cycle.
Window alignment. 'billing\_cycle' phases the interval to the customer's renewal time; 'utc' aligns to the UTC calendar.
When set, only usage from events whose properties match counts toward this cap. Omit to count all usage of the feature.
List of usage alert configurations per feature.
The feature ID this alert applies to.
Whether this usage alert is enabled.
The threshold value that triggers the alert. For usage or remaining, this is an absolute count. For usage\_percentage or remaining\_percentage, this is a percentage (0-100).
Whether the threshold is an absolute count or a percentage of the usage allowance or remaining balance.
What 100% means. balance: every grant on the feature. included: the plan allowance only. recurring: grants that reset. usage\_limit: the cap of the usage limit with the same feature and filter.
Only valid with basis usage\_limit. Points the alert at the usage limit carrying the same filter.
Optional user-defined label to distinguish multiple alerts on the same feature.
List of overage allowed controls per feature. When enabled, usage can exceed balance.
The feature ID this overage allowed control applies to.
Whether overage is allowed for this feature.
Arbitrary key-value metadata defined by you for your own use. Shared across all versions of the plan.
Whether the trial on this plan is available to this customer. For example, if the customer used the trial in the past, this will be false.
The customer's current status with this plan. 'active' if attached, 'scheduled' if pending activation.
Whether the customer's active instance of this plan is set to cancel.
Whether the customer is currently on a free trial of this plan.
The action that would occur if this plan were attached to the customer.
Deprecated. Use variant\_details.base\_plan\_id instead. If this is a variant, the ID of the base plan it was created from.
Details about how this variant relates to its latest base plan.
The ID of the base plan this variant was derived from.
The customization that transforms the base plan into this variant.
Base price configuration for a plan.
Base price amount for the plan, in major currency units (e.g. dollars).
Billing interval (e.g. 'month', 'year').
Number of intervals per billing cycle. Defaults to 1.
Base price amounts in additional currencies. The base 'amount' is in the org's default currency.
Three-letter Stripe-supported currency code (e.g. 'eur', 'gbp').
Price amount in this currency. Set explicitly per currency, not converted from the base amount.
Items to add to the plan.
Bills this many feature units when outstanding overage reaches it.
The ID of the feature to configure.
Number of free units included. Balance resets to this each interval for consumable features.
If true, customer has unlimited access to this feature.
Whether entity-level grants contribute to a shared customer balance.
Reset configuration for consumable features. Omit for non-consumable features like seats.
Interval at which balance resets (e.g. 'month', 'year'). For consumable features only.
Number of intervals between resets. Defaults to 1.
Pricing for usage beyond included units. Omit for free features.
Price per billing\_units after included usage. Either 'amount' or 'tiers' is required.
Amounts in additional currencies for this flat price. The base 'amount' is in the org's default currency. Only valid with 'amount', not 'tiers'.
Three-letter Stripe-supported currency code (e.g. 'eur', 'gbp').
Price amount in this currency. Set explicitly per currency, not converted from the base amount.
Tiered pricing. Either 'amount' or 'tiers' is required.
Three-letter Stripe-supported currency code (e.g. 'eur', 'gbp').
Per-unit amount for this tier in this currency.
Flat amount for this tier in this currency, if the tier uses one.
Billing interval. For consumable features, should match reset.interval.
Number of intervals per billing cycle. Defaults to 1.
Units per price increment. Usage is rounded UP when billed (e.g. billing\_units=100 means 101 rounds to 200).
'prepaid' for upfront payment (seats), 'usage\_based' for pay-as-you-go.
Max units purchasable beyond included. E.g. included=100, max\_purchase=300 allows 400 total. Null for no limit.
Proration settings for prepaid features. Controls mid-cycle quantity change billing.
Billing behavior when quantity increases mid-cycle.
Credit behavior when quantity decreases mid-cycle.
Rollover config for unused units. If set, unused included units carry over.
Max rollover units. Omit for unlimited rollover.
Maximum rollover as a percentage (0-100) of included + prepaid grant. Mutually exclusive with max.
When rolled over units expire.
Number of periods before expiry.
Overrides fields of this item's feature for customers on this plan (e.g. a credit system's credit\_schema).
For credit system features: replaces the feature's credit\_schema entirely for customers on this plan.
ID of the metered feature that draws from this credit system.
Number of metered-feature units priced together. Defaults to one when omitted.
Named rates chosen by event properties. The most specific match sets the rate; with no match the item's own rate applies.
Event properties this entry applies to. Every key must equal the tracked property, compared as strings.
Breaks ties between dimensions that match the same number of keys. Higher wins.
Inclusive upper usage boundary for this graduated tier. The final tier must be 'inf'.
Credits consumed per billing-unit group within this tier.
Named adjustments chosen by event properties. Every match applies: factors multiply, then adds are summed.
Event properties this entry applies to. Every key must equal the tracked property, compared as strings.
Multiplies the matched rate. All matching multipliers stack.
Added to the rate after every factor is applied, in credits per billing-unit group.
Inclusive upper usage boundary for this graduated tier. The final tier must be 'inf'.
Credits consumed per billing-unit group within this tier.
Credits consumed per billing-unit group.
For AI credit system features: replaces the feature's markup chain entirely for customers on this plan. An unset level means no markup at that level rather than inheriting the feature's.
Default percentage markup for customers on this plan. Use -100 to make usage free.
Per-provider markup percentages for customers on this plan.
Per-model markup overrides for customers on this plan.
Filters selecting items to remove from the plan.
Match items linked to this feature.
Match items with this billing method (prepaid or usage\_based).
Match items with this interval. Accepts either a BillingInterval (price-side) or a ResetInterval (reset-side, includes day/hour/minute) so price-less items keyed by reset.interval can be disambiguated.
Match items with this interval\_count. Disambiguates between items that share an interval but differ in count.
Match items whose grant equals this included usage. Omitted is a wildcard.
Free trial configuration for a plan.
Number of duration\_type periods the trial lasts.
Unit of time for the trial ('day', 'month', 'year').
If true, a payment method is required to start the trial and the customer is charged when it ends. Defaults to false.
Behavior when the trial ends. 'bill' charges the customer (default). 'revert' expires the trial and restores the customer's previous plan.
Override the plan's billing controls (auto top-ups, spend limits, usage limits, usage alerts, overage allowed) for this customer.
List of auto top-up configurations per feature.
The ID of the feature (credit balance) to auto top-up.
Whether auto top-up is enabled.
When the balance drops below this threshold, an auto top-up will be purchased.
Amount of credits to add per auto top-up.
Optional rate limit to cap how often auto top-ups occur. Pass count to set the current window's consumed top-ups.
The time interval for the purchase limit window.
Number of intervals in the purchase limit window.
Maximum number of auto top-ups allowed within the interval.
Set the current window's consumed auto top-up count. Omit to leave runtime state unchanged.
When true, auto top-up creates a send\_invoice invoice instead of auto-charging.
List of overage spend limits per feature (caps overage spend).
Optional feature ID this spend limit applies to.
Whether the overage spend limit is enabled.
How overage\_limit is interpreted: an absolute overage cap (default) or a percentage of the main-plan allowance.
Overage cap for the feature: absolute units, or a percent (e.g. 120) when limit\_type is usage\_percentage.
When true, overage for this feature is not posted to Stripe. Usage tracking and balance resets still behave normally.
List of hard usage caps per feature (max units per interval).
The feature this usage limit applies to.
Whether this usage limit is enabled.
Maximum units allowed per interval.
Interval for the cap, aligned to the customer's billing cycle.
Window alignment. 'billing\_cycle' phases the interval to the customer's renewal time; 'utc' aligns to the UTC calendar.
When set, only usage from events whose properties match counts toward this cap. Omit to count all usage of the feature.
List of usage alert configurations per feature.
The feature ID this alert applies to.
Whether this usage alert is enabled.
The threshold value that triggers the alert. For usage or remaining, this is an absolute count. For usage\_percentage or remaining\_percentage, this is a percentage (0-100).
Whether the threshold is an absolute count or a percentage of the usage allowance or remaining balance.
What 100% means. balance: every grant on the feature. included: the plan allowance only. recurring: grants that reset. usage\_limit: the cap of the usage limit with the same feature and filter.
Only valid with basis usage\_limit. Points the alert at the usage limit carrying the same filter.
Optional user-defined label to distinguish multiple alerts on the same feature.
List of overage allowed controls per feature. When enabled, usage can exceed balance.
The feature ID this overage allowed control applies to.
Whether overage is allowed for this feature.
License links to add or override for this customer, keyed by license\_plan\_id. Omitted fields inherit the plan catalog link (included defaults to 1 when the license is not in the catalog). A bare entry restores the license to pure catalog inheritance.
Base price configuration for a plan.
Base price amount for the plan, in major currency units (e.g. dollars).
Billing interval (e.g. 'month', 'year').
Number of intervals per billing cycle. Defaults to 1.
Base price amounts in additional currencies. The base 'amount' is in the org's default currency.
Three-letter Stripe-supported currency code (e.g. 'eur', 'gbp').
Price amount in this currency. Set explicitly per currency, not converted from the base amount.
Bills this many feature units when outstanding overage reaches it.
The ID of the feature to configure.
Number of free units included. Balance resets to this each interval for consumable features.
If true, customer has unlimited access to this feature.
Whether entity-level grants contribute to a shared customer balance.
Reset configuration for consumable features. Omit for non-consumable features like seats.
Interval at which balance resets (e.g. 'month', 'year'). For consumable features only.
Number of intervals between resets. Defaults to 1.
Pricing for usage beyond included units. Omit for free features.
Price per billing\_units after included usage. Either 'amount' or 'tiers' is required.
Amounts in additional currencies for this flat price. The base 'amount' is in the org's default currency. Only valid with 'amount', not 'tiers'.
Three-letter Stripe-supported currency code (e.g. 'eur', 'gbp').
Price amount in this currency. Set explicitly per currency, not converted from the base amount.
Tiered pricing. Either 'amount' or 'tiers' is required.
Three-letter Stripe-supported currency code (e.g. 'eur', 'gbp').
Per-unit amount for this tier in this currency.
Flat amount for this tier in this currency, if the tier uses one.
Billing interval. For consumable features, should match reset.interval.
Number of intervals per billing cycle. Defaults to 1.
Units per price increment. Usage is rounded UP when billed (e.g. billing\_units=100 means 101 rounds to 200).
'prepaid' for upfront payment (seats), 'usage\_based' for pay-as-you-go.
Max units purchasable beyond included. E.g. included=100, max\_purchase=300 allows 400 total. Null for no limit.
Proration settings for prepaid features. Controls mid-cycle quantity change billing.
Billing behavior when quantity increases mid-cycle.
Credit behavior when quantity decreases mid-cycle.
Rollover config for unused units. If set, unused included units carry over.
Max rollover units. Omit for unlimited rollover.
Maximum rollover as a percentage (0-100) of included + prepaid grant. Mutually exclusive with max.
When rolled over units expire.
Number of periods before expiry.
Overrides fields of this item's feature for customers on this plan (e.g. a credit system's credit\_schema).
For credit system features: replaces the feature's credit\_schema entirely for customers on this plan.
ID of the metered feature that draws from this credit system.
Number of metered-feature units priced together. Defaults to one when omitted.
Named rates chosen by event properties. The most specific match sets the rate; with no match the item's own rate applies.
Event properties this entry applies to. Every key must equal the tracked property, compared as strings.
Breaks ties between dimensions that match the same number of keys. Higher wins.
Inclusive upper usage boundary for this graduated tier. The final tier must be 'inf'.
Credits consumed per billing-unit group within this tier.
Named adjustments chosen by event properties. Every match applies: factors multiply, then adds are summed.
Event properties this entry applies to. Every key must equal the tracked property, compared as strings.
Multiplies the matched rate. All matching multipliers stack.
Added to the rate after every factor is applied, in credits per billing-unit group.
Inclusive upper usage boundary for this graduated tier. The final tier must be 'inf'.
Credits consumed per billing-unit group within this tier.
Credits consumed per billing-unit group.
For AI credit system features: replaces the feature's markup chain entirely for customers on this plan. An unset level means no markup at that level rather than inheriting the feature's.
Default percentage markup for customers on this plan. Use -100 to make usage free.
Per-provider markup percentages for customers on this plan.
Per-model markup overrides for customers on this plan.
Match items linked to this feature.
Match items with this billing method (prepaid or usage\_based).
Match items with this interval. Accepts either a BillingInterval (price-side) or a ResetInterval (reset-side, includes day/hour/minute) so price-less items keyed by reset.interval can be disambiguated.
Match items with this interval\_count. Disambiguates between items that share an interval but differ in count.
Match items whose grant equals this included usage. Omitted is a wildcard.
License links to drop, keyed by license\_plan\_id. Parallel to remove\_items.
The unique identifier of the purchased plan.
Timestamp when the purchase expires, or null for lifetime access.
Timestamp when the purchase was made.
Number of units purchased.
Whether this purchase is attached at the customer level or entity level.
License seat pools granted by the customer's plans, with seat counts.
The plan offered as an assignable license.
The plan that offers this license.
Display name of the license plan.
Total seats the customer has for this license, included plus paid.
Seats currently assigned to entities.
Seats still available to assign.
Paid seats purchased on top of the plan's included amount.
Feature balances keyed by feature ID, showing usage limits and remaining amounts.
The feature ID this balance is for.
The full feature object if expanded.
The unique identifier for this feature, used in /check and /track calls.
Human-readable name displayed in the dashboard and billing UI.
Feature type: 'boolean' for on/off access, 'metered' for usage-tracked features, 'credit\_system' for unified credit pools, 'ai\_credit\_system' for model-based token pricing.
For metered features: true if usage resets periodically (API calls, credits), false if allocated persistently (seats, storage).
Event names that trigger this feature's balance. Allows multiple features to respond to a single event.
For classic credit systems: maps metered features to flat or graduated credit costs.
ID of the metered feature that draws from this credit system.
Number of metered-feature units priced together. Defaults to one when omitted.
Named rates chosen by event properties. The most specific match sets the rate; with no match the item's own rate applies.
Event properties this entry applies to. Every key must equal the tracked property, compared as strings.
Breaks ties between dimensions that match the same number of keys. Higher wins.
Inclusive upper usage boundary for this graduated tier. The final tier must be 'inf'.
Credits consumed per billing-unit group within this tier.
Named adjustments chosen by event properties. Every match applies: factors multiply, then adds are summed.
Event properties this entry applies to. Every key must equal the tracked property, compared as strings.
Multiplies the matched rate. All matching multipliers stack.
Added to the rate after every factor is applied, in credits per billing-unit group.
Inclusive upper usage boundary for this graduated tier. The final tier must be 'inf'.
Credits consumed per billing-unit group within this tier.
Credits consumed per billing-unit group.
Whether usage of this classic credit system should be itemized as invoice credits.
Per-model markup overrides for AI credit systems.
Default percentage markup for AI credit systems. Use -100 to make usage free.
Per-provider default markup percentages for AI credit systems.
Display names for the feature in billing UI and customer-facing components.
Singular form for UI display (e.g., 'API call', 'seat').
Plural form for UI display (e.g., 'API calls', 'seats').
Whether the feature is archived and hidden from the dashboard.
Processor mappings for this feature. Present when a Stripe product or meter is set.
Stripe product ID this feature's usage prices bill under.
Stripe meter ID used to create this feature's metered price.
Total balance granted (included + prepaid).
Remaining balance available for use.
Total usage consumed in the current period.
Whether this feature has unlimited usage.
Whether usage beyond the granted balance is allowed (with overage charges).
Maximum quantity that can be purchased as a top-up, or null for unlimited.
Timestamp when the balance will reset, or null for no reset.
Detailed breakdown of balance sources when stacking multiple plans or grants.
The unique identifier for this balance breakdown.
The plan ID this balance originates from, or null for standalone balances.
Amount granted from the plan's included usage.
Amount granted from prepaid purchases or top-ups.
Remaining balance available for use.
Amount consumed in the current period.
Whether this balance has unlimited usage.
Reset configuration for this balance, or null if no reset.
The reset interval (hour, day, week, month, etc.) or 'multiple' if combined from different intervals.
Number of intervals between resets (eg. 2 for bi-monthly).
Timestamp when the balance will next reset.
Pricing configuration if this balance has usage-based pricing.
The per-unit price amount.
Tiered pricing configuration if applicable.
How tiers are applied: graduated (split across bands) or volume (flat rate for the matched tier).
The number of units per billing increment (eg. \$9 / 250 units).
Whether usage is prepaid or billed pay-per-use.
Maximum quantity that can be purchased, or null for unlimited.
Timestamp when this balance expires, or null for no expiration.
Rollover balances carried over from previous periods.
Amount originally rolled over from a previous period, before any of it was consumed.
Amount of balance rolled over from a previous period.
Timestamp when the rollover balance expires.
Boolean feature flags keyed by feature ID, showing enabled access for on/off features.
The unique identifier for this flag.
The plan ID this flag originates from, or null for standalone flags.
Timestamp when this flag expires, or null for no expiration.
The feature ID this flag is for.
The full feature object if expanded.
The unique identifier for this feature, used in /check and /track calls.
Human-readable name displayed in the dashboard and billing UI.
Feature type: 'boolean' for on/off access, 'metered' for usage-tracked features, 'credit\_system' for unified credit pools, 'ai\_credit\_system' for model-based token pricing.
For metered features: true if usage resets periodically (API calls, credits), false if allocated persistently (seats, storage).
Event names that trigger this feature's balance. Allows multiple features to respond to a single event.
For classic credit systems: maps metered features to flat or graduated credit costs.
ID of the metered feature that draws from this credit system.
Number of metered-feature units priced together. Defaults to one when omitted.
Named rates chosen by event properties. The most specific match sets the rate; with no match the item's own rate applies.
Event properties this entry applies to. Every key must equal the tracked property, compared as strings.
Breaks ties between dimensions that match the same number of keys. Higher wins.
Inclusive upper usage boundary for this graduated tier. The final tier must be 'inf'.
Credits consumed per billing-unit group within this tier.
Named adjustments chosen by event properties. Every match applies: factors multiply, then adds are summed.
Event properties this entry applies to. Every key must equal the tracked property, compared as strings.
Multiplies the matched rate. All matching multipliers stack.
Added to the rate after every factor is applied, in credits per billing-unit group.
Inclusive upper usage boundary for this graduated tier. The final tier must be 'inf'.
Credits consumed per billing-unit group within this tier.
Credits consumed per billing-unit group.
Whether usage of this classic credit system should be itemized as invoice credits.
Per-model markup overrides for AI credit systems.
Default percentage markup for AI credit systems. Use -100 to make usage free.
Per-provider default markup percentages for AI credit systems.
Display names for the feature in billing UI and customer-facing components.
Singular form for UI display (e.g., 'API call', 'seat').
Plural form for UI display (e.g., 'API calls', 'seats').
Whether the feature is archived and hidden from the dashboard.
Processor mappings for this feature. Present when a Stripe product or meter is set.
Stripe product ID this feature's usage prices bill under.
Stripe meter ID used to create this feature's metered price.
Configuration for the customer.
Whether to disable the shared customer-level pool for entities.
Stops Autumn from posting usage-overage line items to Stripe for this customer. Check/track and balance resets still behave normally. When set, this overrides the organization-level disable\_overage\_billing setting.
Payment processors this customer is connected to (Stripe, Vercel, RevenueCat). Omitted entirely when the customer has not been created in any processor.
Stripe processor connection for the customer.
Stripe customer ID.
Vercel processor connection for the customer (public-safe subset).
Vercel marketplace installation ID for this customer.
Vercel account ID associated with the installation.
RevenueCat processor connection for the customer.
Customer's external ID, used as the RevenueCat app user ID. Null if the customer has no external ID set.
Opaque cursor for the next page. Null when there are no more results.
```json 200 theme={null}
{
"list": [
{
"id": "2ee25a41-0d81-4ad2-8451-ec1aadaefe58",
"name": "Patrick",
"email": "patrick@useautumn.com",
"createdAt": 1771409161016,
"fingerprint": null,
"stripeId": "cus_U0BKxpq1mFhuJO",
"processors": {
"stripe": {
"id": "cus_U0BKxpq1mFhuJO"
}
},
"env": "sandbox",
"metadata": {},
"sendEmailReceipts": false,
"billingControls": {
"autoTopups": []
},
"subscriptions": [
{
"planId": "pro_plan",
"autoEnable": true,
"addOn": false,
"status": "active",
"pastDue": false,
"canceledAt": null,
"expiresAt": null,
"trialEndsAt": null,
"startedAt": 1771431921437,
"currentPeriodStart": 1771431921437,
"currentPeriodEnd": 1771999921437,
"quantity": 1
}
],
"purchases": [],
"licenses": [],
"balances": {
"messages": {
"featureId": "messages",
"granted": 100,
"remaining": 0,
"usage": 100,
"unlimited": false,
"overageAllowed": false,
"maxPurchase": null,
"nextResetAt": 1773851121437,
"breakdown": [
{
"id": "cus_ent_39qmLooixXLAqMywgXywjAz96rV",
"planId": "pro_plan",
"includedGrant": 100,
"prepaidGrant": 0,
"remaining": 0,
"usage": 100,
"unlimited": false,
"reset": {
"interval": "month",
"resetsAt": 1773851121437
},
"price": null,
"expiresAt": null
}
]
}
},
"flags": {
"advanced_workflows": {
"id": "cus_ent_abc123",
"plan_id": "pro_plan",
"expires_at": null,
"feature_id": "advanced_workflows"
}
},
"config": {
"disable_pooled_balance": false,
"disable_overage_billing": false
}
}
],
"next_cursor": null
}
```
# Update Customer
Source: https://docs.useautumn.com/api-reference/customers/updateCustomer
openapi POST /v1/customers.update
Updates an existing customer by ID.
### Body Parameters
ID of the customer to update
Customer's name
Customer's email address
Unique identifier (eg, serial number) to detect duplicate customers and prevent free trial abuse
Additional metadata for the customer
Stripe customer ID if you already have one
Whether to send email receipts to this customer
Currency to bill this customer in (e.g. usd, eur). Defaults to the organization's default currency.
List of auto top-up configurations per feature.
The ID of the feature (credit balance) to auto top-up.
Whether auto top-up is enabled.
When the balance drops below this threshold, an auto top-up will be purchased.
Amount of credits to add per auto top-up.
Optional rate limit to cap how often auto top-ups occur. Pass count to set the current window's consumed top-ups.
The time interval for the purchase limit window.
Number of intervals in the purchase limit window.
Maximum number of auto top-ups allowed within the interval.
Set the current window's consumed auto top-up count. Omit to leave runtime state unchanged.
When true, auto top-up creates a send\_invoice invoice instead of auto-charging.
List of overage spend limits per feature (caps overage spend).
Optional feature ID this spend limit applies to.
Whether the overage spend limit is enabled.
How overage\_limit is interpreted: an absolute overage cap (default) or a percentage of the main-plan allowance.
Overage cap for the feature: absolute units, or a percent (e.g. 120) when limit\_type is usage\_percentage.
When true, overage for this feature is not posted to Stripe. Usage tracking and balance resets still behave normally.
List of hard usage caps per feature. An entry with only feature\_id and usage sets the current counter without changing configuration.
The feature this usage limit applies to.
Whether this usage limit is enabled.
Maximum units allowed per interval.
Interval for the cap, aligned to the customer's billing cycle.
Window alignment. 'billing\_cycle' phases the interval to the customer's renewal time; 'utc' aligns to the UTC calendar.
When set, only usage from events whose properties match counts toward this cap. Omit to count all usage of the feature.
Usage consumed in the active interval, stored in the usage-window counter.
Response-only: whether the entry is a customer-level override or inherited from an attached plan's defaults.
List of usage alert configurations per feature.
The feature ID this alert applies to.
Whether this usage alert is enabled.
The threshold value that triggers the alert. For usage or remaining, this is an absolute count. For usage\_percentage or remaining\_percentage, this is a percentage (0-100).
Whether the threshold is an absolute count or a percentage of the usage allowance or remaining balance.
What 100% means. balance: every grant on the feature. included: the plan allowance only. recurring: grants that reset. usage\_limit: the cap of the usage limit with the same feature and filter.
Only valid with basis usage\_limit. Points the alert at the usage limit carrying the same filter.
Optional user-defined label to distinguish multiple alerts on the same feature.
List of overage allowed controls per feature. When enabled, usage can exceed balance.
The feature ID this overage allowed control applies to.
Whether overage is allowed for this feature.
Miscellaneous configurations for the customer.
Whether to disable the shared customer-level pool for entities.
Stops Autumn from posting usage-overage line items to Stripe for this customer. Check/track and balance resets still behave normally. When set, this overrides the organization-level disable\_overage\_billing setting.
New ID for the customer
### Response
Your unique identifier for the customer.
The name of the customer.
The email address of the customer.
Timestamp of customer creation in milliseconds since epoch.
A unique identifier (eg. serial number) to de-duplicate customers across devices or browsers. For example: apple device ID.
Stripe customer ID.
The environment this customer was created in.
The metadata for the customer.
Whether to send email receipts to the customer.
Billing controls for the customer (auto top-ups, etc.)
List of auto top-up configurations per feature.
The ID of the feature (credit balance) to auto top-up.
Whether auto top-up is enabled.
When the balance drops below this threshold, an auto top-up will be purchased.
Amount of credits to add per auto top-up.
Optional rate limit to cap how often auto top-ups occur. Expand billing\_controls.auto\_topups.purchase\_limit for a count of top ups and the next\_reset\_at.
The time interval for the purchase limit window. Null when no purchase limit is configured.
Number of intervals in the purchase limit window. Null when no purchase limit is configured.
Maximum number of auto top-ups allowed within the interval. Null when no purchase limit is configured.
Number of auto top-ups already consumed in the current window.
Unix ms timestamp when the current purchase window ends and the count resets.
When true, auto top-up creates a send\_invoice invoice instead of auto-charging.
Response-only: whether the entry is a customer-level override or inherited from an attached plan's defaults.
List of overage spend limits per feature (caps overage spend).
Optional feature ID this spend limit applies to.
Whether the overage spend limit is enabled.
How overage\_limit is interpreted: an absolute overage cap (default) or a percentage of the main-plan allowance.
Overage cap for the feature: absolute units, or a percent (e.g. 120) when limit\_type is usage\_percentage.
When true, overage for this feature is not posted to Stripe. Usage tracking and balance resets still behave normally.
Response-only: whether the entry is a customer-level override or inherited from an attached plan's defaults.
List of hard usage caps per feature, with current interval usage.
The feature this usage limit applies to.
Whether this usage limit is enabled.
Maximum units allowed per interval.
Interval for the cap, aligned to the customer's billing cycle.
Window alignment. 'billing\_cycle' phases the interval to the customer's renewal time; 'utc' aligns to the UTC calendar.
When set, only usage from events whose properties match counts toward this cap. Omit to count all usage of the feature.
Usage consumed in the active interval, stored in the usage-window counter.
Response-only: whether the entry is a customer-level override or inherited from an attached plan's defaults.
List of usage alert configurations per feature.
The feature ID this alert applies to.
Whether this usage alert is enabled.
The threshold value that triggers the alert. For usage or remaining, this is an absolute count. For usage\_percentage or remaining\_percentage, this is a percentage (0-100).
Whether the threshold is an absolute count or a percentage of the usage allowance or remaining balance.
What 100% means. balance: every grant on the feature. included: the plan allowance only. recurring: grants that reset. usage\_limit: the cap of the usage limit with the same feature and filter.
Only valid with basis usage\_limit. Points the alert at the usage limit carrying the same filter.
Optional user-defined label to distinguish multiple alerts on the same feature.
Response-only: whether the entry is a customer-level override or inherited from an attached plan's defaults.
List of overage allowed controls per feature. When enabled, usage can exceed balance.
The feature ID this overage allowed control applies to.
Whether overage is allowed for this feature.
Response-only: whether the entry is a customer-level override or inherited from an attached plan's defaults.
Active and scheduled recurring plans that this customer has attached.
The unique identifier of this subscription. If a subscription\_id was provided at attach time, it is used; otherwise, falls back to the internal ID.
The full plan object if expanded.
Unique identifier for the plan.
Display name of the plan.
Optional description of the plan.
Group identifier for organizing related plans. Plans in the same group are mutually exclusive.
Version number of the plan. Incremented when plan configuration changes.
User-facing version identity. Defaults to v\{n} when the version is minted.
Whether this is the active version of the plan. At most one version is active.
Whether this is an add-on plan that can be attached alongside a main plan.
If true, this plan is automatically attached when a customer is created. Used for free plans.
Base recurring price for the plan. Null for free plans or usage-only plans.
Base price amount for the plan, in major currency units (e.g. dollars).
Base price amounts in additional currencies. The base 'amount' is in the org's default currency.
Three-letter Stripe-supported currency code (e.g. 'eur', 'gbp').
Price amount in this currency. Set explicitly per currency, not converted from the base amount.
Billing interval (e.g. 'month', 'year').
Number of intervals per billing cycle. Defaults to 1.
Display text for showing this price in pricing pages.
Main display text (e.g. '\$10' or '100 messages').
Secondary display text (e.g. 'per month' or 'then \$0.5 per 100').
Payment processors this base price is connected to. Omitted when unset.
Stripe price ID. For prepaid with included > 0 this is the V2 price.
Feature configurations included in this plan. Each item defines included units, pricing, and reset behavior for a feature.
Bills this many feature units when outstanding overage reaches it.
The ID of the feature this item configures.
The full feature object if expanded.
The ID of the feature, used to refer to it in other API calls like /track or /check.
The name of the feature.
The type of the feature
Singular and plural display names for the feature.
The singular display name for the feature.
The plural display name for the feature.
Credit cost schema for credit system features.
The ID of the metered feature (should be a single\_use feature).
The credit cost of the metered feature.
Whether or not the feature is archived.
Number of free units included. For consumable features, balance resets to this number each interval.
Whether the customer has unlimited access to this feature.
Whether entity-level grants contribute to a shared customer balance.
Reset configuration for consumable features. Null for non-consumable features like seats where usage persists across billing cycles.
The interval at which the feature balance resets (e.g. 'month', 'year'). For consumable features, usage resets to 0 and included units are restored.
Number of intervals between resets. Defaults to 1.
Pricing configuration for usage beyond included units. Null if feature is entirely free.
Price per billing\_units after included usage is consumed. Mutually exclusive with tiers.
Amounts in additional currencies for this flat price. The base 'amount' is in the org's default currency. Only valid with 'amount', not 'tiers' (tiered prices carry per-currency amounts on each tier).
Three-letter Stripe-supported currency code (e.g. 'eur', 'gbp').
Price amount in this currency. Set explicitly per currency, not converted from the base amount.
Tiered pricing configuration. Each tier's 'to' INCLUDES the included amount. Either 'tiers' or 'amount' is required.
Three-letter Stripe-supported currency code (e.g. 'eur', 'gbp').
Per-unit amount for this tier in this currency.
Flat amount for this tier in this currency, if the tier uses one.
Billing interval for this price. For consumable features, should match reset.interval.
Number of intervals per billing cycle. Defaults to 1.
Number of units per price increment. Usage is rounded UP to the nearest billing\_units when billed (e.g. billing\_units=100 means 101 usage rounds to 200).
'prepaid' for features like seats where customers pay upfront, 'usage\_based' for pay-as-you-go after included usage.
Maximum units a customer can purchase beyond included. E.g. if included=100 and max\_purchase=300, customer can use up to 400 total before usage is capped. Null for no limit.
Payment processors this item price is connected to. Omitted when unset.
Stripe price ID. For prepaid with included > 0 this is the V2 price.
Display text for showing this item in pricing pages.
Main display text (e.g. '\$10' or '100 messages').
Secondary display text (e.g. 'per month' or 'then \$0.5 per 100').
Rollover configuration for unused units. If set, unused included units roll over to the next period.
Maximum rollover units. Null for unlimited rollover.
Maximum rollover as a percentage (0-100) of included + prepaid grant. Mutually exclusive with max.
When rolled over units expire.
Number of periods before expiry.
Overrides fields of this item's feature for customers on this plan (e.g. a credit system's credit\_schema).
For credit system features: replaces the feature's credit\_schema entirely for customers on this plan.
ID of the metered feature that draws from this credit system.
Number of metered-feature units priced together. Defaults to one when omitted.
Named rates chosen by event properties. The most specific match sets the rate; with no match the item's own rate applies.
Event properties this entry applies to. Every key must equal the tracked property, compared as strings.
Breaks ties between dimensions that match the same number of keys. Higher wins.
Inclusive upper usage boundary for this graduated tier. The final tier must be 'inf'.
Credits consumed per billing-unit group within this tier.
Named adjustments chosen by event properties. Every match applies: factors multiply, then adds are summed.
Event properties this entry applies to. Every key must equal the tracked property, compared as strings.
Multiplies the matched rate. All matching multipliers stack.
Added to the rate after every factor is applied, in credits per billing-unit group.
Inclusive upper usage boundary for this graduated tier. The final tier must be 'inf'.
Credits consumed per billing-unit group within this tier.
Credits consumed per billing-unit group.
For AI credit system features: replaces the feature's markup chain entirely for customers on this plan. An unset level means no markup at that level rather than inheriting the feature's.
Default percentage markup for customers on this plan. Use -100 to make usage free.
Per-provider markup percentages for customers on this plan.
Per-model markup overrides for customers on this plan.
Payment processors this plan is connected to. Omitted when unset.
Stripe product ID this plan is billed under.
Extra Stripe product IDs aliased to this plan.
Every RevenueCat product that maps to this plan. Replaces the current set.
RevenueCat product ID that grants this plan when purchased.
Prepaid quantities granted when this specific RevenueCat product is purchased, in feature units.
Free trial configuration. If set, new customers can try this plan before being charged.
Number of duration\_type periods the trial lasts.
Unit of time for the trial duration ('day', 'month', 'year').
Whether a payment method is required to start the trial. If true, customer will be charged after trial ends.
Behavior when the trial ends. 'bill' charges the customer (default). 'revert' expires the trial and restores the customer's previous plan.
Unix timestamp (ms) when the plan was created.
Environment this plan belongs to ('sandbox' or 'live').
Whether the plan is archived. Archived plans cannot be attached to new customers.
Miscellaneous plan-level configuration flags.
If true, entitlements attached to this plan will still reset on schedule even when the customer's product is in a past\_due state.
Plan-level billing controls used as customer defaults.
List of auto top-up configurations per feature.
The ID of the feature (credit balance) to auto top-up.
Whether auto top-up is enabled.
When the balance drops below this threshold, an auto top-up will be purchased.
Amount of credits to add per auto top-up.
Optional rate limit to cap how often auto top-ups occur.
The time interval for the purchase limit window.
Number of intervals in the purchase limit window.
Maximum number of auto top-ups allowed within the interval.
When true, auto top-up creates a send\_invoice invoice instead of auto-charging.
List of overage spend limits per feature (caps overage spend).
Optional feature ID this spend limit applies to.
Whether the overage spend limit is enabled.
How overage\_limit is interpreted: an absolute overage cap (default) or a percentage of the main-plan allowance.
Overage cap for the feature: absolute units, or a percent (e.g. 120) when limit\_type is usage\_percentage.
When true, overage for this feature is not posted to Stripe. Usage tracking and balance resets still behave normally.
List of hard usage caps per feature (max units per interval).
The feature this usage limit applies to.
Whether this usage limit is enabled.
Maximum units allowed per interval.
Interval for the cap, aligned to the customer's billing cycle.
Window alignment. 'billing\_cycle' phases the interval to the customer's renewal time; 'utc' aligns to the UTC calendar.
When set, only usage from events whose properties match counts toward this cap. Omit to count all usage of the feature.
List of usage alert configurations per feature.
The feature ID this alert applies to.
Whether this usage alert is enabled.
The threshold value that triggers the alert. For usage or remaining, this is an absolute count. For usage\_percentage or remaining\_percentage, this is a percentage (0-100).
Whether the threshold is an absolute count or a percentage of the usage allowance or remaining balance.
What 100% means. balance: every grant on the feature. included: the plan allowance only. recurring: grants that reset. usage\_limit: the cap of the usage limit with the same feature and filter.
Only valid with basis usage\_limit. Points the alert at the usage limit carrying the same filter.
Optional user-defined label to distinguish multiple alerts on the same feature.
List of overage allowed controls per feature. When enabled, usage can exceed balance.
The feature ID this overage allowed control applies to.
Whether overage is allowed for this feature.
Arbitrary key-value metadata defined by you for your own use. Shared across all versions of the plan.
Whether the trial on this plan is available to this customer. For example, if the customer used the trial in the past, this will be false.
The customer's current status with this plan. 'active' if attached, 'scheduled' if pending activation.
Whether the customer's active instance of this plan is set to cancel.
Whether the customer is currently on a free trial of this plan.
The action that would occur if this plan were attached to the customer.
Deprecated. Use variant\_details.base\_plan\_id instead. If this is a variant, the ID of the base plan it was created from.
Details about how this variant relates to its latest base plan.
The ID of the base plan this variant was derived from.
The customization that transforms the base plan into this variant.
Base price configuration for a plan.
Base price amount for the plan, in major currency units (e.g. dollars).
Billing interval (e.g. 'month', 'year').
Number of intervals per billing cycle. Defaults to 1.
Base price amounts in additional currencies. The base 'amount' is in the org's default currency.
Three-letter Stripe-supported currency code (e.g. 'eur', 'gbp').
Price amount in this currency. Set explicitly per currency, not converted from the base amount.
Items to add to the plan.
Bills this many feature units when outstanding overage reaches it.
The ID of the feature to configure.
Number of free units included. Balance resets to this each interval for consumable features.
If true, customer has unlimited access to this feature.
Whether entity-level grants contribute to a shared customer balance.
Reset configuration for consumable features. Omit for non-consumable features like seats.
Interval at which balance resets (e.g. 'month', 'year'). For consumable features only.
Number of intervals between resets. Defaults to 1.
Pricing for usage beyond included units. Omit for free features.
Price per billing\_units after included usage. Either 'amount' or 'tiers' is required.
Amounts in additional currencies for this flat price. The base 'amount' is in the org's default currency. Only valid with 'amount', not 'tiers'.
Three-letter Stripe-supported currency code (e.g. 'eur', 'gbp').
Price amount in this currency. Set explicitly per currency, not converted from the base amount.
Tiered pricing. Either 'amount' or 'tiers' is required.
Three-letter Stripe-supported currency code (e.g. 'eur', 'gbp').
Per-unit amount for this tier in this currency.
Flat amount for this tier in this currency, if the tier uses one.
Billing interval. For consumable features, should match reset.interval.
Number of intervals per billing cycle. Defaults to 1.
Units per price increment. Usage is rounded UP when billed (e.g. billing\_units=100 means 101 rounds to 200).
'prepaid' for upfront payment (seats), 'usage\_based' for pay-as-you-go.
Max units purchasable beyond included. E.g. included=100, max\_purchase=300 allows 400 total. Null for no limit.
Proration settings for prepaid features. Controls mid-cycle quantity change billing.
Billing behavior when quantity increases mid-cycle.
Credit behavior when quantity decreases mid-cycle.
Rollover config for unused units. If set, unused included units carry over.
Max rollover units. Omit for unlimited rollover.
Maximum rollover as a percentage (0-100) of included + prepaid grant. Mutually exclusive with max.
When rolled over units expire.
Number of periods before expiry.
Overrides fields of this item's feature for customers on this plan (e.g. a credit system's credit\_schema).
For credit system features: replaces the feature's credit\_schema entirely for customers on this plan.
ID of the metered feature that draws from this credit system.
Number of metered-feature units priced together. Defaults to one when omitted.
Named rates chosen by event properties. The most specific match sets the rate; with no match the item's own rate applies.
Event properties this entry applies to. Every key must equal the tracked property, compared as strings.
Breaks ties between dimensions that match the same number of keys. Higher wins.
Inclusive upper usage boundary for this graduated tier. The final tier must be 'inf'.
Credits consumed per billing-unit group within this tier.
Named adjustments chosen by event properties. Every match applies: factors multiply, then adds are summed.
Event properties this entry applies to. Every key must equal the tracked property, compared as strings.
Multiplies the matched rate. All matching multipliers stack.
Added to the rate after every factor is applied, in credits per billing-unit group.
Inclusive upper usage boundary for this graduated tier. The final tier must be 'inf'.
Credits consumed per billing-unit group within this tier.
Credits consumed per billing-unit group.
For AI credit system features: replaces the feature's markup chain entirely for customers on this plan. An unset level means no markup at that level rather than inheriting the feature's.
Default percentage markup for customers on this plan. Use -100 to make usage free.
Per-provider markup percentages for customers on this plan.
Per-model markup overrides for customers on this plan.
Filters selecting items to remove from the plan.
Match items linked to this feature.
Match items with this billing method (prepaid or usage\_based).
Match items with this interval. Accepts either a BillingInterval (price-side) or a ResetInterval (reset-side, includes day/hour/minute) so price-less items keyed by reset.interval can be disambiguated.
Match items with this interval\_count. Disambiguates between items that share an interval but differ in count.
Match items whose grant equals this included usage. Omitted is a wildcard.
Free trial configuration for a plan.
Number of duration\_type periods the trial lasts.
Unit of time for the trial ('day', 'month', 'year').
If true, a payment method is required to start the trial and the customer is charged when it ends. Defaults to false.
Behavior when the trial ends. 'bill' charges the customer (default). 'revert' expires the trial and restores the customer's previous plan.
Override the plan's billing controls (auto top-ups, spend limits, usage limits, usage alerts, overage allowed) for this customer.
List of auto top-up configurations per feature.
The ID of the feature (credit balance) to auto top-up.
Whether auto top-up is enabled.
When the balance drops below this threshold, an auto top-up will be purchased.
Amount of credits to add per auto top-up.
Optional rate limit to cap how often auto top-ups occur. Pass count to set the current window's consumed top-ups.
The time interval for the purchase limit window.
Number of intervals in the purchase limit window.
Maximum number of auto top-ups allowed within the interval.
Set the current window's consumed auto top-up count. Omit to leave runtime state unchanged.
When true, auto top-up creates a send\_invoice invoice instead of auto-charging.
List of overage spend limits per feature (caps overage spend).
Optional feature ID this spend limit applies to.
Whether the overage spend limit is enabled.
How overage\_limit is interpreted: an absolute overage cap (default) or a percentage of the main-plan allowance.
Overage cap for the feature: absolute units, or a percent (e.g. 120) when limit\_type is usage\_percentage.
When true, overage for this feature is not posted to Stripe. Usage tracking and balance resets still behave normally.
List of hard usage caps per feature (max units per interval).
The feature this usage limit applies to.
Whether this usage limit is enabled.
Maximum units allowed per interval.
Interval for the cap, aligned to the customer's billing cycle.
Window alignment. 'billing\_cycle' phases the interval to the customer's renewal time; 'utc' aligns to the UTC calendar.
When set, only usage from events whose properties match counts toward this cap. Omit to count all usage of the feature.
List of usage alert configurations per feature.
The feature ID this alert applies to.
Whether this usage alert is enabled.
The threshold value that triggers the alert. For usage or remaining, this is an absolute count. For usage\_percentage or remaining\_percentage, this is a percentage (0-100).
Whether the threshold is an absolute count or a percentage of the usage allowance or remaining balance.
What 100% means. balance: every grant on the feature. included: the plan allowance only. recurring: grants that reset. usage\_limit: the cap of the usage limit with the same feature and filter.
Only valid with basis usage\_limit. Points the alert at the usage limit carrying the same filter.
Optional user-defined label to distinguish multiple alerts on the same feature.
List of overage allowed controls per feature. When enabled, usage can exceed balance.
The feature ID this overage allowed control applies to.
Whether overage is allowed for this feature.
License links to add or override for this customer, keyed by license\_plan\_id. Omitted fields inherit the plan catalog link (included defaults to 1 when the license is not in the catalog). A bare entry restores the license to pure catalog inheritance.
Base price configuration for a plan.
Base price amount for the plan, in major currency units (e.g. dollars).
Billing interval (e.g. 'month', 'year').
Number of intervals per billing cycle. Defaults to 1.
Base price amounts in additional currencies. The base 'amount' is in the org's default currency.
Three-letter Stripe-supported currency code (e.g. 'eur', 'gbp').
Price amount in this currency. Set explicitly per currency, not converted from the base amount.
Bills this many feature units when outstanding overage reaches it.
The ID of the feature to configure.
Number of free units included. Balance resets to this each interval for consumable features.
If true, customer has unlimited access to this feature.
Whether entity-level grants contribute to a shared customer balance.
Reset configuration for consumable features. Omit for non-consumable features like seats.
Interval at which balance resets (e.g. 'month', 'year'). For consumable features only.
Number of intervals between resets. Defaults to 1.
Pricing for usage beyond included units. Omit for free features.
Price per billing\_units after included usage. Either 'amount' or 'tiers' is required.
Amounts in additional currencies for this flat price. The base 'amount' is in the org's default currency. Only valid with 'amount', not 'tiers'.
Three-letter Stripe-supported currency code (e.g. 'eur', 'gbp').
Price amount in this currency. Set explicitly per currency, not converted from the base amount.
Tiered pricing. Either 'amount' or 'tiers' is required.
Three-letter Stripe-supported currency code (e.g. 'eur', 'gbp').
Per-unit amount for this tier in this currency.
Flat amount for this tier in this currency, if the tier uses one.
Billing interval. For consumable features, should match reset.interval.
Number of intervals per billing cycle. Defaults to 1.
Units per price increment. Usage is rounded UP when billed (e.g. billing\_units=100 means 101 rounds to 200).
'prepaid' for upfront payment (seats), 'usage\_based' for pay-as-you-go.
Max units purchasable beyond included. E.g. included=100, max\_purchase=300 allows 400 total. Null for no limit.
Proration settings for prepaid features. Controls mid-cycle quantity change billing.
Billing behavior when quantity increases mid-cycle.
Credit behavior when quantity decreases mid-cycle.
Rollover config for unused units. If set, unused included units carry over.
Max rollover units. Omit for unlimited rollover.
Maximum rollover as a percentage (0-100) of included + prepaid grant. Mutually exclusive with max.
When rolled over units expire.
Number of periods before expiry.
Overrides fields of this item's feature for customers on this plan (e.g. a credit system's credit\_schema).
For credit system features: replaces the feature's credit\_schema entirely for customers on this plan.
ID of the metered feature that draws from this credit system.
Number of metered-feature units priced together. Defaults to one when omitted.
Named rates chosen by event properties. The most specific match sets the rate; with no match the item's own rate applies.
Event properties this entry applies to. Every key must equal the tracked property, compared as strings.
Breaks ties between dimensions that match the same number of keys. Higher wins.
Inclusive upper usage boundary for this graduated tier. The final tier must be 'inf'.
Credits consumed per billing-unit group within this tier.
Named adjustments chosen by event properties. Every match applies: factors multiply, then adds are summed.
Event properties this entry applies to. Every key must equal the tracked property, compared as strings.
Multiplies the matched rate. All matching multipliers stack.
Added to the rate after every factor is applied, in credits per billing-unit group.
Inclusive upper usage boundary for this graduated tier. The final tier must be 'inf'.
Credits consumed per billing-unit group within this tier.
Credits consumed per billing-unit group.
For AI credit system features: replaces the feature's markup chain entirely for customers on this plan. An unset level means no markup at that level rather than inheriting the feature's.
Default percentage markup for customers on this plan. Use -100 to make usage free.
Per-provider markup percentages for customers on this plan.
Per-model markup overrides for customers on this plan.
Match items linked to this feature.
Match items with this billing method (prepaid or usage\_based).
Match items with this interval. Accepts either a BillingInterval (price-side) or a ResetInterval (reset-side, includes day/hour/minute) so price-less items keyed by reset.interval can be disambiguated.
Match items with this interval\_count. Disambiguates between items that share an interval but differ in count.
Match items whose grant equals this included usage. Omitted is a wildcard.
License links to drop, keyed by license\_plan\_id. Parallel to remove\_items.
The unique identifier of the subscribed plan.
Whether the plan was automatically enabled for the customer.
Whether this is an add-on plan rather than a base subscription.
Current status of the subscription.
Whether the subscription has overdue payments.
Timestamp when the subscription was canceled, or null if not canceled.
Timestamp when the subscription will expire, or null if no expiry set.
Timestamp when the trial period ends, or null if not on trial.
Timestamp when the subscription started.
Start timestamp of the current billing period.
End timestamp of the current billing period.
Number of units of this subscription (for per-seat plans).
Whether this subscription is attached at the customer level or entity level.
One-time purchases made by the customer.
The full plan object if expanded.
Unique identifier for the plan.
Display name of the plan.
Optional description of the plan.
Group identifier for organizing related plans. Plans in the same group are mutually exclusive.
Version number of the plan. Incremented when plan configuration changes.
User-facing version identity. Defaults to v\{n} when the version is minted.
Whether this is the active version of the plan. At most one version is active.
Whether this is an add-on plan that can be attached alongside a main plan.
If true, this plan is automatically attached when a customer is created. Used for free plans.
Base recurring price for the plan. Null for free plans or usage-only plans.
Base price amount for the plan, in major currency units (e.g. dollars).
Base price amounts in additional currencies. The base 'amount' is in the org's default currency.
Three-letter Stripe-supported currency code (e.g. 'eur', 'gbp').
Price amount in this currency. Set explicitly per currency, not converted from the base amount.
Billing interval (e.g. 'month', 'year').
Number of intervals per billing cycle. Defaults to 1.
Display text for showing this price in pricing pages.
Main display text (e.g. '\$10' or '100 messages').
Secondary display text (e.g. 'per month' or 'then \$0.5 per 100').
Payment processors this base price is connected to. Omitted when unset.
Stripe price ID. For prepaid with included > 0 this is the V2 price.
Feature configurations included in this plan. Each item defines included units, pricing, and reset behavior for a feature.
Bills this many feature units when outstanding overage reaches it.
The ID of the feature this item configures.
The full feature object if expanded.
The ID of the feature, used to refer to it in other API calls like /track or /check.
The name of the feature.
The type of the feature
Singular and plural display names for the feature.
The singular display name for the feature.
The plural display name for the feature.
Credit cost schema for credit system features.
The ID of the metered feature (should be a single\_use feature).
The credit cost of the metered feature.
Whether or not the feature is archived.
Number of free units included. For consumable features, balance resets to this number each interval.
Whether the customer has unlimited access to this feature.
Whether entity-level grants contribute to a shared customer balance.
Reset configuration for consumable features. Null for non-consumable features like seats where usage persists across billing cycles.
The interval at which the feature balance resets (e.g. 'month', 'year'). For consumable features, usage resets to 0 and included units are restored.
Number of intervals between resets. Defaults to 1.
Pricing configuration for usage beyond included units. Null if feature is entirely free.
Price per billing\_units after included usage is consumed. Mutually exclusive with tiers.
Amounts in additional currencies for this flat price. The base 'amount' is in the org's default currency. Only valid with 'amount', not 'tiers' (tiered prices carry per-currency amounts on each tier).
Three-letter Stripe-supported currency code (e.g. 'eur', 'gbp').
Price amount in this currency. Set explicitly per currency, not converted from the base amount.
Tiered pricing configuration. Each tier's 'to' INCLUDES the included amount. Either 'tiers' or 'amount' is required.
Three-letter Stripe-supported currency code (e.g. 'eur', 'gbp').
Per-unit amount for this tier in this currency.
Flat amount for this tier in this currency, if the tier uses one.
Billing interval for this price. For consumable features, should match reset.interval.
Number of intervals per billing cycle. Defaults to 1.
Number of units per price increment. Usage is rounded UP to the nearest billing\_units when billed (e.g. billing\_units=100 means 101 usage rounds to 200).
'prepaid' for features like seats where customers pay upfront, 'usage\_based' for pay-as-you-go after included usage.
Maximum units a customer can purchase beyond included. E.g. if included=100 and max\_purchase=300, customer can use up to 400 total before usage is capped. Null for no limit.
Payment processors this item price is connected to. Omitted when unset.
Stripe price ID. For prepaid with included > 0 this is the V2 price.
Display text for showing this item in pricing pages.
Main display text (e.g. '\$10' or '100 messages').
Secondary display text (e.g. 'per month' or 'then \$0.5 per 100').
Rollover configuration for unused units. If set, unused included units roll over to the next period.
Maximum rollover units. Null for unlimited rollover.
Maximum rollover as a percentage (0-100) of included + prepaid grant. Mutually exclusive with max.
When rolled over units expire.
Number of periods before expiry.
Overrides fields of this item's feature for customers on this plan (e.g. a credit system's credit\_schema).
For credit system features: replaces the feature's credit\_schema entirely for customers on this plan.
ID of the metered feature that draws from this credit system.
Number of metered-feature units priced together. Defaults to one when omitted.
Named rates chosen by event properties. The most specific match sets the rate; with no match the item's own rate applies.
Event properties this entry applies to. Every key must equal the tracked property, compared as strings.
Breaks ties between dimensions that match the same number of keys. Higher wins.
Inclusive upper usage boundary for this graduated tier. The final tier must be 'inf'.
Credits consumed per billing-unit group within this tier.
Named adjustments chosen by event properties. Every match applies: factors multiply, then adds are summed.
Event properties this entry applies to. Every key must equal the tracked property, compared as strings.
Multiplies the matched rate. All matching multipliers stack.
Added to the rate after every factor is applied, in credits per billing-unit group.
Inclusive upper usage boundary for this graduated tier. The final tier must be 'inf'.
Credits consumed per billing-unit group within this tier.
Credits consumed per billing-unit group.
For AI credit system features: replaces the feature's markup chain entirely for customers on this plan. An unset level means no markup at that level rather than inheriting the feature's.
Default percentage markup for customers on this plan. Use -100 to make usage free.
Per-provider markup percentages for customers on this plan.
Per-model markup overrides for customers on this plan.
Payment processors this plan is connected to. Omitted when unset.
Stripe product ID this plan is billed under.
Extra Stripe product IDs aliased to this plan.
Every RevenueCat product that maps to this plan. Replaces the current set.
RevenueCat product ID that grants this plan when purchased.
Prepaid quantities granted when this specific RevenueCat product is purchased, in feature units.
Free trial configuration. If set, new customers can try this plan before being charged.
Number of duration\_type periods the trial lasts.
Unit of time for the trial duration ('day', 'month', 'year').
Whether a payment method is required to start the trial. If true, customer will be charged after trial ends.
Behavior when the trial ends. 'bill' charges the customer (default). 'revert' expires the trial and restores the customer's previous plan.
Unix timestamp (ms) when the plan was created.
Environment this plan belongs to ('sandbox' or 'live').
Whether the plan is archived. Archived plans cannot be attached to new customers.
Miscellaneous plan-level configuration flags.
If true, entitlements attached to this plan will still reset on schedule even when the customer's product is in a past\_due state.
Plan-level billing controls used as customer defaults.
List of auto top-up configurations per feature.
The ID of the feature (credit balance) to auto top-up.
Whether auto top-up is enabled.
When the balance drops below this threshold, an auto top-up will be purchased.
Amount of credits to add per auto top-up.
Optional rate limit to cap how often auto top-ups occur.
The time interval for the purchase limit window.
Number of intervals in the purchase limit window.
Maximum number of auto top-ups allowed within the interval.
When true, auto top-up creates a send\_invoice invoice instead of auto-charging.
List of overage spend limits per feature (caps overage spend).
Optional feature ID this spend limit applies to.
Whether the overage spend limit is enabled.
How overage\_limit is interpreted: an absolute overage cap (default) or a percentage of the main-plan allowance.
Overage cap for the feature: absolute units, or a percent (e.g. 120) when limit\_type is usage\_percentage.
When true, overage for this feature is not posted to Stripe. Usage tracking and balance resets still behave normally.
List of hard usage caps per feature (max units per interval).
The feature this usage limit applies to.
Whether this usage limit is enabled.
Maximum units allowed per interval.
Interval for the cap, aligned to the customer's billing cycle.
Window alignment. 'billing\_cycle' phases the interval to the customer's renewal time; 'utc' aligns to the UTC calendar.
When set, only usage from events whose properties match counts toward this cap. Omit to count all usage of the feature.
List of usage alert configurations per feature.
The feature ID this alert applies to.
Whether this usage alert is enabled.
The threshold value that triggers the alert. For usage or remaining, this is an absolute count. For usage\_percentage or remaining\_percentage, this is a percentage (0-100).
Whether the threshold is an absolute count or a percentage of the usage allowance or remaining balance.
What 100% means. balance: every grant on the feature. included: the plan allowance only. recurring: grants that reset. usage\_limit: the cap of the usage limit with the same feature and filter.
Only valid with basis usage\_limit. Points the alert at the usage limit carrying the same filter.
Optional user-defined label to distinguish multiple alerts on the same feature.
List of overage allowed controls per feature. When enabled, usage can exceed balance.
The feature ID this overage allowed control applies to.
Whether overage is allowed for this feature.
Arbitrary key-value metadata defined by you for your own use. Shared across all versions of the plan.
Whether the trial on this plan is available to this customer. For example, if the customer used the trial in the past, this will be false.
The customer's current status with this plan. 'active' if attached, 'scheduled' if pending activation.
Whether the customer's active instance of this plan is set to cancel.
Whether the customer is currently on a free trial of this plan.
The action that would occur if this plan were attached to the customer.
Deprecated. Use variant\_details.base\_plan\_id instead. If this is a variant, the ID of the base plan it was created from.
Details about how this variant relates to its latest base plan.
The ID of the base plan this variant was derived from.
The customization that transforms the base plan into this variant.
Base price configuration for a plan.
Base price amount for the plan, in major currency units (e.g. dollars).
Billing interval (e.g. 'month', 'year').
Number of intervals per billing cycle. Defaults to 1.
Base price amounts in additional currencies. The base 'amount' is in the org's default currency.
Three-letter Stripe-supported currency code (e.g. 'eur', 'gbp').
Price amount in this currency. Set explicitly per currency, not converted from the base amount.
Items to add to the plan.
Bills this many feature units when outstanding overage reaches it.
The ID of the feature to configure.
Number of free units included. Balance resets to this each interval for consumable features.
If true, customer has unlimited access to this feature.
Whether entity-level grants contribute to a shared customer balance.
Reset configuration for consumable features. Omit for non-consumable features like seats.
Interval at which balance resets (e.g. 'month', 'year'). For consumable features only.
Number of intervals between resets. Defaults to 1.
Pricing for usage beyond included units. Omit for free features.
Price per billing\_units after included usage. Either 'amount' or 'tiers' is required.
Amounts in additional currencies for this flat price. The base 'amount' is in the org's default currency. Only valid with 'amount', not 'tiers'.
Three-letter Stripe-supported currency code (e.g. 'eur', 'gbp').
Price amount in this currency. Set explicitly per currency, not converted from the base amount.
Tiered pricing. Either 'amount' or 'tiers' is required.
Three-letter Stripe-supported currency code (e.g. 'eur', 'gbp').
Per-unit amount for this tier in this currency.
Flat amount for this tier in this currency, if the tier uses one.
Billing interval. For consumable features, should match reset.interval.
Number of intervals per billing cycle. Defaults to 1.
Units per price increment. Usage is rounded UP when billed (e.g. billing\_units=100 means 101 rounds to 200).
'prepaid' for upfront payment (seats), 'usage\_based' for pay-as-you-go.
Max units purchasable beyond included. E.g. included=100, max\_purchase=300 allows 400 total. Null for no limit.
Proration settings for prepaid features. Controls mid-cycle quantity change billing.
Billing behavior when quantity increases mid-cycle.
Credit behavior when quantity decreases mid-cycle.
Rollover config for unused units. If set, unused included units carry over.
Max rollover units. Omit for unlimited rollover.
Maximum rollover as a percentage (0-100) of included + prepaid grant. Mutually exclusive with max.
When rolled over units expire.
Number of periods before expiry.
Overrides fields of this item's feature for customers on this plan (e.g. a credit system's credit\_schema).
For credit system features: replaces the feature's credit\_schema entirely for customers on this plan.
ID of the metered feature that draws from this credit system.
Number of metered-feature units priced together. Defaults to one when omitted.
Named rates chosen by event properties. The most specific match sets the rate; with no match the item's own rate applies.
Event properties this entry applies to. Every key must equal the tracked property, compared as strings.
Breaks ties between dimensions that match the same number of keys. Higher wins.
Inclusive upper usage boundary for this graduated tier. The final tier must be 'inf'.
Credits consumed per billing-unit group within this tier.
Named adjustments chosen by event properties. Every match applies: factors multiply, then adds are summed.
Event properties this entry applies to. Every key must equal the tracked property, compared as strings.
Multiplies the matched rate. All matching multipliers stack.
Added to the rate after every factor is applied, in credits per billing-unit group.
Inclusive upper usage boundary for this graduated tier. The final tier must be 'inf'.
Credits consumed per billing-unit group within this tier.
Credits consumed per billing-unit group.
For AI credit system features: replaces the feature's markup chain entirely for customers on this plan. An unset level means no markup at that level rather than inheriting the feature's.
Default percentage markup for customers on this plan. Use -100 to make usage free.
Per-provider markup percentages for customers on this plan.
Per-model markup overrides for customers on this plan.
Filters selecting items to remove from the plan.
Match items linked to this feature.
Match items with this billing method (prepaid or usage\_based).
Match items with this interval. Accepts either a BillingInterval (price-side) or a ResetInterval (reset-side, includes day/hour/minute) so price-less items keyed by reset.interval can be disambiguated.
Match items with this interval\_count. Disambiguates between items that share an interval but differ in count.
Match items whose grant equals this included usage. Omitted is a wildcard.
Free trial configuration for a plan.
Number of duration\_type periods the trial lasts.
Unit of time for the trial ('day', 'month', 'year').
If true, a payment method is required to start the trial and the customer is charged when it ends. Defaults to false.
Behavior when the trial ends. 'bill' charges the customer (default). 'revert' expires the trial and restores the customer's previous plan.
Override the plan's billing controls (auto top-ups, spend limits, usage limits, usage alerts, overage allowed) for this customer.
List of auto top-up configurations per feature.
The ID of the feature (credit balance) to auto top-up.
Whether auto top-up is enabled.
When the balance drops below this threshold, an auto top-up will be purchased.
Amount of credits to add per auto top-up.
Optional rate limit to cap how often auto top-ups occur. Pass count to set the current window's consumed top-ups.
The time interval for the purchase limit window.
Number of intervals in the purchase limit window.
Maximum number of auto top-ups allowed within the interval.
Set the current window's consumed auto top-up count. Omit to leave runtime state unchanged.
When true, auto top-up creates a send\_invoice invoice instead of auto-charging.
List of overage spend limits per feature (caps overage spend).
Optional feature ID this spend limit applies to.
Whether the overage spend limit is enabled.
How overage\_limit is interpreted: an absolute overage cap (default) or a percentage of the main-plan allowance.
Overage cap for the feature: absolute units, or a percent (e.g. 120) when limit\_type is usage\_percentage.
When true, overage for this feature is not posted to Stripe. Usage tracking and balance resets still behave normally.
List of hard usage caps per feature (max units per interval).
The feature this usage limit applies to.
Whether this usage limit is enabled.
Maximum units allowed per interval.
Interval for the cap, aligned to the customer's billing cycle.
Window alignment. 'billing\_cycle' phases the interval to the customer's renewal time; 'utc' aligns to the UTC calendar.
When set, only usage from events whose properties match counts toward this cap. Omit to count all usage of the feature.
List of usage alert configurations per feature.
The feature ID this alert applies to.
Whether this usage alert is enabled.
The threshold value that triggers the alert. For usage or remaining, this is an absolute count. For usage\_percentage or remaining\_percentage, this is a percentage (0-100).
Whether the threshold is an absolute count or a percentage of the usage allowance or remaining balance.
What 100% means. balance: every grant on the feature. included: the plan allowance only. recurring: grants that reset. usage\_limit: the cap of the usage limit with the same feature and filter.
Only valid with basis usage\_limit. Points the alert at the usage limit carrying the same filter.
Optional user-defined label to distinguish multiple alerts on the same feature.
List of overage allowed controls per feature. When enabled, usage can exceed balance.
The feature ID this overage allowed control applies to.
Whether overage is allowed for this feature.
License links to add or override for this customer, keyed by license\_plan\_id. Omitted fields inherit the plan catalog link (included defaults to 1 when the license is not in the catalog). A bare entry restores the license to pure catalog inheritance.
Base price configuration for a plan.
Base price amount for the plan, in major currency units (e.g. dollars).
Billing interval (e.g. 'month', 'year').
Number of intervals per billing cycle. Defaults to 1.
Base price amounts in additional currencies. The base 'amount' is in the org's default currency.
Three-letter Stripe-supported currency code (e.g. 'eur', 'gbp').
Price amount in this currency. Set explicitly per currency, not converted from the base amount.
Bills this many feature units when outstanding overage reaches it.
The ID of the feature to configure.
Number of free units included. Balance resets to this each interval for consumable features.
If true, customer has unlimited access to this feature.
Whether entity-level grants contribute to a shared customer balance.
Reset configuration for consumable features. Omit for non-consumable features like seats.
Interval at which balance resets (e.g. 'month', 'year'). For consumable features only.
Number of intervals between resets. Defaults to 1.
Pricing for usage beyond included units. Omit for free features.
Price per billing\_units after included usage. Either 'amount' or 'tiers' is required.
Amounts in additional currencies for this flat price. The base 'amount' is in the org's default currency. Only valid with 'amount', not 'tiers'.
Three-letter Stripe-supported currency code (e.g. 'eur', 'gbp').
Price amount in this currency. Set explicitly per currency, not converted from the base amount.
Tiered pricing. Either 'amount' or 'tiers' is required.
Three-letter Stripe-supported currency code (e.g. 'eur', 'gbp').
Per-unit amount for this tier in this currency.
Flat amount for this tier in this currency, if the tier uses one.
Billing interval. For consumable features, should match reset.interval.
Number of intervals per billing cycle. Defaults to 1.
Units per price increment. Usage is rounded UP when billed (e.g. billing\_units=100 means 101 rounds to 200).
'prepaid' for upfront payment (seats), 'usage\_based' for pay-as-you-go.
Max units purchasable beyond included. E.g. included=100, max\_purchase=300 allows 400 total. Null for no limit.
Proration settings for prepaid features. Controls mid-cycle quantity change billing.
Billing behavior when quantity increases mid-cycle.
Credit behavior when quantity decreases mid-cycle.
Rollover config for unused units. If set, unused included units carry over.
Max rollover units. Omit for unlimited rollover.
Maximum rollover as a percentage (0-100) of included + prepaid grant. Mutually exclusive with max.
When rolled over units expire.
Number of periods before expiry.
Overrides fields of this item's feature for customers on this plan (e.g. a credit system's credit\_schema).
For credit system features: replaces the feature's credit\_schema entirely for customers on this plan.
ID of the metered feature that draws from this credit system.
Number of metered-feature units priced together. Defaults to one when omitted.
Named rates chosen by event properties. The most specific match sets the rate; with no match the item's own rate applies.
Event properties this entry applies to. Every key must equal the tracked property, compared as strings.
Breaks ties between dimensions that match the same number of keys. Higher wins.
Inclusive upper usage boundary for this graduated tier. The final tier must be 'inf'.
Credits consumed per billing-unit group within this tier.
Named adjustments chosen by event properties. Every match applies: factors multiply, then adds are summed.
Event properties this entry applies to. Every key must equal the tracked property, compared as strings.
Multiplies the matched rate. All matching multipliers stack.
Added to the rate after every factor is applied, in credits per billing-unit group.
Inclusive upper usage boundary for this graduated tier. The final tier must be 'inf'.
Credits consumed per billing-unit group within this tier.
Credits consumed per billing-unit group.
For AI credit system features: replaces the feature's markup chain entirely for customers on this plan. An unset level means no markup at that level rather than inheriting the feature's.
Default percentage markup for customers on this plan. Use -100 to make usage free.
Per-provider markup percentages for customers on this plan.
Per-model markup overrides for customers on this plan.
Match items linked to this feature.
Match items with this billing method (prepaid or usage\_based).
Match items with this interval. Accepts either a BillingInterval (price-side) or a ResetInterval (reset-side, includes day/hour/minute) so price-less items keyed by reset.interval can be disambiguated.
Match items with this interval\_count. Disambiguates between items that share an interval but differ in count.
Match items whose grant equals this included usage. Omitted is a wildcard.
License links to drop, keyed by license\_plan\_id. Parallel to remove\_items.
The unique identifier of the purchased plan.
Timestamp when the purchase expires, or null for lifetime access.
Timestamp when the purchase was made.
Number of units purchased.
Whether this purchase is attached at the customer level or entity level.
License seat pools granted by the customer's plans, with seat counts.
The plan offered as an assignable license.
The plan that offers this license.
Display name of the license plan.
Total seats the customer has for this license, included plus paid.
Seats currently assigned to entities.
Seats still available to assign.
Paid seats purchased on top of the plan's included amount.
Feature balances keyed by feature ID, showing usage limits and remaining amounts.
The feature ID this balance is for.
The full feature object if expanded.
The unique identifier for this feature, used in /check and /track calls.
Human-readable name displayed in the dashboard and billing UI.
Feature type: 'boolean' for on/off access, 'metered' for usage-tracked features, 'credit\_system' for unified credit pools, 'ai\_credit\_system' for model-based token pricing.
For metered features: true if usage resets periodically (API calls, credits), false if allocated persistently (seats, storage).
Event names that trigger this feature's balance. Allows multiple features to respond to a single event.
For classic credit systems: maps metered features to flat or graduated credit costs.
ID of the metered feature that draws from this credit system.
Number of metered-feature units priced together. Defaults to one when omitted.
Named rates chosen by event properties. The most specific match sets the rate; with no match the item's own rate applies.
Event properties this entry applies to. Every key must equal the tracked property, compared as strings.
Breaks ties between dimensions that match the same number of keys. Higher wins.
Inclusive upper usage boundary for this graduated tier. The final tier must be 'inf'.
Credits consumed per billing-unit group within this tier.
Named adjustments chosen by event properties. Every match applies: factors multiply, then adds are summed.
Event properties this entry applies to. Every key must equal the tracked property, compared as strings.
Multiplies the matched rate. All matching multipliers stack.
Added to the rate after every factor is applied, in credits per billing-unit group.
Inclusive upper usage boundary for this graduated tier. The final tier must be 'inf'.
Credits consumed per billing-unit group within this tier.
Credits consumed per billing-unit group.
Whether usage of this classic credit system should be itemized as invoice credits.
Per-model markup overrides for AI credit systems.
Default percentage markup for AI credit systems. Use -100 to make usage free.
Per-provider default markup percentages for AI credit systems.
Display names for the feature in billing UI and customer-facing components.
Singular form for UI display (e.g., 'API call', 'seat').
Plural form for UI display (e.g., 'API calls', 'seats').
Whether the feature is archived and hidden from the dashboard.
Processor mappings for this feature. Present when a Stripe product or meter is set.
Stripe product ID this feature's usage prices bill under.
Stripe meter ID used to create this feature's metered price.
Total balance granted (included + prepaid).
Remaining balance available for use.
Total usage consumed in the current period.
Whether this feature has unlimited usage.
Whether usage beyond the granted balance is allowed (with overage charges).
Maximum quantity that can be purchased as a top-up, or null for unlimited.
Timestamp when the balance will reset, or null for no reset.
Detailed breakdown of balance sources when stacking multiple plans or grants.
The unique identifier for this balance breakdown.
The plan ID this balance originates from, or null for standalone balances.
Amount granted from the plan's included usage.
Amount granted from prepaid purchases or top-ups.
Remaining balance available for use.
Amount consumed in the current period.
Whether this balance has unlimited usage.
Reset configuration for this balance, or null if no reset.
The reset interval (hour, day, week, month, etc.) or 'multiple' if combined from different intervals.
Number of intervals between resets (eg. 2 for bi-monthly).
Timestamp when the balance will next reset.
Pricing configuration if this balance has usage-based pricing.
The per-unit price amount.
Tiered pricing configuration if applicable.
How tiers are applied: graduated (split across bands) or volume (flat rate for the matched tier).
The number of units per billing increment (eg. \$9 / 250 units).
Whether usage is prepaid or billed pay-per-use.
Maximum quantity that can be purchased, or null for unlimited.
Timestamp when this balance expires, or null for no expiration.
Rollover balances carried over from previous periods.
Amount originally rolled over from a previous period, before any of it was consumed.
Amount of balance rolled over from a previous period.
Timestamp when the rollover balance expires.
Boolean feature flags keyed by feature ID, showing enabled access for on/off features.
The unique identifier for this flag.
The plan ID this flag originates from, or null for standalone flags.
Timestamp when this flag expires, or null for no expiration.
The feature ID this flag is for.
The full feature object if expanded.
The unique identifier for this feature, used in /check and /track calls.
Human-readable name displayed in the dashboard and billing UI.
Feature type: 'boolean' for on/off access, 'metered' for usage-tracked features, 'credit\_system' for unified credit pools, 'ai\_credit\_system' for model-based token pricing.
For metered features: true if usage resets periodically (API calls, credits), false if allocated persistently (seats, storage).
Event names that trigger this feature's balance. Allows multiple features to respond to a single event.
For classic credit systems: maps metered features to flat or graduated credit costs.
ID of the metered feature that draws from this credit system.
Number of metered-feature units priced together. Defaults to one when omitted.
Named rates chosen by event properties. The most specific match sets the rate; with no match the item's own rate applies.
Event properties this entry applies to. Every key must equal the tracked property, compared as strings.
Breaks ties between dimensions that match the same number of keys. Higher wins.
Inclusive upper usage boundary for this graduated tier. The final tier must be 'inf'.
Credits consumed per billing-unit group within this tier.
Named adjustments chosen by event properties. Every match applies: factors multiply, then adds are summed.
Event properties this entry applies to. Every key must equal the tracked property, compared as strings.
Multiplies the matched rate. All matching multipliers stack.
Added to the rate after every factor is applied, in credits per billing-unit group.
Inclusive upper usage boundary for this graduated tier. The final tier must be 'inf'.
Credits consumed per billing-unit group within this tier.
Credits consumed per billing-unit group.
Whether usage of this classic credit system should be itemized as invoice credits.
Per-model markup overrides for AI credit systems.
Default percentage markup for AI credit systems. Use -100 to make usage free.
Per-provider default markup percentages for AI credit systems.
Display names for the feature in billing UI and customer-facing components.
Singular form for UI display (e.g., 'API call', 'seat').
Plural form for UI display (e.g., 'API calls', 'seats').
Whether the feature is archived and hidden from the dashboard.
Processor mappings for this feature. Present when a Stripe product or meter is set.
Stripe product ID this feature's usage prices bill under.
Stripe meter ID used to create this feature's metered price.
Configuration for the customer.
Whether to disable the shared customer-level pool for entities.
Stops Autumn from posting usage-overage line items to Stripe for this customer. Check/track and balance resets still behave normally. When set, this overrides the organization-level disable\_overage\_billing setting.
Payment processors this customer is connected to (Stripe, Vercel, RevenueCat). Omitted entirely when the customer has not been created in any processor.
Stripe processor connection for the customer.
Stripe customer ID.
Vercel processor connection for the customer (public-safe subset).
Vercel marketplace installation ID for this customer.
Vercel account ID associated with the installation.
RevenueCat processor connection for the customer.
Customer's external ID, used as the RevenueCat app user ID. Null if the customer has no external ID set.
```json 200 theme={null}
{
"id": "2ee25a41-0d81-4ad2-8451-ec1aadaefe58",
"name": "Patrick",
"email": "patrick@useautumn.com",
"createdAt": 1771409161016,
"fingerprint": null,
"stripeId": "cus_U0BKxpq1mFhuJO",
"processors": {
"stripe": {
"id": "cus_U0BKxpq1mFhuJO"
}
},
"env": "sandbox",
"metadata": {},
"sendEmailReceipts": false,
"billingControls": {
"autoTopups": []
},
"subscriptions": [
{
"planId": "pro_plan",
"autoEnable": true,
"addOn": false,
"status": "active",
"pastDue": false,
"canceledAt": null,
"expiresAt": null,
"trialEndsAt": null,
"startedAt": 1771431921437,
"currentPeriodStart": 1771431921437,
"currentPeriodEnd": 1771999921437,
"quantity": 1
}
],
"purchases": [],
"licenses": [],
"balances": {
"messages": {
"featureId": "messages",
"granted": 100,
"remaining": 0,
"usage": 100,
"unlimited": false,
"overageAllowed": false,
"maxPurchase": null,
"nextResetAt": 1773851121437,
"breakdown": [
{
"id": "cus_ent_39qmLooixXLAqMywgXywjAz96rV",
"planId": "pro_plan",
"includedGrant": 100,
"prepaidGrant": 0,
"remaining": 0,
"usage": 100,
"unlimited": false,
"reset": {
"interval": "month",
"resetsAt": 1773851121437
},
"price": null,
"expiresAt": null
}
]
}
},
"flags": {
"advanced_workflows": {
"id": "cus_ent_abc123",
"plan_id": "pro_plan",
"expires_at": null,
"feature_id": "advanced_workflows"
}
},
"config": {
"disable_pooled_balance": false,
"disable_overage_billing": false
}
}
```
# Create Entity
Source: https://docs.useautumn.com/api-reference/entities/createEntity
openapi POST /v1/entities.create
Creates an entity for a customer and feature, then returns the entity with balances and subscriptions.
Use entities when usage and access must be scoped to sub-resources (for example seats, projects, or workspaces) instead of only the customer.
### Body Parameters
The name of the entity
The ID of the feature this entity is associated with
Billing controls for the entity.
List of spend limits per feature. Each entry caps overage (overage\_limit) and/or per-interval usage (usage\_limit).
Optional feature ID this spend limit applies to.
Whether the overage spend limit is enabled.
How overage\_limit is interpreted: an absolute overage cap (default) or a percentage of the main-plan allowance.
Overage cap for the feature: absolute units, or a percent (e.g. 120) when limit\_type is usage\_percentage.
When true, overage for this feature is not posted to Stripe. Usage tracking and balance resets still behave normally.
List of hard usage caps per feature for this entity. An entity entry overrides the customer's for that feature.
The feature this usage limit applies to.
Whether this usage limit is enabled.
Maximum units allowed per interval.
Interval for the cap, aligned to the customer's billing cycle.
Window alignment. 'billing\_cycle' phases the interval to the customer's renewal time; 'utc' aligns to the UTC calendar.
When set, only usage from events whose properties match counts toward this cap. Omit to count all usage of the feature.
List of usage alert configurations per feature.
The feature ID this alert applies to.
Whether this usage alert is enabled.
The threshold value that triggers the alert. For usage or remaining, this is an absolute count. For usage\_percentage or remaining\_percentage, this is a percentage (0-100).
Whether the threshold is an absolute count or a percentage of the usage allowance or remaining balance.
What 100% means. balance: every grant on the feature. included: the plan allowance only. recurring: grants that reset. usage\_limit: the cap of the usage limit with the same feature and filter.
Only valid with basis usage\_limit. Points the alert at the usage limit carrying the same filter.
Optional user-defined label to distinguish multiple alerts on the same feature.
List of overage allowed controls per feature. When enabled, usage can exceed balance.
The feature ID this overage allowed control applies to.
Whether overage is allowed for this feature.
Customer attributes used to resolve the customer when customer\_id is not provided.
Customer's name
Customer's email address
Unique identifier (eg, serial number) to detect duplicate customers and prevent free trial abuse
Additional metadata for the customer
Stripe customer ID if you already have one
Whether to create the customer in Stripe
The ID of the free plan to auto-enable for the customer
Whether to send email receipts to this customer
Currency to bill this customer in (e.g. usd, eur). Defaults to the organization's default currency.
Billing controls for the customer (auto top-ups, etc.)
List of auto top-up configurations per feature.
The ID of the feature (credit balance) to auto top-up.
Whether auto top-up is enabled.
When the balance drops below this threshold, an auto top-up will be purchased.
Amount of credits to add per auto top-up.
Optional rate limit to cap how often auto top-ups occur. Pass count to set the current window's consumed top-ups.
The time interval for the purchase limit window.
Number of intervals in the purchase limit window.
Maximum number of auto top-ups allowed within the interval.
Set the current window's consumed auto top-up count. Omit to leave runtime state unchanged.
When true, auto top-up creates a send\_invoice invoice instead of auto-charging.
List of overage spend limits per feature (caps overage spend).
Optional feature ID this spend limit applies to.
Whether the overage spend limit is enabled.
How overage\_limit is interpreted: an absolute overage cap (default) or a percentage of the main-plan allowance.
Overage cap for the feature: absolute units, or a percent (e.g. 120) when limit\_type is usage\_percentage.
When true, overage for this feature is not posted to Stripe. Usage tracking and balance resets still behave normally.
List of hard usage caps per feature (max units per interval).
The feature this usage limit applies to.
Whether this usage limit is enabled.
Maximum units allowed per interval.
Interval for the cap, aligned to the customer's billing cycle.
Window alignment. 'billing\_cycle' phases the interval to the customer's renewal time; 'utc' aligns to the UTC calendar.
When set, only usage from events whose properties match counts toward this cap. Omit to count all usage of the feature.
List of usage alert configurations per feature.
The feature ID this alert applies to.
Whether this usage alert is enabled.
The threshold value that triggers the alert. For usage or remaining, this is an absolute count. For usage\_percentage or remaining\_percentage, this is a percentage (0-100).
Whether the threshold is an absolute count or a percentage of the usage allowance or remaining balance.
What 100% means. balance: every grant on the feature. included: the plan allowance only. recurring: grants that reset. usage\_limit: the cap of the usage limit with the same feature and filter.
Only valid with basis usage\_limit. Points the alert at the usage limit carrying the same filter.
Optional user-defined label to distinguish multiple alerts on the same feature.
List of overage allowed controls per feature. When enabled, usage can exceed balance.
The feature ID this overage allowed control applies to.
Whether overage is allowed for this feature.
Miscellaneous configurations for the customer.
Whether to disable the shared customer-level pool for entities.
Stops Autumn from posting usage-overage line items to Stripe for this customer. Check/track and balance resets still behave normally. When set, this overrides the organization-level disable\_overage\_billing setting.
The ID of the customer to create the entity for.
The ID of the entity.
### Response
The unique identifier of the entity
The name of the entity
The customer ID this entity belongs to
The feature ID this entity belongs to
Unix timestamp when the entity was created
The environment (sandbox/live)
The unique identifier of this subscription. If a subscription\_id was provided at attach time, it is used; otherwise, falls back to the internal ID.
The full plan object if expanded.
Unique identifier for the plan.
Display name of the plan.
Optional description of the plan.
Group identifier for organizing related plans. Plans in the same group are mutually exclusive.
Version number of the plan. Incremented when plan configuration changes.
User-facing version identity. Defaults to v\{n} when the version is minted.
Whether this is the active version of the plan. At most one version is active.
Whether this is an add-on plan that can be attached alongside a main plan.
If true, this plan is automatically attached when a customer is created. Used for free plans.
Base recurring price for the plan. Null for free plans or usage-only plans.
Base price amount for the plan, in major currency units (e.g. dollars).
Base price amounts in additional currencies. The base 'amount' is in the org's default currency.
Three-letter Stripe-supported currency code (e.g. 'eur', 'gbp').
Price amount in this currency. Set explicitly per currency, not converted from the base amount.
Billing interval (e.g. 'month', 'year').
Number of intervals per billing cycle. Defaults to 1.
Display text for showing this price in pricing pages.
Main display text (e.g. '\$10' or '100 messages').
Secondary display text (e.g. 'per month' or 'then \$0.5 per 100').
Payment processors this base price is connected to. Omitted when unset.
Stripe price ID. For prepaid with included > 0 this is the V2 price.
Feature configurations included in this plan. Each item defines included units, pricing, and reset behavior for a feature.
Bills this many feature units when outstanding overage reaches it.
The ID of the feature this item configures.
The full feature object if expanded.
The ID of the feature, used to refer to it in other API calls like /track or /check.
The name of the feature.
The type of the feature
Singular and plural display names for the feature.
The singular display name for the feature.
The plural display name for the feature.
Credit cost schema for credit system features.
The ID of the metered feature (should be a single\_use feature).
The credit cost of the metered feature.
Whether or not the feature is archived.
Number of free units included. For consumable features, balance resets to this number each interval.
Whether the customer has unlimited access to this feature.
Whether entity-level grants contribute to a shared customer balance.
Reset configuration for consumable features. Null for non-consumable features like seats where usage persists across billing cycles.
The interval at which the feature balance resets (e.g. 'month', 'year'). For consumable features, usage resets to 0 and included units are restored.
Number of intervals between resets. Defaults to 1.
Pricing configuration for usage beyond included units. Null if feature is entirely free.
Price per billing\_units after included usage is consumed. Mutually exclusive with tiers.
Amounts in additional currencies for this flat price. The base 'amount' is in the org's default currency. Only valid with 'amount', not 'tiers' (tiered prices carry per-currency amounts on each tier).
Three-letter Stripe-supported currency code (e.g. 'eur', 'gbp').
Price amount in this currency. Set explicitly per currency, not converted from the base amount.
Tiered pricing configuration. Each tier's 'to' INCLUDES the included amount. Either 'tiers' or 'amount' is required.
Three-letter Stripe-supported currency code (e.g. 'eur', 'gbp').
Per-unit amount for this tier in this currency.
Flat amount for this tier in this currency, if the tier uses one.
Billing interval for this price. For consumable features, should match reset.interval.
Number of intervals per billing cycle. Defaults to 1.
Number of units per price increment. Usage is rounded UP to the nearest billing\_units when billed (e.g. billing\_units=100 means 101 usage rounds to 200).
'prepaid' for features like seats where customers pay upfront, 'usage\_based' for pay-as-you-go after included usage.
Maximum units a customer can purchase beyond included. E.g. if included=100 and max\_purchase=300, customer can use up to 400 total before usage is capped. Null for no limit.
Payment processors this item price is connected to. Omitted when unset.
Stripe price ID. For prepaid with included > 0 this is the V2 price.
Display text for showing this item in pricing pages.
Main display text (e.g. '\$10' or '100 messages').
Secondary display text (e.g. 'per month' or 'then \$0.5 per 100').
Rollover configuration for unused units. If set, unused included units roll over to the next period.
Maximum rollover units. Null for unlimited rollover.
Maximum rollover as a percentage (0-100) of included + prepaid grant. Mutually exclusive with max.
When rolled over units expire.
Number of periods before expiry.
Overrides fields of this item's feature for customers on this plan (e.g. a credit system's credit\_schema).
For credit system features: replaces the feature's credit\_schema entirely for customers on this plan.
ID of the metered feature that draws from this credit system.
Number of metered-feature units priced together. Defaults to one when omitted.
Named rates chosen by event properties. The most specific match sets the rate; with no match the item's own rate applies.
Event properties this entry applies to. Every key must equal the tracked property, compared as strings.
Breaks ties between dimensions that match the same number of keys. Higher wins.
Inclusive upper usage boundary for this graduated tier. The final tier must be 'inf'.
Credits consumed per billing-unit group within this tier.
Named adjustments chosen by event properties. Every match applies: factors multiply, then adds are summed.
Event properties this entry applies to. Every key must equal the tracked property, compared as strings.
Multiplies the matched rate. All matching multipliers stack.
Added to the rate after every factor is applied, in credits per billing-unit group.
Inclusive upper usage boundary for this graduated tier. The final tier must be 'inf'.
Credits consumed per billing-unit group within this tier.
Credits consumed per billing-unit group.
For AI credit system features: replaces the feature's markup chain entirely for customers on this plan. An unset level means no markup at that level rather than inheriting the feature's.
Default percentage markup for customers on this plan. Use -100 to make usage free.
Per-provider markup percentages for customers on this plan.
Per-model markup overrides for customers on this plan.
Payment processors this plan is connected to. Omitted when unset.
Stripe product ID this plan is billed under.
Extra Stripe product IDs aliased to this plan.
Every RevenueCat product that maps to this plan. Replaces the current set.
RevenueCat product ID that grants this plan when purchased.
Prepaid quantities granted when this specific RevenueCat product is purchased, in feature units.
Free trial configuration. If set, new customers can try this plan before being charged.
Number of duration\_type periods the trial lasts.
Unit of time for the trial duration ('day', 'month', 'year').
Whether a payment method is required to start the trial. If true, customer will be charged after trial ends.
Behavior when the trial ends. 'bill' charges the customer (default). 'revert' expires the trial and restores the customer's previous plan.
Unix timestamp (ms) when the plan was created.
Environment this plan belongs to ('sandbox' or 'live').
Whether the plan is archived. Archived plans cannot be attached to new customers.
Miscellaneous plan-level configuration flags.
If true, entitlements attached to this plan will still reset on schedule even when the customer's product is in a past\_due state.
Plan-level billing controls used as customer defaults.
List of auto top-up configurations per feature.
The ID of the feature (credit balance) to auto top-up.
Whether auto top-up is enabled.
When the balance drops below this threshold, an auto top-up will be purchased.
Amount of credits to add per auto top-up.
Optional rate limit to cap how often auto top-ups occur.
The time interval for the purchase limit window.
Number of intervals in the purchase limit window.
Maximum number of auto top-ups allowed within the interval.
When true, auto top-up creates a send\_invoice invoice instead of auto-charging.
List of overage spend limits per feature (caps overage spend).
Optional feature ID this spend limit applies to.
Whether the overage spend limit is enabled.
How overage\_limit is interpreted: an absolute overage cap (default) or a percentage of the main-plan allowance.
Overage cap for the feature: absolute units, or a percent (e.g. 120) when limit\_type is usage\_percentage.
When true, overage for this feature is not posted to Stripe. Usage tracking and balance resets still behave normally.
List of hard usage caps per feature (max units per interval).
The feature this usage limit applies to.
Whether this usage limit is enabled.
Maximum units allowed per interval.
Interval for the cap, aligned to the customer's billing cycle.
Window alignment. 'billing\_cycle' phases the interval to the customer's renewal time; 'utc' aligns to the UTC calendar.
When set, only usage from events whose properties match counts toward this cap. Omit to count all usage of the feature.
List of usage alert configurations per feature.
The feature ID this alert applies to.
Whether this usage alert is enabled.
The threshold value that triggers the alert. For usage or remaining, this is an absolute count. For usage\_percentage or remaining\_percentage, this is a percentage (0-100).
Whether the threshold is an absolute count or a percentage of the usage allowance or remaining balance.
What 100% means. balance: every grant on the feature. included: the plan allowance only. recurring: grants that reset. usage\_limit: the cap of the usage limit with the same feature and filter.
Only valid with basis usage\_limit. Points the alert at the usage limit carrying the same filter.
Optional user-defined label to distinguish multiple alerts on the same feature.
List of overage allowed controls per feature. When enabled, usage can exceed balance.
The feature ID this overage allowed control applies to.
Whether overage is allowed for this feature.
Arbitrary key-value metadata defined by you for your own use. Shared across all versions of the plan.
Whether the trial on this plan is available to this customer. For example, if the customer used the trial in the past, this will be false.
The customer's current status with this plan. 'active' if attached, 'scheduled' if pending activation.
Whether the customer's active instance of this plan is set to cancel.
Whether the customer is currently on a free trial of this plan.
The action that would occur if this plan were attached to the customer.
Deprecated. Use variant\_details.base\_plan\_id instead. If this is a variant, the ID of the base plan it was created from.
Details about how this variant relates to its latest base plan.
The ID of the base plan this variant was derived from.
The customization that transforms the base plan into this variant.
Base price configuration for a plan.
Base price amount for the plan, in major currency units (e.g. dollars).
Billing interval (e.g. 'month', 'year').
Number of intervals per billing cycle. Defaults to 1.
Base price amounts in additional currencies. The base 'amount' is in the org's default currency.
Three-letter Stripe-supported currency code (e.g. 'eur', 'gbp').
Price amount in this currency. Set explicitly per currency, not converted from the base amount.
Items to add to the plan.
Bills this many feature units when outstanding overage reaches it.
The ID of the feature to configure.
Number of free units included. Balance resets to this each interval for consumable features.
If true, customer has unlimited access to this feature.
Whether entity-level grants contribute to a shared customer balance.
Reset configuration for consumable features. Omit for non-consumable features like seats.
Interval at which balance resets (e.g. 'month', 'year'). For consumable features only.
Number of intervals between resets. Defaults to 1.
Pricing for usage beyond included units. Omit for free features.
Price per billing\_units after included usage. Either 'amount' or 'tiers' is required.
Amounts in additional currencies for this flat price. The base 'amount' is in the org's default currency. Only valid with 'amount', not 'tiers'.
Three-letter Stripe-supported currency code (e.g. 'eur', 'gbp').
Price amount in this currency. Set explicitly per currency, not converted from the base amount.
Tiered pricing. Either 'amount' or 'tiers' is required.
Three-letter Stripe-supported currency code (e.g. 'eur', 'gbp').
Per-unit amount for this tier in this currency.
Flat amount for this tier in this currency, if the tier uses one.
Billing interval. For consumable features, should match reset.interval.
Number of intervals per billing cycle. Defaults to 1.
Units per price increment. Usage is rounded UP when billed (e.g. billing\_units=100 means 101 rounds to 200).
'prepaid' for upfront payment (seats), 'usage\_based' for pay-as-you-go.
Max units purchasable beyond included. E.g. included=100, max\_purchase=300 allows 400 total. Null for no limit.
Proration settings for prepaid features. Controls mid-cycle quantity change billing.
Billing behavior when quantity increases mid-cycle.
Credit behavior when quantity decreases mid-cycle.
Rollover config for unused units. If set, unused included units carry over.
Max rollover units. Omit for unlimited rollover.
Maximum rollover as a percentage (0-100) of included + prepaid grant. Mutually exclusive with max.
When rolled over units expire.
Number of periods before expiry.
Overrides fields of this item's feature for customers on this plan (e.g. a credit system's credit\_schema).
For credit system features: replaces the feature's credit\_schema entirely for customers on this plan.
ID of the metered feature that draws from this credit system.
Number of metered-feature units priced together. Defaults to one when omitted.
Named rates chosen by event properties. The most specific match sets the rate; with no match the item's own rate applies.
Event properties this entry applies to. Every key must equal the tracked property, compared as strings.
Breaks ties between dimensions that match the same number of keys. Higher wins.
Inclusive upper usage boundary for this graduated tier. The final tier must be 'inf'.
Credits consumed per billing-unit group within this tier.
Named adjustments chosen by event properties. Every match applies: factors multiply, then adds are summed.
Event properties this entry applies to. Every key must equal the tracked property, compared as strings.
Multiplies the matched rate. All matching multipliers stack.
Added to the rate after every factor is applied, in credits per billing-unit group.
Inclusive upper usage boundary for this graduated tier. The final tier must be 'inf'.
Credits consumed per billing-unit group within this tier.
Credits consumed per billing-unit group.
For AI credit system features: replaces the feature's markup chain entirely for customers on this plan. An unset level means no markup at that level rather than inheriting the feature's.
Default percentage markup for customers on this plan. Use -100 to make usage free.
Per-provider markup percentages for customers on this plan.
Per-model markup overrides for customers on this plan.
Filters selecting items to remove from the plan.
Match items linked to this feature.
Match items with this billing method (prepaid or usage\_based).
Match items with this interval. Accepts either a BillingInterval (price-side) or a ResetInterval (reset-side, includes day/hour/minute) so price-less items keyed by reset.interval can be disambiguated.
Match items with this interval\_count. Disambiguates between items that share an interval but differ in count.
Match items whose grant equals this included usage. Omitted is a wildcard.
Free trial configuration for a plan.
Number of duration\_type periods the trial lasts.
Unit of time for the trial ('day', 'month', 'year').
If true, a payment method is required to start the trial and the customer is charged when it ends. Defaults to false.
Behavior when the trial ends. 'bill' charges the customer (default). 'revert' expires the trial and restores the customer's previous plan.
Override the plan's billing controls (auto top-ups, spend limits, usage limits, usage alerts, overage allowed) for this customer.
List of auto top-up configurations per feature.
The ID of the feature (credit balance) to auto top-up.
Whether auto top-up is enabled.
When the balance drops below this threshold, an auto top-up will be purchased.
Amount of credits to add per auto top-up.
Optional rate limit to cap how often auto top-ups occur. Pass count to set the current window's consumed top-ups.
The time interval for the purchase limit window.
Number of intervals in the purchase limit window.
Maximum number of auto top-ups allowed within the interval.
Set the current window's consumed auto top-up count. Omit to leave runtime state unchanged.
When true, auto top-up creates a send\_invoice invoice instead of auto-charging.
List of overage spend limits per feature (caps overage spend).
Optional feature ID this spend limit applies to.
Whether the overage spend limit is enabled.
How overage\_limit is interpreted: an absolute overage cap (default) or a percentage of the main-plan allowance.
Overage cap for the feature: absolute units, or a percent (e.g. 120) when limit\_type is usage\_percentage.
When true, overage for this feature is not posted to Stripe. Usage tracking and balance resets still behave normally.
List of hard usage caps per feature (max units per interval).
The feature this usage limit applies to.
Whether this usage limit is enabled.
Maximum units allowed per interval.
Interval for the cap, aligned to the customer's billing cycle.
Window alignment. 'billing\_cycle' phases the interval to the customer's renewal time; 'utc' aligns to the UTC calendar.
When set, only usage from events whose properties match counts toward this cap. Omit to count all usage of the feature.
List of usage alert configurations per feature.
The feature ID this alert applies to.
Whether this usage alert is enabled.
The threshold value that triggers the alert. For usage or remaining, this is an absolute count. For usage\_percentage or remaining\_percentage, this is a percentage (0-100).
Whether the threshold is an absolute count or a percentage of the usage allowance or remaining balance.
What 100% means. balance: every grant on the feature. included: the plan allowance only. recurring: grants that reset. usage\_limit: the cap of the usage limit with the same feature and filter.
Only valid with basis usage\_limit. Points the alert at the usage limit carrying the same filter.
Optional user-defined label to distinguish multiple alerts on the same feature.
List of overage allowed controls per feature. When enabled, usage can exceed balance.
The feature ID this overage allowed control applies to.
Whether overage is allowed for this feature.
License links to add or override for this customer, keyed by license\_plan\_id. Omitted fields inherit the plan catalog link (included defaults to 1 when the license is not in the catalog). A bare entry restores the license to pure catalog inheritance.
Base price configuration for a plan.
Base price amount for the plan, in major currency units (e.g. dollars).
Billing interval (e.g. 'month', 'year').
Number of intervals per billing cycle. Defaults to 1.
Base price amounts in additional currencies. The base 'amount' is in the org's default currency.
Three-letter Stripe-supported currency code (e.g. 'eur', 'gbp').
Price amount in this currency. Set explicitly per currency, not converted from the base amount.
Bills this many feature units when outstanding overage reaches it.
The ID of the feature to configure.
Number of free units included. Balance resets to this each interval for consumable features.
If true, customer has unlimited access to this feature.
Whether entity-level grants contribute to a shared customer balance.
Reset configuration for consumable features. Omit for non-consumable features like seats.
Interval at which balance resets (e.g. 'month', 'year'). For consumable features only.
Number of intervals between resets. Defaults to 1.
Pricing for usage beyond included units. Omit for free features.
Price per billing\_units after included usage. Either 'amount' or 'tiers' is required.
Amounts in additional currencies for this flat price. The base 'amount' is in the org's default currency. Only valid with 'amount', not 'tiers'.
Three-letter Stripe-supported currency code (e.g. 'eur', 'gbp').
Price amount in this currency. Set explicitly per currency, not converted from the base amount.
Tiered pricing. Either 'amount' or 'tiers' is required.
Three-letter Stripe-supported currency code (e.g. 'eur', 'gbp').
Per-unit amount for this tier in this currency.
Flat amount for this tier in this currency, if the tier uses one.
Billing interval. For consumable features, should match reset.interval.
Number of intervals per billing cycle. Defaults to 1.
Units per price increment. Usage is rounded UP when billed (e.g. billing\_units=100 means 101 rounds to 200).
'prepaid' for upfront payment (seats), 'usage\_based' for pay-as-you-go.
Max units purchasable beyond included. E.g. included=100, max\_purchase=300 allows 400 total. Null for no limit.
Proration settings for prepaid features. Controls mid-cycle quantity change billing.
Billing behavior when quantity increases mid-cycle.
Credit behavior when quantity decreases mid-cycle.
Rollover config for unused units. If set, unused included units carry over.
Max rollover units. Omit for unlimited rollover.
Maximum rollover as a percentage (0-100) of included + prepaid grant. Mutually exclusive with max.
When rolled over units expire.
Number of periods before expiry.
Overrides fields of this item's feature for customers on this plan (e.g. a credit system's credit\_schema).
For credit system features: replaces the feature's credit\_schema entirely for customers on this plan.
ID of the metered feature that draws from this credit system.
Number of metered-feature units priced together. Defaults to one when omitted.
Named rates chosen by event properties. The most specific match sets the rate; with no match the item's own rate applies.
Event properties this entry applies to. Every key must equal the tracked property, compared as strings.
Breaks ties between dimensions that match the same number of keys. Higher wins.
Inclusive upper usage boundary for this graduated tier. The final tier must be 'inf'.
Credits consumed per billing-unit group within this tier.
Named adjustments chosen by event properties. Every match applies: factors multiply, then adds are summed.
Event properties this entry applies to. Every key must equal the tracked property, compared as strings.
Multiplies the matched rate. All matching multipliers stack.
Added to the rate after every factor is applied, in credits per billing-unit group.
Inclusive upper usage boundary for this graduated tier. The final tier must be 'inf'.
Credits consumed per billing-unit group within this tier.
Credits consumed per billing-unit group.
For AI credit system features: replaces the feature's markup chain entirely for customers on this plan. An unset level means no markup at that level rather than inheriting the feature's.
Default percentage markup for customers on this plan. Use -100 to make usage free.
Per-provider markup percentages for customers on this plan.
Per-model markup overrides for customers on this plan.
Match items linked to this feature.
Match items with this billing method (prepaid or usage\_based).
Match items with this interval. Accepts either a BillingInterval (price-side) or a ResetInterval (reset-side, includes day/hour/minute) so price-less items keyed by reset.interval can be disambiguated.
Match items with this interval\_count. Disambiguates between items that share an interval but differ in count.
Match items whose grant equals this included usage. Omitted is a wildcard.
License links to drop, keyed by license\_plan\_id. Parallel to remove\_items.
The unique identifier of the subscribed plan.
Whether the plan was automatically enabled for the customer.
Whether this is an add-on plan rather than a base subscription.
Current status of the subscription.
Whether the subscription has overdue payments.
Timestamp when the subscription was canceled, or null if not canceled.
Timestamp when the subscription will expire, or null if no expiry set.
Timestamp when the trial period ends, or null if not on trial.
Timestamp when the subscription started.
Start timestamp of the current billing period.
End timestamp of the current billing period.
Number of units of this subscription (for per-seat plans).
Whether this subscription is attached at the customer level or entity level.
The full plan object if expanded.
Unique identifier for the plan.
Display name of the plan.
Optional description of the plan.
Group identifier for organizing related plans. Plans in the same group are mutually exclusive.
Version number of the plan. Incremented when plan configuration changes.
User-facing version identity. Defaults to v\{n} when the version is minted.
Whether this is the active version of the plan. At most one version is active.
Whether this is an add-on plan that can be attached alongside a main plan.
If true, this plan is automatically attached when a customer is created. Used for free plans.
Base recurring price for the plan. Null for free plans or usage-only plans.
Base price amount for the plan, in major currency units (e.g. dollars).
Base price amounts in additional currencies. The base 'amount' is in the org's default currency.
Three-letter Stripe-supported currency code (e.g. 'eur', 'gbp').
Price amount in this currency. Set explicitly per currency, not converted from the base amount.
Billing interval (e.g. 'month', 'year').
Number of intervals per billing cycle. Defaults to 1.
Display text for showing this price in pricing pages.
Main display text (e.g. '\$10' or '100 messages').
Secondary display text (e.g. 'per month' or 'then \$0.5 per 100').
Payment processors this base price is connected to. Omitted when unset.
Stripe price ID. For prepaid with included > 0 this is the V2 price.
Feature configurations included in this plan. Each item defines included units, pricing, and reset behavior for a feature.
Bills this many feature units when outstanding overage reaches it.
The ID of the feature this item configures.
The full feature object if expanded.
The ID of the feature, used to refer to it in other API calls like /track or /check.
The name of the feature.
The type of the feature
Singular and plural display names for the feature.
The singular display name for the feature.
The plural display name for the feature.
Credit cost schema for credit system features.
The ID of the metered feature (should be a single\_use feature).
The credit cost of the metered feature.
Whether or not the feature is archived.
Number of free units included. For consumable features, balance resets to this number each interval.
Whether the customer has unlimited access to this feature.
Whether entity-level grants contribute to a shared customer balance.
Reset configuration for consumable features. Null for non-consumable features like seats where usage persists across billing cycles.
The interval at which the feature balance resets (e.g. 'month', 'year'). For consumable features, usage resets to 0 and included units are restored.
Number of intervals between resets. Defaults to 1.
Pricing configuration for usage beyond included units. Null if feature is entirely free.
Price per billing\_units after included usage is consumed. Mutually exclusive with tiers.
Amounts in additional currencies for this flat price. The base 'amount' is in the org's default currency. Only valid with 'amount', not 'tiers' (tiered prices carry per-currency amounts on each tier).
Three-letter Stripe-supported currency code (e.g. 'eur', 'gbp').
Price amount in this currency. Set explicitly per currency, not converted from the base amount.
Tiered pricing configuration. Each tier's 'to' INCLUDES the included amount. Either 'tiers' or 'amount' is required.
Three-letter Stripe-supported currency code (e.g. 'eur', 'gbp').
Per-unit amount for this tier in this currency.
Flat amount for this tier in this currency, if the tier uses one.
Billing interval for this price. For consumable features, should match reset.interval.
Number of intervals per billing cycle. Defaults to 1.
Number of units per price increment. Usage is rounded UP to the nearest billing\_units when billed (e.g. billing\_units=100 means 101 usage rounds to 200).
'prepaid' for features like seats where customers pay upfront, 'usage\_based' for pay-as-you-go after included usage.
Maximum units a customer can purchase beyond included. E.g. if included=100 and max\_purchase=300, customer can use up to 400 total before usage is capped. Null for no limit.
Payment processors this item price is connected to. Omitted when unset.
Stripe price ID. For prepaid with included > 0 this is the V2 price.
Display text for showing this item in pricing pages.
Main display text (e.g. '\$10' or '100 messages').
Secondary display text (e.g. 'per month' or 'then \$0.5 per 100').
Rollover configuration for unused units. If set, unused included units roll over to the next period.
Maximum rollover units. Null for unlimited rollover.
Maximum rollover as a percentage (0-100) of included + prepaid grant. Mutually exclusive with max.
When rolled over units expire.
Number of periods before expiry.
Overrides fields of this item's feature for customers on this plan (e.g. a credit system's credit\_schema).
For credit system features: replaces the feature's credit\_schema entirely for customers on this plan.
ID of the metered feature that draws from this credit system.
Number of metered-feature units priced together. Defaults to one when omitted.
Named rates chosen by event properties. The most specific match sets the rate; with no match the item's own rate applies.
Event properties this entry applies to. Every key must equal the tracked property, compared as strings.
Breaks ties between dimensions that match the same number of keys. Higher wins.
Inclusive upper usage boundary for this graduated tier. The final tier must be 'inf'.
Credits consumed per billing-unit group within this tier.
Named adjustments chosen by event properties. Every match applies: factors multiply, then adds are summed.
Event properties this entry applies to. Every key must equal the tracked property, compared as strings.
Multiplies the matched rate. All matching multipliers stack.
Added to the rate after every factor is applied, in credits per billing-unit group.
Inclusive upper usage boundary for this graduated tier. The final tier must be 'inf'.
Credits consumed per billing-unit group within this tier.
Credits consumed per billing-unit group.
For AI credit system features: replaces the feature's markup chain entirely for customers on this plan. An unset level means no markup at that level rather than inheriting the feature's.
Default percentage markup for customers on this plan. Use -100 to make usage free.
Per-provider markup percentages for customers on this plan.
Per-model markup overrides for customers on this plan.
Payment processors this plan is connected to. Omitted when unset.
Stripe product ID this plan is billed under.
Extra Stripe product IDs aliased to this plan.
Every RevenueCat product that maps to this plan. Replaces the current set.
RevenueCat product ID that grants this plan when purchased.
Prepaid quantities granted when this specific RevenueCat product is purchased, in feature units.
Free trial configuration. If set, new customers can try this plan before being charged.
Number of duration\_type periods the trial lasts.
Unit of time for the trial duration ('day', 'month', 'year').
Whether a payment method is required to start the trial. If true, customer will be charged after trial ends.
Behavior when the trial ends. 'bill' charges the customer (default). 'revert' expires the trial and restores the customer's previous plan.
Unix timestamp (ms) when the plan was created.
Environment this plan belongs to ('sandbox' or 'live').
Whether the plan is archived. Archived plans cannot be attached to new customers.
Miscellaneous plan-level configuration flags.
If true, entitlements attached to this plan will still reset on schedule even when the customer's product is in a past\_due state.
Plan-level billing controls used as customer defaults.
List of auto top-up configurations per feature.
The ID of the feature (credit balance) to auto top-up.
Whether auto top-up is enabled.
When the balance drops below this threshold, an auto top-up will be purchased.
Amount of credits to add per auto top-up.
Optional rate limit to cap how often auto top-ups occur.
The time interval for the purchase limit window.
Number of intervals in the purchase limit window.
Maximum number of auto top-ups allowed within the interval.
When true, auto top-up creates a send\_invoice invoice instead of auto-charging.
List of overage spend limits per feature (caps overage spend).
Optional feature ID this spend limit applies to.
Whether the overage spend limit is enabled.
How overage\_limit is interpreted: an absolute overage cap (default) or a percentage of the main-plan allowance.
Overage cap for the feature: absolute units, or a percent (e.g. 120) when limit\_type is usage\_percentage.
When true, overage for this feature is not posted to Stripe. Usage tracking and balance resets still behave normally.
List of hard usage caps per feature (max units per interval).
The feature this usage limit applies to.
Whether this usage limit is enabled.
Maximum units allowed per interval.
Interval for the cap, aligned to the customer's billing cycle.
Window alignment. 'billing\_cycle' phases the interval to the customer's renewal time; 'utc' aligns to the UTC calendar.
When set, only usage from events whose properties match counts toward this cap. Omit to count all usage of the feature.
List of usage alert configurations per feature.
The feature ID this alert applies to.
Whether this usage alert is enabled.
The threshold value that triggers the alert. For usage or remaining, this is an absolute count. For usage\_percentage or remaining\_percentage, this is a percentage (0-100).
Whether the threshold is an absolute count or a percentage of the usage allowance or remaining balance.
What 100% means. balance: every grant on the feature. included: the plan allowance only. recurring: grants that reset. usage\_limit: the cap of the usage limit with the same feature and filter.
Only valid with basis usage\_limit. Points the alert at the usage limit carrying the same filter.
Optional user-defined label to distinguish multiple alerts on the same feature.
List of overage allowed controls per feature. When enabled, usage can exceed balance.
The feature ID this overage allowed control applies to.
Whether overage is allowed for this feature.
Arbitrary key-value metadata defined by you for your own use. Shared across all versions of the plan.
Whether the trial on this plan is available to this customer. For example, if the customer used the trial in the past, this will be false.
The customer's current status with this plan. 'active' if attached, 'scheduled' if pending activation.
Whether the customer's active instance of this plan is set to cancel.
Whether the customer is currently on a free trial of this plan.
The action that would occur if this plan were attached to the customer.
Deprecated. Use variant\_details.base\_plan\_id instead. If this is a variant, the ID of the base plan it was created from.
Details about how this variant relates to its latest base plan.
The ID of the base plan this variant was derived from.
The customization that transforms the base plan into this variant.
Base price configuration for a plan.
Base price amount for the plan, in major currency units (e.g. dollars).
Billing interval (e.g. 'month', 'year').
Number of intervals per billing cycle. Defaults to 1.
Base price amounts in additional currencies. The base 'amount' is in the org's default currency.
Three-letter Stripe-supported currency code (e.g. 'eur', 'gbp').
Price amount in this currency. Set explicitly per currency, not converted from the base amount.
Items to add to the plan.
Bills this many feature units when outstanding overage reaches it.
The ID of the feature to configure.
Number of free units included. Balance resets to this each interval for consumable features.
If true, customer has unlimited access to this feature.
Whether entity-level grants contribute to a shared customer balance.
Reset configuration for consumable features. Omit for non-consumable features like seats.
Interval at which balance resets (e.g. 'month', 'year'). For consumable features only.
Number of intervals between resets. Defaults to 1.
Pricing for usage beyond included units. Omit for free features.
Price per billing\_units after included usage. Either 'amount' or 'tiers' is required.
Amounts in additional currencies for this flat price. The base 'amount' is in the org's default currency. Only valid with 'amount', not 'tiers'.
Three-letter Stripe-supported currency code (e.g. 'eur', 'gbp').
Price amount in this currency. Set explicitly per currency, not converted from the base amount.
Tiered pricing. Either 'amount' or 'tiers' is required.
Three-letter Stripe-supported currency code (e.g. 'eur', 'gbp').
Per-unit amount for this tier in this currency.
Flat amount for this tier in this currency, if the tier uses one.
Billing interval. For consumable features, should match reset.interval.
Number of intervals per billing cycle. Defaults to 1.
Units per price increment. Usage is rounded UP when billed (e.g. billing\_units=100 means 101 rounds to 200).
'prepaid' for upfront payment (seats), 'usage\_based' for pay-as-you-go.
Max units purchasable beyond included. E.g. included=100, max\_purchase=300 allows 400 total. Null for no limit.
Proration settings for prepaid features. Controls mid-cycle quantity change billing.
Billing behavior when quantity increases mid-cycle.
Credit behavior when quantity decreases mid-cycle.
Rollover config for unused units. If set, unused included units carry over.
Max rollover units. Omit for unlimited rollover.
Maximum rollover as a percentage (0-100) of included + prepaid grant. Mutually exclusive with max.
When rolled over units expire.
Number of periods before expiry.
Overrides fields of this item's feature for customers on this plan (e.g. a credit system's credit\_schema).
For credit system features: replaces the feature's credit\_schema entirely for customers on this plan.
ID of the metered feature that draws from this credit system.
Number of metered-feature units priced together. Defaults to one when omitted.
Named rates chosen by event properties. The most specific match sets the rate; with no match the item's own rate applies.
Event properties this entry applies to. Every key must equal the tracked property, compared as strings.
Breaks ties between dimensions that match the same number of keys. Higher wins.
Inclusive upper usage boundary for this graduated tier. The final tier must be 'inf'.
Credits consumed per billing-unit group within this tier.
Named adjustments chosen by event properties. Every match applies: factors multiply, then adds are summed.
Event properties this entry applies to. Every key must equal the tracked property, compared as strings.
Multiplies the matched rate. All matching multipliers stack.
Added to the rate after every factor is applied, in credits per billing-unit group.
Inclusive upper usage boundary for this graduated tier. The final tier must be 'inf'.
Credits consumed per billing-unit group within this tier.
Credits consumed per billing-unit group.
For AI credit system features: replaces the feature's markup chain entirely for customers on this plan. An unset level means no markup at that level rather than inheriting the feature's.
Default percentage markup for customers on this plan. Use -100 to make usage free.
Per-provider markup percentages for customers on this plan.
Per-model markup overrides for customers on this plan.
Filters selecting items to remove from the plan.
Match items linked to this feature.
Match items with this billing method (prepaid or usage\_based).
Match items with this interval. Accepts either a BillingInterval (price-side) or a ResetInterval (reset-side, includes day/hour/minute) so price-less items keyed by reset.interval can be disambiguated.
Match items with this interval\_count. Disambiguates between items that share an interval but differ in count.
Match items whose grant equals this included usage. Omitted is a wildcard.
Free trial configuration for a plan.
Number of duration\_type periods the trial lasts.
Unit of time for the trial ('day', 'month', 'year').
If true, a payment method is required to start the trial and the customer is charged when it ends. Defaults to false.
Behavior when the trial ends. 'bill' charges the customer (default). 'revert' expires the trial and restores the customer's previous plan.
Override the plan's billing controls (auto top-ups, spend limits, usage limits, usage alerts, overage allowed) for this customer.
List of auto top-up configurations per feature.
The ID of the feature (credit balance) to auto top-up.
Whether auto top-up is enabled.
When the balance drops below this threshold, an auto top-up will be purchased.
Amount of credits to add per auto top-up.
Optional rate limit to cap how often auto top-ups occur. Pass count to set the current window's consumed top-ups.
The time interval for the purchase limit window.
Number of intervals in the purchase limit window.
Maximum number of auto top-ups allowed within the interval.
Set the current window's consumed auto top-up count. Omit to leave runtime state unchanged.
When true, auto top-up creates a send\_invoice invoice instead of auto-charging.
List of overage spend limits per feature (caps overage spend).
Optional feature ID this spend limit applies to.
Whether the overage spend limit is enabled.
How overage\_limit is interpreted: an absolute overage cap (default) or a percentage of the main-plan allowance.
Overage cap for the feature: absolute units, or a percent (e.g. 120) when limit\_type is usage\_percentage.
When true, overage for this feature is not posted to Stripe. Usage tracking and balance resets still behave normally.
List of hard usage caps per feature (max units per interval).
The feature this usage limit applies to.
Whether this usage limit is enabled.
Maximum units allowed per interval.
Interval for the cap, aligned to the customer's billing cycle.
Window alignment. 'billing\_cycle' phases the interval to the customer's renewal time; 'utc' aligns to the UTC calendar.
When set, only usage from events whose properties match counts toward this cap. Omit to count all usage of the feature.
List of usage alert configurations per feature.
The feature ID this alert applies to.
Whether this usage alert is enabled.
The threshold value that triggers the alert. For usage or remaining, this is an absolute count. For usage\_percentage or remaining\_percentage, this is a percentage (0-100).
Whether the threshold is an absolute count or a percentage of the usage allowance or remaining balance.
What 100% means. balance: every grant on the feature. included: the plan allowance only. recurring: grants that reset. usage\_limit: the cap of the usage limit with the same feature and filter.
Only valid with basis usage\_limit. Points the alert at the usage limit carrying the same filter.
Optional user-defined label to distinguish multiple alerts on the same feature.
List of overage allowed controls per feature. When enabled, usage can exceed balance.
The feature ID this overage allowed control applies to.
Whether overage is allowed for this feature.
License links to add or override for this customer, keyed by license\_plan\_id. Omitted fields inherit the plan catalog link (included defaults to 1 when the license is not in the catalog). A bare entry restores the license to pure catalog inheritance.
Base price configuration for a plan.
Base price amount for the plan, in major currency units (e.g. dollars).
Billing interval (e.g. 'month', 'year').
Number of intervals per billing cycle. Defaults to 1.
Base price amounts in additional currencies. The base 'amount' is in the org's default currency.
Three-letter Stripe-supported currency code (e.g. 'eur', 'gbp').
Price amount in this currency. Set explicitly per currency, not converted from the base amount.
Bills this many feature units when outstanding overage reaches it.
The ID of the feature to configure.
Number of free units included. Balance resets to this each interval for consumable features.
If true, customer has unlimited access to this feature.
Whether entity-level grants contribute to a shared customer balance.
Reset configuration for consumable features. Omit for non-consumable features like seats.
Interval at which balance resets (e.g. 'month', 'year'). For consumable features only.
Number of intervals between resets. Defaults to 1.
Pricing for usage beyond included units. Omit for free features.
Price per billing\_units after included usage. Either 'amount' or 'tiers' is required.
Amounts in additional currencies for this flat price. The base 'amount' is in the org's default currency. Only valid with 'amount', not 'tiers'.
Three-letter Stripe-supported currency code (e.g. 'eur', 'gbp').
Price amount in this currency. Set explicitly per currency, not converted from the base amount.
Tiered pricing. Either 'amount' or 'tiers' is required.
Three-letter Stripe-supported currency code (e.g. 'eur', 'gbp').
Per-unit amount for this tier in this currency.
Flat amount for this tier in this currency, if the tier uses one.
Billing interval. For consumable features, should match reset.interval.
Number of intervals per billing cycle. Defaults to 1.
Units per price increment. Usage is rounded UP when billed (e.g. billing\_units=100 means 101 rounds to 200).
'prepaid' for upfront payment (seats), 'usage\_based' for pay-as-you-go.
Max units purchasable beyond included. E.g. included=100, max\_purchase=300 allows 400 total. Null for no limit.
Proration settings for prepaid features. Controls mid-cycle quantity change billing.
Billing behavior when quantity increases mid-cycle.
Credit behavior when quantity decreases mid-cycle.
Rollover config for unused units. If set, unused included units carry over.
Max rollover units. Omit for unlimited rollover.
Maximum rollover as a percentage (0-100) of included + prepaid grant. Mutually exclusive with max.
When rolled over units expire.
Number of periods before expiry.
Overrides fields of this item's feature for customers on this plan (e.g. a credit system's credit\_schema).
For credit system features: replaces the feature's credit\_schema entirely for customers on this plan.
ID of the metered feature that draws from this credit system.
Number of metered-feature units priced together. Defaults to one when omitted.
Named rates chosen by event properties. The most specific match sets the rate; with no match the item's own rate applies.
Event properties this entry applies to. Every key must equal the tracked property, compared as strings.
Breaks ties between dimensions that match the same number of keys. Higher wins.
Inclusive upper usage boundary for this graduated tier. The final tier must be 'inf'.
Credits consumed per billing-unit group within this tier.
Named adjustments chosen by event properties. Every match applies: factors multiply, then adds are summed.
Event properties this entry applies to. Every key must equal the tracked property, compared as strings.
Multiplies the matched rate. All matching multipliers stack.
Added to the rate after every factor is applied, in credits per billing-unit group.
Inclusive upper usage boundary for this graduated tier. The final tier must be 'inf'.
Credits consumed per billing-unit group within this tier.
Credits consumed per billing-unit group.
For AI credit system features: replaces the feature's markup chain entirely for customers on this plan. An unset level means no markup at that level rather than inheriting the feature's.
Default percentage markup for customers on this plan. Use -100 to make usage free.
Per-provider markup percentages for customers on this plan.
Per-model markup overrides for customers on this plan.
Match items linked to this feature.
Match items with this billing method (prepaid or usage\_based).
Match items with this interval. Accepts either a BillingInterval (price-side) or a ResetInterval (reset-side, includes day/hour/minute) so price-less items keyed by reset.interval can be disambiguated.
Match items with this interval\_count. Disambiguates between items that share an interval but differ in count.
Match items whose grant equals this included usage. Omitted is a wildcard.
License links to drop, keyed by license\_plan\_id. Parallel to remove\_items.
The unique identifier of the purchased plan.
Timestamp when the purchase expires, or null for lifetime access.
Timestamp when the purchase was made.
Number of units purchased.
Whether this purchase is attached at the customer level or entity level.
The feature ID this balance is for.
The full feature object if expanded.
The unique identifier for this feature, used in /check and /track calls.
Human-readable name displayed in the dashboard and billing UI.
Feature type: 'boolean' for on/off access, 'metered' for usage-tracked features, 'credit\_system' for unified credit pools, 'ai\_credit\_system' for model-based token pricing.
For metered features: true if usage resets periodically (API calls, credits), false if allocated persistently (seats, storage).
Event names that trigger this feature's balance. Allows multiple features to respond to a single event.
For classic credit systems: maps metered features to flat or graduated credit costs.
ID of the metered feature that draws from this credit system.
Number of metered-feature units priced together. Defaults to one when omitted.
Named rates chosen by event properties. The most specific match sets the rate; with no match the item's own rate applies.
Event properties this entry applies to. Every key must equal the tracked property, compared as strings.
Breaks ties between dimensions that match the same number of keys. Higher wins.
Inclusive upper usage boundary for this graduated tier. The final tier must be 'inf'.
Credits consumed per billing-unit group within this tier.
Named adjustments chosen by event properties. Every match applies: factors multiply, then adds are summed.
Event properties this entry applies to. Every key must equal the tracked property, compared as strings.
Multiplies the matched rate. All matching multipliers stack.
Added to the rate after every factor is applied, in credits per billing-unit group.
Inclusive upper usage boundary for this graduated tier. The final tier must be 'inf'.
Credits consumed per billing-unit group within this tier.
Credits consumed per billing-unit group.
Whether usage of this classic credit system should be itemized as invoice credits.
Per-model markup overrides for AI credit systems.
Default percentage markup for AI credit systems. Use -100 to make usage free.
Per-provider default markup percentages for AI credit systems.
Display names for the feature in billing UI and customer-facing components.
Singular form for UI display (e.g., 'API call', 'seat').
Plural form for UI display (e.g., 'API calls', 'seats').
Whether the feature is archived and hidden from the dashboard.
Processor mappings for this feature. Present when a Stripe product or meter is set.
Stripe product ID this feature's usage prices bill under.
Stripe meter ID used to create this feature's metered price.
Total balance granted (included + prepaid).
Remaining balance available for use.
Total usage consumed in the current period.
Whether this feature has unlimited usage.
Whether usage beyond the granted balance is allowed (with overage charges).
Maximum quantity that can be purchased as a top-up, or null for unlimited.
Timestamp when the balance will reset, or null for no reset.
Detailed breakdown of balance sources when stacking multiple plans or grants.
The unique identifier for this balance breakdown.
The plan ID this balance originates from, or null for standalone balances.
Amount granted from the plan's included usage.
Amount granted from prepaid purchases or top-ups.
Remaining balance available for use.
Amount consumed in the current period.
Whether this balance has unlimited usage.
Reset configuration for this balance, or null if no reset.
The reset interval (hour, day, week, month, etc.) or 'multiple' if combined from different intervals.
Number of intervals between resets (eg. 2 for bi-monthly).
Timestamp when the balance will next reset.
Pricing configuration if this balance has usage-based pricing.
The per-unit price amount.
Tiered pricing configuration if applicable.
How tiers are applied: graduated (split across bands) or volume (flat rate for the matched tier).
The number of units per billing increment (eg. \$9 / 250 units).
Whether usage is prepaid or billed pay-per-use.
Maximum quantity that can be purchased, or null for unlimited.
Timestamp when this balance expires, or null for no expiration.
Rollover balances carried over from previous periods.
Amount originally rolled over from a previous period, before any of it was consumed.
Amount of balance rolled over from a previous period.
Timestamp when the rollover balance expires.
The unique identifier for this flag.
The plan ID this flag originates from, or null for standalone flags.
Timestamp when this flag expires, or null for no expiration.
The feature ID this flag is for.
The full feature object if expanded.
The unique identifier for this feature, used in /check and /track calls.
Human-readable name displayed in the dashboard and billing UI.
Feature type: 'boolean' for on/off access, 'metered' for usage-tracked features, 'credit\_system' for unified credit pools, 'ai\_credit\_system' for model-based token pricing.
For metered features: true if usage resets periodically (API calls, credits), false if allocated persistently (seats, storage).
Event names that trigger this feature's balance. Allows multiple features to respond to a single event.
For classic credit systems: maps metered features to flat or graduated credit costs.
ID of the metered feature that draws from this credit system.
Number of metered-feature units priced together. Defaults to one when omitted.
Named rates chosen by event properties. The most specific match sets the rate; with no match the item's own rate applies.
Event properties this entry applies to. Every key must equal the tracked property, compared as strings.
Breaks ties between dimensions that match the same number of keys. Higher wins.
Inclusive upper usage boundary for this graduated tier. The final tier must be 'inf'.
Credits consumed per billing-unit group within this tier.
Named adjustments chosen by event properties. Every match applies: factors multiply, then adds are summed.
Event properties this entry applies to. Every key must equal the tracked property, compared as strings.
Multiplies the matched rate. All matching multipliers stack.
Added to the rate after every factor is applied, in credits per billing-unit group.
Inclusive upper usage boundary for this graduated tier. The final tier must be 'inf'.
Credits consumed per billing-unit group within this tier.
Credits consumed per billing-unit group.
Whether usage of this classic credit system should be itemized as invoice credits.
Per-model markup overrides for AI credit systems.
Default percentage markup for AI credit systems. Use -100 to make usage free.
Per-provider default markup percentages for AI credit systems.
Display names for the feature in billing UI and customer-facing components.
Singular form for UI display (e.g., 'API call', 'seat').
Plural form for UI display (e.g., 'API calls', 'seats').
Whether the feature is archived and hidden from the dashboard.
Processor mappings for this feature. Present when a Stripe product or meter is set.
Stripe product ID this feature's usage prices bill under.
Stripe meter ID used to create this feature's metered price.
Billing controls for the entity.
List of spend limits per feature. Each entry caps overage (overage\_limit) and/or per-interval usage (usage\_limit).
Optional feature ID this spend limit applies to.
Whether the overage spend limit is enabled.
How overage\_limit is interpreted: an absolute overage cap (default) or a percentage of the main-plan allowance.
Overage cap for the feature: absolute units, or a percent (e.g. 120) when limit\_type is usage\_percentage.
When true, overage for this feature is not posted to Stripe. Usage tracking and balance resets still behave normally.
Response-only: whether the entry is a customer-level override or inherited from an attached plan's defaults.
List of hard usage caps per feature for this entity. An entity entry overrides the customer's for that feature.
The feature this usage limit applies to.
Whether this usage limit is enabled.
Maximum units allowed per interval.
Interval for the cap, aligned to the customer's billing cycle.
Window alignment. 'billing\_cycle' phases the interval to the customer's renewal time; 'utc' aligns to the UTC calendar.
When set, only usage from events whose properties match counts toward this cap. Omit to count all usage of the feature.
Usage consumed in the active interval, stored in the usage-window counter.
Response-only: whether the entry is a customer-level override or inherited from an attached plan's defaults.
List of usage alert configurations per feature.
The feature ID this alert applies to.
Whether this usage alert is enabled.
The threshold value that triggers the alert. For usage or remaining, this is an absolute count. For usage\_percentage or remaining\_percentage, this is a percentage (0-100).
Whether the threshold is an absolute count or a percentage of the usage allowance or remaining balance.
What 100% means. balance: every grant on the feature. included: the plan allowance only. recurring: grants that reset. usage\_limit: the cap of the usage limit with the same feature and filter.
Only valid with basis usage\_limit. Points the alert at the usage limit carrying the same filter.
Optional user-defined label to distinguish multiple alerts on the same feature.
Response-only: whether the entry is a customer-level override or inherited from an attached plan's defaults.
List of overage allowed controls per feature. When enabled, usage can exceed balance.
The feature ID this overage allowed control applies to.
Whether overage is allowed for this feature.
Response-only: whether the entry is a customer-level override or inherited from an attached plan's defaults.
Invoices for this entity (only included when expand=invoices)
Array of plan IDs included in this invoice
The Stripe invoice ID
The billing processor that owns this invoice.
The status of the invoice
The total amount of the invoice
The currency code for the invoice
Timestamp when the invoice was created
URL to the Stripe-hosted invoice page
```json 200 theme={null}
{
"id": "seat_42",
"name": "Seat 42",
"customer_id": "cus_123",
"feature_id": "seats",
"created_at": 1771409161016,
"env": "sandbox",
"subscriptions": [
{
"plan_id": "pro_plan",
"auto_enable": true,
"add_on": false,
"status": "active",
"past_due": false,
"canceled_at": null,
"expires_at": null,
"trial_ends_at": null,
"started_at": 1771431921437,
"current_period_start": 1771431921437,
"current_period_end": 1771999921437,
"quantity": 1
}
],
"purchases": [],
"balances": {
"messages": {
"feature_id": "messages",
"granted": 100,
"remaining": 72,
"usage": 28,
"unlimited": false,
"overage_allowed": false,
"max_purchase": null,
"next_reset_at": 1773851121437,
"breakdown": [
{
"id": "cus_ent_39qmLooixXLAqMywgXywjAz96rV",
"plan_id": "pro_plan",
"included_grant": 100,
"prepaid_grant": 0,
"remaining": 72,
"usage": 28,
"unlimited": false,
"reset": {
"interval": "month",
"resets_at": 1773851121437
},
"price": null,
"expires_at": null
}
]
}
},
"invoices": []
}
```
# Delete Entity
Source: https://docs.useautumn.com/api-reference/entities/deleteEntity
openapi POST /v1/entities.delete
Deletes an entity by entity ID.
Use this when the underlying resource is removed and you no longer want entity-scoped balances or subscriptions tracked for it.
### Body Parameters
The ID of the customer.
The ID of the entity.
### Response
```json 200 theme={null}
{
"success": true
}
```
# Get Entity
Source: https://docs.useautumn.com/api-reference/entities/getEntity
openapi POST /v1/entities.get
Fetches an entity by its ID.
Use this to read one entity's current state. Pass customerId when you want to scope the lookup to a specific customer.
### Body Parameters
The ID of the customer to create the entity for.
The ID of the entity.
### Response
The unique identifier of the entity
The name of the entity
The customer ID this entity belongs to
The feature ID this entity belongs to
Unix timestamp when the entity was created
The environment (sandbox/live)
The unique identifier of this subscription. If a subscription\_id was provided at attach time, it is used; otherwise, falls back to the internal ID.
The full plan object if expanded.
Unique identifier for the plan.
Display name of the plan.
Optional description of the plan.
Group identifier for organizing related plans. Plans in the same group are mutually exclusive.
Version number of the plan. Incremented when plan configuration changes.
User-facing version identity. Defaults to v\{n} when the version is minted.
Whether this is the active version of the plan. At most one version is active.
Whether this is an add-on plan that can be attached alongside a main plan.
If true, this plan is automatically attached when a customer is created. Used for free plans.
Base recurring price for the plan. Null for free plans or usage-only plans.
Base price amount for the plan, in major currency units (e.g. dollars).
Base price amounts in additional currencies. The base 'amount' is in the org's default currency.
Three-letter Stripe-supported currency code (e.g. 'eur', 'gbp').
Price amount in this currency. Set explicitly per currency, not converted from the base amount.
Billing interval (e.g. 'month', 'year').
Number of intervals per billing cycle. Defaults to 1.
Display text for showing this price in pricing pages.
Main display text (e.g. '\$10' or '100 messages').
Secondary display text (e.g. 'per month' or 'then \$0.5 per 100').
Payment processors this base price is connected to. Omitted when unset.
Stripe price ID. For prepaid with included > 0 this is the V2 price.
Feature configurations included in this plan. Each item defines included units, pricing, and reset behavior for a feature.
Bills this many feature units when outstanding overage reaches it.
The ID of the feature this item configures.
The full feature object if expanded.
The ID of the feature, used to refer to it in other API calls like /track or /check.
The name of the feature.
The type of the feature
Singular and plural display names for the feature.
The singular display name for the feature.
The plural display name for the feature.
Credit cost schema for credit system features.
The ID of the metered feature (should be a single\_use feature).
The credit cost of the metered feature.
Whether or not the feature is archived.
Number of free units included. For consumable features, balance resets to this number each interval.
Whether the customer has unlimited access to this feature.
Whether entity-level grants contribute to a shared customer balance.
Reset configuration for consumable features. Null for non-consumable features like seats where usage persists across billing cycles.
The interval at which the feature balance resets (e.g. 'month', 'year'). For consumable features, usage resets to 0 and included units are restored.
Number of intervals between resets. Defaults to 1.
Pricing configuration for usage beyond included units. Null if feature is entirely free.
Price per billing\_units after included usage is consumed. Mutually exclusive with tiers.
Amounts in additional currencies for this flat price. The base 'amount' is in the org's default currency. Only valid with 'amount', not 'tiers' (tiered prices carry per-currency amounts on each tier).
Three-letter Stripe-supported currency code (e.g. 'eur', 'gbp').
Price amount in this currency. Set explicitly per currency, not converted from the base amount.
Tiered pricing configuration. Each tier's 'to' INCLUDES the included amount. Either 'tiers' or 'amount' is required.
Three-letter Stripe-supported currency code (e.g. 'eur', 'gbp').
Per-unit amount for this tier in this currency.
Flat amount for this tier in this currency, if the tier uses one.
Billing interval for this price. For consumable features, should match reset.interval.
Number of intervals per billing cycle. Defaults to 1.
Number of units per price increment. Usage is rounded UP to the nearest billing\_units when billed (e.g. billing\_units=100 means 101 usage rounds to 200).
'prepaid' for features like seats where customers pay upfront, 'usage\_based' for pay-as-you-go after included usage.
Maximum units a customer can purchase beyond included. E.g. if included=100 and max\_purchase=300, customer can use up to 400 total before usage is capped. Null for no limit.
Payment processors this item price is connected to. Omitted when unset.
Stripe price ID. For prepaid with included > 0 this is the V2 price.
Display text for showing this item in pricing pages.
Main display text (e.g. '\$10' or '100 messages').
Secondary display text (e.g. 'per month' or 'then \$0.5 per 100').
Rollover configuration for unused units. If set, unused included units roll over to the next period.
Maximum rollover units. Null for unlimited rollover.
Maximum rollover as a percentage (0-100) of included + prepaid grant. Mutually exclusive with max.
When rolled over units expire.
Number of periods before expiry.
Overrides fields of this item's feature for customers on this plan (e.g. a credit system's credit\_schema).
For credit system features: replaces the feature's credit\_schema entirely for customers on this plan.
ID of the metered feature that draws from this credit system.
Number of metered-feature units priced together. Defaults to one when omitted.
Named rates chosen by event properties. The most specific match sets the rate; with no match the item's own rate applies.
Event properties this entry applies to. Every key must equal the tracked property, compared as strings.
Breaks ties between dimensions that match the same number of keys. Higher wins.
Inclusive upper usage boundary for this graduated tier. The final tier must be 'inf'.
Credits consumed per billing-unit group within this tier.
Named adjustments chosen by event properties. Every match applies: factors multiply, then adds are summed.
Event properties this entry applies to. Every key must equal the tracked property, compared as strings.
Multiplies the matched rate. All matching multipliers stack.
Added to the rate after every factor is applied, in credits per billing-unit group.
Inclusive upper usage boundary for this graduated tier. The final tier must be 'inf'.
Credits consumed per billing-unit group within this tier.
Credits consumed per billing-unit group.
For AI credit system features: replaces the feature's markup chain entirely for customers on this plan. An unset level means no markup at that level rather than inheriting the feature's.
Default percentage markup for customers on this plan. Use -100 to make usage free.
Per-provider markup percentages for customers on this plan.
Per-model markup overrides for customers on this plan.
Payment processors this plan is connected to. Omitted when unset.
Stripe product ID this plan is billed under.
Extra Stripe product IDs aliased to this plan.
Every RevenueCat product that maps to this plan. Replaces the current set.
RevenueCat product ID that grants this plan when purchased.
Prepaid quantities granted when this specific RevenueCat product is purchased, in feature units.
Free trial configuration. If set, new customers can try this plan before being charged.
Number of duration\_type periods the trial lasts.
Unit of time for the trial duration ('day', 'month', 'year').
Whether a payment method is required to start the trial. If true, customer will be charged after trial ends.
Behavior when the trial ends. 'bill' charges the customer (default). 'revert' expires the trial and restores the customer's previous plan.
Unix timestamp (ms) when the plan was created.
Environment this plan belongs to ('sandbox' or 'live').
Whether the plan is archived. Archived plans cannot be attached to new customers.
Miscellaneous plan-level configuration flags.
If true, entitlements attached to this plan will still reset on schedule even when the customer's product is in a past\_due state.
Plan-level billing controls used as customer defaults.
List of auto top-up configurations per feature.
The ID of the feature (credit balance) to auto top-up.
Whether auto top-up is enabled.
When the balance drops below this threshold, an auto top-up will be purchased.
Amount of credits to add per auto top-up.
Optional rate limit to cap how often auto top-ups occur.
The time interval for the purchase limit window.
Number of intervals in the purchase limit window.
Maximum number of auto top-ups allowed within the interval.
When true, auto top-up creates a send\_invoice invoice instead of auto-charging.
List of overage spend limits per feature (caps overage spend).
Optional feature ID this spend limit applies to.
Whether the overage spend limit is enabled.
How overage\_limit is interpreted: an absolute overage cap (default) or a percentage of the main-plan allowance.
Overage cap for the feature: absolute units, or a percent (e.g. 120) when limit\_type is usage\_percentage.
When true, overage for this feature is not posted to Stripe. Usage tracking and balance resets still behave normally.
List of hard usage caps per feature (max units per interval).
The feature this usage limit applies to.
Whether this usage limit is enabled.
Maximum units allowed per interval.
Interval for the cap, aligned to the customer's billing cycle.
Window alignment. 'billing\_cycle' phases the interval to the customer's renewal time; 'utc' aligns to the UTC calendar.
When set, only usage from events whose properties match counts toward this cap. Omit to count all usage of the feature.
List of usage alert configurations per feature.
The feature ID this alert applies to.
Whether this usage alert is enabled.
The threshold value that triggers the alert. For usage or remaining, this is an absolute count. For usage\_percentage or remaining\_percentage, this is a percentage (0-100).
Whether the threshold is an absolute count or a percentage of the usage allowance or remaining balance.
What 100% means. balance: every grant on the feature. included: the plan allowance only. recurring: grants that reset. usage\_limit: the cap of the usage limit with the same feature and filter.
Only valid with basis usage\_limit. Points the alert at the usage limit carrying the same filter.
Optional user-defined label to distinguish multiple alerts on the same feature.
List of overage allowed controls per feature. When enabled, usage can exceed balance.
The feature ID this overage allowed control applies to.
Whether overage is allowed for this feature.
Arbitrary key-value metadata defined by you for your own use. Shared across all versions of the plan.
Whether the trial on this plan is available to this customer. For example, if the customer used the trial in the past, this will be false.
The customer's current status with this plan. 'active' if attached, 'scheduled' if pending activation.
Whether the customer's active instance of this plan is set to cancel.
Whether the customer is currently on a free trial of this plan.
The action that would occur if this plan were attached to the customer.
Deprecated. Use variant\_details.base\_plan\_id instead. If this is a variant, the ID of the base plan it was created from.
Details about how this variant relates to its latest base plan.
The ID of the base plan this variant was derived from.
The customization that transforms the base plan into this variant.
Base price configuration for a plan.
Base price amount for the plan, in major currency units (e.g. dollars).
Billing interval (e.g. 'month', 'year').
Number of intervals per billing cycle. Defaults to 1.
Base price amounts in additional currencies. The base 'amount' is in the org's default currency.
Three-letter Stripe-supported currency code (e.g. 'eur', 'gbp').
Price amount in this currency. Set explicitly per currency, not converted from the base amount.
Items to add to the plan.
Bills this many feature units when outstanding overage reaches it.
The ID of the feature to configure.
Number of free units included. Balance resets to this each interval for consumable features.
If true, customer has unlimited access to this feature.
Whether entity-level grants contribute to a shared customer balance.
Reset configuration for consumable features. Omit for non-consumable features like seats.
Interval at which balance resets (e.g. 'month', 'year'). For consumable features only.
Number of intervals between resets. Defaults to 1.
Pricing for usage beyond included units. Omit for free features.
Price per billing\_units after included usage. Either 'amount' or 'tiers' is required.
Amounts in additional currencies for this flat price. The base 'amount' is in the org's default currency. Only valid with 'amount', not 'tiers'.
Three-letter Stripe-supported currency code (e.g. 'eur', 'gbp').
Price amount in this currency. Set explicitly per currency, not converted from the base amount.
Tiered pricing. Either 'amount' or 'tiers' is required.
Three-letter Stripe-supported currency code (e.g. 'eur', 'gbp').
Per-unit amount for this tier in this currency.
Flat amount for this tier in this currency, if the tier uses one.
Billing interval. For consumable features, should match reset.interval.
Number of intervals per billing cycle. Defaults to 1.
Units per price increment. Usage is rounded UP when billed (e.g. billing\_units=100 means 101 rounds to 200).
'prepaid' for upfront payment (seats), 'usage\_based' for pay-as-you-go.
Max units purchasable beyond included. E.g. included=100, max\_purchase=300 allows 400 total. Null for no limit.
Proration settings for prepaid features. Controls mid-cycle quantity change billing.
Billing behavior when quantity increases mid-cycle.
Credit behavior when quantity decreases mid-cycle.
Rollover config for unused units. If set, unused included units carry over.
Max rollover units. Omit for unlimited rollover.
Maximum rollover as a percentage (0-100) of included + prepaid grant. Mutually exclusive with max.
When rolled over units expire.
Number of periods before expiry.
Overrides fields of this item's feature for customers on this plan (e.g. a credit system's credit\_schema).
For credit system features: replaces the feature's credit\_schema entirely for customers on this plan.
ID of the metered feature that draws from this credit system.
Number of metered-feature units priced together. Defaults to one when omitted.
Named rates chosen by event properties. The most specific match sets the rate; with no match the item's own rate applies.
Event properties this entry applies to. Every key must equal the tracked property, compared as strings.
Breaks ties between dimensions that match the same number of keys. Higher wins.
Inclusive upper usage boundary for this graduated tier. The final tier must be 'inf'.
Credits consumed per billing-unit group within this tier.
Named adjustments chosen by event properties. Every match applies: factors multiply, then adds are summed.
Event properties this entry applies to. Every key must equal the tracked property, compared as strings.
Multiplies the matched rate. All matching multipliers stack.
Added to the rate after every factor is applied, in credits per billing-unit group.
Inclusive upper usage boundary for this graduated tier. The final tier must be 'inf'.
Credits consumed per billing-unit group within this tier.
Credits consumed per billing-unit group.
For AI credit system features: replaces the feature's markup chain entirely for customers on this plan. An unset level means no markup at that level rather than inheriting the feature's.
Default percentage markup for customers on this plan. Use -100 to make usage free.
Per-provider markup percentages for customers on this plan.
Per-model markup overrides for customers on this plan.
Filters selecting items to remove from the plan.
Match items linked to this feature.
Match items with this billing method (prepaid or usage\_based).
Match items with this interval. Accepts either a BillingInterval (price-side) or a ResetInterval (reset-side, includes day/hour/minute) so price-less items keyed by reset.interval can be disambiguated.
Match items with this interval\_count. Disambiguates between items that share an interval but differ in count.
Match items whose grant equals this included usage. Omitted is a wildcard.
Free trial configuration for a plan.
Number of duration\_type periods the trial lasts.
Unit of time for the trial ('day', 'month', 'year').
If true, a payment method is required to start the trial and the customer is charged when it ends. Defaults to false.
Behavior when the trial ends. 'bill' charges the customer (default). 'revert' expires the trial and restores the customer's previous plan.
Override the plan's billing controls (auto top-ups, spend limits, usage limits, usage alerts, overage allowed) for this customer.
List of auto top-up configurations per feature.
The ID of the feature (credit balance) to auto top-up.
Whether auto top-up is enabled.
When the balance drops below this threshold, an auto top-up will be purchased.
Amount of credits to add per auto top-up.
Optional rate limit to cap how often auto top-ups occur. Pass count to set the current window's consumed top-ups.
The time interval for the purchase limit window.
Number of intervals in the purchase limit window.
Maximum number of auto top-ups allowed within the interval.
Set the current window's consumed auto top-up count. Omit to leave runtime state unchanged.
When true, auto top-up creates a send\_invoice invoice instead of auto-charging.
List of overage spend limits per feature (caps overage spend).
Optional feature ID this spend limit applies to.
Whether the overage spend limit is enabled.
How overage\_limit is interpreted: an absolute overage cap (default) or a percentage of the main-plan allowance.
Overage cap for the feature: absolute units, or a percent (e.g. 120) when limit\_type is usage\_percentage.
When true, overage for this feature is not posted to Stripe. Usage tracking and balance resets still behave normally.
List of hard usage caps per feature (max units per interval).
The feature this usage limit applies to.
Whether this usage limit is enabled.
Maximum units allowed per interval.
Interval for the cap, aligned to the customer's billing cycle.
Window alignment. 'billing\_cycle' phases the interval to the customer's renewal time; 'utc' aligns to the UTC calendar.
When set, only usage from events whose properties match counts toward this cap. Omit to count all usage of the feature.
List of usage alert configurations per feature.
The feature ID this alert applies to.
Whether this usage alert is enabled.
The threshold value that triggers the alert. For usage or remaining, this is an absolute count. For usage\_percentage or remaining\_percentage, this is a percentage (0-100).
Whether the threshold is an absolute count or a percentage of the usage allowance or remaining balance.
What 100% means. balance: every grant on the feature. included: the plan allowance only. recurring: grants that reset. usage\_limit: the cap of the usage limit with the same feature and filter.
Only valid with basis usage\_limit. Points the alert at the usage limit carrying the same filter.
Optional user-defined label to distinguish multiple alerts on the same feature.
List of overage allowed controls per feature. When enabled, usage can exceed balance.
The feature ID this overage allowed control applies to.
Whether overage is allowed for this feature.
License links to add or override for this customer, keyed by license\_plan\_id. Omitted fields inherit the plan catalog link (included defaults to 1 when the license is not in the catalog). A bare entry restores the license to pure catalog inheritance.
Base price configuration for a plan.
Base price amount for the plan, in major currency units (e.g. dollars).
Billing interval (e.g. 'month', 'year').
Number of intervals per billing cycle. Defaults to 1.
Base price amounts in additional currencies. The base 'amount' is in the org's default currency.
Three-letter Stripe-supported currency code (e.g. 'eur', 'gbp').
Price amount in this currency. Set explicitly per currency, not converted from the base amount.
Bills this many feature units when outstanding overage reaches it.
The ID of the feature to configure.
Number of free units included. Balance resets to this each interval for consumable features.
If true, customer has unlimited access to this feature.
Whether entity-level grants contribute to a shared customer balance.
Reset configuration for consumable features. Omit for non-consumable features like seats.
Interval at which balance resets (e.g. 'month', 'year'). For consumable features only.
Number of intervals between resets. Defaults to 1.
Pricing for usage beyond included units. Omit for free features.
Price per billing\_units after included usage. Either 'amount' or 'tiers' is required.
Amounts in additional currencies for this flat price. The base 'amount' is in the org's default currency. Only valid with 'amount', not 'tiers'.
Three-letter Stripe-supported currency code (e.g. 'eur', 'gbp').
Price amount in this currency. Set explicitly per currency, not converted from the base amount.
Tiered pricing. Either 'amount' or 'tiers' is required.
Three-letter Stripe-supported currency code (e.g. 'eur', 'gbp').
Per-unit amount for this tier in this currency.
Flat amount for this tier in this currency, if the tier uses one.
Billing interval. For consumable features, should match reset.interval.
Number of intervals per billing cycle. Defaults to 1.
Units per price increment. Usage is rounded UP when billed (e.g. billing\_units=100 means 101 rounds to 200).
'prepaid' for upfront payment (seats), 'usage\_based' for pay-as-you-go.
Max units purchasable beyond included. E.g. included=100, max\_purchase=300 allows 400 total. Null for no limit.
Proration settings for prepaid features. Controls mid-cycle quantity change billing.
Billing behavior when quantity increases mid-cycle.
Credit behavior when quantity decreases mid-cycle.
Rollover config for unused units. If set, unused included units carry over.
Max rollover units. Omit for unlimited rollover.
Maximum rollover as a percentage (0-100) of included + prepaid grant. Mutually exclusive with max.
When rolled over units expire.
Number of periods before expiry.
Overrides fields of this item's feature for customers on this plan (e.g. a credit system's credit\_schema).
For credit system features: replaces the feature's credit\_schema entirely for customers on this plan.
ID of the metered feature that draws from this credit system.
Number of metered-feature units priced together. Defaults to one when omitted.
Named rates chosen by event properties. The most specific match sets the rate; with no match the item's own rate applies.
Event properties this entry applies to. Every key must equal the tracked property, compared as strings.
Breaks ties between dimensions that match the same number of keys. Higher wins.
Inclusive upper usage boundary for this graduated tier. The final tier must be 'inf'.
Credits consumed per billing-unit group within this tier.
Named adjustments chosen by event properties. Every match applies: factors multiply, then adds are summed.
Event properties this entry applies to. Every key must equal the tracked property, compared as strings.
Multiplies the matched rate. All matching multipliers stack.
Added to the rate after every factor is applied, in credits per billing-unit group.
Inclusive upper usage boundary for this graduated tier. The final tier must be 'inf'.
Credits consumed per billing-unit group within this tier.
Credits consumed per billing-unit group.
For AI credit system features: replaces the feature's markup chain entirely for customers on this plan. An unset level means no markup at that level rather than inheriting the feature's.
Default percentage markup for customers on this plan. Use -100 to make usage free.
Per-provider markup percentages for customers on this plan.
Per-model markup overrides for customers on this plan.
Match items linked to this feature.
Match items with this billing method (prepaid or usage\_based).
Match items with this interval. Accepts either a BillingInterval (price-side) or a ResetInterval (reset-side, includes day/hour/minute) so price-less items keyed by reset.interval can be disambiguated.
Match items with this interval\_count. Disambiguates between items that share an interval but differ in count.
Match items whose grant equals this included usage. Omitted is a wildcard.
License links to drop, keyed by license\_plan\_id. Parallel to remove\_items.
The unique identifier of the subscribed plan.
Whether the plan was automatically enabled for the customer.
Whether this is an add-on plan rather than a base subscription.
Current status of the subscription.
Whether the subscription has overdue payments.
Timestamp when the subscription was canceled, or null if not canceled.
Timestamp when the subscription will expire, or null if no expiry set.
Timestamp when the trial period ends, or null if not on trial.
Timestamp when the subscription started.
Start timestamp of the current billing period.
End timestamp of the current billing period.
Number of units of this subscription (for per-seat plans).
Whether this subscription is attached at the customer level or entity level.
The full plan object if expanded.
Unique identifier for the plan.
Display name of the plan.
Optional description of the plan.
Group identifier for organizing related plans. Plans in the same group are mutually exclusive.
Version number of the plan. Incremented when plan configuration changes.
User-facing version identity. Defaults to v\{n} when the version is minted.
Whether this is the active version of the plan. At most one version is active.
Whether this is an add-on plan that can be attached alongside a main plan.
If true, this plan is automatically attached when a customer is created. Used for free plans.
Base recurring price for the plan. Null for free plans or usage-only plans.
Base price amount for the plan, in major currency units (e.g. dollars).
Base price amounts in additional currencies. The base 'amount' is in the org's default currency.
Three-letter Stripe-supported currency code (e.g. 'eur', 'gbp').
Price amount in this currency. Set explicitly per currency, not converted from the base amount.
Billing interval (e.g. 'month', 'year').
Number of intervals per billing cycle. Defaults to 1.
Display text for showing this price in pricing pages.
Main display text (e.g. '\$10' or '100 messages').
Secondary display text (e.g. 'per month' or 'then \$0.5 per 100').
Payment processors this base price is connected to. Omitted when unset.
Stripe price ID. For prepaid with included > 0 this is the V2 price.
Feature configurations included in this plan. Each item defines included units, pricing, and reset behavior for a feature.
Bills this many feature units when outstanding overage reaches it.
The ID of the feature this item configures.
The full feature object if expanded.
The ID of the feature, used to refer to it in other API calls like /track or /check.
The name of the feature.
The type of the feature
Singular and plural display names for the feature.
The singular display name for the feature.
The plural display name for the feature.
Credit cost schema for credit system features.
The ID of the metered feature (should be a single\_use feature).
The credit cost of the metered feature.
Whether or not the feature is archived.
Number of free units included. For consumable features, balance resets to this number each interval.
Whether the customer has unlimited access to this feature.
Whether entity-level grants contribute to a shared customer balance.
Reset configuration for consumable features. Null for non-consumable features like seats where usage persists across billing cycles.
The interval at which the feature balance resets (e.g. 'month', 'year'). For consumable features, usage resets to 0 and included units are restored.
Number of intervals between resets. Defaults to 1.
Pricing configuration for usage beyond included units. Null if feature is entirely free.
Price per billing\_units after included usage is consumed. Mutually exclusive with tiers.
Amounts in additional currencies for this flat price. The base 'amount' is in the org's default currency. Only valid with 'amount', not 'tiers' (tiered prices carry per-currency amounts on each tier).
Three-letter Stripe-supported currency code (e.g. 'eur', 'gbp').
Price amount in this currency. Set explicitly per currency, not converted from the base amount.
Tiered pricing configuration. Each tier's 'to' INCLUDES the included amount. Either 'tiers' or 'amount' is required.
Three-letter Stripe-supported currency code (e.g. 'eur', 'gbp').
Per-unit amount for this tier in this currency.
Flat amount for this tier in this currency, if the tier uses one.
Billing interval for this price. For consumable features, should match reset.interval.
Number of intervals per billing cycle. Defaults to 1.
Number of units per price increment. Usage is rounded UP to the nearest billing\_units when billed (e.g. billing\_units=100 means 101 usage rounds to 200).
'prepaid' for features like seats where customers pay upfront, 'usage\_based' for pay-as-you-go after included usage.
Maximum units a customer can purchase beyond included. E.g. if included=100 and max\_purchase=300, customer can use up to 400 total before usage is capped. Null for no limit.
Payment processors this item price is connected to. Omitted when unset.
Stripe price ID. For prepaid with included > 0 this is the V2 price.
Display text for showing this item in pricing pages.
Main display text (e.g. '\$10' or '100 messages').
Secondary display text (e.g. 'per month' or 'then \$0.5 per 100').
Rollover configuration for unused units. If set, unused included units roll over to the next period.
Maximum rollover units. Null for unlimited rollover.
Maximum rollover as a percentage (0-100) of included + prepaid grant. Mutually exclusive with max.
When rolled over units expire.
Number of periods before expiry.
Overrides fields of this item's feature for customers on this plan (e.g. a credit system's credit\_schema).
For credit system features: replaces the feature's credit\_schema entirely for customers on this plan.
ID of the metered feature that draws from this credit system.
Number of metered-feature units priced together. Defaults to one when omitted.
Named rates chosen by event properties. The most specific match sets the rate; with no match the item's own rate applies.
Event properties this entry applies to. Every key must equal the tracked property, compared as strings.
Breaks ties between dimensions that match the same number of keys. Higher wins.
Inclusive upper usage boundary for this graduated tier. The final tier must be 'inf'.
Credits consumed per billing-unit group within this tier.
Named adjustments chosen by event properties. Every match applies: factors multiply, then adds are summed.
Event properties this entry applies to. Every key must equal the tracked property, compared as strings.
Multiplies the matched rate. All matching multipliers stack.
Added to the rate after every factor is applied, in credits per billing-unit group.
Inclusive upper usage boundary for this graduated tier. The final tier must be 'inf'.
Credits consumed per billing-unit group within this tier.
Credits consumed per billing-unit group.
For AI credit system features: replaces the feature's markup chain entirely for customers on this plan. An unset level means no markup at that level rather than inheriting the feature's.
Default percentage markup for customers on this plan. Use -100 to make usage free.
Per-provider markup percentages for customers on this plan.
Per-model markup overrides for customers on this plan.
Payment processors this plan is connected to. Omitted when unset.
Stripe product ID this plan is billed under.
Extra Stripe product IDs aliased to this plan.
Every RevenueCat product that maps to this plan. Replaces the current set.
RevenueCat product ID that grants this plan when purchased.
Prepaid quantities granted when this specific RevenueCat product is purchased, in feature units.
Free trial configuration. If set, new customers can try this plan before being charged.
Number of duration\_type periods the trial lasts.
Unit of time for the trial duration ('day', 'month', 'year').
Whether a payment method is required to start the trial. If true, customer will be charged after trial ends.
Behavior when the trial ends. 'bill' charges the customer (default). 'revert' expires the trial and restores the customer's previous plan.
Unix timestamp (ms) when the plan was created.
Environment this plan belongs to ('sandbox' or 'live').
Whether the plan is archived. Archived plans cannot be attached to new customers.
Miscellaneous plan-level configuration flags.
If true, entitlements attached to this plan will still reset on schedule even when the customer's product is in a past\_due state.
Plan-level billing controls used as customer defaults.
List of auto top-up configurations per feature.
The ID of the feature (credit balance) to auto top-up.
Whether auto top-up is enabled.
When the balance drops below this threshold, an auto top-up will be purchased.
Amount of credits to add per auto top-up.
Optional rate limit to cap how often auto top-ups occur.
The time interval for the purchase limit window.
Number of intervals in the purchase limit window.
Maximum number of auto top-ups allowed within the interval.
When true, auto top-up creates a send\_invoice invoice instead of auto-charging.
List of overage spend limits per feature (caps overage spend).
Optional feature ID this spend limit applies to.
Whether the overage spend limit is enabled.
How overage\_limit is interpreted: an absolute overage cap (default) or a percentage of the main-plan allowance.
Overage cap for the feature: absolute units, or a percent (e.g. 120) when limit\_type is usage\_percentage.
When true, overage for this feature is not posted to Stripe. Usage tracking and balance resets still behave normally.
List of hard usage caps per feature (max units per interval).
The feature this usage limit applies to.
Whether this usage limit is enabled.
Maximum units allowed per interval.
Interval for the cap, aligned to the customer's billing cycle.
Window alignment. 'billing\_cycle' phases the interval to the customer's renewal time; 'utc' aligns to the UTC calendar.
When set, only usage from events whose properties match counts toward this cap. Omit to count all usage of the feature.
List of usage alert configurations per feature.
The feature ID this alert applies to.
Whether this usage alert is enabled.
The threshold value that triggers the alert. For usage or remaining, this is an absolute count. For usage\_percentage or remaining\_percentage, this is a percentage (0-100).
Whether the threshold is an absolute count or a percentage of the usage allowance or remaining balance.
What 100% means. balance: every grant on the feature. included: the plan allowance only. recurring: grants that reset. usage\_limit: the cap of the usage limit with the same feature and filter.
Only valid with basis usage\_limit. Points the alert at the usage limit carrying the same filter.
Optional user-defined label to distinguish multiple alerts on the same feature.
List of overage allowed controls per feature. When enabled, usage can exceed balance.
The feature ID this overage allowed control applies to.
Whether overage is allowed for this feature.
Arbitrary key-value metadata defined by you for your own use. Shared across all versions of the plan.
Whether the trial on this plan is available to this customer. For example, if the customer used the trial in the past, this will be false.
The customer's current status with this plan. 'active' if attached, 'scheduled' if pending activation.
Whether the customer's active instance of this plan is set to cancel.
Whether the customer is currently on a free trial of this plan.
The action that would occur if this plan were attached to the customer.
Deprecated. Use variant\_details.base\_plan\_id instead. If this is a variant, the ID of the base plan it was created from.
Details about how this variant relates to its latest base plan.
The ID of the base plan this variant was derived from.
The customization that transforms the base plan into this variant.
Base price configuration for a plan.
Base price amount for the plan, in major currency units (e.g. dollars).
Billing interval (e.g. 'month', 'year').
Number of intervals per billing cycle. Defaults to 1.
Base price amounts in additional currencies. The base 'amount' is in the org's default currency.
Three-letter Stripe-supported currency code (e.g. 'eur', 'gbp').
Price amount in this currency. Set explicitly per currency, not converted from the base amount.
Items to add to the plan.
Bills this many feature units when outstanding overage reaches it.
The ID of the feature to configure.
Number of free units included. Balance resets to this each interval for consumable features.
If true, customer has unlimited access to this feature.
Whether entity-level grants contribute to a shared customer balance.
Reset configuration for consumable features. Omit for non-consumable features like seats.
Interval at which balance resets (e.g. 'month', 'year'). For consumable features only.
Number of intervals between resets. Defaults to 1.
Pricing for usage beyond included units. Omit for free features.
Price per billing\_units after included usage. Either 'amount' or 'tiers' is required.
Amounts in additional currencies for this flat price. The base 'amount' is in the org's default currency. Only valid with 'amount', not 'tiers'.
Three-letter Stripe-supported currency code (e.g. 'eur', 'gbp').
Price amount in this currency. Set explicitly per currency, not converted from the base amount.
Tiered pricing. Either 'amount' or 'tiers' is required.
Three-letter Stripe-supported currency code (e.g. 'eur', 'gbp').
Per-unit amount for this tier in this currency.
Flat amount for this tier in this currency, if the tier uses one.
Billing interval. For consumable features, should match reset.interval.
Number of intervals per billing cycle. Defaults to 1.
Units per price increment. Usage is rounded UP when billed (e.g. billing\_units=100 means 101 rounds to 200).
'prepaid' for upfront payment (seats), 'usage\_based' for pay-as-you-go.
Max units purchasable beyond included. E.g. included=100, max\_purchase=300 allows 400 total. Null for no limit.
Proration settings for prepaid features. Controls mid-cycle quantity change billing.
Billing behavior when quantity increases mid-cycle.
Credit behavior when quantity decreases mid-cycle.
Rollover config for unused units. If set, unused included units carry over.
Max rollover units. Omit for unlimited rollover.
Maximum rollover as a percentage (0-100) of included + prepaid grant. Mutually exclusive with max.
When rolled over units expire.
Number of periods before expiry.
Overrides fields of this item's feature for customers on this plan (e.g. a credit system's credit\_schema).
For credit system features: replaces the feature's credit\_schema entirely for customers on this plan.
ID of the metered feature that draws from this credit system.
Number of metered-feature units priced together. Defaults to one when omitted.
Named rates chosen by event properties. The most specific match sets the rate; with no match the item's own rate applies.
Event properties this entry applies to. Every key must equal the tracked property, compared as strings.
Breaks ties between dimensions that match the same number of keys. Higher wins.
Inclusive upper usage boundary for this graduated tier. The final tier must be 'inf'.
Credits consumed per billing-unit group within this tier.
Named adjustments chosen by event properties. Every match applies: factors multiply, then adds are summed.
Event properties this entry applies to. Every key must equal the tracked property, compared as strings.
Multiplies the matched rate. All matching multipliers stack.
Added to the rate after every factor is applied, in credits per billing-unit group.
Inclusive upper usage boundary for this graduated tier. The final tier must be 'inf'.
Credits consumed per billing-unit group within this tier.
Credits consumed per billing-unit group.
For AI credit system features: replaces the feature's markup chain entirely for customers on this plan. An unset level means no markup at that level rather than inheriting the feature's.
Default percentage markup for customers on this plan. Use -100 to make usage free.
Per-provider markup percentages for customers on this plan.
Per-model markup overrides for customers on this plan.
Filters selecting items to remove from the plan.
Match items linked to this feature.
Match items with this billing method (prepaid or usage\_based).
Match items with this interval. Accepts either a BillingInterval (price-side) or a ResetInterval (reset-side, includes day/hour/minute) so price-less items keyed by reset.interval can be disambiguated.
Match items with this interval\_count. Disambiguates between items that share an interval but differ in count.
Match items whose grant equals this included usage. Omitted is a wildcard.
Free trial configuration for a plan.
Number of duration\_type periods the trial lasts.
Unit of time for the trial ('day', 'month', 'year').
If true, a payment method is required to start the trial and the customer is charged when it ends. Defaults to false.
Behavior when the trial ends. 'bill' charges the customer (default). 'revert' expires the trial and restores the customer's previous plan.
Override the plan's billing controls (auto top-ups, spend limits, usage limits, usage alerts, overage allowed) for this customer.
List of auto top-up configurations per feature.
The ID of the feature (credit balance) to auto top-up.
Whether auto top-up is enabled.
When the balance drops below this threshold, an auto top-up will be purchased.
Amount of credits to add per auto top-up.
Optional rate limit to cap how often auto top-ups occur. Pass count to set the current window's consumed top-ups.
The time interval for the purchase limit window.
Number of intervals in the purchase limit window.
Maximum number of auto top-ups allowed within the interval.
Set the current window's consumed auto top-up count. Omit to leave runtime state unchanged.
When true, auto top-up creates a send\_invoice invoice instead of auto-charging.
List of overage spend limits per feature (caps overage spend).
Optional feature ID this spend limit applies to.
Whether the overage spend limit is enabled.
How overage\_limit is interpreted: an absolute overage cap (default) or a percentage of the main-plan allowance.
Overage cap for the feature: absolute units, or a percent (e.g. 120) when limit\_type is usage\_percentage.
When true, overage for this feature is not posted to Stripe. Usage tracking and balance resets still behave normally.
List of hard usage caps per feature (max units per interval).
The feature this usage limit applies to.
Whether this usage limit is enabled.
Maximum units allowed per interval.
Interval for the cap, aligned to the customer's billing cycle.
Window alignment. 'billing\_cycle' phases the interval to the customer's renewal time; 'utc' aligns to the UTC calendar.
When set, only usage from events whose properties match counts toward this cap. Omit to count all usage of the feature.
List of usage alert configurations per feature.
The feature ID this alert applies to.
Whether this usage alert is enabled.
The threshold value that triggers the alert. For usage or remaining, this is an absolute count. For usage\_percentage or remaining\_percentage, this is a percentage (0-100).
Whether the threshold is an absolute count or a percentage of the usage allowance or remaining balance.
What 100% means. balance: every grant on the feature. included: the plan allowance only. recurring: grants that reset. usage\_limit: the cap of the usage limit with the same feature and filter.
Only valid with basis usage\_limit. Points the alert at the usage limit carrying the same filter.
Optional user-defined label to distinguish multiple alerts on the same feature.
List of overage allowed controls per feature. When enabled, usage can exceed balance.
The feature ID this overage allowed control applies to.
Whether overage is allowed for this feature.
License links to add or override for this customer, keyed by license\_plan\_id. Omitted fields inherit the plan catalog link (included defaults to 1 when the license is not in the catalog). A bare entry restores the license to pure catalog inheritance.
Base price configuration for a plan.
Base price amount for the plan, in major currency units (e.g. dollars).
Billing interval (e.g. 'month', 'year').
Number of intervals per billing cycle. Defaults to 1.
Base price amounts in additional currencies. The base 'amount' is in the org's default currency.
Three-letter Stripe-supported currency code (e.g. 'eur', 'gbp').
Price amount in this currency. Set explicitly per currency, not converted from the base amount.
Bills this many feature units when outstanding overage reaches it.
The ID of the feature to configure.
Number of free units included. Balance resets to this each interval for consumable features.
If true, customer has unlimited access to this feature.
Whether entity-level grants contribute to a shared customer balance.
Reset configuration for consumable features. Omit for non-consumable features like seats.
Interval at which balance resets (e.g. 'month', 'year'). For consumable features only.
Number of intervals between resets. Defaults to 1.
Pricing for usage beyond included units. Omit for free features.
Price per billing\_units after included usage. Either 'amount' or 'tiers' is required.
Amounts in additional currencies for this flat price. The base 'amount' is in the org's default currency. Only valid with 'amount', not 'tiers'.
Three-letter Stripe-supported currency code (e.g. 'eur', 'gbp').
Price amount in this currency. Set explicitly per currency, not converted from the base amount.
Tiered pricing. Either 'amount' or 'tiers' is required.
Three-letter Stripe-supported currency code (e.g. 'eur', 'gbp').
Per-unit amount for this tier in this currency.
Flat amount for this tier in this currency, if the tier uses one.
Billing interval. For consumable features, should match reset.interval.
Number of intervals per billing cycle. Defaults to 1.
Units per price increment. Usage is rounded UP when billed (e.g. billing\_units=100 means 101 rounds to 200).
'prepaid' for upfront payment (seats), 'usage\_based' for pay-as-you-go.
Max units purchasable beyond included. E.g. included=100, max\_purchase=300 allows 400 total. Null for no limit.
Proration settings for prepaid features. Controls mid-cycle quantity change billing.
Billing behavior when quantity increases mid-cycle.
Credit behavior when quantity decreases mid-cycle.
Rollover config for unused units. If set, unused included units carry over.
Max rollover units. Omit for unlimited rollover.
Maximum rollover as a percentage (0-100) of included + prepaid grant. Mutually exclusive with max.
When rolled over units expire.
Number of periods before expiry.
Overrides fields of this item's feature for customers on this plan (e.g. a credit system's credit\_schema).
For credit system features: replaces the feature's credit\_schema entirely for customers on this plan.
ID of the metered feature that draws from this credit system.
Number of metered-feature units priced together. Defaults to one when omitted.
Named rates chosen by event properties. The most specific match sets the rate; with no match the item's own rate applies.
Event properties this entry applies to. Every key must equal the tracked property, compared as strings.
Breaks ties between dimensions that match the same number of keys. Higher wins.
Inclusive upper usage boundary for this graduated tier. The final tier must be 'inf'.
Credits consumed per billing-unit group within this tier.
Named adjustments chosen by event properties. Every match applies: factors multiply, then adds are summed.
Event properties this entry applies to. Every key must equal the tracked property, compared as strings.
Multiplies the matched rate. All matching multipliers stack.
Added to the rate after every factor is applied, in credits per billing-unit group.
Inclusive upper usage boundary for this graduated tier. The final tier must be 'inf'.
Credits consumed per billing-unit group within this tier.
Credits consumed per billing-unit group.
For AI credit system features: replaces the feature's markup chain entirely for customers on this plan. An unset level means no markup at that level rather than inheriting the feature's.
Default percentage markup for customers on this plan. Use -100 to make usage free.
Per-provider markup percentages for customers on this plan.
Per-model markup overrides for customers on this plan.
Match items linked to this feature.
Match items with this billing method (prepaid or usage\_based).
Match items with this interval. Accepts either a BillingInterval (price-side) or a ResetInterval (reset-side, includes day/hour/minute) so price-less items keyed by reset.interval can be disambiguated.
Match items with this interval\_count. Disambiguates between items that share an interval but differ in count.
Match items whose grant equals this included usage. Omitted is a wildcard.
License links to drop, keyed by license\_plan\_id. Parallel to remove\_items.
The unique identifier of the purchased plan.
Timestamp when the purchase expires, or null for lifetime access.
Timestamp when the purchase was made.
Number of units purchased.
Whether this purchase is attached at the customer level or entity level.
The feature ID this balance is for.
The full feature object if expanded.
The unique identifier for this feature, used in /check and /track calls.
Human-readable name displayed in the dashboard and billing UI.
Feature type: 'boolean' for on/off access, 'metered' for usage-tracked features, 'credit\_system' for unified credit pools, 'ai\_credit\_system' for model-based token pricing.
For metered features: true if usage resets periodically (API calls, credits), false if allocated persistently (seats, storage).
Event names that trigger this feature's balance. Allows multiple features to respond to a single event.
For classic credit systems: maps metered features to flat or graduated credit costs.
ID of the metered feature that draws from this credit system.
Number of metered-feature units priced together. Defaults to one when omitted.
Named rates chosen by event properties. The most specific match sets the rate; with no match the item's own rate applies.
Event properties this entry applies to. Every key must equal the tracked property, compared as strings.
Breaks ties between dimensions that match the same number of keys. Higher wins.
Inclusive upper usage boundary for this graduated tier. The final tier must be 'inf'.
Credits consumed per billing-unit group within this tier.
Named adjustments chosen by event properties. Every match applies: factors multiply, then adds are summed.
Event properties this entry applies to. Every key must equal the tracked property, compared as strings.
Multiplies the matched rate. All matching multipliers stack.
Added to the rate after every factor is applied, in credits per billing-unit group.
Inclusive upper usage boundary for this graduated tier. The final tier must be 'inf'.
Credits consumed per billing-unit group within this tier.
Credits consumed per billing-unit group.
Whether usage of this classic credit system should be itemized as invoice credits.
Per-model markup overrides for AI credit systems.
Default percentage markup for AI credit systems. Use -100 to make usage free.
Per-provider default markup percentages for AI credit systems.
Display names for the feature in billing UI and customer-facing components.
Singular form for UI display (e.g., 'API call', 'seat').
Plural form for UI display (e.g., 'API calls', 'seats').
Whether the feature is archived and hidden from the dashboard.
Processor mappings for this feature. Present when a Stripe product or meter is set.
Stripe product ID this feature's usage prices bill under.
Stripe meter ID used to create this feature's metered price.
Total balance granted (included + prepaid).
Remaining balance available for use.
Total usage consumed in the current period.
Whether this feature has unlimited usage.
Whether usage beyond the granted balance is allowed (with overage charges).
Maximum quantity that can be purchased as a top-up, or null for unlimited.
Timestamp when the balance will reset, or null for no reset.
Detailed breakdown of balance sources when stacking multiple plans or grants.
The unique identifier for this balance breakdown.
The plan ID this balance originates from, or null for standalone balances.
Amount granted from the plan's included usage.
Amount granted from prepaid purchases or top-ups.
Remaining balance available for use.
Amount consumed in the current period.
Whether this balance has unlimited usage.
Reset configuration for this balance, or null if no reset.
The reset interval (hour, day, week, month, etc.) or 'multiple' if combined from different intervals.
Number of intervals between resets (eg. 2 for bi-monthly).
Timestamp when the balance will next reset.
Pricing configuration if this balance has usage-based pricing.
The per-unit price amount.
Tiered pricing configuration if applicable.
How tiers are applied: graduated (split across bands) or volume (flat rate for the matched tier).
The number of units per billing increment (eg. \$9 / 250 units).
Whether usage is prepaid or billed pay-per-use.
Maximum quantity that can be purchased, or null for unlimited.
Timestamp when this balance expires, or null for no expiration.
Rollover balances carried over from previous periods.
Amount originally rolled over from a previous period, before any of it was consumed.
Amount of balance rolled over from a previous period.
Timestamp when the rollover balance expires.
The unique identifier for this flag.
The plan ID this flag originates from, or null for standalone flags.
Timestamp when this flag expires, or null for no expiration.
The feature ID this flag is for.
The full feature object if expanded.
The unique identifier for this feature, used in /check and /track calls.
Human-readable name displayed in the dashboard and billing UI.
Feature type: 'boolean' for on/off access, 'metered' for usage-tracked features, 'credit\_system' for unified credit pools, 'ai\_credit\_system' for model-based token pricing.
For metered features: true if usage resets periodically (API calls, credits), false if allocated persistently (seats, storage).
Event names that trigger this feature's balance. Allows multiple features to respond to a single event.
For classic credit systems: maps metered features to flat or graduated credit costs.
ID of the metered feature that draws from this credit system.
Number of metered-feature units priced together. Defaults to one when omitted.
Named rates chosen by event properties. The most specific match sets the rate; with no match the item's own rate applies.
Event properties this entry applies to. Every key must equal the tracked property, compared as strings.
Breaks ties between dimensions that match the same number of keys. Higher wins.
Inclusive upper usage boundary for this graduated tier. The final tier must be 'inf'.
Credits consumed per billing-unit group within this tier.
Named adjustments chosen by event properties. Every match applies: factors multiply, then adds are summed.
Event properties this entry applies to. Every key must equal the tracked property, compared as strings.
Multiplies the matched rate. All matching multipliers stack.
Added to the rate after every factor is applied, in credits per billing-unit group.
Inclusive upper usage boundary for this graduated tier. The final tier must be 'inf'.
Credits consumed per billing-unit group within this tier.
Credits consumed per billing-unit group.
Whether usage of this classic credit system should be itemized as invoice credits.
Per-model markup overrides for AI credit systems.
Default percentage markup for AI credit systems. Use -100 to make usage free.
Per-provider default markup percentages for AI credit systems.
Display names for the feature in billing UI and customer-facing components.
Singular form for UI display (e.g., 'API call', 'seat').
Plural form for UI display (e.g., 'API calls', 'seats').
Whether the feature is archived and hidden from the dashboard.
Processor mappings for this feature. Present when a Stripe product or meter is set.
Stripe product ID this feature's usage prices bill under.
Stripe meter ID used to create this feature's metered price.
Billing controls for the entity.
List of spend limits per feature. Each entry caps overage (overage\_limit) and/or per-interval usage (usage\_limit).
Optional feature ID this spend limit applies to.
Whether the overage spend limit is enabled.
How overage\_limit is interpreted: an absolute overage cap (default) or a percentage of the main-plan allowance.
Overage cap for the feature: absolute units, or a percent (e.g. 120) when limit\_type is usage\_percentage.
When true, overage for this feature is not posted to Stripe. Usage tracking and balance resets still behave normally.
Response-only: whether the entry is a customer-level override or inherited from an attached plan's defaults.
List of hard usage caps per feature for this entity. An entity entry overrides the customer's for that feature.
The feature this usage limit applies to.
Whether this usage limit is enabled.
Maximum units allowed per interval.
Interval for the cap, aligned to the customer's billing cycle.
Window alignment. 'billing\_cycle' phases the interval to the customer's renewal time; 'utc' aligns to the UTC calendar.
When set, only usage from events whose properties match counts toward this cap. Omit to count all usage of the feature.
Usage consumed in the active interval, stored in the usage-window counter.
Response-only: whether the entry is a customer-level override or inherited from an attached plan's defaults.
List of usage alert configurations per feature.
The feature ID this alert applies to.
Whether this usage alert is enabled.
The threshold value that triggers the alert. For usage or remaining, this is an absolute count. For usage\_percentage or remaining\_percentage, this is a percentage (0-100).
Whether the threshold is an absolute count or a percentage of the usage allowance or remaining balance.
What 100% means. balance: every grant on the feature. included: the plan allowance only. recurring: grants that reset. usage\_limit: the cap of the usage limit with the same feature and filter.
Only valid with basis usage\_limit. Points the alert at the usage limit carrying the same filter.
Optional user-defined label to distinguish multiple alerts on the same feature.
Response-only: whether the entry is a customer-level override or inherited from an attached plan's defaults.
List of overage allowed controls per feature. When enabled, usage can exceed balance.
The feature ID this overage allowed control applies to.
Whether overage is allowed for this feature.
Response-only: whether the entry is a customer-level override or inherited from an attached plan's defaults.
Invoices for this entity (only included when expand=invoices)
Array of plan IDs included in this invoice
The Stripe invoice ID
The billing processor that owns this invoice.
The status of the invoice
The total amount of the invoice
The currency code for the invoice
Timestamp when the invoice was created
URL to the Stripe-hosted invoice page
```json 200 theme={null}
{
"id": "seat_42",
"name": "Seat 42",
"customer_id": "cus_123",
"feature_id": "seats",
"created_at": 1771409161016,
"env": "sandbox",
"subscriptions": [
{
"plan_id": "pro_plan",
"auto_enable": true,
"add_on": false,
"status": "active",
"past_due": false,
"canceled_at": null,
"expires_at": null,
"trial_ends_at": null,
"started_at": 1771431921437,
"current_period_start": 1771431921437,
"current_period_end": 1771999921437,
"quantity": 1
}
],
"purchases": [],
"balances": {
"messages": {
"feature_id": "messages",
"granted": 100,
"remaining": 72,
"usage": 28,
"unlimited": false,
"overage_allowed": false,
"max_purchase": null,
"next_reset_at": 1773851121437,
"breakdown": [
{
"id": "cus_ent_39qmLooixXLAqMywgXywjAz96rV",
"plan_id": "pro_plan",
"included_grant": 100,
"prepaid_grant": 0,
"remaining": 72,
"usage": 28,
"unlimited": false,
"reset": {
"interval": "month",
"resets_at": 1773851121437
},
"price": null,
"expires_at": null
}
]
}
},
"invoices": []
}
```
# List Entities
Source: https://docs.useautumn.com/api-reference/entities/listEntities
openapi POST /v1/entities.list
Lists entities across the organization with pagination and optional filters.
Use this to page through entities globally, including filtering by plans inherited from parent customers or attached directly to entities.
### Body Parameters
Opaque pagination cursor. Empty string (default) requests the first page; use next\_cursor from a prior response for subsequent pages.
Number of items to return. Default 50, hard ceiling 5000.
Filter by plan ID and version. Returns entities with active subscriptions to this plan, including plans inherited from the parent customer.
Filter customer products used for entity hydration and plan matching. Defaults to active and scheduled.
Search entities by id or name.
Filter by parent customer processor type (stripe, revenuecat, vercel).
Restrict the response to entities owned by this customer id. Use to bulk-fetch all entities for one customer in a single paginated call instead of iterating entities.get.
### Response
Items for current page.
The unique identifier of the entity
The name of the entity
The customer ID this entity belongs to
The feature ID this entity belongs to
Unix timestamp when the entity was created
The environment (sandbox/live)
The unique identifier of this subscription. If a subscription\_id was provided at attach time, it is used; otherwise, falls back to the internal ID.
The full plan object if expanded.
Unique identifier for the plan.
Display name of the plan.
Optional description of the plan.
Group identifier for organizing related plans. Plans in the same group are mutually exclusive.
Version number of the plan. Incremented when plan configuration changes.
User-facing version identity. Defaults to v\{n} when the version is minted.
Whether this is the active version of the plan. At most one version is active.
Whether this is an add-on plan that can be attached alongside a main plan.
If true, this plan is automatically attached when a customer is created. Used for free plans.
Base recurring price for the plan. Null for free plans or usage-only plans.
Base price amount for the plan, in major currency units (e.g. dollars).
Base price amounts in additional currencies. The base 'amount' is in the org's default currency.
Three-letter Stripe-supported currency code (e.g. 'eur', 'gbp').
Price amount in this currency. Set explicitly per currency, not converted from the base amount.
Billing interval (e.g. 'month', 'year').
Number of intervals per billing cycle. Defaults to 1.
Display text for showing this price in pricing pages.
Main display text (e.g. '\$10' or '100 messages').
Secondary display text (e.g. 'per month' or 'then \$0.5 per 100').
Payment processors this base price is connected to. Omitted when unset.
Stripe price ID. For prepaid with included > 0 this is the V2 price.
Feature configurations included in this plan. Each item defines included units, pricing, and reset behavior for a feature.
Bills this many feature units when outstanding overage reaches it.
The ID of the feature this item configures.
The full feature object if expanded.
The ID of the feature, used to refer to it in other API calls like /track or /check.
The name of the feature.
The type of the feature
Singular and plural display names for the feature.
The singular display name for the feature.
The plural display name for the feature.
Credit cost schema for credit system features.
The ID of the metered feature (should be a single\_use feature).
The credit cost of the metered feature.
Whether or not the feature is archived.
Number of free units included. For consumable features, balance resets to this number each interval.
Whether the customer has unlimited access to this feature.
Whether entity-level grants contribute to a shared customer balance.
Reset configuration for consumable features. Null for non-consumable features like seats where usage persists across billing cycles.
The interval at which the feature balance resets (e.g. 'month', 'year'). For consumable features, usage resets to 0 and included units are restored.
Number of intervals between resets. Defaults to 1.
Pricing configuration for usage beyond included units. Null if feature is entirely free.
Price per billing\_units after included usage is consumed. Mutually exclusive with tiers.
Amounts in additional currencies for this flat price. The base 'amount' is in the org's default currency. Only valid with 'amount', not 'tiers' (tiered prices carry per-currency amounts on each tier).
Three-letter Stripe-supported currency code (e.g. 'eur', 'gbp').
Price amount in this currency. Set explicitly per currency, not converted from the base amount.
Tiered pricing configuration. Each tier's 'to' INCLUDES the included amount. Either 'tiers' or 'amount' is required.
Three-letter Stripe-supported currency code (e.g. 'eur', 'gbp').
Per-unit amount for this tier in this currency.
Flat amount for this tier in this currency, if the tier uses one.
Billing interval for this price. For consumable features, should match reset.interval.
Number of intervals per billing cycle. Defaults to 1.
Number of units per price increment. Usage is rounded UP to the nearest billing\_units when billed (e.g. billing\_units=100 means 101 usage rounds to 200).
'prepaid' for features like seats where customers pay upfront, 'usage\_based' for pay-as-you-go after included usage.
Maximum units a customer can purchase beyond included. E.g. if included=100 and max\_purchase=300, customer can use up to 400 total before usage is capped. Null for no limit.
Payment processors this item price is connected to. Omitted when unset.
Stripe price ID. For prepaid with included > 0 this is the V2 price.
Display text for showing this item in pricing pages.
Main display text (e.g. '\$10' or '100 messages').
Secondary display text (e.g. 'per month' or 'then \$0.5 per 100').
Rollover configuration for unused units. If set, unused included units roll over to the next period.
Maximum rollover units. Null for unlimited rollover.
Maximum rollover as a percentage (0-100) of included + prepaid grant. Mutually exclusive with max.
When rolled over units expire.
Number of periods before expiry.
Overrides fields of this item's feature for customers on this plan (e.g. a credit system's credit\_schema).
For credit system features: replaces the feature's credit\_schema entirely for customers on this plan.
ID of the metered feature that draws from this credit system.
Number of metered-feature units priced together. Defaults to one when omitted.
Named rates chosen by event properties. The most specific match sets the rate; with no match the item's own rate applies.
Event properties this entry applies to. Every key must equal the tracked property, compared as strings.
Breaks ties between dimensions that match the same number of keys. Higher wins.
Inclusive upper usage boundary for this graduated tier. The final tier must be 'inf'.
Credits consumed per billing-unit group within this tier.
Named adjustments chosen by event properties. Every match applies: factors multiply, then adds are summed.
Event properties this entry applies to. Every key must equal the tracked property, compared as strings.
Multiplies the matched rate. All matching multipliers stack.
Added to the rate after every factor is applied, in credits per billing-unit group.
Inclusive upper usage boundary for this graduated tier. The final tier must be 'inf'.
Credits consumed per billing-unit group within this tier.
Credits consumed per billing-unit group.
For AI credit system features: replaces the feature's markup chain entirely for customers on this plan. An unset level means no markup at that level rather than inheriting the feature's.
Default percentage markup for customers on this plan. Use -100 to make usage free.
Per-provider markup percentages for customers on this plan.
Per-model markup overrides for customers on this plan.
Payment processors this plan is connected to. Omitted when unset.
Stripe product ID this plan is billed under.
Extra Stripe product IDs aliased to this plan.
Every RevenueCat product that maps to this plan. Replaces the current set.
RevenueCat product ID that grants this plan when purchased.
Prepaid quantities granted when this specific RevenueCat product is purchased, in feature units.
Free trial configuration. If set, new customers can try this plan before being charged.
Number of duration\_type periods the trial lasts.
Unit of time for the trial duration ('day', 'month', 'year').
Whether a payment method is required to start the trial. If true, customer will be charged after trial ends.
Behavior when the trial ends. 'bill' charges the customer (default). 'revert' expires the trial and restores the customer's previous plan.
Unix timestamp (ms) when the plan was created.
Environment this plan belongs to ('sandbox' or 'live').
Whether the plan is archived. Archived plans cannot be attached to new customers.
Miscellaneous plan-level configuration flags.
If true, entitlements attached to this plan will still reset on schedule even when the customer's product is in a past\_due state.
Plan-level billing controls used as customer defaults.
List of auto top-up configurations per feature.
The ID of the feature (credit balance) to auto top-up.
Whether auto top-up is enabled.
When the balance drops below this threshold, an auto top-up will be purchased.
Amount of credits to add per auto top-up.
Optional rate limit to cap how often auto top-ups occur.
The time interval for the purchase limit window.
Number of intervals in the purchase limit window.
Maximum number of auto top-ups allowed within the interval.
When true, auto top-up creates a send\_invoice invoice instead of auto-charging.
List of overage spend limits per feature (caps overage spend).
Optional feature ID this spend limit applies to.
Whether the overage spend limit is enabled.
How overage\_limit is interpreted: an absolute overage cap (default) or a percentage of the main-plan allowance.
Overage cap for the feature: absolute units, or a percent (e.g. 120) when limit\_type is usage\_percentage.
When true, overage for this feature is not posted to Stripe. Usage tracking and balance resets still behave normally.
List of hard usage caps per feature (max units per interval).
The feature this usage limit applies to.
Whether this usage limit is enabled.
Maximum units allowed per interval.
Interval for the cap, aligned to the customer's billing cycle.
Window alignment. 'billing\_cycle' phases the interval to the customer's renewal time; 'utc' aligns to the UTC calendar.
When set, only usage from events whose properties match counts toward this cap. Omit to count all usage of the feature.
List of usage alert configurations per feature.
The feature ID this alert applies to.
Whether this usage alert is enabled.
The threshold value that triggers the alert. For usage or remaining, this is an absolute count. For usage\_percentage or remaining\_percentage, this is a percentage (0-100).
Whether the threshold is an absolute count or a percentage of the usage allowance or remaining balance.
What 100% means. balance: every grant on the feature. included: the plan allowance only. recurring: grants that reset. usage\_limit: the cap of the usage limit with the same feature and filter.
Only valid with basis usage\_limit. Points the alert at the usage limit carrying the same filter.
Optional user-defined label to distinguish multiple alerts on the same feature.
List of overage allowed controls per feature. When enabled, usage can exceed balance.
The feature ID this overage allowed control applies to.
Whether overage is allowed for this feature.
Arbitrary key-value metadata defined by you for your own use. Shared across all versions of the plan.
Whether the trial on this plan is available to this customer. For example, if the customer used the trial in the past, this will be false.
The customer's current status with this plan. 'active' if attached, 'scheduled' if pending activation.
Whether the customer's active instance of this plan is set to cancel.
Whether the customer is currently on a free trial of this plan.
The action that would occur if this plan were attached to the customer.
Deprecated. Use variant\_details.base\_plan\_id instead. If this is a variant, the ID of the base plan it was created from.
Details about how this variant relates to its latest base plan.
The ID of the base plan this variant was derived from.
The customization that transforms the base plan into this variant.
Base price configuration for a plan.
Base price amount for the plan, in major currency units (e.g. dollars).
Billing interval (e.g. 'month', 'year').
Number of intervals per billing cycle. Defaults to 1.
Base price amounts in additional currencies. The base 'amount' is in the org's default currency.
Three-letter Stripe-supported currency code (e.g. 'eur', 'gbp').
Price amount in this currency. Set explicitly per currency, not converted from the base amount.
Items to add to the plan.
Bills this many feature units when outstanding overage reaches it.
The ID of the feature to configure.
Number of free units included. Balance resets to this each interval for consumable features.
If true, customer has unlimited access to this feature.
Whether entity-level grants contribute to a shared customer balance.
Reset configuration for consumable features. Omit for non-consumable features like seats.
Interval at which balance resets (e.g. 'month', 'year'). For consumable features only.
Number of intervals between resets. Defaults to 1.
Pricing for usage beyond included units. Omit for free features.
Price per billing\_units after included usage. Either 'amount' or 'tiers' is required.
Amounts in additional currencies for this flat price. The base 'amount' is in the org's default currency. Only valid with 'amount', not 'tiers'.
Three-letter Stripe-supported currency code (e.g. 'eur', 'gbp').
Price amount in this currency. Set explicitly per currency, not converted from the base amount.
Tiered pricing. Either 'amount' or 'tiers' is required.
Three-letter Stripe-supported currency code (e.g. 'eur', 'gbp').
Per-unit amount for this tier in this currency.
Flat amount for this tier in this currency, if the tier uses one.
Billing interval. For consumable features, should match reset.interval.
Number of intervals per billing cycle. Defaults to 1.
Units per price increment. Usage is rounded UP when billed (e.g. billing\_units=100 means 101 rounds to 200).
'prepaid' for upfront payment (seats), 'usage\_based' for pay-as-you-go.
Max units purchasable beyond included. E.g. included=100, max\_purchase=300 allows 400 total. Null for no limit.
Proration settings for prepaid features. Controls mid-cycle quantity change billing.
Billing behavior when quantity increases mid-cycle.
Credit behavior when quantity decreases mid-cycle.
Rollover config for unused units. If set, unused included units carry over.
Max rollover units. Omit for unlimited rollover.
Maximum rollover as a percentage (0-100) of included + prepaid grant. Mutually exclusive with max.
When rolled over units expire.
Number of periods before expiry.
Overrides fields of this item's feature for customers on this plan (e.g. a credit system's credit\_schema).
For credit system features: replaces the feature's credit\_schema entirely for customers on this plan.
ID of the metered feature that draws from this credit system.
Number of metered-feature units priced together. Defaults to one when omitted.
Named rates chosen by event properties. The most specific match sets the rate; with no match the item's own rate applies.
Event properties this entry applies to. Every key must equal the tracked property, compared as strings.
Breaks ties between dimensions that match the same number of keys. Higher wins.
Inclusive upper usage boundary for this graduated tier. The final tier must be 'inf'.
Credits consumed per billing-unit group within this tier.
Named adjustments chosen by event properties. Every match applies: factors multiply, then adds are summed.
Event properties this entry applies to. Every key must equal the tracked property, compared as strings.
Multiplies the matched rate. All matching multipliers stack.
Added to the rate after every factor is applied, in credits per billing-unit group.
Inclusive upper usage boundary for this graduated tier. The final tier must be 'inf'.
Credits consumed per billing-unit group within this tier.
Credits consumed per billing-unit group.
For AI credit system features: replaces the feature's markup chain entirely for customers on this plan. An unset level means no markup at that level rather than inheriting the feature's.
Default percentage markup for customers on this plan. Use -100 to make usage free.
Per-provider markup percentages for customers on this plan.
Per-model markup overrides for customers on this plan.
Filters selecting items to remove from the plan.
Match items linked to this feature.
Match items with this billing method (prepaid or usage\_based).
Match items with this interval. Accepts either a BillingInterval (price-side) or a ResetInterval (reset-side, includes day/hour/minute) so price-less items keyed by reset.interval can be disambiguated.
Match items with this interval\_count. Disambiguates between items that share an interval but differ in count.
Match items whose grant equals this included usage. Omitted is a wildcard.
Free trial configuration for a plan.
Number of duration\_type periods the trial lasts.
Unit of time for the trial ('day', 'month', 'year').
If true, a payment method is required to start the trial and the customer is charged when it ends. Defaults to false.
Behavior when the trial ends. 'bill' charges the customer (default). 'revert' expires the trial and restores the customer's previous plan.
Override the plan's billing controls (auto top-ups, spend limits, usage limits, usage alerts, overage allowed) for this customer.
List of auto top-up configurations per feature.
The ID of the feature (credit balance) to auto top-up.
Whether auto top-up is enabled.
When the balance drops below this threshold, an auto top-up will be purchased.
Amount of credits to add per auto top-up.
Optional rate limit to cap how often auto top-ups occur. Pass count to set the current window's consumed top-ups.
The time interval for the purchase limit window.
Number of intervals in the purchase limit window.
Maximum number of auto top-ups allowed within the interval.
Set the current window's consumed auto top-up count. Omit to leave runtime state unchanged.
When true, auto top-up creates a send\_invoice invoice instead of auto-charging.
List of overage spend limits per feature (caps overage spend).
Optional feature ID this spend limit applies to.
Whether the overage spend limit is enabled.
How overage\_limit is interpreted: an absolute overage cap (default) or a percentage of the main-plan allowance.
Overage cap for the feature: absolute units, or a percent (e.g. 120) when limit\_type is usage\_percentage.
When true, overage for this feature is not posted to Stripe. Usage tracking and balance resets still behave normally.
List of hard usage caps per feature (max units per interval).
The feature this usage limit applies to.
Whether this usage limit is enabled.
Maximum units allowed per interval.
Interval for the cap, aligned to the customer's billing cycle.
Window alignment. 'billing\_cycle' phases the interval to the customer's renewal time; 'utc' aligns to the UTC calendar.
When set, only usage from events whose properties match counts toward this cap. Omit to count all usage of the feature.
List of usage alert configurations per feature.
The feature ID this alert applies to.
Whether this usage alert is enabled.
The threshold value that triggers the alert. For usage or remaining, this is an absolute count. For usage\_percentage or remaining\_percentage, this is a percentage (0-100).
Whether the threshold is an absolute count or a percentage of the usage allowance or remaining balance.
What 100% means. balance: every grant on the feature. included: the plan allowance only. recurring: grants that reset. usage\_limit: the cap of the usage limit with the same feature and filter.
Only valid with basis usage\_limit. Points the alert at the usage limit carrying the same filter.
Optional user-defined label to distinguish multiple alerts on the same feature.
List of overage allowed controls per feature. When enabled, usage can exceed balance.
The feature ID this overage allowed control applies to.
Whether overage is allowed for this feature.
License links to add or override for this customer, keyed by license\_plan\_id. Omitted fields inherit the plan catalog link (included defaults to 1 when the license is not in the catalog). A bare entry restores the license to pure catalog inheritance.
Base price configuration for a plan.
Base price amount for the plan, in major currency units (e.g. dollars).
Billing interval (e.g. 'month', 'year').
Number of intervals per billing cycle. Defaults to 1.
Base price amounts in additional currencies. The base 'amount' is in the org's default currency.
Three-letter Stripe-supported currency code (e.g. 'eur', 'gbp').
Price amount in this currency. Set explicitly per currency, not converted from the base amount.
Bills this many feature units when outstanding overage reaches it.
The ID of the feature to configure.
Number of free units included. Balance resets to this each interval for consumable features.
If true, customer has unlimited access to this feature.
Whether entity-level grants contribute to a shared customer balance.
Reset configuration for consumable features. Omit for non-consumable features like seats.
Interval at which balance resets (e.g. 'month', 'year'). For consumable features only.
Number of intervals between resets. Defaults to 1.
Pricing for usage beyond included units. Omit for free features.
Price per billing\_units after included usage. Either 'amount' or 'tiers' is required.
Amounts in additional currencies for this flat price. The base 'amount' is in the org's default currency. Only valid with 'amount', not 'tiers'.
Three-letter Stripe-supported currency code (e.g. 'eur', 'gbp').
Price amount in this currency. Set explicitly per currency, not converted from the base amount.
Tiered pricing. Either 'amount' or 'tiers' is required.
Three-letter Stripe-supported currency code (e.g. 'eur', 'gbp').
Per-unit amount for this tier in this currency.
Flat amount for this tier in this currency, if the tier uses one.
Billing interval. For consumable features, should match reset.interval.
Number of intervals per billing cycle. Defaults to 1.
Units per price increment. Usage is rounded UP when billed (e.g. billing\_units=100 means 101 rounds to 200).
'prepaid' for upfront payment (seats), 'usage\_based' for pay-as-you-go.
Max units purchasable beyond included. E.g. included=100, max\_purchase=300 allows 400 total. Null for no limit.
Proration settings for prepaid features. Controls mid-cycle quantity change billing.
Billing behavior when quantity increases mid-cycle.
Credit behavior when quantity decreases mid-cycle.
Rollover config for unused units. If set, unused included units carry over.
Max rollover units. Omit for unlimited rollover.
Maximum rollover as a percentage (0-100) of included + prepaid grant. Mutually exclusive with max.
When rolled over units expire.
Number of periods before expiry.
Overrides fields of this item's feature for customers on this plan (e.g. a credit system's credit\_schema).
For credit system features: replaces the feature's credit\_schema entirely for customers on this plan.
ID of the metered feature that draws from this credit system.
Number of metered-feature units priced together. Defaults to one when omitted.
Named rates chosen by event properties. The most specific match sets the rate; with no match the item's own rate applies.
Event properties this entry applies to. Every key must equal the tracked property, compared as strings.
Breaks ties between dimensions that match the same number of keys. Higher wins.
Inclusive upper usage boundary for this graduated tier. The final tier must be 'inf'.
Credits consumed per billing-unit group within this tier.
Named adjustments chosen by event properties. Every match applies: factors multiply, then adds are summed.
Event properties this entry applies to. Every key must equal the tracked property, compared as strings.
Multiplies the matched rate. All matching multipliers stack.
Added to the rate after every factor is applied, in credits per billing-unit group.
Inclusive upper usage boundary for this graduated tier. The final tier must be 'inf'.
Credits consumed per billing-unit group within this tier.
Credits consumed per billing-unit group.
For AI credit system features: replaces the feature's markup chain entirely for customers on this plan. An unset level means no markup at that level rather than inheriting the feature's.
Default percentage markup for customers on this plan. Use -100 to make usage free.
Per-provider markup percentages for customers on this plan.
Per-model markup overrides for customers on this plan.
Match items linked to this feature.
Match items with this billing method (prepaid or usage\_based).
Match items with this interval. Accepts either a BillingInterval (price-side) or a ResetInterval (reset-side, includes day/hour/minute) so price-less items keyed by reset.interval can be disambiguated.
Match items with this interval\_count. Disambiguates between items that share an interval but differ in count.
Match items whose grant equals this included usage. Omitted is a wildcard.
License links to drop, keyed by license\_plan\_id. Parallel to remove\_items.
The unique identifier of the subscribed plan.
Whether the plan was automatically enabled for the customer.
Whether this is an add-on plan rather than a base subscription.
Current status of the subscription.
Whether the subscription has overdue payments.
Timestamp when the subscription was canceled, or null if not canceled.
Timestamp when the subscription will expire, or null if no expiry set.
Timestamp when the trial period ends, or null if not on trial.
Timestamp when the subscription started.
Start timestamp of the current billing period.
End timestamp of the current billing period.
Number of units of this subscription (for per-seat plans).
Whether this subscription is attached at the customer level or entity level.
The full plan object if expanded.
Unique identifier for the plan.
Display name of the plan.
Optional description of the plan.
Group identifier for organizing related plans. Plans in the same group are mutually exclusive.
Version number of the plan. Incremented when plan configuration changes.
User-facing version identity. Defaults to v\{n} when the version is minted.
Whether this is the active version of the plan. At most one version is active.
Whether this is an add-on plan that can be attached alongside a main plan.
If true, this plan is automatically attached when a customer is created. Used for free plans.
Base recurring price for the plan. Null for free plans or usage-only plans.
Base price amount for the plan, in major currency units (e.g. dollars).
Base price amounts in additional currencies. The base 'amount' is in the org's default currency.
Three-letter Stripe-supported currency code (e.g. 'eur', 'gbp').
Price amount in this currency. Set explicitly per currency, not converted from the base amount.
Billing interval (e.g. 'month', 'year').
Number of intervals per billing cycle. Defaults to 1.
Display text for showing this price in pricing pages.
Main display text (e.g. '\$10' or '100 messages').
Secondary display text (e.g. 'per month' or 'then \$0.5 per 100').
Payment processors this base price is connected to. Omitted when unset.
Stripe price ID. For prepaid with included > 0 this is the V2 price.
Feature configurations included in this plan. Each item defines included units, pricing, and reset behavior for a feature.
Bills this many feature units when outstanding overage reaches it.
The ID of the feature this item configures.
The full feature object if expanded.
The ID of the feature, used to refer to it in other API calls like /track or /check.
The name of the feature.
The type of the feature
Singular and plural display names for the feature.
The singular display name for the feature.
The plural display name for the feature.
Credit cost schema for credit system features.
The ID of the metered feature (should be a single\_use feature).
The credit cost of the metered feature.
Whether or not the feature is archived.
Number of free units included. For consumable features, balance resets to this number each interval.
Whether the customer has unlimited access to this feature.
Whether entity-level grants contribute to a shared customer balance.
Reset configuration for consumable features. Null for non-consumable features like seats where usage persists across billing cycles.
The interval at which the feature balance resets (e.g. 'month', 'year'). For consumable features, usage resets to 0 and included units are restored.
Number of intervals between resets. Defaults to 1.
Pricing configuration for usage beyond included units. Null if feature is entirely free.
Price per billing\_units after included usage is consumed. Mutually exclusive with tiers.
Amounts in additional currencies for this flat price. The base 'amount' is in the org's default currency. Only valid with 'amount', not 'tiers' (tiered prices carry per-currency amounts on each tier).
Three-letter Stripe-supported currency code (e.g. 'eur', 'gbp').
Price amount in this currency. Set explicitly per currency, not converted from the base amount.
Tiered pricing configuration. Each tier's 'to' INCLUDES the included amount. Either 'tiers' or 'amount' is required.
Three-letter Stripe-supported currency code (e.g. 'eur', 'gbp').
Per-unit amount for this tier in this currency.
Flat amount for this tier in this currency, if the tier uses one.
Billing interval for this price. For consumable features, should match reset.interval.
Number of intervals per billing cycle. Defaults to 1.
Number of units per price increment. Usage is rounded UP to the nearest billing\_units when billed (e.g. billing\_units=100 means 101 usage rounds to 200).
'prepaid' for features like seats where customers pay upfront, 'usage\_based' for pay-as-you-go after included usage.
Maximum units a customer can purchase beyond included. E.g. if included=100 and max\_purchase=300, customer can use up to 400 total before usage is capped. Null for no limit.
Payment processors this item price is connected to. Omitted when unset.
Stripe price ID. For prepaid with included > 0 this is the V2 price.
Display text for showing this item in pricing pages.
Main display text (e.g. '\$10' or '100 messages').
Secondary display text (e.g. 'per month' or 'then \$0.5 per 100').
Rollover configuration for unused units. If set, unused included units roll over to the next period.
Maximum rollover units. Null for unlimited rollover.
Maximum rollover as a percentage (0-100) of included + prepaid grant. Mutually exclusive with max.
When rolled over units expire.
Number of periods before expiry.
Overrides fields of this item's feature for customers on this plan (e.g. a credit system's credit\_schema).
For credit system features: replaces the feature's credit\_schema entirely for customers on this plan.
ID of the metered feature that draws from this credit system.
Number of metered-feature units priced together. Defaults to one when omitted.
Named rates chosen by event properties. The most specific match sets the rate; with no match the item's own rate applies.
Event properties this entry applies to. Every key must equal the tracked property, compared as strings.
Breaks ties between dimensions that match the same number of keys. Higher wins.
Inclusive upper usage boundary for this graduated tier. The final tier must be 'inf'.
Credits consumed per billing-unit group within this tier.
Named adjustments chosen by event properties. Every match applies: factors multiply, then adds are summed.
Event properties this entry applies to. Every key must equal the tracked property, compared as strings.
Multiplies the matched rate. All matching multipliers stack.
Added to the rate after every factor is applied, in credits per billing-unit group.
Inclusive upper usage boundary for this graduated tier. The final tier must be 'inf'.
Credits consumed per billing-unit group within this tier.
Credits consumed per billing-unit group.
For AI credit system features: replaces the feature's markup chain entirely for customers on this plan. An unset level means no markup at that level rather than inheriting the feature's.
Default percentage markup for customers on this plan. Use -100 to make usage free.
Per-provider markup percentages for customers on this plan.
Per-model markup overrides for customers on this plan.
Payment processors this plan is connected to. Omitted when unset.
Stripe product ID this plan is billed under.
Extra Stripe product IDs aliased to this plan.
Every RevenueCat product that maps to this plan. Replaces the current set.
RevenueCat product ID that grants this plan when purchased.
Prepaid quantities granted when this specific RevenueCat product is purchased, in feature units.
Free trial configuration. If set, new customers can try this plan before being charged.
Number of duration\_type periods the trial lasts.
Unit of time for the trial duration ('day', 'month', 'year').
Whether a payment method is required to start the trial. If true, customer will be charged after trial ends.
Behavior when the trial ends. 'bill' charges the customer (default). 'revert' expires the trial and restores the customer's previous plan.
Unix timestamp (ms) when the plan was created.
Environment this plan belongs to ('sandbox' or 'live').
Whether the plan is archived. Archived plans cannot be attached to new customers.
Miscellaneous plan-level configuration flags.
If true, entitlements attached to this plan will still reset on schedule even when the customer's product is in a past\_due state.
Plan-level billing controls used as customer defaults.
List of auto top-up configurations per feature.
The ID of the feature (credit balance) to auto top-up.
Whether auto top-up is enabled.
When the balance drops below this threshold, an auto top-up will be purchased.
Amount of credits to add per auto top-up.
Optional rate limit to cap how often auto top-ups occur.
The time interval for the purchase limit window.
Number of intervals in the purchase limit window.
Maximum number of auto top-ups allowed within the interval.
When true, auto top-up creates a send\_invoice invoice instead of auto-charging.
List of overage spend limits per feature (caps overage spend).
Optional feature ID this spend limit applies to.
Whether the overage spend limit is enabled.
How overage\_limit is interpreted: an absolute overage cap (default) or a percentage of the main-plan allowance.
Overage cap for the feature: absolute units, or a percent (e.g. 120) when limit\_type is usage\_percentage.
When true, overage for this feature is not posted to Stripe. Usage tracking and balance resets still behave normally.
List of hard usage caps per feature (max units per interval).
The feature this usage limit applies to.
Whether this usage limit is enabled.
Maximum units allowed per interval.
Interval for the cap, aligned to the customer's billing cycle.
Window alignment. 'billing\_cycle' phases the interval to the customer's renewal time; 'utc' aligns to the UTC calendar.
When set, only usage from events whose properties match counts toward this cap. Omit to count all usage of the feature.
List of usage alert configurations per feature.
The feature ID this alert applies to.
Whether this usage alert is enabled.
The threshold value that triggers the alert. For usage or remaining, this is an absolute count. For usage\_percentage or remaining\_percentage, this is a percentage (0-100).
Whether the threshold is an absolute count or a percentage of the usage allowance or remaining balance.
What 100% means. balance: every grant on the feature. included: the plan allowance only. recurring: grants that reset. usage\_limit: the cap of the usage limit with the same feature and filter.
Only valid with basis usage\_limit. Points the alert at the usage limit carrying the same filter.
Optional user-defined label to distinguish multiple alerts on the same feature.
List of overage allowed controls per feature. When enabled, usage can exceed balance.
The feature ID this overage allowed control applies to.
Whether overage is allowed for this feature.
Arbitrary key-value metadata defined by you for your own use. Shared across all versions of the plan.
Whether the trial on this plan is available to this customer. For example, if the customer used the trial in the past, this will be false.
The customer's current status with this plan. 'active' if attached, 'scheduled' if pending activation.
Whether the customer's active instance of this plan is set to cancel.
Whether the customer is currently on a free trial of this plan.
The action that would occur if this plan were attached to the customer.
Deprecated. Use variant\_details.base\_plan\_id instead. If this is a variant, the ID of the base plan it was created from.
Details about how this variant relates to its latest base plan.
The ID of the base plan this variant was derived from.
The customization that transforms the base plan into this variant.
Base price configuration for a plan.
Base price amount for the plan, in major currency units (e.g. dollars).
Billing interval (e.g. 'month', 'year').
Number of intervals per billing cycle. Defaults to 1.
Base price amounts in additional currencies. The base 'amount' is in the org's default currency.
Three-letter Stripe-supported currency code (e.g. 'eur', 'gbp').
Price amount in this currency. Set explicitly per currency, not converted from the base amount.
Items to add to the plan.
Bills this many feature units when outstanding overage reaches it.
The ID of the feature to configure.
Number of free units included. Balance resets to this each interval for consumable features.
If true, customer has unlimited access to this feature.
Whether entity-level grants contribute to a shared customer balance.
Reset configuration for consumable features. Omit for non-consumable features like seats.
Interval at which balance resets (e.g. 'month', 'year'). For consumable features only.
Number of intervals between resets. Defaults to 1.
Pricing for usage beyond included units. Omit for free features.
Price per billing\_units after included usage. Either 'amount' or 'tiers' is required.
Amounts in additional currencies for this flat price. The base 'amount' is in the org's default currency. Only valid with 'amount', not 'tiers'.
Three-letter Stripe-supported currency code (e.g. 'eur', 'gbp').
Price amount in this currency. Set explicitly per currency, not converted from the base amount.
Tiered pricing. Either 'amount' or 'tiers' is required.
Three-letter Stripe-supported currency code (e.g. 'eur', 'gbp').
Per-unit amount for this tier in this currency.
Flat amount for this tier in this currency, if the tier uses one.
Billing interval. For consumable features, should match reset.interval.
Number of intervals per billing cycle. Defaults to 1.
Units per price increment. Usage is rounded UP when billed (e.g. billing\_units=100 means 101 rounds to 200).
'prepaid' for upfront payment (seats), 'usage\_based' for pay-as-you-go.
Max units purchasable beyond included. E.g. included=100, max\_purchase=300 allows 400 total. Null for no limit.
Proration settings for prepaid features. Controls mid-cycle quantity change billing.
Billing behavior when quantity increases mid-cycle.
Credit behavior when quantity decreases mid-cycle.
Rollover config for unused units. If set, unused included units carry over.
Max rollover units. Omit for unlimited rollover.
Maximum rollover as a percentage (0-100) of included + prepaid grant. Mutually exclusive with max.
When rolled over units expire.
Number of periods before expiry.
Overrides fields of this item's feature for customers on this plan (e.g. a credit system's credit\_schema).
For credit system features: replaces the feature's credit\_schema entirely for customers on this plan.
ID of the metered feature that draws from this credit system.
Number of metered-feature units priced together. Defaults to one when omitted.
Named rates chosen by event properties. The most specific match sets the rate; with no match the item's own rate applies.
Event properties this entry applies to. Every key must equal the tracked property, compared as strings.
Breaks ties between dimensions that match the same number of keys. Higher wins.
Inclusive upper usage boundary for this graduated tier. The final tier must be 'inf'.
Credits consumed per billing-unit group within this tier.
Named adjustments chosen by event properties. Every match applies: factors multiply, then adds are summed.
Event properties this entry applies to. Every key must equal the tracked property, compared as strings.
Multiplies the matched rate. All matching multipliers stack.
Added to the rate after every factor is applied, in credits per billing-unit group.
Inclusive upper usage boundary for this graduated tier. The final tier must be 'inf'.
Credits consumed per billing-unit group within this tier.
Credits consumed per billing-unit group.
For AI credit system features: replaces the feature's markup chain entirely for customers on this plan. An unset level means no markup at that level rather than inheriting the feature's.
Default percentage markup for customers on this plan. Use -100 to make usage free.
Per-provider markup percentages for customers on this plan.
Per-model markup overrides for customers on this plan.
Filters selecting items to remove from the plan.
Match items linked to this feature.
Match items with this billing method (prepaid or usage\_based).
Match items with this interval. Accepts either a BillingInterval (price-side) or a ResetInterval (reset-side, includes day/hour/minute) so price-less items keyed by reset.interval can be disambiguated.
Match items with this interval\_count. Disambiguates between items that share an interval but differ in count.
Match items whose grant equals this included usage. Omitted is a wildcard.
Free trial configuration for a plan.
Number of duration\_type periods the trial lasts.
Unit of time for the trial ('day', 'month', 'year').
If true, a payment method is required to start the trial and the customer is charged when it ends. Defaults to false.
Behavior when the trial ends. 'bill' charges the customer (default). 'revert' expires the trial and restores the customer's previous plan.
Override the plan's billing controls (auto top-ups, spend limits, usage limits, usage alerts, overage allowed) for this customer.
List of auto top-up configurations per feature.
The ID of the feature (credit balance) to auto top-up.
Whether auto top-up is enabled.
When the balance drops below this threshold, an auto top-up will be purchased.
Amount of credits to add per auto top-up.
Optional rate limit to cap how often auto top-ups occur. Pass count to set the current window's consumed top-ups.
The time interval for the purchase limit window.
Number of intervals in the purchase limit window.
Maximum number of auto top-ups allowed within the interval.
Set the current window's consumed auto top-up count. Omit to leave runtime state unchanged.
When true, auto top-up creates a send\_invoice invoice instead of auto-charging.
List of overage spend limits per feature (caps overage spend).
Optional feature ID this spend limit applies to.
Whether the overage spend limit is enabled.
How overage\_limit is interpreted: an absolute overage cap (default) or a percentage of the main-plan allowance.
Overage cap for the feature: absolute units, or a percent (e.g. 120) when limit\_type is usage\_percentage.
When true, overage for this feature is not posted to Stripe. Usage tracking and balance resets still behave normally.
List of hard usage caps per feature (max units per interval).
The feature this usage limit applies to.
Whether this usage limit is enabled.
Maximum units allowed per interval.
Interval for the cap, aligned to the customer's billing cycle.
Window alignment. 'billing\_cycle' phases the interval to the customer's renewal time; 'utc' aligns to the UTC calendar.
When set, only usage from events whose properties match counts toward this cap. Omit to count all usage of the feature.
List of usage alert configurations per feature.
The feature ID this alert applies to.
Whether this usage alert is enabled.
The threshold value that triggers the alert. For usage or remaining, this is an absolute count. For usage\_percentage or remaining\_percentage, this is a percentage (0-100).
Whether the threshold is an absolute count or a percentage of the usage allowance or remaining balance.
What 100% means. balance: every grant on the feature. included: the plan allowance only. recurring: grants that reset. usage\_limit: the cap of the usage limit with the same feature and filter.
Only valid with basis usage\_limit. Points the alert at the usage limit carrying the same filter.
Optional user-defined label to distinguish multiple alerts on the same feature.
List of overage allowed controls per feature. When enabled, usage can exceed balance.
The feature ID this overage allowed control applies to.
Whether overage is allowed for this feature.
License links to add or override for this customer, keyed by license\_plan\_id. Omitted fields inherit the plan catalog link (included defaults to 1 when the license is not in the catalog). A bare entry restores the license to pure catalog inheritance.
Base price configuration for a plan.
Base price amount for the plan, in major currency units (e.g. dollars).
Billing interval (e.g. 'month', 'year').
Number of intervals per billing cycle. Defaults to 1.
Base price amounts in additional currencies. The base 'amount' is in the org's default currency.
Three-letter Stripe-supported currency code (e.g. 'eur', 'gbp').
Price amount in this currency. Set explicitly per currency, not converted from the base amount.
Bills this many feature units when outstanding overage reaches it.
The ID of the feature to configure.
Number of free units included. Balance resets to this each interval for consumable features.
If true, customer has unlimited access to this feature.
Whether entity-level grants contribute to a shared customer balance.
Reset configuration for consumable features. Omit for non-consumable features like seats.
Interval at which balance resets (e.g. 'month', 'year'). For consumable features only.
Number of intervals between resets. Defaults to 1.
Pricing for usage beyond included units. Omit for free features.
Price per billing\_units after included usage. Either 'amount' or 'tiers' is required.
Amounts in additional currencies for this flat price. The base 'amount' is in the org's default currency. Only valid with 'amount', not 'tiers'.
Three-letter Stripe-supported currency code (e.g. 'eur', 'gbp').
Price amount in this currency. Set explicitly per currency, not converted from the base amount.
Tiered pricing. Either 'amount' or 'tiers' is required.
Three-letter Stripe-supported currency code (e.g. 'eur', 'gbp').
Per-unit amount for this tier in this currency.
Flat amount for this tier in this currency, if the tier uses one.
Billing interval. For consumable features, should match reset.interval.
Number of intervals per billing cycle. Defaults to 1.
Units per price increment. Usage is rounded UP when billed (e.g. billing\_units=100 means 101 rounds to 200).
'prepaid' for upfront payment (seats), 'usage\_based' for pay-as-you-go.
Max units purchasable beyond included. E.g. included=100, max\_purchase=300 allows 400 total. Null for no limit.
Proration settings for prepaid features. Controls mid-cycle quantity change billing.
Billing behavior when quantity increases mid-cycle.
Credit behavior when quantity decreases mid-cycle.
Rollover config for unused units. If set, unused included units carry over.
Max rollover units. Omit for unlimited rollover.
Maximum rollover as a percentage (0-100) of included + prepaid grant. Mutually exclusive with max.
When rolled over units expire.
Number of periods before expiry.
Overrides fields of this item's feature for customers on this plan (e.g. a credit system's credit\_schema).
For credit system features: replaces the feature's credit\_schema entirely for customers on this plan.
ID of the metered feature that draws from this credit system.
Number of metered-feature units priced together. Defaults to one when omitted.
Named rates chosen by event properties. The most specific match sets the rate; with no match the item's own rate applies.
Event properties this entry applies to. Every key must equal the tracked property, compared as strings.
Breaks ties between dimensions that match the same number of keys. Higher wins.
Inclusive upper usage boundary for this graduated tier. The final tier must be 'inf'.
Credits consumed per billing-unit group within this tier.
Named adjustments chosen by event properties. Every match applies: factors multiply, then adds are summed.
Event properties this entry applies to. Every key must equal the tracked property, compared as strings.
Multiplies the matched rate. All matching multipliers stack.
Added to the rate after every factor is applied, in credits per billing-unit group.
Inclusive upper usage boundary for this graduated tier. The final tier must be 'inf'.
Credits consumed per billing-unit group within this tier.
Credits consumed per billing-unit group.
For AI credit system features: replaces the feature's markup chain entirely for customers on this plan. An unset level means no markup at that level rather than inheriting the feature's.
Default percentage markup for customers on this plan. Use -100 to make usage free.
Per-provider markup percentages for customers on this plan.
Per-model markup overrides for customers on this plan.
Match items linked to this feature.
Match items with this billing method (prepaid or usage\_based).
Match items with this interval. Accepts either a BillingInterval (price-side) or a ResetInterval (reset-side, includes day/hour/minute) so price-less items keyed by reset.interval can be disambiguated.
Match items with this interval\_count. Disambiguates between items that share an interval but differ in count.
Match items whose grant equals this included usage. Omitted is a wildcard.
License links to drop, keyed by license\_plan\_id. Parallel to remove\_items.
The unique identifier of the purchased plan.
Timestamp when the purchase expires, or null for lifetime access.
Timestamp when the purchase was made.
Number of units purchased.
Whether this purchase is attached at the customer level or entity level.
The feature ID this balance is for.
The full feature object if expanded.
The unique identifier for this feature, used in /check and /track calls.
Human-readable name displayed in the dashboard and billing UI.
Feature type: 'boolean' for on/off access, 'metered' for usage-tracked features, 'credit\_system' for unified credit pools, 'ai\_credit\_system' for model-based token pricing.
For metered features: true if usage resets periodically (API calls, credits), false if allocated persistently (seats, storage).
Event names that trigger this feature's balance. Allows multiple features to respond to a single event.
For classic credit systems: maps metered features to flat or graduated credit costs.
ID of the metered feature that draws from this credit system.
Number of metered-feature units priced together. Defaults to one when omitted.
Named rates chosen by event properties. The most specific match sets the rate; with no match the item's own rate applies.
Event properties this entry applies to. Every key must equal the tracked property, compared as strings.
Breaks ties between dimensions that match the same number of keys. Higher wins.
Inclusive upper usage boundary for this graduated tier. The final tier must be 'inf'.
Credits consumed per billing-unit group within this tier.
Named adjustments chosen by event properties. Every match applies: factors multiply, then adds are summed.
Event properties this entry applies to. Every key must equal the tracked property, compared as strings.
Multiplies the matched rate. All matching multipliers stack.
Added to the rate after every factor is applied, in credits per billing-unit group.
Inclusive upper usage boundary for this graduated tier. The final tier must be 'inf'.
Credits consumed per billing-unit group within this tier.
Credits consumed per billing-unit group.
Whether usage of this classic credit system should be itemized as invoice credits.
Per-model markup overrides for AI credit systems.
Default percentage markup for AI credit systems. Use -100 to make usage free.
Per-provider default markup percentages for AI credit systems.
Display names for the feature in billing UI and customer-facing components.
Singular form for UI display (e.g., 'API call', 'seat').
Plural form for UI display (e.g., 'API calls', 'seats').
Whether the feature is archived and hidden from the dashboard.
Processor mappings for this feature. Present when a Stripe product or meter is set.
Stripe product ID this feature's usage prices bill under.
Stripe meter ID used to create this feature's metered price.
Total balance granted (included + prepaid).
Remaining balance available for use.
Total usage consumed in the current period.
Whether this feature has unlimited usage.
Whether usage beyond the granted balance is allowed (with overage charges).
Maximum quantity that can be purchased as a top-up, or null for unlimited.
Timestamp when the balance will reset, or null for no reset.
Detailed breakdown of balance sources when stacking multiple plans or grants.
The unique identifier for this balance breakdown.
The plan ID this balance originates from, or null for standalone balances.
Amount granted from the plan's included usage.
Amount granted from prepaid purchases or top-ups.
Remaining balance available for use.
Amount consumed in the current period.
Whether this balance has unlimited usage.
Reset configuration for this balance, or null if no reset.
The reset interval (hour, day, week, month, etc.) or 'multiple' if combined from different intervals.
Number of intervals between resets (eg. 2 for bi-monthly).
Timestamp when the balance will next reset.
Pricing configuration if this balance has usage-based pricing.
The per-unit price amount.
Tiered pricing configuration if applicable.
How tiers are applied: graduated (split across bands) or volume (flat rate for the matched tier).
The number of units per billing increment (eg. \$9 / 250 units).
Whether usage is prepaid or billed pay-per-use.
Maximum quantity that can be purchased, or null for unlimited.
Timestamp when this balance expires, or null for no expiration.
Rollover balances carried over from previous periods.
Amount originally rolled over from a previous period, before any of it was consumed.
Amount of balance rolled over from a previous period.
Timestamp when the rollover balance expires.
The unique identifier for this flag.
The plan ID this flag originates from, or null for standalone flags.
Timestamp when this flag expires, or null for no expiration.
The feature ID this flag is for.
The full feature object if expanded.
The unique identifier for this feature, used in /check and /track calls.
Human-readable name displayed in the dashboard and billing UI.
Feature type: 'boolean' for on/off access, 'metered' for usage-tracked features, 'credit\_system' for unified credit pools, 'ai\_credit\_system' for model-based token pricing.
For metered features: true if usage resets periodically (API calls, credits), false if allocated persistently (seats, storage).
Event names that trigger this feature's balance. Allows multiple features to respond to a single event.
For classic credit systems: maps metered features to flat or graduated credit costs.
ID of the metered feature that draws from this credit system.
Number of metered-feature units priced together. Defaults to one when omitted.
Named rates chosen by event properties. The most specific match sets the rate; with no match the item's own rate applies.
Event properties this entry applies to. Every key must equal the tracked property, compared as strings.
Breaks ties between dimensions that match the same number of keys. Higher wins.
Inclusive upper usage boundary for this graduated tier. The final tier must be 'inf'.
Credits consumed per billing-unit group within this tier.
Named adjustments chosen by event properties. Every match applies: factors multiply, then adds are summed.
Event properties this entry applies to. Every key must equal the tracked property, compared as strings.
Multiplies the matched rate. All matching multipliers stack.
Added to the rate after every factor is applied, in credits per billing-unit group.
Inclusive upper usage boundary for this graduated tier. The final tier must be 'inf'.
Credits consumed per billing-unit group within this tier.
Credits consumed per billing-unit group.
Whether usage of this classic credit system should be itemized as invoice credits.
Per-model markup overrides for AI credit systems.
Default percentage markup for AI credit systems. Use -100 to make usage free.
Per-provider default markup percentages for AI credit systems.
Display names for the feature in billing UI and customer-facing components.
Singular form for UI display (e.g., 'API call', 'seat').
Plural form for UI display (e.g., 'API calls', 'seats').
Whether the feature is archived and hidden from the dashboard.
Processor mappings for this feature. Present when a Stripe product or meter is set.
Stripe product ID this feature's usage prices bill under.
Stripe meter ID used to create this feature's metered price.
Billing controls for the entity.
List of spend limits per feature. Each entry caps overage (overage\_limit) and/or per-interval usage (usage\_limit).
Optional feature ID this spend limit applies to.
Whether the overage spend limit is enabled.
How overage\_limit is interpreted: an absolute overage cap (default) or a percentage of the main-plan allowance.
Overage cap for the feature: absolute units, or a percent (e.g. 120) when limit\_type is usage\_percentage.
When true, overage for this feature is not posted to Stripe. Usage tracking and balance resets still behave normally.
Response-only: whether the entry is a customer-level override or inherited from an attached plan's defaults.
List of hard usage caps per feature for this entity. An entity entry overrides the customer's for that feature.
The feature this usage limit applies to.
Whether this usage limit is enabled.
Maximum units allowed per interval.
Interval for the cap, aligned to the customer's billing cycle.
Window alignment. 'billing\_cycle' phases the interval to the customer's renewal time; 'utc' aligns to the UTC calendar.
When set, only usage from events whose properties match counts toward this cap. Omit to count all usage of the feature.
Usage consumed in the active interval, stored in the usage-window counter.
Response-only: whether the entry is a customer-level override or inherited from an attached plan's defaults.
List of usage alert configurations per feature.
The feature ID this alert applies to.
Whether this usage alert is enabled.
The threshold value that triggers the alert. For usage or remaining, this is an absolute count. For usage\_percentage or remaining\_percentage, this is a percentage (0-100).
Whether the threshold is an absolute count or a percentage of the usage allowance or remaining balance.
What 100% means. balance: every grant on the feature. included: the plan allowance only. recurring: grants that reset. usage\_limit: the cap of the usage limit with the same feature and filter.
Only valid with basis usage\_limit. Points the alert at the usage limit carrying the same filter.
Optional user-defined label to distinguish multiple alerts on the same feature.
Response-only: whether the entry is a customer-level override or inherited from an attached plan's defaults.
List of overage allowed controls per feature. When enabled, usage can exceed balance.
The feature ID this overage allowed control applies to.
Whether overage is allowed for this feature.
Response-only: whether the entry is a customer-level override or inherited from an attached plan's defaults.
Invoices for this entity (only included when expand=invoices)
Array of plan IDs included in this invoice
The Stripe invoice ID
The billing processor that owns this invoice.
The status of the invoice
The total amount of the invoice
The currency code for the invoice
Timestamp when the invoice was created
URL to the Stripe-hosted invoice page
Opaque cursor for the next page. Null when there are no more results.
```json 200 theme={null}
{
"list": [
{
"id": "seat_42",
"name": "Seat 42",
"customer_id": "cus_123",
"feature_id": "seats",
"created_at": 1771409161016,
"env": "sandbox",
"subscriptions": [
{
"plan_id": "pro_plan",
"auto_enable": true,
"add_on": false,
"status": "active",
"past_due": false,
"canceled_at": null,
"expires_at": null,
"trial_ends_at": null,
"started_at": 1771431921437,
"current_period_start": 1771431921437,
"current_period_end": 1771999921437,
"quantity": 1
}
],
"purchases": [],
"balances": {
"messages": {
"feature_id": "messages",
"granted": 100,
"remaining": 72,
"usage": 28,
"unlimited": false,
"overage_allowed": false,
"max_purchase": null,
"next_reset_at": 1773851121437,
"breakdown": [
{
"id": "cus_ent_39qmLooixXLAqMywgXywjAz96rV",
"plan_id": "pro_plan",
"included_grant": 100,
"prepaid_grant": 0,
"remaining": 72,
"usage": 28,
"unlimited": false,
"reset": {
"interval": "month",
"resets_at": 1773851121437
},
"price": null,
"expires_at": null
}
]
}
},
"invoices": []
}
],
"next_cursor": null
}
```
# Update Entity
Source: https://docs.useautumn.com/api-reference/entities/updateEntity
openapi POST /v1/entities.update
Updates an existing entity and returns the refreshed entity object.
Use this to change entity billing controls or other mutable entity fields after the entity has already been created.
### Body Parameters
The ID of the customer that owns the entity.
The ID of the entity.
Billing controls to replace on the entity.
List of spend limits per feature. Each entry caps overage (overage\_limit) and/or per-interval usage (usage\_limit).
Optional feature ID this spend limit applies to.
Whether the overage spend limit is enabled.
How overage\_limit is interpreted: an absolute overage cap (default) or a percentage of the main-plan allowance.
Overage cap for the feature: absolute units, or a percent (e.g. 120) when limit\_type is usage\_percentage.
When true, overage for this feature is not posted to Stripe. Usage tracking and balance resets still behave normally.
List of hard usage caps per feature. An entry with only feature\_id and usage sets the current counter without changing configuration.
The feature this usage limit applies to.
Whether this usage limit is enabled.
Maximum units allowed per interval.
Interval for the cap, aligned to the customer's billing cycle.
Window alignment. 'billing\_cycle' phases the interval to the customer's renewal time; 'utc' aligns to the UTC calendar.
When set, only usage from events whose properties match counts toward this cap. Omit to count all usage of the feature.
Usage consumed in the active interval, stored in the usage-window counter.
Response-only: whether the entry is a customer-level override or inherited from an attached plan's defaults.
List of usage alert configurations per feature.
The feature ID this alert applies to.
Whether this usage alert is enabled.
The threshold value that triggers the alert. For usage or remaining, this is an absolute count. For usage\_percentage or remaining\_percentage, this is a percentage (0-100).
Whether the threshold is an absolute count or a percentage of the usage allowance or remaining balance.
What 100% means. balance: every grant on the feature. included: the plan allowance only. recurring: grants that reset. usage\_limit: the cap of the usage limit with the same feature and filter.
Only valid with basis usage\_limit. Points the alert at the usage limit carrying the same filter.
Optional user-defined label to distinguish multiple alerts on the same feature.
List of overage allowed controls per feature. When enabled, usage can exceed balance.
The feature ID this overage allowed control applies to.
Whether overage is allowed for this feature.
### Response
The unique identifier of the entity
The name of the entity
The customer ID this entity belongs to
The feature ID this entity belongs to
Unix timestamp when the entity was created
The environment (sandbox/live)
The unique identifier of this subscription. If a subscription\_id was provided at attach time, it is used; otherwise, falls back to the internal ID.
The full plan object if expanded.
Unique identifier for the plan.
Display name of the plan.
Optional description of the plan.
Group identifier for organizing related plans. Plans in the same group are mutually exclusive.
Version number of the plan. Incremented when plan configuration changes.
User-facing version identity. Defaults to v\{n} when the version is minted.
Whether this is the active version of the plan. At most one version is active.
Whether this is an add-on plan that can be attached alongside a main plan.
If true, this plan is automatically attached when a customer is created. Used for free plans.
Base recurring price for the plan. Null for free plans or usage-only plans.
Base price amount for the plan, in major currency units (e.g. dollars).
Base price amounts in additional currencies. The base 'amount' is in the org's default currency.
Three-letter Stripe-supported currency code (e.g. 'eur', 'gbp').
Price amount in this currency. Set explicitly per currency, not converted from the base amount.
Billing interval (e.g. 'month', 'year').
Number of intervals per billing cycle. Defaults to 1.
Display text for showing this price in pricing pages.
Main display text (e.g. '\$10' or '100 messages').
Secondary display text (e.g. 'per month' or 'then \$0.5 per 100').
Payment processors this base price is connected to. Omitted when unset.
Stripe price ID. For prepaid with included > 0 this is the V2 price.
Feature configurations included in this plan. Each item defines included units, pricing, and reset behavior for a feature.
Bills this many feature units when outstanding overage reaches it.
The ID of the feature this item configures.
The full feature object if expanded.
The ID of the feature, used to refer to it in other API calls like /track or /check.
The name of the feature.
The type of the feature
Singular and plural display names for the feature.
The singular display name for the feature.
The plural display name for the feature.
Credit cost schema for credit system features.
The ID of the metered feature (should be a single\_use feature).
The credit cost of the metered feature.
Whether or not the feature is archived.
Number of free units included. For consumable features, balance resets to this number each interval.
Whether the customer has unlimited access to this feature.
Whether entity-level grants contribute to a shared customer balance.
Reset configuration for consumable features. Null for non-consumable features like seats where usage persists across billing cycles.
The interval at which the feature balance resets (e.g. 'month', 'year'). For consumable features, usage resets to 0 and included units are restored.
Number of intervals between resets. Defaults to 1.
Pricing configuration for usage beyond included units. Null if feature is entirely free.
Price per billing\_units after included usage is consumed. Mutually exclusive with tiers.
Amounts in additional currencies for this flat price. The base 'amount' is in the org's default currency. Only valid with 'amount', not 'tiers' (tiered prices carry per-currency amounts on each tier).
Three-letter Stripe-supported currency code (e.g. 'eur', 'gbp').
Price amount in this currency. Set explicitly per currency, not converted from the base amount.
Tiered pricing configuration. Each tier's 'to' INCLUDES the included amount. Either 'tiers' or 'amount' is required.
Three-letter Stripe-supported currency code (e.g. 'eur', 'gbp').
Per-unit amount for this tier in this currency.
Flat amount for this tier in this currency, if the tier uses one.
Billing interval for this price. For consumable features, should match reset.interval.
Number of intervals per billing cycle. Defaults to 1.
Number of units per price increment. Usage is rounded UP to the nearest billing\_units when billed (e.g. billing\_units=100 means 101 usage rounds to 200).
'prepaid' for features like seats where customers pay upfront, 'usage\_based' for pay-as-you-go after included usage.
Maximum units a customer can purchase beyond included. E.g. if included=100 and max\_purchase=300, customer can use up to 400 total before usage is capped. Null for no limit.
Payment processors this item price is connected to. Omitted when unset.
Stripe price ID. For prepaid with included > 0 this is the V2 price.
Display text for showing this item in pricing pages.
Main display text (e.g. '\$10' or '100 messages').
Secondary display text (e.g. 'per month' or 'then \$0.5 per 100').
Rollover configuration for unused units. If set, unused included units roll over to the next period.
Maximum rollover units. Null for unlimited rollover.
Maximum rollover as a percentage (0-100) of included + prepaid grant. Mutually exclusive with max.
When rolled over units expire.
Number of periods before expiry.
Overrides fields of this item's feature for customers on this plan (e.g. a credit system's credit\_schema).
For credit system features: replaces the feature's credit\_schema entirely for customers on this plan.
ID of the metered feature that draws from this credit system.
Number of metered-feature units priced together. Defaults to one when omitted.
Named rates chosen by event properties. The most specific match sets the rate; with no match the item's own rate applies.
Event properties this entry applies to. Every key must equal the tracked property, compared as strings.
Breaks ties between dimensions that match the same number of keys. Higher wins.
Inclusive upper usage boundary for this graduated tier. The final tier must be 'inf'.
Credits consumed per billing-unit group within this tier.
Named adjustments chosen by event properties. Every match applies: factors multiply, then adds are summed.
Event properties this entry applies to. Every key must equal the tracked property, compared as strings.
Multiplies the matched rate. All matching multipliers stack.
Added to the rate after every factor is applied, in credits per billing-unit group.
Inclusive upper usage boundary for this graduated tier. The final tier must be 'inf'.
Credits consumed per billing-unit group within this tier.
Credits consumed per billing-unit group.
For AI credit system features: replaces the feature's markup chain entirely for customers on this plan. An unset level means no markup at that level rather than inheriting the feature's.
Default percentage markup for customers on this plan. Use -100 to make usage free.
Per-provider markup percentages for customers on this plan.
Per-model markup overrides for customers on this plan.
Payment processors this plan is connected to. Omitted when unset.
Stripe product ID this plan is billed under.
Extra Stripe product IDs aliased to this plan.
Every RevenueCat product that maps to this plan. Replaces the current set.
RevenueCat product ID that grants this plan when purchased.
Prepaid quantities granted when this specific RevenueCat product is purchased, in feature units.
Free trial configuration. If set, new customers can try this plan before being charged.
Number of duration\_type periods the trial lasts.
Unit of time for the trial duration ('day', 'month', 'year').
Whether a payment method is required to start the trial. If true, customer will be charged after trial ends.
Behavior when the trial ends. 'bill' charges the customer (default). 'revert' expires the trial and restores the customer's previous plan.
Unix timestamp (ms) when the plan was created.
Environment this plan belongs to ('sandbox' or 'live').
Whether the plan is archived. Archived plans cannot be attached to new customers.
Miscellaneous plan-level configuration flags.
If true, entitlements attached to this plan will still reset on schedule even when the customer's product is in a past\_due state.
Plan-level billing controls used as customer defaults.
List of auto top-up configurations per feature.
The ID of the feature (credit balance) to auto top-up.
Whether auto top-up is enabled.
When the balance drops below this threshold, an auto top-up will be purchased.
Amount of credits to add per auto top-up.
Optional rate limit to cap how often auto top-ups occur.
The time interval for the purchase limit window.
Number of intervals in the purchase limit window.
Maximum number of auto top-ups allowed within the interval.
When true, auto top-up creates a send\_invoice invoice instead of auto-charging.
List of overage spend limits per feature (caps overage spend).
Optional feature ID this spend limit applies to.
Whether the overage spend limit is enabled.
How overage\_limit is interpreted: an absolute overage cap (default) or a percentage of the main-plan allowance.
Overage cap for the feature: absolute units, or a percent (e.g. 120) when limit\_type is usage\_percentage.
When true, overage for this feature is not posted to Stripe. Usage tracking and balance resets still behave normally.
List of hard usage caps per feature (max units per interval).
The feature this usage limit applies to.
Whether this usage limit is enabled.
Maximum units allowed per interval.
Interval for the cap, aligned to the customer's billing cycle.
Window alignment. 'billing\_cycle' phases the interval to the customer's renewal time; 'utc' aligns to the UTC calendar.
When set, only usage from events whose properties match counts toward this cap. Omit to count all usage of the feature.
List of usage alert configurations per feature.
The feature ID this alert applies to.
Whether this usage alert is enabled.
The threshold value that triggers the alert. For usage or remaining, this is an absolute count. For usage\_percentage or remaining\_percentage, this is a percentage (0-100).
Whether the threshold is an absolute count or a percentage of the usage allowance or remaining balance.
What 100% means. balance: every grant on the feature. included: the plan allowance only. recurring: grants that reset. usage\_limit: the cap of the usage limit with the same feature and filter.
Only valid with basis usage\_limit. Points the alert at the usage limit carrying the same filter.
Optional user-defined label to distinguish multiple alerts on the same feature.
List of overage allowed controls per feature. When enabled, usage can exceed balance.
The feature ID this overage allowed control applies to.
Whether overage is allowed for this feature.
Arbitrary key-value metadata defined by you for your own use. Shared across all versions of the plan.
Whether the trial on this plan is available to this customer. For example, if the customer used the trial in the past, this will be false.
The customer's current status with this plan. 'active' if attached, 'scheduled' if pending activation.
Whether the customer's active instance of this plan is set to cancel.
Whether the customer is currently on a free trial of this plan.
The action that would occur if this plan were attached to the customer.
Deprecated. Use variant\_details.base\_plan\_id instead. If this is a variant, the ID of the base plan it was created from.
Details about how this variant relates to its latest base plan.
The ID of the base plan this variant was derived from.
The customization that transforms the base plan into this variant.
Base price configuration for a plan.
Base price amount for the plan, in major currency units (e.g. dollars).
Billing interval (e.g. 'month', 'year').
Number of intervals per billing cycle. Defaults to 1.
Base price amounts in additional currencies. The base 'amount' is in the org's default currency.
Three-letter Stripe-supported currency code (e.g. 'eur', 'gbp').
Price amount in this currency. Set explicitly per currency, not converted from the base amount.
Items to add to the plan.
Bills this many feature units when outstanding overage reaches it.
The ID of the feature to configure.
Number of free units included. Balance resets to this each interval for consumable features.
If true, customer has unlimited access to this feature.
Whether entity-level grants contribute to a shared customer balance.
Reset configuration for consumable features. Omit for non-consumable features like seats.
Interval at which balance resets (e.g. 'month', 'year'). For consumable features only.
Number of intervals between resets. Defaults to 1.
Pricing for usage beyond included units. Omit for free features.
Price per billing\_units after included usage. Either 'amount' or 'tiers' is required.
Amounts in additional currencies for this flat price. The base 'amount' is in the org's default currency. Only valid with 'amount', not 'tiers'.
Three-letter Stripe-supported currency code (e.g. 'eur', 'gbp').
Price amount in this currency. Set explicitly per currency, not converted from the base amount.
Tiered pricing. Either 'amount' or 'tiers' is required.
Three-letter Stripe-supported currency code (e.g. 'eur', 'gbp').
Per-unit amount for this tier in this currency.
Flat amount for this tier in this currency, if the tier uses one.
Billing interval. For consumable features, should match reset.interval.
Number of intervals per billing cycle. Defaults to 1.
Units per price increment. Usage is rounded UP when billed (e.g. billing\_units=100 means 101 rounds to 200).
'prepaid' for upfront payment (seats), 'usage\_based' for pay-as-you-go.
Max units purchasable beyond included. E.g. included=100, max\_purchase=300 allows 400 total. Null for no limit.
Proration settings for prepaid features. Controls mid-cycle quantity change billing.
Billing behavior when quantity increases mid-cycle.
Credit behavior when quantity decreases mid-cycle.
Rollover config for unused units. If set, unused included units carry over.
Max rollover units. Omit for unlimited rollover.
Maximum rollover as a percentage (0-100) of included + prepaid grant. Mutually exclusive with max.
When rolled over units expire.
Number of periods before expiry.
Overrides fields of this item's feature for customers on this plan (e.g. a credit system's credit\_schema).
For credit system features: replaces the feature's credit\_schema entirely for customers on this plan.
ID of the metered feature that draws from this credit system.
Number of metered-feature units priced together. Defaults to one when omitted.
Named rates chosen by event properties. The most specific match sets the rate; with no match the item's own rate applies.
Event properties this entry applies to. Every key must equal the tracked property, compared as strings.
Breaks ties between dimensions that match the same number of keys. Higher wins.
Inclusive upper usage boundary for this graduated tier. The final tier must be 'inf'.
Credits consumed per billing-unit group within this tier.
Named adjustments chosen by event properties. Every match applies: factors multiply, then adds are summed.
Event properties this entry applies to. Every key must equal the tracked property, compared as strings.
Multiplies the matched rate. All matching multipliers stack.
Added to the rate after every factor is applied, in credits per billing-unit group.
Inclusive upper usage boundary for this graduated tier. The final tier must be 'inf'.
Credits consumed per billing-unit group within this tier.
Credits consumed per billing-unit group.
For AI credit system features: replaces the feature's markup chain entirely for customers on this plan. An unset level means no markup at that level rather than inheriting the feature's.
Default percentage markup for customers on this plan. Use -100 to make usage free.
Per-provider markup percentages for customers on this plan.
Per-model markup overrides for customers on this plan.
Filters selecting items to remove from the plan.
Match items linked to this feature.
Match items with this billing method (prepaid or usage\_based).
Match items with this interval. Accepts either a BillingInterval (price-side) or a ResetInterval (reset-side, includes day/hour/minute) so price-less items keyed by reset.interval can be disambiguated.
Match items with this interval\_count. Disambiguates between items that share an interval but differ in count.
Match items whose grant equals this included usage. Omitted is a wildcard.
Free trial configuration for a plan.
Number of duration\_type periods the trial lasts.
Unit of time for the trial ('day', 'month', 'year').
If true, a payment method is required to start the trial and the customer is charged when it ends. Defaults to false.
Behavior when the trial ends. 'bill' charges the customer (default). 'revert' expires the trial and restores the customer's previous plan.
Override the plan's billing controls (auto top-ups, spend limits, usage limits, usage alerts, overage allowed) for this customer.
List of auto top-up configurations per feature.
The ID of the feature (credit balance) to auto top-up.
Whether auto top-up is enabled.
When the balance drops below this threshold, an auto top-up will be purchased.
Amount of credits to add per auto top-up.
Optional rate limit to cap how often auto top-ups occur. Pass count to set the current window's consumed top-ups.
The time interval for the purchase limit window.
Number of intervals in the purchase limit window.
Maximum number of auto top-ups allowed within the interval.
Set the current window's consumed auto top-up count. Omit to leave runtime state unchanged.
When true, auto top-up creates a send\_invoice invoice instead of auto-charging.
List of overage spend limits per feature (caps overage spend).
Optional feature ID this spend limit applies to.
Whether the overage spend limit is enabled.
How overage\_limit is interpreted: an absolute overage cap (default) or a percentage of the main-plan allowance.
Overage cap for the feature: absolute units, or a percent (e.g. 120) when limit\_type is usage\_percentage.
When true, overage for this feature is not posted to Stripe. Usage tracking and balance resets still behave normally.
List of hard usage caps per feature (max units per interval).
The feature this usage limit applies to.
Whether this usage limit is enabled.
Maximum units allowed per interval.
Interval for the cap, aligned to the customer's billing cycle.
Window alignment. 'billing\_cycle' phases the interval to the customer's renewal time; 'utc' aligns to the UTC calendar.
When set, only usage from events whose properties match counts toward this cap. Omit to count all usage of the feature.
List of usage alert configurations per feature.
The feature ID this alert applies to.
Whether this usage alert is enabled.
The threshold value that triggers the alert. For usage or remaining, this is an absolute count. For usage\_percentage or remaining\_percentage, this is a percentage (0-100).
Whether the threshold is an absolute count or a percentage of the usage allowance or remaining balance.
What 100% means. balance: every grant on the feature. included: the plan allowance only. recurring: grants that reset. usage\_limit: the cap of the usage limit with the same feature and filter.
Only valid with basis usage\_limit. Points the alert at the usage limit carrying the same filter.
Optional user-defined label to distinguish multiple alerts on the same feature.
List of overage allowed controls per feature. When enabled, usage can exceed balance.
The feature ID this overage allowed control applies to.
Whether overage is allowed for this feature.
License links to add or override for this customer, keyed by license\_plan\_id. Omitted fields inherit the plan catalog link (included defaults to 1 when the license is not in the catalog). A bare entry restores the license to pure catalog inheritance.
Base price configuration for a plan.
Base price amount for the plan, in major currency units (e.g. dollars).
Billing interval (e.g. 'month', 'year').
Number of intervals per billing cycle. Defaults to 1.
Base price amounts in additional currencies. The base 'amount' is in the org's default currency.
Three-letter Stripe-supported currency code (e.g. 'eur', 'gbp').
Price amount in this currency. Set explicitly per currency, not converted from the base amount.
Bills this many feature units when outstanding overage reaches it.
The ID of the feature to configure.
Number of free units included. Balance resets to this each interval for consumable features.
If true, customer has unlimited access to this feature.
Whether entity-level grants contribute to a shared customer balance.
Reset configuration for consumable features. Omit for non-consumable features like seats.
Interval at which balance resets (e.g. 'month', 'year'). For consumable features only.
Number of intervals between resets. Defaults to 1.
Pricing for usage beyond included units. Omit for free features.
Price per billing\_units after included usage. Either 'amount' or 'tiers' is required.
Amounts in additional currencies for this flat price. The base 'amount' is in the org's default currency. Only valid with 'amount', not 'tiers'.
Three-letter Stripe-supported currency code (e.g. 'eur', 'gbp').
Price amount in this currency. Set explicitly per currency, not converted from the base amount.
Tiered pricing. Either 'amount' or 'tiers' is required.
Three-letter Stripe-supported currency code (e.g. 'eur', 'gbp').
Per-unit amount for this tier in this currency.
Flat amount for this tier in this currency, if the tier uses one.
Billing interval. For consumable features, should match reset.interval.
Number of intervals per billing cycle. Defaults to 1.
Units per price increment. Usage is rounded UP when billed (e.g. billing\_units=100 means 101 rounds to 200).
'prepaid' for upfront payment (seats), 'usage\_based' for pay-as-you-go.
Max units purchasable beyond included. E.g. included=100, max\_purchase=300 allows 400 total. Null for no limit.
Proration settings for prepaid features. Controls mid-cycle quantity change billing.
Billing behavior when quantity increases mid-cycle.
Credit behavior when quantity decreases mid-cycle.
Rollover config for unused units. If set, unused included units carry over.
Max rollover units. Omit for unlimited rollover.
Maximum rollover as a percentage (0-100) of included + prepaid grant. Mutually exclusive with max.
When rolled over units expire.
Number of periods before expiry.
Overrides fields of this item's feature for customers on this plan (e.g. a credit system's credit\_schema).
For credit system features: replaces the feature's credit\_schema entirely for customers on this plan.
ID of the metered feature that draws from this credit system.
Number of metered-feature units priced together. Defaults to one when omitted.
Named rates chosen by event properties. The most specific match sets the rate; with no match the item's own rate applies.
Event properties this entry applies to. Every key must equal the tracked property, compared as strings.
Breaks ties between dimensions that match the same number of keys. Higher wins.
Inclusive upper usage boundary for this graduated tier. The final tier must be 'inf'.
Credits consumed per billing-unit group within this tier.
Named adjustments chosen by event properties. Every match applies: factors multiply, then adds are summed.
Event properties this entry applies to. Every key must equal the tracked property, compared as strings.
Multiplies the matched rate. All matching multipliers stack.
Added to the rate after every factor is applied, in credits per billing-unit group.
Inclusive upper usage boundary for this graduated tier. The final tier must be 'inf'.
Credits consumed per billing-unit group within this tier.
Credits consumed per billing-unit group.
For AI credit system features: replaces the feature's markup chain entirely for customers on this plan. An unset level means no markup at that level rather than inheriting the feature's.
Default percentage markup for customers on this plan. Use -100 to make usage free.
Per-provider markup percentages for customers on this plan.
Per-model markup overrides for customers on this plan.
Match items linked to this feature.
Match items with this billing method (prepaid or usage\_based).
Match items with this interval. Accepts either a BillingInterval (price-side) or a ResetInterval (reset-side, includes day/hour/minute) so price-less items keyed by reset.interval can be disambiguated.
Match items with this interval\_count. Disambiguates between items that share an interval but differ in count.
Match items whose grant equals this included usage. Omitted is a wildcard.
License links to drop, keyed by license\_plan\_id. Parallel to remove\_items.
The unique identifier of the subscribed plan.
Whether the plan was automatically enabled for the customer.
Whether this is an add-on plan rather than a base subscription.
Current status of the subscription.
Whether the subscription has overdue payments.
Timestamp when the subscription was canceled, or null if not canceled.
Timestamp when the subscription will expire, or null if no expiry set.
Timestamp when the trial period ends, or null if not on trial.
Timestamp when the subscription started.
Start timestamp of the current billing period.
End timestamp of the current billing period.
Number of units of this subscription (for per-seat plans).
Whether this subscription is attached at the customer level or entity level.
The full plan object if expanded.
Unique identifier for the plan.
Display name of the plan.
Optional description of the plan.
Group identifier for organizing related plans. Plans in the same group are mutually exclusive.
Version number of the plan. Incremented when plan configuration changes.
User-facing version identity. Defaults to v\{n} when the version is minted.
Whether this is the active version of the plan. At most one version is active.
Whether this is an add-on plan that can be attached alongside a main plan.
If true, this plan is automatically attached when a customer is created. Used for free plans.
Base recurring price for the plan. Null for free plans or usage-only plans.
Base price amount for the plan, in major currency units (e.g. dollars).
Base price amounts in additional currencies. The base 'amount' is in the org's default currency.
Three-letter Stripe-supported currency code (e.g. 'eur', 'gbp').
Price amount in this currency. Set explicitly per currency, not converted from the base amount.
Billing interval (e.g. 'month', 'year').
Number of intervals per billing cycle. Defaults to 1.
Display text for showing this price in pricing pages.
Main display text (e.g. '\$10' or '100 messages').
Secondary display text (e.g. 'per month' or 'then \$0.5 per 100').
Payment processors this base price is connected to. Omitted when unset.
Stripe price ID. For prepaid with included > 0 this is the V2 price.
Feature configurations included in this plan. Each item defines included units, pricing, and reset behavior for a feature.
Bills this many feature units when outstanding overage reaches it.
The ID of the feature this item configures.
The full feature object if expanded.
The ID of the feature, used to refer to it in other API calls like /track or /check.
The name of the feature.
The type of the feature
Singular and plural display names for the feature.
The singular display name for the feature.
The plural display name for the feature.
Credit cost schema for credit system features.
The ID of the metered feature (should be a single\_use feature).
The credit cost of the metered feature.
Whether or not the feature is archived.
Number of free units included. For consumable features, balance resets to this number each interval.
Whether the customer has unlimited access to this feature.
Whether entity-level grants contribute to a shared customer balance.
Reset configuration for consumable features. Null for non-consumable features like seats where usage persists across billing cycles.
The interval at which the feature balance resets (e.g. 'month', 'year'). For consumable features, usage resets to 0 and included units are restored.
Number of intervals between resets. Defaults to 1.
Pricing configuration for usage beyond included units. Null if feature is entirely free.
Price per billing\_units after included usage is consumed. Mutually exclusive with tiers.
Amounts in additional currencies for this flat price. The base 'amount' is in the org's default currency. Only valid with 'amount', not 'tiers' (tiered prices carry per-currency amounts on each tier).
Three-letter Stripe-supported currency code (e.g. 'eur', 'gbp').
Price amount in this currency. Set explicitly per currency, not converted from the base amount.
Tiered pricing configuration. Each tier's 'to' INCLUDES the included amount. Either 'tiers' or 'amount' is required.
Three-letter Stripe-supported currency code (e.g. 'eur', 'gbp').
Per-unit amount for this tier in this currency.
Flat amount for this tier in this currency, if the tier uses one.
Billing interval for this price. For consumable features, should match reset.interval.
Number of intervals per billing cycle. Defaults to 1.
Number of units per price increment. Usage is rounded UP to the nearest billing\_units when billed (e.g. billing\_units=100 means 101 usage rounds to 200).
'prepaid' for features like seats where customers pay upfront, 'usage\_based' for pay-as-you-go after included usage.
Maximum units a customer can purchase beyond included. E.g. if included=100 and max\_purchase=300, customer can use up to 400 total before usage is capped. Null for no limit.
Payment processors this item price is connected to. Omitted when unset.
Stripe price ID. For prepaid with included > 0 this is the V2 price.
Display text for showing this item in pricing pages.
Main display text (e.g. '\$10' or '100 messages').
Secondary display text (e.g. 'per month' or 'then \$0.5 per 100').
Rollover configuration for unused units. If set, unused included units roll over to the next period.
Maximum rollover units. Null for unlimited rollover.
Maximum rollover as a percentage (0-100) of included + prepaid grant. Mutually exclusive with max.
When rolled over units expire.
Number of periods before expiry.
Overrides fields of this item's feature for customers on this plan (e.g. a credit system's credit\_schema).
For credit system features: replaces the feature's credit\_schema entirely for customers on this plan.
ID of the metered feature that draws from this credit system.
Number of metered-feature units priced together. Defaults to one when omitted.
Named rates chosen by event properties. The most specific match sets the rate; with no match the item's own rate applies.
Event properties this entry applies to. Every key must equal the tracked property, compared as strings.
Breaks ties between dimensions that match the same number of keys. Higher wins.
Inclusive upper usage boundary for this graduated tier. The final tier must be 'inf'.
Credits consumed per billing-unit group within this tier.
Named adjustments chosen by event properties. Every match applies: factors multiply, then adds are summed.
Event properties this entry applies to. Every key must equal the tracked property, compared as strings.
Multiplies the matched rate. All matching multipliers stack.
Added to the rate after every factor is applied, in credits per billing-unit group.
Inclusive upper usage boundary for this graduated tier. The final tier must be 'inf'.
Credits consumed per billing-unit group within this tier.
Credits consumed per billing-unit group.
For AI credit system features: replaces the feature's markup chain entirely for customers on this plan. An unset level means no markup at that level rather than inheriting the feature's.
Default percentage markup for customers on this plan. Use -100 to make usage free.
Per-provider markup percentages for customers on this plan.
Per-model markup overrides for customers on this plan.
Payment processors this plan is connected to. Omitted when unset.
Stripe product ID this plan is billed under.
Extra Stripe product IDs aliased to this plan.
Every RevenueCat product that maps to this plan. Replaces the current set.
RevenueCat product ID that grants this plan when purchased.
Prepaid quantities granted when this specific RevenueCat product is purchased, in feature units.
Free trial configuration. If set, new customers can try this plan before being charged.
Number of duration\_type periods the trial lasts.
Unit of time for the trial duration ('day', 'month', 'year').
Whether a payment method is required to start the trial. If true, customer will be charged after trial ends.
Behavior when the trial ends. 'bill' charges the customer (default). 'revert' expires the trial and restores the customer's previous plan.
Unix timestamp (ms) when the plan was created.
Environment this plan belongs to ('sandbox' or 'live').
Whether the plan is archived. Archived plans cannot be attached to new customers.
Miscellaneous plan-level configuration flags.
If true, entitlements attached to this plan will still reset on schedule even when the customer's product is in a past\_due state.
Plan-level billing controls used as customer defaults.
List of auto top-up configurations per feature.
The ID of the feature (credit balance) to auto top-up.
Whether auto top-up is enabled.
When the balance drops below this threshold, an auto top-up will be purchased.
Amount of credits to add per auto top-up.
Optional rate limit to cap how often auto top-ups occur.
The time interval for the purchase limit window.
Number of intervals in the purchase limit window.
Maximum number of auto top-ups allowed within the interval.
When true, auto top-up creates a send\_invoice invoice instead of auto-charging.
List of overage spend limits per feature (caps overage spend).
Optional feature ID this spend limit applies to.
Whether the overage spend limit is enabled.
How overage\_limit is interpreted: an absolute overage cap (default) or a percentage of the main-plan allowance.
Overage cap for the feature: absolute units, or a percent (e.g. 120) when limit\_type is usage\_percentage.
When true, overage for this feature is not posted to Stripe. Usage tracking and balance resets still behave normally.
List of hard usage caps per feature (max units per interval).
The feature this usage limit applies to.
Whether this usage limit is enabled.
Maximum units allowed per interval.
Interval for the cap, aligned to the customer's billing cycle.
Window alignment. 'billing\_cycle' phases the interval to the customer's renewal time; 'utc' aligns to the UTC calendar.
When set, only usage from events whose properties match counts toward this cap. Omit to count all usage of the feature.
List of usage alert configurations per feature.
The feature ID this alert applies to.
Whether this usage alert is enabled.
The threshold value that triggers the alert. For usage or remaining, this is an absolute count. For usage\_percentage or remaining\_percentage, this is a percentage (0-100).
Whether the threshold is an absolute count or a percentage of the usage allowance or remaining balance.
What 100% means. balance: every grant on the feature. included: the plan allowance only. recurring: grants that reset. usage\_limit: the cap of the usage limit with the same feature and filter.
Only valid with basis usage\_limit. Points the alert at the usage limit carrying the same filter.
Optional user-defined label to distinguish multiple alerts on the same feature.
List of overage allowed controls per feature. When enabled, usage can exceed balance.
The feature ID this overage allowed control applies to.
Whether overage is allowed for this feature.
Arbitrary key-value metadata defined by you for your own use. Shared across all versions of the plan.
Whether the trial on this plan is available to this customer. For example, if the customer used the trial in the past, this will be false.
The customer's current status with this plan. 'active' if attached, 'scheduled' if pending activation.
Whether the customer's active instance of this plan is set to cancel.
Whether the customer is currently on a free trial of this plan.
The action that would occur if this plan were attached to the customer.
Deprecated. Use variant\_details.base\_plan\_id instead. If this is a variant, the ID of the base plan it was created from.
Details about how this variant relates to its latest base plan.
The ID of the base plan this variant was derived from.
The customization that transforms the base plan into this variant.
Base price configuration for a plan.
Base price amount for the plan, in major currency units (e.g. dollars).
Billing interval (e.g. 'month', 'year').
Number of intervals per billing cycle. Defaults to 1.
Base price amounts in additional currencies. The base 'amount' is in the org's default currency.
Three-letter Stripe-supported currency code (e.g. 'eur', 'gbp').
Price amount in this currency. Set explicitly per currency, not converted from the base amount.
Items to add to the plan.
Bills this many feature units when outstanding overage reaches it.
The ID of the feature to configure.
Number of free units included. Balance resets to this each interval for consumable features.
If true, customer has unlimited access to this feature.
Whether entity-level grants contribute to a shared customer balance.
Reset configuration for consumable features. Omit for non-consumable features like seats.
Interval at which balance resets (e.g. 'month', 'year'). For consumable features only.
Number of intervals between resets. Defaults to 1.
Pricing for usage beyond included units. Omit for free features.
Price per billing\_units after included usage. Either 'amount' or 'tiers' is required.
Amounts in additional currencies for this flat price. The base 'amount' is in the org's default currency. Only valid with 'amount', not 'tiers'.
Three-letter Stripe-supported currency code (e.g. 'eur', 'gbp').
Price amount in this currency. Set explicitly per currency, not converted from the base amount.
Tiered pricing. Either 'amount' or 'tiers' is required.
Three-letter Stripe-supported currency code (e.g. 'eur', 'gbp').
Per-unit amount for this tier in this currency.
Flat amount for this tier in this currency, if the tier uses one.
Billing interval. For consumable features, should match reset.interval.
Number of intervals per billing cycle. Defaults to 1.
Units per price increment. Usage is rounded UP when billed (e.g. billing\_units=100 means 101 rounds to 200).
'prepaid' for upfront payment (seats), 'usage\_based' for pay-as-you-go.
Max units purchasable beyond included. E.g. included=100, max\_purchase=300 allows 400 total. Null for no limit.
Proration settings for prepaid features. Controls mid-cycle quantity change billing.
Billing behavior when quantity increases mid-cycle.
Credit behavior when quantity decreases mid-cycle.
Rollover config for unused units. If set, unused included units carry over.
Max rollover units. Omit for unlimited rollover.
Maximum rollover as a percentage (0-100) of included + prepaid grant. Mutually exclusive with max.
When rolled over units expire.
Number of periods before expiry.
Overrides fields of this item's feature for customers on this plan (e.g. a credit system's credit\_schema).
For credit system features: replaces the feature's credit\_schema entirely for customers on this plan.
ID of the metered feature that draws from this credit system.
Number of metered-feature units priced together. Defaults to one when omitted.
Named rates chosen by event properties. The most specific match sets the rate; with no match the item's own rate applies.
Event properties this entry applies to. Every key must equal the tracked property, compared as strings.
Breaks ties between dimensions that match the same number of keys. Higher wins.
Inclusive upper usage boundary for this graduated tier. The final tier must be 'inf'.
Credits consumed per billing-unit group within this tier.
Named adjustments chosen by event properties. Every match applies: factors multiply, then adds are summed.
Event properties this entry applies to. Every key must equal the tracked property, compared as strings.
Multiplies the matched rate. All matching multipliers stack.
Added to the rate after every factor is applied, in credits per billing-unit group.
Inclusive upper usage boundary for this graduated tier. The final tier must be 'inf'.
Credits consumed per billing-unit group within this tier.
Credits consumed per billing-unit group.
For AI credit system features: replaces the feature's markup chain entirely for customers on this plan. An unset level means no markup at that level rather than inheriting the feature's.
Default percentage markup for customers on this plan. Use -100 to make usage free.
Per-provider markup percentages for customers on this plan.
Per-model markup overrides for customers on this plan.
Filters selecting items to remove from the plan.
Match items linked to this feature.
Match items with this billing method (prepaid or usage\_based).
Match items with this interval. Accepts either a BillingInterval (price-side) or a ResetInterval (reset-side, includes day/hour/minute) so price-less items keyed by reset.interval can be disambiguated.
Match items with this interval\_count. Disambiguates between items that share an interval but differ in count.
Match items whose grant equals this included usage. Omitted is a wildcard.
Free trial configuration for a plan.
Number of duration\_type periods the trial lasts.
Unit of time for the trial ('day', 'month', 'year').
If true, a payment method is required to start the trial and the customer is charged when it ends. Defaults to false.
Behavior when the trial ends. 'bill' charges the customer (default). 'revert' expires the trial and restores the customer's previous plan.
Override the plan's billing controls (auto top-ups, spend limits, usage limits, usage alerts, overage allowed) for this customer.
List of auto top-up configurations per feature.
The ID of the feature (credit balance) to auto top-up.
Whether auto top-up is enabled.
When the balance drops below this threshold, an auto top-up will be purchased.
Amount of credits to add per auto top-up.
Optional rate limit to cap how often auto top-ups occur. Pass count to set the current window's consumed top-ups.
The time interval for the purchase limit window.
Number of intervals in the purchase limit window.
Maximum number of auto top-ups allowed within the interval.
Set the current window's consumed auto top-up count. Omit to leave runtime state unchanged.
When true, auto top-up creates a send\_invoice invoice instead of auto-charging.
List of overage spend limits per feature (caps overage spend).
Optional feature ID this spend limit applies to.
Whether the overage spend limit is enabled.
How overage\_limit is interpreted: an absolute overage cap (default) or a percentage of the main-plan allowance.
Overage cap for the feature: absolute units, or a percent (e.g. 120) when limit\_type is usage\_percentage.
When true, overage for this feature is not posted to Stripe. Usage tracking and balance resets still behave normally.
List of hard usage caps per feature (max units per interval).
The feature this usage limit applies to.
Whether this usage limit is enabled.
Maximum units allowed per interval.
Interval for the cap, aligned to the customer's billing cycle.
Window alignment. 'billing\_cycle' phases the interval to the customer's renewal time; 'utc' aligns to the UTC calendar.
When set, only usage from events whose properties match counts toward this cap. Omit to count all usage of the feature.
List of usage alert configurations per feature.
The feature ID this alert applies to.
Whether this usage alert is enabled.
The threshold value that triggers the alert. For usage or remaining, this is an absolute count. For usage\_percentage or remaining\_percentage, this is a percentage (0-100).
Whether the threshold is an absolute count or a percentage of the usage allowance or remaining balance.
What 100% means. balance: every grant on the feature. included: the plan allowance only. recurring: grants that reset. usage\_limit: the cap of the usage limit with the same feature and filter.
Only valid with basis usage\_limit. Points the alert at the usage limit carrying the same filter.
Optional user-defined label to distinguish multiple alerts on the same feature.
List of overage allowed controls per feature. When enabled, usage can exceed balance.
The feature ID this overage allowed control applies to.
Whether overage is allowed for this feature.
License links to add or override for this customer, keyed by license\_plan\_id. Omitted fields inherit the plan catalog link (included defaults to 1 when the license is not in the catalog). A bare entry restores the license to pure catalog inheritance.
Base price configuration for a plan.
Base price amount for the plan, in major currency units (e.g. dollars).
Billing interval (e.g. 'month', 'year').
Number of intervals per billing cycle. Defaults to 1.
Base price amounts in additional currencies. The base 'amount' is in the org's default currency.
Three-letter Stripe-supported currency code (e.g. 'eur', 'gbp').
Price amount in this currency. Set explicitly per currency, not converted from the base amount.
Bills this many feature units when outstanding overage reaches it.
The ID of the feature to configure.
Number of free units included. Balance resets to this each interval for consumable features.
If true, customer has unlimited access to this feature.
Whether entity-level grants contribute to a shared customer balance.
Reset configuration for consumable features. Omit for non-consumable features like seats.
Interval at which balance resets (e.g. 'month', 'year'). For consumable features only.
Number of intervals between resets. Defaults to 1.
Pricing for usage beyond included units. Omit for free features.
Price per billing\_units after included usage. Either 'amount' or 'tiers' is required.
Amounts in additional currencies for this flat price. The base 'amount' is in the org's default currency. Only valid with 'amount', not 'tiers'.
Three-letter Stripe-supported currency code (e.g. 'eur', 'gbp').
Price amount in this currency. Set explicitly per currency, not converted from the base amount.
Tiered pricing. Either 'amount' or 'tiers' is required.
Three-letter Stripe-supported currency code (e.g. 'eur', 'gbp').
Per-unit amount for this tier in this currency.
Flat amount for this tier in this currency, if the tier uses one.
Billing interval. For consumable features, should match reset.interval.
Number of intervals per billing cycle. Defaults to 1.
Units per price increment. Usage is rounded UP when billed (e.g. billing\_units=100 means 101 rounds to 200).
'prepaid' for upfront payment (seats), 'usage\_based' for pay-as-you-go.
Max units purchasable beyond included. E.g. included=100, max\_purchase=300 allows 400 total. Null for no limit.
Proration settings for prepaid features. Controls mid-cycle quantity change billing.
Billing behavior when quantity increases mid-cycle.
Credit behavior when quantity decreases mid-cycle.
Rollover config for unused units. If set, unused included units carry over.
Max rollover units. Omit for unlimited rollover.
Maximum rollover as a percentage (0-100) of included + prepaid grant. Mutually exclusive with max.
When rolled over units expire.
Number of periods before expiry.
Overrides fields of this item's feature for customers on this plan (e.g. a credit system's credit\_schema).
For credit system features: replaces the feature's credit\_schema entirely for customers on this plan.
ID of the metered feature that draws from this credit system.
Number of metered-feature units priced together. Defaults to one when omitted.
Named rates chosen by event properties. The most specific match sets the rate; with no match the item's own rate applies.
Event properties this entry applies to. Every key must equal the tracked property, compared as strings.
Breaks ties between dimensions that match the same number of keys. Higher wins.
Inclusive upper usage boundary for this graduated tier. The final tier must be 'inf'.
Credits consumed per billing-unit group within this tier.
Named adjustments chosen by event properties. Every match applies: factors multiply, then adds are summed.
Event properties this entry applies to. Every key must equal the tracked property, compared as strings.
Multiplies the matched rate. All matching multipliers stack.
Added to the rate after every factor is applied, in credits per billing-unit group.
Inclusive upper usage boundary for this graduated tier. The final tier must be 'inf'.
Credits consumed per billing-unit group within this tier.
Credits consumed per billing-unit group.
For AI credit system features: replaces the feature's markup chain entirely for customers on this plan. An unset level means no markup at that level rather than inheriting the feature's.
Default percentage markup for customers on this plan. Use -100 to make usage free.
Per-provider markup percentages for customers on this plan.
Per-model markup overrides for customers on this plan.
Match items linked to this feature.
Match items with this billing method (prepaid or usage\_based).
Match items with this interval. Accepts either a BillingInterval (price-side) or a ResetInterval (reset-side, includes day/hour/minute) so price-less items keyed by reset.interval can be disambiguated.
Match items with this interval\_count. Disambiguates between items that share an interval but differ in count.
Match items whose grant equals this included usage. Omitted is a wildcard.
License links to drop, keyed by license\_plan\_id. Parallel to remove\_items.
The unique identifier of the purchased plan.
Timestamp when the purchase expires, or null for lifetime access.
Timestamp when the purchase was made.
Number of units purchased.
Whether this purchase is attached at the customer level or entity level.
The feature ID this balance is for.
The full feature object if expanded.
The unique identifier for this feature, used in /check and /track calls.
Human-readable name displayed in the dashboard and billing UI.
Feature type: 'boolean' for on/off access, 'metered' for usage-tracked features, 'credit\_system' for unified credit pools, 'ai\_credit\_system' for model-based token pricing.
For metered features: true if usage resets periodically (API calls, credits), false if allocated persistently (seats, storage).
Event names that trigger this feature's balance. Allows multiple features to respond to a single event.
For classic credit systems: maps metered features to flat or graduated credit costs.
ID of the metered feature that draws from this credit system.
Number of metered-feature units priced together. Defaults to one when omitted.
Named rates chosen by event properties. The most specific match sets the rate; with no match the item's own rate applies.
Event properties this entry applies to. Every key must equal the tracked property, compared as strings.
Breaks ties between dimensions that match the same number of keys. Higher wins.
Inclusive upper usage boundary for this graduated tier. The final tier must be 'inf'.
Credits consumed per billing-unit group within this tier.
Named adjustments chosen by event properties. Every match applies: factors multiply, then adds are summed.
Event properties this entry applies to. Every key must equal the tracked property, compared as strings.
Multiplies the matched rate. All matching multipliers stack.
Added to the rate after every factor is applied, in credits per billing-unit group.
Inclusive upper usage boundary for this graduated tier. The final tier must be 'inf'.
Credits consumed per billing-unit group within this tier.
Credits consumed per billing-unit group.
Whether usage of this classic credit system should be itemized as invoice credits.
Per-model markup overrides for AI credit systems.
Default percentage markup for AI credit systems. Use -100 to make usage free.
Per-provider default markup percentages for AI credit systems.
Display names for the feature in billing UI and customer-facing components.
Singular form for UI display (e.g., 'API call', 'seat').
Plural form for UI display (e.g., 'API calls', 'seats').
Whether the feature is archived and hidden from the dashboard.
Processor mappings for this feature. Present when a Stripe product or meter is set.
Stripe product ID this feature's usage prices bill under.
Stripe meter ID used to create this feature's metered price.
Total balance granted (included + prepaid).
Remaining balance available for use.
Total usage consumed in the current period.
Whether this feature has unlimited usage.
Whether usage beyond the granted balance is allowed (with overage charges).
Maximum quantity that can be purchased as a top-up, or null for unlimited.
Timestamp when the balance will reset, or null for no reset.
Detailed breakdown of balance sources when stacking multiple plans or grants.
The unique identifier for this balance breakdown.
The plan ID this balance originates from, or null for standalone balances.
Amount granted from the plan's included usage.
Amount granted from prepaid purchases or top-ups.
Remaining balance available for use.
Amount consumed in the current period.
Whether this balance has unlimited usage.
Reset configuration for this balance, or null if no reset.
The reset interval (hour, day, week, month, etc.) or 'multiple' if combined from different intervals.
Number of intervals between resets (eg. 2 for bi-monthly).
Timestamp when the balance will next reset.
Pricing configuration if this balance has usage-based pricing.
The per-unit price amount.
Tiered pricing configuration if applicable.
How tiers are applied: graduated (split across bands) or volume (flat rate for the matched tier).
The number of units per billing increment (eg. \$9 / 250 units).
Whether usage is prepaid or billed pay-per-use.
Maximum quantity that can be purchased, or null for unlimited.
Timestamp when this balance expires, or null for no expiration.
Rollover balances carried over from previous periods.
Amount originally rolled over from a previous period, before any of it was consumed.
Amount of balance rolled over from a previous period.
Timestamp when the rollover balance expires.
The unique identifier for this flag.
The plan ID this flag originates from, or null for standalone flags.
Timestamp when this flag expires, or null for no expiration.
The feature ID this flag is for.
The full feature object if expanded.
The unique identifier for this feature, used in /check and /track calls.
Human-readable name displayed in the dashboard and billing UI.
Feature type: 'boolean' for on/off access, 'metered' for usage-tracked features, 'credit\_system' for unified credit pools, 'ai\_credit\_system' for model-based token pricing.
For metered features: true if usage resets periodically (API calls, credits), false if allocated persistently (seats, storage).
Event names that trigger this feature's balance. Allows multiple features to respond to a single event.
For classic credit systems: maps metered features to flat or graduated credit costs.
ID of the metered feature that draws from this credit system.
Number of metered-feature units priced together. Defaults to one when omitted.
Named rates chosen by event properties. The most specific match sets the rate; with no match the item's own rate applies.
Event properties this entry applies to. Every key must equal the tracked property, compared as strings.
Breaks ties between dimensions that match the same number of keys. Higher wins.
Inclusive upper usage boundary for this graduated tier. The final tier must be 'inf'.
Credits consumed per billing-unit group within this tier.
Named adjustments chosen by event properties. Every match applies: factors multiply, then adds are summed.
Event properties this entry applies to. Every key must equal the tracked property, compared as strings.
Multiplies the matched rate. All matching multipliers stack.
Added to the rate after every factor is applied, in credits per billing-unit group.
Inclusive upper usage boundary for this graduated tier. The final tier must be 'inf'.
Credits consumed per billing-unit group within this tier.
Credits consumed per billing-unit group.
Whether usage of this classic credit system should be itemized as invoice credits.
Per-model markup overrides for AI credit systems.
Default percentage markup for AI credit systems. Use -100 to make usage free.
Per-provider default markup percentages for AI credit systems.
Display names for the feature in billing UI and customer-facing components.
Singular form for UI display (e.g., 'API call', 'seat').
Plural form for UI display (e.g., 'API calls', 'seats').
Whether the feature is archived and hidden from the dashboard.
Processor mappings for this feature. Present when a Stripe product or meter is set.
Stripe product ID this feature's usage prices bill under.
Stripe meter ID used to create this feature's metered price.
Billing controls for the entity.
List of spend limits per feature. Each entry caps overage (overage\_limit) and/or per-interval usage (usage\_limit).
Optional feature ID this spend limit applies to.
Whether the overage spend limit is enabled.
How overage\_limit is interpreted: an absolute overage cap (default) or a percentage of the main-plan allowance.
Overage cap for the feature: absolute units, or a percent (e.g. 120) when limit\_type is usage\_percentage.
When true, overage for this feature is not posted to Stripe. Usage tracking and balance resets still behave normally.
Response-only: whether the entry is a customer-level override or inherited from an attached plan's defaults.
List of hard usage caps per feature for this entity. An entity entry overrides the customer's for that feature.
The feature this usage limit applies to.
Whether this usage limit is enabled.
Maximum units allowed per interval.
Interval for the cap, aligned to the customer's billing cycle.
Window alignment. 'billing\_cycle' phases the interval to the customer's renewal time; 'utc' aligns to the UTC calendar.
When set, only usage from events whose properties match counts toward this cap. Omit to count all usage of the feature.
Usage consumed in the active interval, stored in the usage-window counter.
Response-only: whether the entry is a customer-level override or inherited from an attached plan's defaults.
List of usage alert configurations per feature.
The feature ID this alert applies to.
Whether this usage alert is enabled.
The threshold value that triggers the alert. For usage or remaining, this is an absolute count. For usage\_percentage or remaining\_percentage, this is a percentage (0-100).
Whether the threshold is an absolute count or a percentage of the usage allowance or remaining balance.
What 100% means. balance: every grant on the feature. included: the plan allowance only. recurring: grants that reset. usage\_limit: the cap of the usage limit with the same feature and filter.
Only valid with basis usage\_limit. Points the alert at the usage limit carrying the same filter.
Optional user-defined label to distinguish multiple alerts on the same feature.
Response-only: whether the entry is a customer-level override or inherited from an attached plan's defaults.
List of overage allowed controls per feature. When enabled, usage can exceed balance.
The feature ID this overage allowed control applies to.
Whether overage is allowed for this feature.
Response-only: whether the entry is a customer-level override or inherited from an attached plan's defaults.
Invoices for this entity (only included when expand=invoices)
Array of plan IDs included in this invoice
The Stripe invoice ID
The billing processor that owns this invoice.
The status of the invoice
The total amount of the invoice
The currency code for the invoice
Timestamp when the invoice was created
URL to the Stripe-hosted invoice page
```json 200 theme={null}
{
"id": "seat_42",
"name": "Seat 42",
"customer_id": "cus_123",
"feature_id": "seats",
"created_at": 1771409161016,
"env": "sandbox",
"subscriptions": [
{
"plan_id": "pro_plan",
"auto_enable": true,
"add_on": false,
"status": "active",
"past_due": false,
"canceled_at": null,
"expires_at": null,
"trial_ends_at": null,
"started_at": 1771431921437,
"current_period_start": 1771431921437,
"current_period_end": 1771999921437,
"quantity": 1
}
],
"purchases": [],
"balances": {
"messages": {
"feature_id": "messages",
"granted": 100,
"remaining": 72,
"usage": 28,
"unlimited": false,
"overage_allowed": false,
"max_purchase": null,
"next_reset_at": 1773851121437,
"breakdown": [
{
"id": "cus_ent_39qmLooixXLAqMywgXywjAz96rV",
"plan_id": "pro_plan",
"included_grant": 100,
"prepaid_grant": 0,
"remaining": 72,
"usage": 28,
"unlimited": false,
"reset": {
"interval": "month",
"resets_at": 1773851121437
},
"price": null,
"expires_at": null
}
]
}
},
"invoices": []
}
```
# Aggregate Events
Source: https://docs.useautumn.com/api-reference/events/aggregateEvents
openapi POST /v1/events.aggregate
Aggregate usage events by time period. Returns usage totals grouped by feature and optionally by a custom property.
Aggregate usage events by time period. Returns usage totals grouped by feature and optionally by a custom property.
## Working with Properties
When tracking events, you can attach custom properties that can later be used for grouping aggregations:
```typescript theme={null}
// Track an event with properties
await autumn.track({
customerId: "cus_123",
featureId: "api_calls",
value: 1,
properties: {
model: "gpt-4",
source: "api",
region: "us-east"
}
});
```
You can then aggregate events grouped by any property using the `group_by` parameter:
```typescript theme={null}
const result = await autumn.events.aggregate({
customerId: "cus_123",
featureId: "api_calls",
range: "7d",
groupBy: "properties.model" // Group by the "model" property
});
```
### Special Group By Operators
In addition to custom properties, you can group by built-in columns using `$`-prefixed operators:
* `$customer_id` -- Group results by customer ID. Useful when aggregating across all customers (i.e. no `customer_id` specified).
* `$entity_id` -- Group results by entity ID. Useful for seeing usage broken down per entity.
```typescript theme={null}
// Aggregate across all customers, grouped by customer
const result = await autumn.events.aggregate({
featureId: "api_calls",
range: "7d",
groupBy: "$customer_id"
});
// Aggregate for a customer, grouped by entity
const result = await autumn.events.aggregate({
customerId: "cus_123",
featureId: "api_calls",
range: "7d",
groupBy: "$entity_id"
});
```
## Response Format
The response structure changes based on whether `group_by` is provided:
### Without `group_by` (Flat Response)
When no grouping is specified, `values` contains the aggregated sum for each feature:
```json theme={null}
{
"list": [
{
"period": 1762905600000,
"values": {
"api_calls": 150,
"messages": 45
}
}
],
"total": {
"api_calls": { "count": 10, "sum": 150 },
"messages": { "count": 5, "sum": 45 }
}
}
```
### With `group_by` (Grouped Response)
When grouping is specified, `values` contains the total sum while `grouped_values` breaks down values by group:
```json theme={null}
{
"list": [
{
"period": 1762905600000,
"values": {
"api_calls": 150
},
"grouped_values": {
"api_calls": {
"gpt-4": 100,
"gpt-3.5": 50
}
}
}
],
"total": {
"api_calls": { "count": 10, "sum": 150 }
}
}
```
The `grouped_values` field is only present when `group_by` is provided in the request.
## Deduction Breakdowns
By default, aggregations answer *"how much usage was tracked?"*. Passing `aggregate_on: "deducted"` additionally answers *"which balances did that usage actually come out of?"* — the response gains a `deductions` array, keyed by the **balance-owning feature** rather than the tracked event. The `list` and `total` fields are unchanged.
A `customer_id` is required in this mode, since deductions are resolved against a specific customer's balances.
There are two situations where this matters:
### Case 1: Usage spilling into a credit system
A feature can have its own included allowance *and* feed a credit system — usage drains the allowance first, then overflows into credits at the feature's credit cost. The standard aggregation only shows tracked totals, so the overflow is invisible. With `aggregate_on: "deducted"`, the two sides show up separately:
```typescript theme={null}
const result = await autumn.events.aggregate({
customerId: "cus_123",
featureId: "observability_events",
range: "30d",
aggregateOn: "deducted"
});
```
```json theme={null}
{
"deductions": [
{
"period": 1762905600000,
"values": {
"observability_events": {
"feature_type": "metered",
"deducted": 1000000,
"events": 12,
"balances": [
{
"balance_id": "cus_ent_abc",
"entity_id": null,
"plan_id": "team",
"reset": { "interval": "month", "resets_at": 1789218895573 },
"credit_cost": null,
"deducted": 1000000,
"events": 12
}
]
},
"usage_credits": {
"feature_type": "credit_system",
"deducted": 0.8,
"events": 1,
"balances": [
{
"balance_id": "cus_ent_def",
"entity_id": null,
"plan_id": "team",
"reset": { "interval": "month", "resets_at": 1789218895573 },
"credit_cost": 0.00008,
"deducted": 0.8,
"events": 1
}
]
}
}
}
]
}
```
Reading this: the customer's 1M-event allowance absorbed the tracked usage, and 10,000 events overflowed into the `usage_credits` pool, burning 0.8 credits at the feature's credit cost of 0.00008. Each entry is in **that balance's own unit** — events for the metered feature, credits for the credit system.
`credit_cost` is only populated when the request pins a single non-credit feature via `feature_id`, since several features feeding one pool each convert at a different rate. It reflects the credit system's current schema.
### Case 2: Per-entity balances falling through to a shared pool
When entities (e.g. seats) each carry their own balance and overflow lands on a customer-level shared balance, group by `$entity_id` to see who spent from where:
```typescript theme={null}
const result = await autumn.events.aggregate({
customerId: "cus_123",
featureId: "ai_credits",
range: "30d",
aggregateOn: "deducted",
groupBy: "$entity_id"
});
```
```json theme={null}
{
"deductions": [
{
"period": 1762905600000,
"values": {
"ai_credits": {
"feature_type": "credit_system",
"deducted": 1650,
"events": 5,
"balances": [
{ "balance_id": "cus_ent_seat_3", "entity_id": "seat_3", "plan_id": "team_seat", "deducted": 600, "events": 2, ... },
{ "balance_id": "cus_ent_seat_4", "entity_id": "seat_4", "plan_id": "team_seat", "deducted": 600, "events": 1, ... },
{ "balance_id": "cus_ent_shared", "entity_id": null, "plan_id": "team_yearly", "deducted": 50, "events": 3, ... }
]
}
},
"grouped_values": {
"cus_ent_seat_3": { "seat_3": { "deducted": 600 } },
"cus_ent_seat_4": { "seat_4": { "deducted": 600 } },
"cus_ent_shared": {
"seat_3": { "deducted": 25 },
"seat_4": { "deducted": 25 }
}
}
}
]
}
```
**Finding each entity's spillover** takes one join between the two halves of the response:
1. In `balances`, find the entry whose `entity_id` is `null`. That's the customer-level shared balance — the pool that entities fall through to when their own balance runs out. (Entries with an `entity_id` are balances owned by that entity.)
2. Take that entry's `balance_id` and look it up in `grouped_values`. The keys of that object are the entities that spent from the shared pool, and each `deducted` is exactly how much they overdrew.
Here `cus_ent_shared` is the shared balance, and `grouped_values["cus_ent_shared"]` shows seats 3 and 4 each pulled 25 credits from it beyond their own 600-credit seat balances — the "used 25 extra credits" number to show next to each seat.
The seat-owned balances appear in `grouped_values` too, but for them the owner and the spender are the same entity, so the split just restates the balance total.
`group_by: "$plan_id"` is rejected with `aggregate_on` — every balance belongs to exactly one plan, so `balances[].plan_id` already carries the plan split.
### Body Parameters
Customer ID to aggregate events for
Entity ID to filter aggregated events for (e.g., per-seat or per-resource limits)
Feature ID(s) to aggregate events for
Property to group events by (e.g. "properties.region"), or "$customer_id" / "$entity\_id" / "$plan_id" to group by those columns. When aggregate_on is "deducted", "$feature\_id" groups deductions by the tracked feature that consumed each balance.
Time range to aggregate events for. Either range or custom\_range must be provided
Size of the time bins to aggregate events for. Defaults to hour if range is 24h, otherwise day
Custom time range to aggregate events for. If provided, range must not be provided
Filter events by property values, e.g. \{"model": "gpt-4", "region": "us"}. Maximum 5 filters.
Maximum number of distinct group values to return per time bin when using group\_by. Remaining values are bundled into an 'Other' bucket. Defaults to 9
Set to "deducted" to additionally return a per-balance breakdown of what each event consumed, under `deductions`. Purely additive: `list` and `total` are unchanged. Requires customer\_id.
### Response
Array of time periods with aggregated values
Unix timestamp (epoch ms) for this time period
Aggregated values per feature: \{ \[featureId]: number }
Values broken down by group (only present when group\_by is used): \{ \[featureId]: \{ \[groupValue]: number } }
Total aggregations per feature. Keys are feature IDs, values contain count and sum.
Number of events for this feature
Sum of event values for this feature
Per-balance breakdown of what was consumed. Present only when aggregate\_on is "deducted".
Unix timestamp (epoch ms), same basis as `list`.
Keyed by the feature that OWNS the balance drawn from, not the feature that was tracked.
credit\_system means `deducted` is credits; metered means it is that feature's own amount.
ID of the balance row drawn from (customer\_entitlement or rollover).
Entity that owns this balance, or null when it is customer-level and shared.
Plan the balance came with. Null for balances created outside a plan.
Reset config for this balance, captured at deduction time.
Multiplier applied converting the tracked feature into this balance. Null when 1:1, or when the query spans sources converting at different rates.
Present only when group\_by is used. Keyed by balance\_id, then by group value — the only way to attribute a shared balance to the entity that spent from it.
```json 200 theme={null}
{
"list": [
{
"period": 1762905600000,
"values": {
"messages": 10,
"sessions": 3
}
},
{
"period": 1762992000000,
"values": {
"messages": 3,
"sessions": 12
}
}
],
"total": {
"messages": {
"count": 2,
"sum": 13
},
"sessions": {
"count": 2,
"sum": 15
}
}
}
```
# List Events
Source: https://docs.useautumn.com/api-reference/events/listEvents
openapi POST /v1/events.list
List usage events for your organization. Filter by customer, feature, or time range.
### Body Parameters
Opaque pagination cursor. Empty string (default) requests the first page; use next\_cursor from a prior response for subsequent pages.
Number of items to return. Default 50, hard ceiling 5000.
Filter events by customer ID
Filter events by entity ID (e.g., per-seat or per-resource)
Filter by specific feature ID(s)
Filter events by time range
Filter events after this timestamp (epoch milliseconds)
Filter events before this timestamp (epoch milliseconds)
### Response
Items for current page.
Event ID (KSUID)
Event timestamp (epoch milliseconds)
ID of the feature that the event belongs to
Customer identifier
Event value/count
Event properties (JSON)
Per-balance breakdown of what this event deducted. Null for events ingested before deductions were tracked; an empty array means the event was accepted but no balance moved.
ID of the underlying balance row that was deducted from (customer\_entitlement or rollover).
The feature this balance belongs to.
ID of the plan/product this balance belongs to. Null when the balance can't be attributed to a single plan (e.g. it spans multiple).
Reset configuration for the balance this deduction came from, or null if the balance doesn't reset.
The reset interval (hour, day, week, month, etc.) or 'multiple' if combined from different intervals.
Number of intervals between resets (eg. 2 for bi-monthly).
Timestamp when the balance will next reset.
Amount deducted from this balance. Positive when usage was consumed, negative when credit was restored (e.g. a refund via negative track value).
Opaque cursor for the next page. Null when there are no more results.
```json 200 theme={null}
{
"list": [
{
"id": "evt_36xpk2TmuQX5zVPPQ8tCtnR5Weg",
"timestamp": 1765958215459,
"feature_id": "credits",
"customer_id": "0pCIbS4AMAFDB1iBMNhARWZt2gDtVwQx",
"value": 30,
"properties": {},
"deductions": [
{
"balance_id": "cus_ent_3DdSDtFBlvDbjyUuJeUIbQlyN12",
"feature_id": "credits",
"plan_id": "pro",
"reset": {
"interval": "month",
"resets_at": 1765958215459
},
"value": 30
}
]
},
{
"id": "evt_36xmHxxjAkqxufDf9yHAPNfRrLM",
"timestamp": 1765956512057,
"feature_id": "credits",
"customer_id": "0pCIbS4AMAFDB1iBMNhARWZt2gDtVwQx",
"value": 49,
"properties": {},
"deductions": null
}
],
"next_cursor": "eyJ2IjowLCJpZCI6ImV2dF8zNnhtSHh4akFrcXh1ZkRmOXlIQVBOZlJyTE0iLCJ0IjoxNzY1OTU2NTEyMDU3fQ"
}
```
# Create Feature
Source: https://docs.useautumn.com/api-reference/features/createFeature
openapi POST /v1/features.create
Creates a new feature.
Use this to programmatically create features for metering usage, managing access, or building credit systems.
### Body Parameters
The name of the feature.
The type of the feature. 'single\_use' features are consumed, like API calls, tokens, or messages. 'continuous\_use' features are allocated, like seats, workspaces, or projects. 'credit\_system' features are schemas that unify multiple 'single\_use' features into a single credit system.
Whether this feature is consumable. A consumable feature is one that periodically resets and is consumed rather than allocated (like credits, API requests, etc.). Applicable only for 'metered' features.
Singular and plural display names for the feature in your user interface.
A schema that maps metered feature IDs to flat or graduated credit costs. For classic credit systems only — AI credit systems use model\_markups instead.
ID of the metered feature that draws from this credit system.
Number of metered-feature units priced together. Defaults to one when omitted.
Named rates chosen by event properties. The most specific match sets the rate; with no match the item's own rate applies.
Event properties this entry applies to. Every key must equal the tracked property, compared as strings.
Breaks ties between dimensions that match the same number of keys. Higher wins.
Inclusive upper usage boundary for this graduated tier. The final tier must be 'inf'.
Credits consumed per billing-unit group within this tier.
Named adjustments chosen by event properties. Every match applies: factors multiply, then adds are summed.
Event properties this entry applies to. Every key must equal the tracked property, compared as strings.
Multiplies the matched rate. All matching multipliers stack.
Added to the rate after every factor is applied, in credits per billing-unit group.
Inclusive upper usage boundary for this graduated tier. The final tier must be 'inf'.
Credits consumed per billing-unit group within this tier.
Credits consumed per billing-unit group.
Whether usage of this classic credit system should be itemized as invoice credits.
Per-model markup overrides for AI credit systems. Maps model IDs to their markup configuration.
Default percentage markup for this AI credit system. Used when no model or provider markup applies. Use -100 to make usage free.
Per-provider default markup percentages for AI credit systems. Provider keys match the first segment of model\_id.
The ID of the feature to create.
### Response
The unique identifier for this feature, used in /check and /track calls.
Human-readable name displayed in the dashboard and billing UI.
Feature type: 'boolean' for on/off access, 'metered' for usage-tracked features, 'credit\_system' for unified credit pools, 'ai\_credit\_system' for model-based token pricing.
For metered features: true if usage resets periodically (API calls, credits), false if allocated persistently (seats, storage).
Event names that trigger this feature's balance. Allows multiple features to respond to a single event.
For classic credit systems: maps metered features to flat or graduated credit costs.
ID of the metered feature that draws from this credit system.
Number of metered-feature units priced together. Defaults to one when omitted.
Named rates chosen by event properties. The most specific match sets the rate; with no match the item's own rate applies.
Event properties this entry applies to. Every key must equal the tracked property, compared as strings.
Breaks ties between dimensions that match the same number of keys. Higher wins.
Inclusive upper usage boundary for this graduated tier. The final tier must be 'inf'.
Credits consumed per billing-unit group within this tier.
Named adjustments chosen by event properties. Every match applies: factors multiply, then adds are summed.
Event properties this entry applies to. Every key must equal the tracked property, compared as strings.
Multiplies the matched rate. All matching multipliers stack.
Added to the rate after every factor is applied, in credits per billing-unit group.
Inclusive upper usage boundary for this graduated tier. The final tier must be 'inf'.
Credits consumed per billing-unit group within this tier.
Credits consumed per billing-unit group.
Whether usage of this classic credit system should be itemized as invoice credits.
Per-model markup overrides for AI credit systems.
Default percentage markup for AI credit systems. Use -100 to make usage free.
Per-provider default markup percentages for AI credit systems.
Display names for the feature in billing UI and customer-facing components.
Singular form for UI display (e.g., 'API call', 'seat').
Plural form for UI display (e.g., 'API calls', 'seats').
Whether the feature is archived and hidden from the dashboard.
Processor mappings for this feature. Present when a Stripe product or meter is set.
Stripe product ID this feature's usage prices bill under.
Stripe meter ID used to create this feature's metered price.
```json 200 theme={null}
{
"id": "api-calls",
"name": "API Calls",
"type": "metered",
"consumable": true,
"archived": false,
"display": {
"singular": "API call",
"plural": "API calls"
}
}
```
# Delete Feature
Source: https://docs.useautumn.com/api-reference/features/deleteFeature
openapi POST /v1/features.delete
Deletes a feature by its ID.
Use this to permanently remove a feature. Note: features that are used in products cannot be deleted - archive them instead.
### Body Parameters
The ID of the feature to delete.
### Response
```json 200 theme={null}
{
"success": true
}
```
# Get Feature
Source: https://docs.useautumn.com/api-reference/features/getFeature
openapi POST /v1/features.get
Retrieves a single feature by its ID.
Use this when you need to fetch the details of a specific feature.
### Body Parameters
The ID of the feature.
### Response
The unique identifier for this feature, used in /check and /track calls.
Human-readable name displayed in the dashboard and billing UI.
Feature type: 'boolean' for on/off access, 'metered' for usage-tracked features, 'credit\_system' for unified credit pools, 'ai\_credit\_system' for model-based token pricing.
For metered features: true if usage resets periodically (API calls, credits), false if allocated persistently (seats, storage).
Event names that trigger this feature's balance. Allows multiple features to respond to a single event.
For classic credit systems: maps metered features to flat or graduated credit costs.
ID of the metered feature that draws from this credit system.
Number of metered-feature units priced together. Defaults to one when omitted.
Named rates chosen by event properties. The most specific match sets the rate; with no match the item's own rate applies.
Event properties this entry applies to. Every key must equal the tracked property, compared as strings.
Breaks ties between dimensions that match the same number of keys. Higher wins.
Inclusive upper usage boundary for this graduated tier. The final tier must be 'inf'.
Credits consumed per billing-unit group within this tier.
Named adjustments chosen by event properties. Every match applies: factors multiply, then adds are summed.
Event properties this entry applies to. Every key must equal the tracked property, compared as strings.
Multiplies the matched rate. All matching multipliers stack.
Added to the rate after every factor is applied, in credits per billing-unit group.
Inclusive upper usage boundary for this graduated tier. The final tier must be 'inf'.
Credits consumed per billing-unit group within this tier.
Credits consumed per billing-unit group.
Whether usage of this classic credit system should be itemized as invoice credits.
Per-model markup overrides for AI credit systems.
Default percentage markup for AI credit systems. Use -100 to make usage free.
Per-provider default markup percentages for AI credit systems.
Display names for the feature in billing UI and customer-facing components.
Singular form for UI display (e.g., 'API call', 'seat').
Plural form for UI display (e.g., 'API calls', 'seats').
Whether the feature is archived and hidden from the dashboard.
Processor mappings for this feature. Present when a Stripe product or meter is set.
Stripe product ID this feature's usage prices bill under.
Stripe meter ID used to create this feature's metered price.
```json 200 theme={null}
{
"id": "api-calls",
"name": "API Calls",
"type": "metered",
"consumable": true,
"archived": false,
"display": {
"singular": "API call",
"plural": "API calls"
}
}
```
# List Features
Source: https://docs.useautumn.com/api-reference/features/listFeatures
openapi POST /v1/features.list
Lists all features in the current environment.
Use this to retrieve all features configured for your organization to display in dashboards or for feature management.
### Response
The unique identifier for this feature, used in /check and /track calls.
Human-readable name displayed in the dashboard and billing UI.
Feature type: 'boolean' for on/off access, 'metered' for usage-tracked features, 'credit\_system' for unified credit pools, 'ai\_credit\_system' for model-based token pricing.
For metered features: true if usage resets periodically (API calls, credits), false if allocated persistently (seats, storage).
Event names that trigger this feature's balance. Allows multiple features to respond to a single event.
For classic credit systems: maps metered features to flat or graduated credit costs.
ID of the metered feature that draws from this credit system.
Number of metered-feature units priced together. Defaults to one when omitted.
Named rates chosen by event properties. The most specific match sets the rate; with no match the item's own rate applies.
Event properties this entry applies to. Every key must equal the tracked property, compared as strings.
Breaks ties between dimensions that match the same number of keys. Higher wins.
Inclusive upper usage boundary for this graduated tier. The final tier must be 'inf'.
Credits consumed per billing-unit group within this tier.
Named adjustments chosen by event properties. Every match applies: factors multiply, then adds are summed.
Event properties this entry applies to. Every key must equal the tracked property, compared as strings.
Multiplies the matched rate. All matching multipliers stack.
Added to the rate after every factor is applied, in credits per billing-unit group.
Inclusive upper usage boundary for this graduated tier. The final tier must be 'inf'.
Credits consumed per billing-unit group within this tier.
Credits consumed per billing-unit group.
Whether usage of this classic credit system should be itemized as invoice credits.
Per-model markup overrides for AI credit systems.
Default percentage markup for AI credit systems. Use -100 to make usage free.
Per-provider default markup percentages for AI credit systems.
Display names for the feature in billing UI and customer-facing components.
Singular form for UI display (e.g., 'API call', 'seat').
Plural form for UI display (e.g., 'API calls', 'seats').
Whether the feature is archived and hidden from the dashboard.
Processor mappings for this feature. Present when a Stripe product or meter is set.
Stripe product ID this feature's usage prices bill under.
Stripe meter ID used to create this feature's metered price.
```json 200 theme={null}
{
"list": [
{
"id": "api-calls",
"name": "API Calls",
"type": "metered",
"consumable": true,
"archived": false,
"display": {
"singular": "API call",
"plural": "API calls"
}
},
{
"id": "credits",
"name": "Credits",
"type": "credit_system",
"consumable": true,
"archived": false,
"credit_schema": [
{
"metered_feature_id": "api-calls",
"credit_cost": 1
},
{
"metered_feature_id": "image-generations",
"credit_cost": 10
}
],
"display": {
"singular": "credit",
"plural": "credits"
}
}
]
}
```
# Update Feature
Source: https://docs.useautumn.com/api-reference/features/updateFeature
openapi POST /v1/features.update
Updates an existing feature.
Use this to modify feature properties like name, display settings, or to archive a feature.
### Body Parameters
The name of the feature.
The type of the feature. 'single\_use' features are consumed, like API calls, tokens, or messages. 'continuous\_use' features are allocated, like seats, workspaces, or projects. 'credit\_system' features are schemas that unify multiple 'single\_use' features into a single credit system.
Whether this feature is consumable. A consumable feature is one that periodically resets and is consumed rather than allocated (like credits, API requests, etc.). Applicable only for 'metered' features.
Singular and plural display names for the feature in your user interface.
A schema that maps metered feature IDs to flat or graduated credit costs. For classic credit systems only — AI credit systems use model\_markups instead.
ID of the metered feature that draws from this credit system.
Number of metered-feature units priced together. Defaults to one when omitted.
Named rates chosen by event properties. The most specific match sets the rate; with no match the item's own rate applies.
Event properties this entry applies to. Every key must equal the tracked property, compared as strings.
Breaks ties between dimensions that match the same number of keys. Higher wins.
Inclusive upper usage boundary for this graduated tier. The final tier must be 'inf'.
Credits consumed per billing-unit group within this tier.
Named adjustments chosen by event properties. Every match applies: factors multiply, then adds are summed.
Event properties this entry applies to. Every key must equal the tracked property, compared as strings.
Multiplies the matched rate. All matching multipliers stack.
Added to the rate after every factor is applied, in credits per billing-unit group.
Inclusive upper usage boundary for this graduated tier. The final tier must be 'inf'.
Credits consumed per billing-unit group within this tier.
Credits consumed per billing-unit group.
Whether usage of this classic credit system should be itemized as invoice credits.
Per-model markup overrides for AI credit systems. Maps model IDs to their markup configuration.
Default percentage markup for this AI credit system. Used when no model or provider markup applies. Use -100 to make usage free.
Per-provider default markup percentages for AI credit systems. Provider keys match the first segment of model\_id.
Whether the feature is archived. Archived features are hidden from the dashboard.
The ID of the feature to update.
The new ID of the feature. Feature ID can only be updated if it's not being used by any customers.
### Response
The unique identifier for this feature, used in /check and /track calls.
Human-readable name displayed in the dashboard and billing UI.
Feature type: 'boolean' for on/off access, 'metered' for usage-tracked features, 'credit\_system' for unified credit pools, 'ai\_credit\_system' for model-based token pricing.
For metered features: true if usage resets periodically (API calls, credits), false if allocated persistently (seats, storage).
Event names that trigger this feature's balance. Allows multiple features to respond to a single event.
For classic credit systems: maps metered features to flat or graduated credit costs.
ID of the metered feature that draws from this credit system.
Number of metered-feature units priced together. Defaults to one when omitted.
Named rates chosen by event properties. The most specific match sets the rate; with no match the item's own rate applies.
Event properties this entry applies to. Every key must equal the tracked property, compared as strings.
Breaks ties between dimensions that match the same number of keys. Higher wins.
Inclusive upper usage boundary for this graduated tier. The final tier must be 'inf'.
Credits consumed per billing-unit group within this tier.
Named adjustments chosen by event properties. Every match applies: factors multiply, then adds are summed.
Event properties this entry applies to. Every key must equal the tracked property, compared as strings.
Multiplies the matched rate. All matching multipliers stack.
Added to the rate after every factor is applied, in credits per billing-unit group.
Inclusive upper usage boundary for this graduated tier. The final tier must be 'inf'.
Credits consumed per billing-unit group within this tier.
Credits consumed per billing-unit group.
Whether usage of this classic credit system should be itemized as invoice credits.
Per-model markup overrides for AI credit systems.
Default percentage markup for AI credit systems. Use -100 to make usage free.
Per-provider default markup percentages for AI credit systems.
Display names for the feature in billing UI and customer-facing components.
Singular form for UI display (e.g., 'API call', 'seat').
Plural form for UI display (e.g., 'API calls', 'seats').
Whether the feature is archived and hidden from the dashboard.
Processor mappings for this feature. Present when a Stripe product or meter is set.
Stripe product ID this feature's usage prices bill under.
Stripe meter ID used to create this feature's metered price.
```json 200 theme={null}
{
"id": "api-calls",
"name": "API Calls",
"type": "metered",
"consumable": true,
"archived": false,
"display": {
"singular": "API call",
"plural": "API calls"
}
}
```
# Insert Invoices
Source: https://docs.useautumn.com/api-reference/invoices/insertInvoices
openapi POST /v1/invoices.insert
Inserts or updates up to 500 historical invoices without reading or mutating the billing processor.
### Body Parameters
Invoices to insert or update, in response order.
The customer this invoice belongs to.
Plan IDs represented by this invoice.
The processor's stable invoice ID.
The billing processor that owns this invoice.
The invoice status.
The invoice total in major currency units.
The amount paid in major currency units.
The refunded amount in major currency units.
The currency code. Defaults to the organization's default currency.
The invoice creation timestamp in milliseconds.
The hosted invoice URL, when available.
### Response
Inserted or updated invoices in request order.
Array of plan IDs included in this invoice
The Stripe invoice ID
The billing processor that owns this invoice.
The status of the invoice
The total amount of the invoice
The currency code for the invoice
Timestamp when the invoice was created
URL to the Stripe-hosted invoice page
The Autumn invoice ID.
The customer this invoice belongs to.
The amount paid in major currency units.
The refunded amount in major currency units.
```json 200 theme={null}
{
"invoices": [
{
"id": "inv_2b3c4d5e6f7g8h",
"customer_id": "cus_123",
"plan_ids": [
"pro"
],
"stripe_id": "in_legacy_123",
"processor_type": "stripe",
"status": "paid",
"total": 29.99,
"amount_paid": 29.99,
"refunded_amount": 0,
"currency": "usd",
"created_at": 1451606400000,
"hosted_invoice_url": "https://billing.example.com/invoices/legacy-123"
}
]
}
```
# List Invoices
Source: https://docs.useautumn.com/api-reference/invoices/listInvoices
openapi POST /v1/invoices.list
Lists invoices with cursor pagination and optional filters (customer, entity, status, processor). Pass `start_cursor: ""` (or omit) for the first page; use `next_cursor` from a prior response for subsequent pages.
### Body Parameters
Opaque pagination cursor. Empty string (default) requests the first page; use next\_cursor from a prior response for subsequent pages.
Number of items to return. Default 50, hard ceiling 5000.
Filter invoices to a single customer by ID.
Filter invoices to a single entity by ID. Must be provided together with customer\_id, since entity IDs are only unique per customer.
Filter by invoice status (draft, open, paid, void, uncollectible).
Filter by billing processor (stripe, revenuecat). Invoices recorded before processor tracking count as stripe.
### Response
Items for current page.
Array of plan IDs included in this invoice
The Stripe invoice ID
The billing processor that owns this invoice.
The status of the invoice
The total amount of the invoice
The currency code for the invoice
Timestamp when the invoice was created
URL to the Stripe-hosted invoice page
The Autumn invoice ID
The ID of the customer this invoice belongs to. Null for customers created without an ID.
The ID of the entity this invoice belongs to, if entity-scoped
The amount paid on the invoice. Null on invoices recorded before amounts paid were tracked.
The total amount refunded on the invoice
Line items on the invoice, one per line as shown in Stripe. Capped at 100. Empty for invoices recorded before line item storage.
Description of the invoice line item
Timestamp when the billing period starts
Timestamp when the billing period ends
The plan this line item came from. Null for lines with no Autumn plan behind them.
The ID of the feature associated with this line item
The name of the feature associated with this line item
Quantity actually charged on this line. Null on fixed-price lines.
Amount charged on this line, pre-discount and pre-tax. Negative for credits.
How this line splits by entity. Empty for customer-level lines. Only populated for invoices finalized after entity attribution shipped.
The entity this share of the line item is attributed to
Quantity charged to this entity. Null on fixed-price lines.
Amount attributed to this entity, pre-discount and pre-tax
Opaque cursor for the next page. Null when there are no more results.
```json 200 theme={null}
{
"list": [
{
"id": "inv_2b3c4d5e6f7g8h",
"customer_id": "cus_123",
"entity_id": null,
"plan_ids": [
"pro_plan"
],
"stripe_id": "in_1A2B3C4D5E6F7G8H",
"processor_type": "stripe",
"status": "paid",
"total": 29.99,
"amount_paid": 29.99,
"refunded_amount": 0,
"currency": "usd",
"created_at": 1759247877000,
"hosted_invoice_url": "https://invoice.stripe.com/i/acct_123/test_456",
"items": [
{
"description": "Pro plan",
"plan_id": "pro_plan",
"feature_id": null,
"feature_name": null,
"quantity": null,
"amount": 20,
"period_start": 1759247877000,
"period_end": 1761839877000,
"entities": []
},
{
"description": "AI credits",
"plan_id": "pro_plan",
"feature_id": "ai_credits",
"feature_name": "AI Credits",
"quantity": 4995,
"amount": 9.99,
"period_start": 1759247877000,
"period_end": 1761839877000,
"entities": [
{
"entity_id": "acme-docs-prod",
"quantity": 4995,
"amount": 9.99
}
]
}
]
}
],
"next_cursor": null
}
```
# Pay Invoice
Source: https://docs.useautumn.com/api-reference/invoices/payInvoice
openapi POST /v1/invoices.pay
Marks an open Stripe invoice as paid out of band. No charge is attempted; use this when payment was collected elsewhere (e.g. a marketplace). Already-paid invoices are returned unchanged.
### Body Parameters
The Autumn invoice ID to mark as paid.
### Response
Array of plan IDs included in this invoice
The Stripe invoice ID
The billing processor that owns this invoice.
The status of the invoice
The total amount of the invoice
The currency code for the invoice
Timestamp when the invoice was created
URL to the Stripe-hosted invoice page
The Autumn invoice ID
The ID of the customer this invoice belongs to. Null for customers created without an ID.
The ID of the entity this invoice belongs to, if entity-scoped
The amount paid on the invoice. Null on invoices recorded before amounts paid were tracked.
The total amount refunded on the invoice
Line items on the invoice, one per line as shown in Stripe. Capped at 100. Empty for invoices recorded before line item storage.
Description of the invoice line item
Timestamp when the billing period starts
Timestamp when the billing period ends
The plan this line item came from. Null for lines with no Autumn plan behind them.
The ID of the feature associated with this line item
The name of the feature associated with this line item
Quantity actually charged on this line. Null on fixed-price lines.
Amount charged on this line, pre-discount and pre-tax. Negative for credits.
How this line splits by entity. Empty for customer-level lines. Only populated for invoices finalized after entity attribution shipped.
The entity this share of the line item is attributed to
Quantity charged to this entity. Null on fixed-price lines.
Amount attributed to this entity, pre-discount and pre-tax
```json 200 theme={null}
{
"invoice": {
"id": "inv_2b3c4d5e6f7g8h",
"customer_id": "cus_123",
"entity_id": null,
"plan_ids": [
"pro_plan"
],
"stripe_id": "in_1A2B3C4D5E6F7G8H",
"processor_type": "stripe",
"status": "paid",
"total": 29.99,
"amount_paid": 29.99,
"refunded_amount": 0,
"currency": "usd",
"created_at": 1759247877000,
"hosted_invoice_url": "https://invoice.stripe.com/i/acct_123/test_456",
"items": [
{
"description": "Pro plan",
"plan_id": "pro_plan",
"feature_id": null,
"feature_name": null,
"quantity": null,
"amount": 20,
"period_start": 1759247877000,
"period_end": 1761839877000,
"entities": []
},
{
"description": "AI credits",
"plan_id": "pro_plan",
"feature_id": "ai_credits",
"feature_name": "AI Credits",
"quantity": 4995,
"amount": 9.99,
"period_start": 1759247877000,
"period_end": 1761839877000,
"entities": [
{
"entity_id": "acme-docs-prod",
"quantity": 4995,
"amount": 9.99
}
]
}
]
}
}
```
# Mint
Source: https://docs.useautumn.com/api-reference/keys/mintKey
openapi POST /v1/keys.mint
Mints a per-customer token (a scoped `am_jwt_` credential) so a downstream / self-hosted app can call Autumn directly without your secret key. Returns a short-lived access token plus a rotating refresh token, both bound to the given customer. Authenticated with your secret key.
Mints a per-customer token — a scoped `am_jwt_` credential — so a self-hosted or downstream app can call Autumn directly without your secret key. Authenticated with your **secret key**. Returns a short-lived access token (1h) and a rotating refresh token (24h), both bound to a single customer.
### How it works
1. Your backend calls `keys.mint` with your secret key to issue a token pair for a customer.
2. Hand the **access token** to that customer's app. It can call `check`, `track`, `customers.get` and `entities.get` — always scoped to that customer, even if a different `customer_id` is sent.
3. Before the access token expires, the app calls [`keys.refresh`](/api-reference/keys/refreshKey) with its **refresh token** to rotate a fresh pair — no secret key required.
```typescript TypeScript theme={null}
const { accessToken, refreshToken } = await autumn.keys.mint({
customerId: "cus_123",
});
```
```bash cURL theme={null}
curl -X POST "https://api.useautumn.com/v1/keys.mint" \
-H "Authorization: Bearer am_sk_live_..." \
-H "Content-Type: application/json" \
-d '{ "customer_id": "cus_123" }'
```
### Body Parameters
The customer to mint a token for.
If true, mint a non-expiring access token (no refresh token). Revoke via keys.revoke.
### Response
Access token (1h, or non-expiring if indefinite), prefixed `am_jwt_`.
Rotating refresh token (24h). Omitted for indefinite tokens.
Access-token expiry, ms since epoch. null for indefinite tokens.
Refresh-token expiry, ms since epoch. Omitted for indefinite tokens.
```json 200 theme={null}
{
"access_token": "am_jwt_eyJhbGciOiJIUzI1NiJ9...",
"refresh_token": "am_jwt_eyJhbGciOiJIUzI1NiJ9...",
"expires_at": 1781113864000,
"refresh_expires_at": 1781196664000
}
```
# Refresh
Source: https://docs.useautumn.com/api-reference/keys/refreshKey
openapi POST /v1/keys.refresh
Exchanges a refresh token (sent as the Bearer credential) for a freshly rotated access + refresh pair. Self-service for the token holder — no secret key required. The previous refresh token is honored for one rotation as a grace window; replaying an older one revokes the customer's tokens.
Exchanges a refresh token for a freshly rotated access + refresh pair. Self-service for the token holder — **no secret key required**. Send the refresh token as the Bearer credential.
### How it works
The just-replaced refresh token is honored for one more rotation (a grace window so a dropped response or a second app instance doesn't lock the customer out). Replaying a refresh token that is more than one generation old is treated as theft and revokes the customer's tokens.
```typescript TypeScript theme={null}
// Client configured with the refresh token as its key
import { Autumn } from "autumn-js";
const autumn = new Autumn({
secretKey: JWT_REFRESH_TOKEN,
});
const { accessToken, refreshToken } = await autumn.keys.refresh({});
```
```bash cURL theme={null}
curl -X POST "https://api.useautumn.com/v1/keys.refresh" \
-H "Authorization: Bearer am_jwt_"
```
### Response
Access token (1h, or non-expiring if indefinite), prefixed `am_jwt_`.
Rotating refresh token (24h). Omitted for indefinite tokens.
Access-token expiry, ms since epoch. null for indefinite tokens.
Refresh-token expiry, ms since epoch. Omitted for indefinite tokens.
```json 200 theme={null}
{
"access_token": "am_jwt_eyJhbGciOiJIUzI1NiJ9...",
"refresh_token": "am_jwt_eyJhbGciOiJIUzI1NiJ9...",
"expires_at": 1781113864000,
"refresh_expires_at": 1781196664000
}
```
# Revoke
Source: https://docs.useautumn.com/api-reference/keys/revokeKey
openapi POST /v1/keys.revoke
Revokes every outstanding token (access and refresh) for a customer. Authenticated with your secret key. New tokens can be issued afterwards with `keys.mint`.
Revokes every outstanding token — access and refresh — for a customer. Authenticated with your **secret key**. Issue new tokens afterwards with [`keys.mint`](/api-reference/keys/mintKey).
```typescript TypeScript theme={null}
await autumn.keys.revoke({ customerId: "cus_123" });
```
```bash cURL theme={null}
curl -X POST "https://api.useautumn.com/v1/keys.revoke" \
-H "Authorization: Bearer am_sk_live_..." \
-H "Content-Type: application/json" \
-d '{ "customer_id": "cus_123" }'
```
### Body Parameters
The customer whose tokens (every outstanding access + refresh token) should be revoked.
### Response
```json 200 theme={null}
{
"revoked": true
}
```
# Attach License
Source: https://docs.useautumn.com/api-reference/licenses/attachLicense
openapi POST /v1/licenses.attach
Assigns licenses to one or more entities.
License assignment is idempotent for an entity that already has an active
assignment for the same license plan. Autumn skips those entities without
consuming another license; mixed batches assign only unassigned entities. A
duplicate-only request still returns `200` with `{ "success": true }`.
Duplicate IDs within one batch and insufficient capacity for new assignments
still return an error.
### Body Parameters
The ID of the entity to assign the license to.
The name of the entity, used when creating it.
The feature the entity is associated with. Required when the entity does not exist yet.
### Response
# List License Assignments
Source: https://docs.useautumn.com/api-reference/licenses/listLicenseAssignments
openapi POST /v1/licenses.list_assignments
Lists license assignments for a customer.
### Body Parameters
### Response
```json 200 theme={null}
{
"list": [
{
"id": "lic_asn_123",
"entity_id": "user_123",
"license_plan_id": "seat_plan",
"started_at": 1759247877000,
"ended_at": null
}
]
}
```
# List Licenses
Source: https://docs.useautumn.com/api-reference/licenses/listLicenses
openapi POST /v1/licenses.list
Lists a customer's license pools and available seats.
### Body Parameters
### Response
The plan offered as an assignable license.
The plan that offers this license.
Display name of the license plan.
Total seats the customer has for this license, included plus paid.
Seats currently assigned to entities.
Seats still available to assign.
Paid seats purchased on top of the plan's included amount.
```json 200 theme={null}
{
"list": [
{
"license_plan_id": "seat_plan",
"parent_plan_id": "pro_plan",
"license_plan_name": "Seat",
"granted": 10,
"usage": 3,
"remaining": 7,
"paid_quantity": 5
}
]
}
```
# Release License
Source: https://docs.useautumn.com/api-reference/licenses/releaseLicense
openapi POST /v1/licenses.release
Releases licenses assigned to one or more entities.
### Body Parameters
Scopes the release when an entity holds licenses of multiple plans.
### Response
# Create a plan
Source: https://docs.useautumn.com/api-reference/plans/createPlan
openapi POST /v1/plans.create
Creates a new plan with optional base price and feature configurations.
Use this to programmatically create pricing plans. See [How plans work](/documentation/pricing/plans) for concepts.
Creates a new plan with optional base price and feature configurations. See [How plans work](/documentation/concepts/plans) for concepts and [Adding features to plans](/documentation/concepts/plan-items) for item configuration.
### Plan Configuration
A plan consists of:
* **Base price** - optional recurring charge for the plan itself
* **Items** - feature configurations defining what customers get and how they're billed
### Configuring Items
Each item in the `items` array configures a single feature. There are two types:
**Consumable features** (API calls, messages, credits):
* Set `included` for free units that reset each period
* Set `reset.interval` to define when balance resets to `included`
* Optionally add `price` for usage beyond included amount
**Non-consumable features** (seats, storage):
* Set `included` for the base allocation
* Do NOT set `reset` - usage persists across billing cycles
* Use `billing_method: "prepaid"` for upfront payment per unit
### Multiple Currencies
To sell a plan in currencies beyond your organization's default, set `additional_currencies` on the base price, a feature price, or each tier of a tiered price. Amounts are explicit per currency - no exchange rates are applied - and tier boundaries stay the same across currencies. See [Plans](/documentation/concepts/plans#multiple-currencies) for how customers are matched to a currency.
### Common Use Cases
```typescript Free plan with auto-enable theme={null}
await autumn.plans.create({
planId: "free_plan",
name: "Free",
autoEnable: true, // Automatically attached on customer creation
items: [
{
featureId: "messages",
included: 100,
reset: { interval: "month" }
}
]
});
```
```typescript Paid plan with base price + usage-based feature theme={null}
await autumn.plans.create({
planId: "pro_plan",
name: "Pro Plan",
price: { amount: 10, interval: "month" },
items: [
{
featureId: "messages",
included: 1000,
reset: { interval: "month" },
price: {
amount: 0.01,
interval: "month",
billingUnits: 1,
billingMethod: "usage_based"
}
}
]
});
```
```typescript Plan with prepaid seats theme={null}
await autumn.plans.create({
planId: "team_plan",
name: "Team Plan",
price: { amount: 49, interval: "month" },
items: [
{
featureId: "seats",
included: 5,
// No reset - seats persist across billing cycles
price: {
amount: 10,
interval: "month",
billingUnits: 1,
billingMethod: "prepaid"
}
}
]
});
```
```typescript Add-on plan theme={null}
await autumn.plans.create({
planId: "analytics_addon",
name: "Advanced Analytics",
addOn: true, // Can be attached alongside other plans
price: { amount: 20, interval: "month" }
});
```
```typescript Plan with tiered pricing theme={null}
await autumn.plans.create({
planId: "api_plan",
name: "API Plan",
items: [
{
featureId: "api_calls",
included: 1000,
reset: { interval: "month" },
price: {
tiers: [
{ to: 10000, amount: 0.001 },
{ to: 100000, amount: 0.0005 },
{ to: "inf", amount: 0.0001 }
],
interval: "month",
billingUnits: 1,
billingMethod: "usage_based"
}
}
]
});
```
```typescript Plan with free trial theme={null}
await autumn.plans.create({
planId: "premium_plan",
name: "Premium",
price: { amount: 99, interval: "month" },
freeTrial: {
durationLength: 14,
durationType: "day",
cardRequired: true
}
});
```
### Body Parameters
The ID of the plan to create.
Group identifier for organizing related plans. Plans in the same group are mutually exclusive.
Display name of the plan.
Optional description of the plan.
If true, this plan can be attached alongside other plans. Otherwise, attaching replaces existing plans in the same group.
If true, plan is automatically attached when a customer is created. Use for free tiers.
Base recurring price for the plan. Omit for free or usage-only plans.
Base price amount for the plan, in major currency units (e.g. dollars).
Billing interval (e.g. 'month', 'year').
Number of intervals per billing cycle. Defaults to 1.
Base price amounts in additional currencies. The base 'amount' is in the org's default currency.
Three-letter Stripe-supported currency code (e.g. 'eur', 'gbp').
Price amount in this currency. Set explicitly per currency, not converted from the base amount.
Feature configurations for this plan. Each item defines included units, pricing, and reset behavior.
Bills this many feature units when outstanding overage reaches it.
The ID of the feature to configure.
Number of free units included. Balance resets to this each interval for consumable features.
If true, customer has unlimited access to this feature.
Whether entity-level grants contribute to a shared customer balance.
Reset configuration for consumable features. Omit for non-consumable features like seats.
Interval at which balance resets (e.g. 'month', 'year'). For consumable features only.
Number of intervals between resets. Defaults to 1.
Pricing for usage beyond included units. Omit for free features.
Price per billing\_units after included usage. Either 'amount' or 'tiers' is required.
Amounts in additional currencies for this flat price. The base 'amount' is in the org's default currency. Only valid with 'amount', not 'tiers'.
Three-letter Stripe-supported currency code (e.g. 'eur', 'gbp').
Price amount in this currency. Set explicitly per currency, not converted from the base amount.
Tiered pricing. Either 'amount' or 'tiers' is required.
Per-currency amounts for this tier. Tier boundaries ('to') are shared across all currencies.
Three-letter Stripe-supported currency code (e.g. 'eur', 'gbp').
Per-unit amount for this tier in this currency.
Flat amount for this tier in this currency, if the tier uses one.
Billing interval. For consumable features, should match reset.interval.
Number of intervals per billing cycle. Defaults to 1.
Units per price increment. Usage is rounded UP when billed (e.g. billing\_units=100 means 101 rounds to 200).
'prepaid' for upfront payment (seats), 'usage\_based' for pay-as-you-go.
Max units purchasable beyond included. E.g. included=100, max\_purchase=300 allows 400 total. Null for no limit.
Proration settings for prepaid features. Controls mid-cycle quantity change billing.
Billing behavior when quantity increases mid-cycle.
Credit behavior when quantity decreases mid-cycle.
Rollover config for unused units. If set, unused included units carry over.
Max rollover units. Omit for unlimited rollover.
Maximum rollover as a percentage (0-100) of included + prepaid grant. Mutually exclusive with max.
When rolled over units expire.
Number of periods before expiry.
Overrides fields of this item's feature for customers on this plan (e.g. a credit system's credit\_schema).
For credit system features: replaces the feature's credit\_schema entirely for customers on this plan.
ID of the metered feature that draws from this credit system.
Number of metered-feature units priced together. Defaults to one when omitted.
Named rates chosen by event properties. The most specific match sets the rate; with no match the item's own rate applies.
Event properties this entry applies to. Every key must equal the tracked property, compared as strings.
Breaks ties between dimensions that match the same number of keys. Higher wins.
Inclusive upper usage boundary for this graduated tier. The final tier must be 'inf'.
Credits consumed per billing-unit group within this tier.
Named adjustments chosen by event properties. Every match applies: factors multiply, then adds are summed.
Event properties this entry applies to. Every key must equal the tracked property, compared as strings.
Multiplies the matched rate. All matching multipliers stack.
Added to the rate after every factor is applied, in credits per billing-unit group.
Inclusive upper usage boundary for this graduated tier. The final tier must be 'inf'.
Credits consumed per billing-unit group within this tier.
Credits consumed per billing-unit group.
For AI credit system features: replaces the feature's markup chain entirely for customers on this plan. An unset level means no markup at that level rather than inheriting the feature's.
Default percentage markup for customers on this plan. Use -100 to make usage free.
Per-provider markup percentages for customers on this plan.
Per-model markup overrides for customers on this plan.
Plans offered as assignable licenses under this plan. The full set replaces existing links.
Base price configuration for a plan.
Base price amount for the plan, in major currency units (e.g. dollars).
Billing interval (e.g. 'month', 'year').
Number of intervals per billing cycle. Defaults to 1.
Base price amounts in additional currencies. The base 'amount' is in the org's default currency.
Three-letter Stripe-supported currency code (e.g. 'eur', 'gbp').
Price amount in this currency. Set explicitly per currency, not converted from the base amount.
Bills this many feature units when outstanding overage reaches it.
The ID of the feature to configure.
Number of free units included. Balance resets to this each interval for consumable features.
If true, customer has unlimited access to this feature.
Whether entity-level grants contribute to a shared customer balance.
Reset configuration for consumable features. Omit for non-consumable features like seats.
Interval at which balance resets (e.g. 'month', 'year'). For consumable features only.
Number of intervals between resets. Defaults to 1.
Pricing for usage beyond included units. Omit for free features.
Price per billing\_units after included usage. Either 'amount' or 'tiers' is required.
Amounts in additional currencies for this flat price. The base 'amount' is in the org's default currency. Only valid with 'amount', not 'tiers'.
Three-letter Stripe-supported currency code (e.g. 'eur', 'gbp').
Price amount in this currency. Set explicitly per currency, not converted from the base amount.
Tiered pricing. Either 'amount' or 'tiers' is required.
Per-currency amounts for this tier. Tier boundaries ('to') are shared across all currencies.
Three-letter Stripe-supported currency code (e.g. 'eur', 'gbp').
Per-unit amount for this tier in this currency.
Flat amount for this tier in this currency, if the tier uses one.
Billing interval. For consumable features, should match reset.interval.
Number of intervals per billing cycle. Defaults to 1.
Units per price increment. Usage is rounded UP when billed (e.g. billing\_units=100 means 101 rounds to 200).
'prepaid' for upfront payment (seats), 'usage\_based' for pay-as-you-go.
Max units purchasable beyond included. E.g. included=100, max\_purchase=300 allows 400 total. Null for no limit.
Proration settings for prepaid features. Controls mid-cycle quantity change billing.
Billing behavior when quantity increases mid-cycle.
Credit behavior when quantity decreases mid-cycle.
Rollover config for unused units. If set, unused included units carry over.
Max rollover units. Omit for unlimited rollover.
Maximum rollover as a percentage (0-100) of included + prepaid grant. Mutually exclusive with max.
When rolled over units expire.
Number of periods before expiry.
Overrides fields of this item's feature for customers on this plan (e.g. a credit system's credit\_schema).
For credit system features: replaces the feature's credit\_schema entirely for customers on this plan.
ID of the metered feature that draws from this credit system.
Number of metered-feature units priced together. Defaults to one when omitted.
Named rates chosen by event properties. The most specific match sets the rate; with no match the item's own rate applies.
Event properties this entry applies to. Every key must equal the tracked property, compared as strings.
Breaks ties between dimensions that match the same number of keys. Higher wins.
Inclusive upper usage boundary for this graduated tier. The final tier must be 'inf'.
Credits consumed per billing-unit group within this tier.
Named adjustments chosen by event properties. Every match applies: factors multiply, then adds are summed.
Event properties this entry applies to. Every key must equal the tracked property, compared as strings.
Multiplies the matched rate. All matching multipliers stack.
Added to the rate after every factor is applied, in credits per billing-unit group.
Inclusive upper usage boundary for this graduated tier. The final tier must be 'inf'.
Credits consumed per billing-unit group within this tier.
Credits consumed per billing-unit group.
For AI credit system features: replaces the feature's markup chain entirely for customers on this plan. An unset level means no markup at that level rather than inheriting the feature's.
Default percentage markup for customers on this plan. Use -100 to make usage free.
Per-provider markup percentages for customers on this plan.
Per-model markup overrides for customers on this plan.
Match items linked to this feature.
Match items with this billing method (prepaid or usage\_based).
Match items with this interval. Accepts either a BillingInterval (price-side) or a ResetInterval (reset-side, includes day/hour/minute) so price-less items keyed by reset.interval can be disambiguated.
Match items with this interval\_count. Disambiguates between items that share an interval but differ in count.
Match items whose grant equals this included usage. Omitted is a wildcard.
Free trial configuration. Customers can try this plan before being charged.
Number of duration\_type periods the trial lasts.
Unit of time for the trial ('day', 'month', 'year').
If true, a payment method is required to start the trial and the customer is charged when it ends. Defaults to false.
Behavior when the trial ends. 'bill' charges the customer (default). 'revert' expires the trial and restores the customer's previous plan.
Miscellaneous plan-level configuration flags.
If true, entitlements attached to this plan will still reset on schedule even when the customer's product is in a past\_due state.
Plan-level billing controls used as customer defaults.
List of auto top-up configurations per feature.
The ID of the feature (credit balance) to auto top-up.
Whether auto top-up is enabled.
When the balance drops below this threshold, an auto top-up will be purchased.
Amount of credits to add per auto top-up.
Optional rate limit to cap how often auto top-ups occur. Pass count to set the current window's consumed top-ups.
The time interval for the purchase limit window.
Number of intervals in the purchase limit window.
Maximum number of auto top-ups allowed within the interval.
Set the current window's consumed auto top-up count. Omit to leave runtime state unchanged.
When true, auto top-up creates a send\_invoice invoice instead of auto-charging.
List of overage spend limits per feature (caps overage spend).
Optional feature ID this spend limit applies to.
Whether the overage spend limit is enabled.
How overage\_limit is interpreted: an absolute overage cap (default) or a percentage of the main-plan allowance.
Overage cap for the feature: absolute units, or a percent (e.g. 120) when limit\_type is usage\_percentage.
When true, overage for this feature is not posted to Stripe. Usage tracking and balance resets still behave normally.
List of hard usage caps per feature (max units per interval).
The feature this usage limit applies to.
Whether this usage limit is enabled.
Maximum units allowed per interval.
Interval for the cap, aligned to the customer's billing cycle.
Window alignment. 'billing\_cycle' phases the interval to the customer's renewal time; 'utc' aligns to the UTC calendar.
When set, only usage from events whose properties match counts toward this cap. Omit to count all usage of the feature.
List of usage alert configurations per feature.
The feature ID this alert applies to.
Whether this usage alert is enabled.
The threshold value that triggers the alert. For usage or remaining, this is an absolute count. For usage\_percentage or remaining\_percentage, this is a percentage (0-100).
Whether the threshold is an absolute count or a percentage of the usage allowance or remaining balance.
What 100% means. balance: every grant on the feature. included: the plan allowance only. recurring: grants that reset. usage\_limit: the cap of the usage limit with the same feature and filter.
Only valid with basis usage\_limit. Points the alert at the usage limit carrying the same filter.
Optional user-defined label to distinguish multiple alerts on the same feature.
List of overage allowed controls per feature. When enabled, usage can exceed balance.
The feature ID this overage allowed control applies to.
Whether overage is allowed for this feature.
Arbitrary key-value metadata defined by you for your own use (e.g. UI copy, feature highlights). Values can be any JSON-serializable value. Shared across all versions of the plan.
### Response
Unique identifier for the plan.
Display name of the plan.
Optional description of the plan.
Group identifier for organizing related plans. Plans in the same group are mutually exclusive.
Version number of the plan. Incremented when plan configuration changes.
User-facing version identity. Defaults to v\{n} when the version is minted.
Whether this is the active version of the plan. At most one version is active.
Whether this is an add-on plan that can be attached alongside a main plan.
If true, this plan is automatically attached when a customer is created. Used for free plans.
Base recurring price for the plan. Null for free plans or usage-only plans.
Base price amount for the plan, in major currency units (e.g. dollars).
Base price amounts in additional currencies. The base 'amount' is in the org's default currency.
Three-letter Stripe-supported currency code (e.g. 'eur', 'gbp').
Price amount in this currency. Set explicitly per currency, not converted from the base amount.
Billing interval (e.g. 'month', 'year').
Number of intervals per billing cycle. Defaults to 1.
Display text for showing this price in pricing pages.
Main display text (e.g. '\$10' or '100 messages').
Secondary display text (e.g. 'per month' or 'then \$0.5 per 100').
Payment processors this base price is connected to. Omitted when unset.
Stripe price ID. For prepaid with included > 0 this is the V2 price.
Feature configurations included in this plan. Each item defines included units, pricing, and reset behavior for a feature.
Bills this many feature units when outstanding overage reaches it.
The ID of the feature this item configures.
The full feature object if expanded.
The ID of the feature, used to refer to it in other API calls like /track or /check.
The name of the feature.
The type of the feature
Singular and plural display names for the feature.
The singular display name for the feature.
The plural display name for the feature.
Credit cost schema for credit system features.
The ID of the metered feature (should be a single\_use feature).
The credit cost of the metered feature.
Whether or not the feature is archived.
Number of free units included. For consumable features, balance resets to this number each interval.
Whether the customer has unlimited access to this feature.
Whether entity-level grants contribute to a shared customer balance.
Reset configuration for consumable features. Null for non-consumable features like seats where usage persists across billing cycles.
The interval at which the feature balance resets (e.g. 'month', 'year'). For consumable features, usage resets to 0 and included units are restored.
Number of intervals between resets. Defaults to 1.
Pricing configuration for usage beyond included units. Null if feature is entirely free.
Price per billing\_units after included usage is consumed. Mutually exclusive with tiers.
Amounts in additional currencies for this flat price. The base 'amount' is in the org's default currency. Only valid with 'amount', not 'tiers' (tiered prices carry per-currency amounts on each tier).
Three-letter Stripe-supported currency code (e.g. 'eur', 'gbp').
Price amount in this currency. Set explicitly per currency, not converted from the base amount.
Tiered pricing configuration. Each tier's 'to' INCLUDES the included amount. Either 'tiers' or 'amount' is required.
Three-letter Stripe-supported currency code (e.g. 'eur', 'gbp').
Per-unit amount for this tier in this currency.
Flat amount for this tier in this currency, if the tier uses one.
Billing interval for this price. For consumable features, should match reset.interval.
Number of intervals per billing cycle. Defaults to 1.
Number of units per price increment. Usage is rounded UP to the nearest billing\_units when billed (e.g. billing\_units=100 means 101 usage rounds to 200).
'prepaid' for features like seats where customers pay upfront, 'usage\_based' for pay-as-you-go after included usage.
Maximum units a customer can purchase beyond included. E.g. if included=100 and max\_purchase=300, customer can use up to 400 total before usage is capped. Null for no limit.
Payment processors this item price is connected to. Omitted when unset.
Stripe price ID. For prepaid with included > 0 this is the V2 price.
Display text for showing this item in pricing pages.
Main display text (e.g. '\$10' or '100 messages').
Secondary display text (e.g. 'per month' or 'then \$0.5 per 100').
Rollover configuration for unused units. If set, unused included units roll over to the next period.
Maximum rollover units. Null for unlimited rollover.
Maximum rollover as a percentage (0-100) of included + prepaid grant. Mutually exclusive with max.
When rolled over units expire.
Number of periods before expiry.
Overrides fields of this item's feature for customers on this plan (e.g. a credit system's credit\_schema).
For credit system features: replaces the feature's credit\_schema entirely for customers on this plan.
ID of the metered feature that draws from this credit system.
Number of metered-feature units priced together. Defaults to one when omitted.
Named rates chosen by event properties. The most specific match sets the rate; with no match the item's own rate applies.
Event properties this entry applies to. Every key must equal the tracked property, compared as strings.
Breaks ties between dimensions that match the same number of keys. Higher wins.
Inclusive upper usage boundary for this graduated tier. The final tier must be 'inf'.
Credits consumed per billing-unit group within this tier.
Named adjustments chosen by event properties. Every match applies: factors multiply, then adds are summed.
Event properties this entry applies to. Every key must equal the tracked property, compared as strings.
Multiplies the matched rate. All matching multipliers stack.
Added to the rate after every factor is applied, in credits per billing-unit group.
Inclusive upper usage boundary for this graduated tier. The final tier must be 'inf'.
Credits consumed per billing-unit group within this tier.
Credits consumed per billing-unit group.
For AI credit system features: replaces the feature's markup chain entirely for customers on this plan. An unset level means no markup at that level rather than inheriting the feature's.
Default percentage markup for customers on this plan. Use -100 to make usage free.
Per-provider markup percentages for customers on this plan.
Per-model markup overrides for customers on this plan.
Payment processors this plan is connected to. Omitted when unset.
Stripe product ID this plan is billed under.
Extra Stripe product IDs aliased to this plan.
Every RevenueCat product that maps to this plan. Replaces the current set.
RevenueCat product ID that grants this plan when purchased.
Prepaid quantities granted when this specific RevenueCat product is purchased, in feature units.
Free trial configuration. If set, new customers can try this plan before being charged.
Number of duration\_type periods the trial lasts.
Unit of time for the trial duration ('day', 'month', 'year').
Whether a payment method is required to start the trial. If true, customer will be charged after trial ends.
Behavior when the trial ends. 'bill' charges the customer (default). 'revert' expires the trial and restores the customer's previous plan.
Unix timestamp (ms) when the plan was created.
Environment this plan belongs to ('sandbox' or 'live').
Whether the plan is archived. Archived plans cannot be attached to new customers.
Miscellaneous plan-level configuration flags.
If true, entitlements attached to this plan will still reset on schedule even when the customer's product is in a past\_due state.
Plan-level billing controls used as customer defaults.
List of auto top-up configurations per feature.
The ID of the feature (credit balance) to auto top-up.
Whether auto top-up is enabled.
When the balance drops below this threshold, an auto top-up will be purchased.
Amount of credits to add per auto top-up.
Optional rate limit to cap how often auto top-ups occur.
The time interval for the purchase limit window.
Number of intervals in the purchase limit window.
Maximum number of auto top-ups allowed within the interval.
When true, auto top-up creates a send\_invoice invoice instead of auto-charging.
List of overage spend limits per feature (caps overage spend).
Optional feature ID this spend limit applies to.
Whether the overage spend limit is enabled.
How overage\_limit is interpreted: an absolute overage cap (default) or a percentage of the main-plan allowance.
Overage cap for the feature: absolute units, or a percent (e.g. 120) when limit\_type is usage\_percentage.
When true, overage for this feature is not posted to Stripe. Usage tracking and balance resets still behave normally.
List of hard usage caps per feature (max units per interval).
The feature this usage limit applies to.
Whether this usage limit is enabled.
Maximum units allowed per interval.
Interval for the cap, aligned to the customer's billing cycle.
Window alignment. 'billing\_cycle' phases the interval to the customer's renewal time; 'utc' aligns to the UTC calendar.
When set, only usage from events whose properties match counts toward this cap. Omit to count all usage of the feature.
List of usage alert configurations per feature.
The feature ID this alert applies to.
Whether this usage alert is enabled.
The threshold value that triggers the alert. For usage or remaining, this is an absolute count. For usage\_percentage or remaining\_percentage, this is a percentage (0-100).
Whether the threshold is an absolute count or a percentage of the usage allowance or remaining balance.
What 100% means. balance: every grant on the feature. included: the plan allowance only. recurring: grants that reset. usage\_limit: the cap of the usage limit with the same feature and filter.
Only valid with basis usage\_limit. Points the alert at the usage limit carrying the same filter.
Optional user-defined label to distinguish multiple alerts on the same feature.
List of overage allowed controls per feature. When enabled, usage can exceed balance.
The feature ID this overage allowed control applies to.
Whether overage is allowed for this feature.
Arbitrary key-value metadata defined by you for your own use. Shared across all versions of the plan.
Whether the trial on this plan is available to this customer. For example, if the customer used the trial in the past, this will be false.
The customer's current status with this plan. 'active' if attached, 'scheduled' if pending activation.
Whether the customer's active instance of this plan is set to cancel.
Whether the customer is currently on a free trial of this plan.
The action that would occur if this plan were attached to the customer.
Deprecated. Use variant\_details.base\_plan\_id instead. If this is a variant, the ID of the base plan it was created from.
Details about how this variant relates to its latest base plan.
The ID of the base plan this variant was derived from.
The customization that transforms the base plan into this variant.
Base price configuration for a plan.
Base price amount for the plan, in major currency units (e.g. dollars).
Billing interval (e.g. 'month', 'year').
Number of intervals per billing cycle. Defaults to 1.
Base price amounts in additional currencies. The base 'amount' is in the org's default currency.
Three-letter Stripe-supported currency code (e.g. 'eur', 'gbp').
Price amount in this currency. Set explicitly per currency, not converted from the base amount.
Items to add to the plan.
Bills this many feature units when outstanding overage reaches it.
The ID of the feature to configure.
Number of free units included. Balance resets to this each interval for consumable features.
If true, customer has unlimited access to this feature.
Whether entity-level grants contribute to a shared customer balance.
Reset configuration for consumable features. Omit for non-consumable features like seats.
Interval at which balance resets (e.g. 'month', 'year'). For consumable features only.
Number of intervals between resets. Defaults to 1.
Pricing for usage beyond included units. Omit for free features.
Price per billing\_units after included usage. Either 'amount' or 'tiers' is required.
Amounts in additional currencies for this flat price. The base 'amount' is in the org's default currency. Only valid with 'amount', not 'tiers'.
Three-letter Stripe-supported currency code (e.g. 'eur', 'gbp').
Price amount in this currency. Set explicitly per currency, not converted from the base amount.
Tiered pricing. Either 'amount' or 'tiers' is required.
Three-letter Stripe-supported currency code (e.g. 'eur', 'gbp').
Per-unit amount for this tier in this currency.
Flat amount for this tier in this currency, if the tier uses one.
Billing interval. For consumable features, should match reset.interval.
Number of intervals per billing cycle. Defaults to 1.
Units per price increment. Usage is rounded UP when billed (e.g. billing\_units=100 means 101 rounds to 200).
'prepaid' for upfront payment (seats), 'usage\_based' for pay-as-you-go.
Max units purchasable beyond included. E.g. included=100, max\_purchase=300 allows 400 total. Null for no limit.
Proration settings for prepaid features. Controls mid-cycle quantity change billing.
Billing behavior when quantity increases mid-cycle.
Credit behavior when quantity decreases mid-cycle.
Rollover config for unused units. If set, unused included units carry over.
Max rollover units. Omit for unlimited rollover.
Maximum rollover as a percentage (0-100) of included + prepaid grant. Mutually exclusive with max.
When rolled over units expire.
Number of periods before expiry.
Overrides fields of this item's feature for customers on this plan (e.g. a credit system's credit\_schema).
For credit system features: replaces the feature's credit\_schema entirely for customers on this plan.
ID of the metered feature that draws from this credit system.
Number of metered-feature units priced together. Defaults to one when omitted.
Named rates chosen by event properties. The most specific match sets the rate; with no match the item's own rate applies.
Event properties this entry applies to. Every key must equal the tracked property, compared as strings.
Breaks ties between dimensions that match the same number of keys. Higher wins.
Inclusive upper usage boundary for this graduated tier. The final tier must be 'inf'.
Credits consumed per billing-unit group within this tier.
Named adjustments chosen by event properties. Every match applies: factors multiply, then adds are summed.
Event properties this entry applies to. Every key must equal the tracked property, compared as strings.
Multiplies the matched rate. All matching multipliers stack.
Added to the rate after every factor is applied, in credits per billing-unit group.
Inclusive upper usage boundary for this graduated tier. The final tier must be 'inf'.
Credits consumed per billing-unit group within this tier.
Credits consumed per billing-unit group.
For AI credit system features: replaces the feature's markup chain entirely for customers on this plan. An unset level means no markup at that level rather than inheriting the feature's.
Default percentage markup for customers on this plan. Use -100 to make usage free.
Per-provider markup percentages for customers on this plan.
Per-model markup overrides for customers on this plan.
Filters selecting items to remove from the plan.
Match items linked to this feature.
Match items with this billing method (prepaid or usage\_based).
Match items with this interval. Accepts either a BillingInterval (price-side) or a ResetInterval (reset-side, includes day/hour/minute) so price-less items keyed by reset.interval can be disambiguated.
Match items with this interval\_count. Disambiguates between items that share an interval but differ in count.
Match items whose grant equals this included usage. Omitted is a wildcard.
Free trial configuration for a plan.
Number of duration\_type periods the trial lasts.
Unit of time for the trial ('day', 'month', 'year').
If true, a payment method is required to start the trial and the customer is charged when it ends. Defaults to false.
Behavior when the trial ends. 'bill' charges the customer (default). 'revert' expires the trial and restores the customer's previous plan.
Override the plan's billing controls (auto top-ups, spend limits, usage limits, usage alerts, overage allowed) for this customer.
List of auto top-up configurations per feature.
The ID of the feature (credit balance) to auto top-up.
Whether auto top-up is enabled.
When the balance drops below this threshold, an auto top-up will be purchased.
Amount of credits to add per auto top-up.
Optional rate limit to cap how often auto top-ups occur. Pass count to set the current window's consumed top-ups.
The time interval for the purchase limit window.
Number of intervals in the purchase limit window.
Maximum number of auto top-ups allowed within the interval.
Set the current window's consumed auto top-up count. Omit to leave runtime state unchanged.
When true, auto top-up creates a send\_invoice invoice instead of auto-charging.
List of overage spend limits per feature (caps overage spend).
Optional feature ID this spend limit applies to.
Whether the overage spend limit is enabled.
How overage\_limit is interpreted: an absolute overage cap (default) or a percentage of the main-plan allowance.
Overage cap for the feature: absolute units, or a percent (e.g. 120) when limit\_type is usage\_percentage.
When true, overage for this feature is not posted to Stripe. Usage tracking and balance resets still behave normally.
List of hard usage caps per feature (max units per interval).
The feature this usage limit applies to.
Whether this usage limit is enabled.
Maximum units allowed per interval.
Interval for the cap, aligned to the customer's billing cycle.
Window alignment. 'billing\_cycle' phases the interval to the customer's renewal time; 'utc' aligns to the UTC calendar.
When set, only usage from events whose properties match counts toward this cap. Omit to count all usage of the feature.
List of usage alert configurations per feature.
The feature ID this alert applies to.
Whether this usage alert is enabled.
The threshold value that triggers the alert. For usage or remaining, this is an absolute count. For usage\_percentage or remaining\_percentage, this is a percentage (0-100).
Whether the threshold is an absolute count or a percentage of the usage allowance or remaining balance.
What 100% means. balance: every grant on the feature. included: the plan allowance only. recurring: grants that reset. usage\_limit: the cap of the usage limit with the same feature and filter.
Only valid with basis usage\_limit. Points the alert at the usage limit carrying the same filter.
Optional user-defined label to distinguish multiple alerts on the same feature.
List of overage allowed controls per feature. When enabled, usage can exceed balance.
The feature ID this overage allowed control applies to.
Whether overage is allowed for this feature.
License links to add or override for this customer, keyed by license\_plan\_id. Omitted fields inherit the plan catalog link (included defaults to 1 when the license is not in the catalog). A bare entry restores the license to pure catalog inheritance.
Base price configuration for a plan.
Base price amount for the plan, in major currency units (e.g. dollars).
Billing interval (e.g. 'month', 'year').
Number of intervals per billing cycle. Defaults to 1.
Base price amounts in additional currencies. The base 'amount' is in the org's default currency.
Three-letter Stripe-supported currency code (e.g. 'eur', 'gbp').
Price amount in this currency. Set explicitly per currency, not converted from the base amount.
Bills this many feature units when outstanding overage reaches it.
The ID of the feature to configure.
Number of free units included. Balance resets to this each interval for consumable features.
If true, customer has unlimited access to this feature.
Whether entity-level grants contribute to a shared customer balance.
Reset configuration for consumable features. Omit for non-consumable features like seats.
Interval at which balance resets (e.g. 'month', 'year'). For consumable features only.
Number of intervals between resets. Defaults to 1.
Pricing for usage beyond included units. Omit for free features.
Price per billing\_units after included usage. Either 'amount' or 'tiers' is required.
Amounts in additional currencies for this flat price. The base 'amount' is in the org's default currency. Only valid with 'amount', not 'tiers'.
Three-letter Stripe-supported currency code (e.g. 'eur', 'gbp').
Price amount in this currency. Set explicitly per currency, not converted from the base amount.
Tiered pricing. Either 'amount' or 'tiers' is required.
Three-letter Stripe-supported currency code (e.g. 'eur', 'gbp').
Per-unit amount for this tier in this currency.
Flat amount for this tier in this currency, if the tier uses one.
Billing interval. For consumable features, should match reset.interval.
Number of intervals per billing cycle. Defaults to 1.
Units per price increment. Usage is rounded UP when billed (e.g. billing\_units=100 means 101 rounds to 200).
'prepaid' for upfront payment (seats), 'usage\_based' for pay-as-you-go.
Max units purchasable beyond included. E.g. included=100, max\_purchase=300 allows 400 total. Null for no limit.
Proration settings for prepaid features. Controls mid-cycle quantity change billing.
Billing behavior when quantity increases mid-cycle.
Credit behavior when quantity decreases mid-cycle.
Rollover config for unused units. If set, unused included units carry over.
Max rollover units. Omit for unlimited rollover.
Maximum rollover as a percentage (0-100) of included + prepaid grant. Mutually exclusive with max.
When rolled over units expire.
Number of periods before expiry.
Overrides fields of this item's feature for customers on this plan (e.g. a credit system's credit\_schema).
For credit system features: replaces the feature's credit\_schema entirely for customers on this plan.
ID of the metered feature that draws from this credit system.
Number of metered-feature units priced together. Defaults to one when omitted.
Named rates chosen by event properties. The most specific match sets the rate; with no match the item's own rate applies.
Event properties this entry applies to. Every key must equal the tracked property, compared as strings.
Breaks ties between dimensions that match the same number of keys. Higher wins.
Inclusive upper usage boundary for this graduated tier. The final tier must be 'inf'.
Credits consumed per billing-unit group within this tier.
Named adjustments chosen by event properties. Every match applies: factors multiply, then adds are summed.
Event properties this entry applies to. Every key must equal the tracked property, compared as strings.
Multiplies the matched rate. All matching multipliers stack.
Added to the rate after every factor is applied, in credits per billing-unit group.
Inclusive upper usage boundary for this graduated tier. The final tier must be 'inf'.
Credits consumed per billing-unit group within this tier.
Credits consumed per billing-unit group.
For AI credit system features: replaces the feature's markup chain entirely for customers on this plan. An unset level means no markup at that level rather than inheriting the feature's.
Default percentage markup for customers on this plan. Use -100 to make usage free.
Per-provider markup percentages for customers on this plan.
Per-model markup overrides for customers on this plan.
Match items linked to this feature.
Match items with this billing method (prepaid or usage\_based).
Match items with this interval. Accepts either a BillingInterval (price-side) or a ResetInterval (reset-side, includes day/hour/minute) so price-less items keyed by reset.interval can be disambiguated.
Match items with this interval\_count. Disambiguates between items that share an interval but differ in count.
Match items whose grant equals this included usage. Omitted is a wildcard.
License links to drop, keyed by license\_plan\_id. Parallel to remove\_items.
```json 200 theme={null}
{
"id": "pro",
"name": "Pro Plan",
"description": null,
"group": null,
"version": 1,
"version_slug": "v1",
"active": true,
"addOn": false,
"autoEnable": false,
"price": {
"amount": 10,
"interval": "month",
"display": {
"primaryText": "$10",
"secondaryText": "per month"
}
},
"items": [
{
"featureId": "messages",
"included": 100,
"unlimited": false,
"reset": {
"interval": "month"
},
"price": {
"amount": 0.5,
"interval": "month",
"billingUnits": 100,
"billingMethod": "usage_based",
"maxPurchase": null
},
"display": {
"primaryText": "100 messages",
"secondaryText": "then $0.5 per 100 messages"
}
},
{
"featureId": "users",
"included": 0,
"unlimited": false,
"reset": null,
"price": {
"amount": 10,
"interval": "month",
"billingUnits": 1,
"billingMethod": "prepaid",
"maxPurchase": null
},
"display": {
"primaryText": "$10 per Users"
}
}
],
"createdAt": 1771513979217,
"env": "sandbox",
"archived": false,
"baseVariantId": null,
"config": {
"ignore_past_due": false
},
"billing_controls": {},
"metadata": {}
}
```
# Delete a plan
Source: https://docs.useautumn.com/api-reference/plans/deletePlan
openapi POST /v1/plans.delete
Deletes a plan by its ID.
Use this to permanently remove a plan. Plans with active customers cannot be deleted - archive them instead.
Deletes a plan or a specific version of a plan.
Deleting a plan cannot be undone. Existing subscriptions to this plan will remain active until canceled.
### Common Use Cases
```typescript Delete latest version theme={null}
await autumn.plans.delete({
planId: "old_plan"
});
```
```typescript Delete all versions theme={null}
await autumn.plans.delete({
planId: "old_plan",
allVersions: true
});
```
### Body Parameters
The ID of the plan to delete.
If true, deletes all versions of the plan. Otherwise, only deletes the latest version.
### Response
# Get a plan
Source: https://docs.useautumn.com/api-reference/plans/getPlan
openapi POST /v1/plans.get
Retrieves a single plan by its ID.
Use this to fetch the full configuration of a specific plan, including its features and pricing.
Retrieves a single plan by its ID. Returns the latest version by default.
### Common Use Cases
```typescript Get a plan theme={null}
const plan = await autumn.plans.get({
planId: "pro_plan"
});
```
```typescript Get a specific version theme={null}
const plan = await autumn.plans.get({
planId: "pro_plan",
version: 2
});
```
### Body Parameters
The ID of the plan to retrieve.
The version of the plan to get. Defaults to the latest version.
### Response
Unique identifier for the plan.
Display name of the plan.
Optional description of the plan.
Group identifier for organizing related plans. Plans in the same group are mutually exclusive.
Version number of the plan. Incremented when plan configuration changes.
User-facing version identity. Defaults to v\{n} when the version is minted.
Whether this is the active version of the plan. At most one version is active.
Whether this is an add-on plan that can be attached alongside a main plan.
If true, this plan is automatically attached when a customer is created. Used for free plans.
Base recurring price for the plan. Null for free plans or usage-only plans.
Base price amount for the plan, in major currency units (e.g. dollars).
Base price amounts in additional currencies. The base 'amount' is in the org's default currency.
Three-letter Stripe-supported currency code (e.g. 'eur', 'gbp').
Price amount in this currency. Set explicitly per currency, not converted from the base amount.
Billing interval (e.g. 'month', 'year').
Number of intervals per billing cycle. Defaults to 1.
Display text for showing this price in pricing pages.
Main display text (e.g. '\$10' or '100 messages').
Secondary display text (e.g. 'per month' or 'then \$0.5 per 100').
Payment processors this base price is connected to. Omitted when unset.
Stripe price ID. For prepaid with included > 0 this is the V2 price.
Feature configurations included in this plan. Each item defines included units, pricing, and reset behavior for a feature.
Bills this many feature units when outstanding overage reaches it.
The ID of the feature this item configures.
The full feature object if expanded.
The ID of the feature, used to refer to it in other API calls like /track or /check.
The name of the feature.
The type of the feature
Singular and plural display names for the feature.
The singular display name for the feature.
The plural display name for the feature.
Credit cost schema for credit system features.
The ID of the metered feature (should be a single\_use feature).
The credit cost of the metered feature.
Whether or not the feature is archived.
Number of free units included. For consumable features, balance resets to this number each interval.
Whether the customer has unlimited access to this feature.
Whether entity-level grants contribute to a shared customer balance.
Reset configuration for consumable features. Null for non-consumable features like seats where usage persists across billing cycles.
The interval at which the feature balance resets (e.g. 'month', 'year'). For consumable features, usage resets to 0 and included units are restored.
Number of intervals between resets. Defaults to 1.
Pricing configuration for usage beyond included units. Null if feature is entirely free.
Price per billing\_units after included usage is consumed. Mutually exclusive with tiers.
Amounts in additional currencies for this flat price. The base 'amount' is in the org's default currency. Only valid with 'amount', not 'tiers' (tiered prices carry per-currency amounts on each tier).
Three-letter Stripe-supported currency code (e.g. 'eur', 'gbp').
Price amount in this currency. Set explicitly per currency, not converted from the base amount.
Tiered pricing configuration. Each tier's 'to' INCLUDES the included amount. Either 'tiers' or 'amount' is required.
Three-letter Stripe-supported currency code (e.g. 'eur', 'gbp').
Per-unit amount for this tier in this currency.
Flat amount for this tier in this currency, if the tier uses one.
Billing interval for this price. For consumable features, should match reset.interval.
Number of intervals per billing cycle. Defaults to 1.
Number of units per price increment. Usage is rounded UP to the nearest billing\_units when billed (e.g. billing\_units=100 means 101 usage rounds to 200).
'prepaid' for features like seats where customers pay upfront, 'usage\_based' for pay-as-you-go after included usage.
Maximum units a customer can purchase beyond included. E.g. if included=100 and max\_purchase=300, customer can use up to 400 total before usage is capped. Null for no limit.
Payment processors this item price is connected to. Omitted when unset.
Stripe price ID. For prepaid with included > 0 this is the V2 price.
Display text for showing this item in pricing pages.
Main display text (e.g. '\$10' or '100 messages').
Secondary display text (e.g. 'per month' or 'then \$0.5 per 100').
Rollover configuration for unused units. If set, unused included units roll over to the next period.
Maximum rollover units. Null for unlimited rollover.
Maximum rollover as a percentage (0-100) of included + prepaid grant. Mutually exclusive with max.
When rolled over units expire.
Number of periods before expiry.
Overrides fields of this item's feature for customers on this plan (e.g. a credit system's credit\_schema).
For credit system features: replaces the feature's credit\_schema entirely for customers on this plan.
ID of the metered feature that draws from this credit system.
Number of metered-feature units priced together. Defaults to one when omitted.
Named rates chosen by event properties. The most specific match sets the rate; with no match the item's own rate applies.
Event properties this entry applies to. Every key must equal the tracked property, compared as strings.
Breaks ties between dimensions that match the same number of keys. Higher wins.
Inclusive upper usage boundary for this graduated tier. The final tier must be 'inf'.
Credits consumed per billing-unit group within this tier.
Named adjustments chosen by event properties. Every match applies: factors multiply, then adds are summed.
Event properties this entry applies to. Every key must equal the tracked property, compared as strings.
Multiplies the matched rate. All matching multipliers stack.
Added to the rate after every factor is applied, in credits per billing-unit group.
Inclusive upper usage boundary for this graduated tier. The final tier must be 'inf'.
Credits consumed per billing-unit group within this tier.
Credits consumed per billing-unit group.
For AI credit system features: replaces the feature's markup chain entirely for customers on this plan. An unset level means no markup at that level rather than inheriting the feature's.
Default percentage markup for customers on this plan. Use -100 to make usage free.
Per-provider markup percentages for customers on this plan.
Per-model markup overrides for customers on this plan.
Payment processors this plan is connected to. Omitted when unset.
Stripe product ID this plan is billed under.
Extra Stripe product IDs aliased to this plan.
Every RevenueCat product that maps to this plan. Replaces the current set.
RevenueCat product ID that grants this plan when purchased.
Prepaid quantities granted when this specific RevenueCat product is purchased, in feature units.
Free trial configuration. If set, new customers can try this plan before being charged.
Number of duration\_type periods the trial lasts.
Unit of time for the trial duration ('day', 'month', 'year').
Whether a payment method is required to start the trial. If true, customer will be charged after trial ends.
Behavior when the trial ends. 'bill' charges the customer (default). 'revert' expires the trial and restores the customer's previous plan.
Unix timestamp (ms) when the plan was created.
Environment this plan belongs to ('sandbox' or 'live').
Whether the plan is archived. Archived plans cannot be attached to new customers.
Miscellaneous plan-level configuration flags.
If true, entitlements attached to this plan will still reset on schedule even when the customer's product is in a past\_due state.
Plan-level billing controls used as customer defaults.
List of auto top-up configurations per feature.
The ID of the feature (credit balance) to auto top-up.
Whether auto top-up is enabled.
When the balance drops below this threshold, an auto top-up will be purchased.
Amount of credits to add per auto top-up.
Optional rate limit to cap how often auto top-ups occur.
The time interval for the purchase limit window.
Number of intervals in the purchase limit window.
Maximum number of auto top-ups allowed within the interval.
When true, auto top-up creates a send\_invoice invoice instead of auto-charging.
List of overage spend limits per feature (caps overage spend).
Optional feature ID this spend limit applies to.
Whether the overage spend limit is enabled.
How overage\_limit is interpreted: an absolute overage cap (default) or a percentage of the main-plan allowance.
Overage cap for the feature: absolute units, or a percent (e.g. 120) when limit\_type is usage\_percentage.
When true, overage for this feature is not posted to Stripe. Usage tracking and balance resets still behave normally.
List of hard usage caps per feature (max units per interval).
The feature this usage limit applies to.
Whether this usage limit is enabled.
Maximum units allowed per interval.
Interval for the cap, aligned to the customer's billing cycle.
Window alignment. 'billing\_cycle' phases the interval to the customer's renewal time; 'utc' aligns to the UTC calendar.
When set, only usage from events whose properties match counts toward this cap. Omit to count all usage of the feature.
List of usage alert configurations per feature.
The feature ID this alert applies to.
Whether this usage alert is enabled.
The threshold value that triggers the alert. For usage or remaining, this is an absolute count. For usage\_percentage or remaining\_percentage, this is a percentage (0-100).
Whether the threshold is an absolute count or a percentage of the usage allowance or remaining balance.
What 100% means. balance: every grant on the feature. included: the plan allowance only. recurring: grants that reset. usage\_limit: the cap of the usage limit with the same feature and filter.
Only valid with basis usage\_limit. Points the alert at the usage limit carrying the same filter.
Optional user-defined label to distinguish multiple alerts on the same feature.
List of overage allowed controls per feature. When enabled, usage can exceed balance.
The feature ID this overage allowed control applies to.
Whether overage is allowed for this feature.
Arbitrary key-value metadata defined by you for your own use. Shared across all versions of the plan.
Whether the trial on this plan is available to this customer. For example, if the customer used the trial in the past, this will be false.
The customer's current status with this plan. 'active' if attached, 'scheduled' if pending activation.
Whether the customer's active instance of this plan is set to cancel.
Whether the customer is currently on a free trial of this plan.
The action that would occur if this plan were attached to the customer.
Deprecated. Use variant\_details.base\_plan\_id instead. If this is a variant, the ID of the base plan it was created from.
Details about how this variant relates to its latest base plan.
The ID of the base plan this variant was derived from.
The customization that transforms the base plan into this variant.
Base price configuration for a plan.
Base price amount for the plan, in major currency units (e.g. dollars).
Billing interval (e.g. 'month', 'year').
Number of intervals per billing cycle. Defaults to 1.
Base price amounts in additional currencies. The base 'amount' is in the org's default currency.
Three-letter Stripe-supported currency code (e.g. 'eur', 'gbp').
Price amount in this currency. Set explicitly per currency, not converted from the base amount.
Items to add to the plan.
Bills this many feature units when outstanding overage reaches it.
The ID of the feature to configure.
Number of free units included. Balance resets to this each interval for consumable features.
If true, customer has unlimited access to this feature.
Whether entity-level grants contribute to a shared customer balance.
Reset configuration for consumable features. Omit for non-consumable features like seats.
Interval at which balance resets (e.g. 'month', 'year'). For consumable features only.
Number of intervals between resets. Defaults to 1.
Pricing for usage beyond included units. Omit for free features.
Price per billing\_units after included usage. Either 'amount' or 'tiers' is required.
Amounts in additional currencies for this flat price. The base 'amount' is in the org's default currency. Only valid with 'amount', not 'tiers'.
Three-letter Stripe-supported currency code (e.g. 'eur', 'gbp').
Price amount in this currency. Set explicitly per currency, not converted from the base amount.
Tiered pricing. Either 'amount' or 'tiers' is required.
Three-letter Stripe-supported currency code (e.g. 'eur', 'gbp').
Per-unit amount for this tier in this currency.
Flat amount for this tier in this currency, if the tier uses one.
Billing interval. For consumable features, should match reset.interval.
Number of intervals per billing cycle. Defaults to 1.
Units per price increment. Usage is rounded UP when billed (e.g. billing\_units=100 means 101 rounds to 200).
'prepaid' for upfront payment (seats), 'usage\_based' for pay-as-you-go.
Max units purchasable beyond included. E.g. included=100, max\_purchase=300 allows 400 total. Null for no limit.
Proration settings for prepaid features. Controls mid-cycle quantity change billing.
Billing behavior when quantity increases mid-cycle.
Credit behavior when quantity decreases mid-cycle.
Rollover config for unused units. If set, unused included units carry over.
Max rollover units. Omit for unlimited rollover.
Maximum rollover as a percentage (0-100) of included + prepaid grant. Mutually exclusive with max.
When rolled over units expire.
Number of periods before expiry.
Overrides fields of this item's feature for customers on this plan (e.g. a credit system's credit\_schema).
For credit system features: replaces the feature's credit\_schema entirely for customers on this plan.
ID of the metered feature that draws from this credit system.
Number of metered-feature units priced together. Defaults to one when omitted.
Named rates chosen by event properties. The most specific match sets the rate; with no match the item's own rate applies.
Event properties this entry applies to. Every key must equal the tracked property, compared as strings.
Breaks ties between dimensions that match the same number of keys. Higher wins.
Inclusive upper usage boundary for this graduated tier. The final tier must be 'inf'.
Credits consumed per billing-unit group within this tier.
Named adjustments chosen by event properties. Every match applies: factors multiply, then adds are summed.
Event properties this entry applies to. Every key must equal the tracked property, compared as strings.
Multiplies the matched rate. All matching multipliers stack.
Added to the rate after every factor is applied, in credits per billing-unit group.
Inclusive upper usage boundary for this graduated tier. The final tier must be 'inf'.
Credits consumed per billing-unit group within this tier.
Credits consumed per billing-unit group.
For AI credit system features: replaces the feature's markup chain entirely for customers on this plan. An unset level means no markup at that level rather than inheriting the feature's.
Default percentage markup for customers on this plan. Use -100 to make usage free.
Per-provider markup percentages for customers on this plan.
Per-model markup overrides for customers on this plan.
Filters selecting items to remove from the plan.
Match items linked to this feature.
Match items with this billing method (prepaid or usage\_based).
Match items with this interval. Accepts either a BillingInterval (price-side) or a ResetInterval (reset-side, includes day/hour/minute) so price-less items keyed by reset.interval can be disambiguated.
Match items with this interval\_count. Disambiguates between items that share an interval but differ in count.
Match items whose grant equals this included usage. Omitted is a wildcard.
Free trial configuration for a plan.
Number of duration\_type periods the trial lasts.
Unit of time for the trial ('day', 'month', 'year').
If true, a payment method is required to start the trial and the customer is charged when it ends. Defaults to false.
Behavior when the trial ends. 'bill' charges the customer (default). 'revert' expires the trial and restores the customer's previous plan.
Override the plan's billing controls (auto top-ups, spend limits, usage limits, usage alerts, overage allowed) for this customer.
List of auto top-up configurations per feature.
The ID of the feature (credit balance) to auto top-up.
Whether auto top-up is enabled.
When the balance drops below this threshold, an auto top-up will be purchased.
Amount of credits to add per auto top-up.
Optional rate limit to cap how often auto top-ups occur. Pass count to set the current window's consumed top-ups.
The time interval for the purchase limit window.
Number of intervals in the purchase limit window.
Maximum number of auto top-ups allowed within the interval.
Set the current window's consumed auto top-up count. Omit to leave runtime state unchanged.
When true, auto top-up creates a send\_invoice invoice instead of auto-charging.
List of overage spend limits per feature (caps overage spend).
Optional feature ID this spend limit applies to.
Whether the overage spend limit is enabled.
How overage\_limit is interpreted: an absolute overage cap (default) or a percentage of the main-plan allowance.
Overage cap for the feature: absolute units, or a percent (e.g. 120) when limit\_type is usage\_percentage.
When true, overage for this feature is not posted to Stripe. Usage tracking and balance resets still behave normally.
List of hard usage caps per feature (max units per interval).
The feature this usage limit applies to.
Whether this usage limit is enabled.
Maximum units allowed per interval.
Interval for the cap, aligned to the customer's billing cycle.
Window alignment. 'billing\_cycle' phases the interval to the customer's renewal time; 'utc' aligns to the UTC calendar.
When set, only usage from events whose properties match counts toward this cap. Omit to count all usage of the feature.
List of usage alert configurations per feature.
The feature ID this alert applies to.
Whether this usage alert is enabled.
The threshold value that triggers the alert. For usage or remaining, this is an absolute count. For usage\_percentage or remaining\_percentage, this is a percentage (0-100).
Whether the threshold is an absolute count or a percentage of the usage allowance or remaining balance.
What 100% means. balance: every grant on the feature. included: the plan allowance only. recurring: grants that reset. usage\_limit: the cap of the usage limit with the same feature and filter.
Only valid with basis usage\_limit. Points the alert at the usage limit carrying the same filter.
Optional user-defined label to distinguish multiple alerts on the same feature.
List of overage allowed controls per feature. When enabled, usage can exceed balance.
The feature ID this overage allowed control applies to.
Whether overage is allowed for this feature.
License links to add or override for this customer, keyed by license\_plan\_id. Omitted fields inherit the plan catalog link (included defaults to 1 when the license is not in the catalog). A bare entry restores the license to pure catalog inheritance.
Base price configuration for a plan.
Base price amount for the plan, in major currency units (e.g. dollars).
Billing interval (e.g. 'month', 'year').
Number of intervals per billing cycle. Defaults to 1.
Base price amounts in additional currencies. The base 'amount' is in the org's default currency.
Three-letter Stripe-supported currency code (e.g. 'eur', 'gbp').
Price amount in this currency. Set explicitly per currency, not converted from the base amount.
Bills this many feature units when outstanding overage reaches it.
The ID of the feature to configure.
Number of free units included. Balance resets to this each interval for consumable features.
If true, customer has unlimited access to this feature.
Whether entity-level grants contribute to a shared customer balance.
Reset configuration for consumable features. Omit for non-consumable features like seats.
Interval at which balance resets (e.g. 'month', 'year'). For consumable features only.
Number of intervals between resets. Defaults to 1.
Pricing for usage beyond included units. Omit for free features.
Price per billing\_units after included usage. Either 'amount' or 'tiers' is required.
Amounts in additional currencies for this flat price. The base 'amount' is in the org's default currency. Only valid with 'amount', not 'tiers'.
Three-letter Stripe-supported currency code (e.g. 'eur', 'gbp').
Price amount in this currency. Set explicitly per currency, not converted from the base amount.
Tiered pricing. Either 'amount' or 'tiers' is required.
Three-letter Stripe-supported currency code (e.g. 'eur', 'gbp').
Per-unit amount for this tier in this currency.
Flat amount for this tier in this currency, if the tier uses one.
Billing interval. For consumable features, should match reset.interval.
Number of intervals per billing cycle. Defaults to 1.
Units per price increment. Usage is rounded UP when billed (e.g. billing\_units=100 means 101 rounds to 200).
'prepaid' for upfront payment (seats), 'usage\_based' for pay-as-you-go.
Max units purchasable beyond included. E.g. included=100, max\_purchase=300 allows 400 total. Null for no limit.
Proration settings for prepaid features. Controls mid-cycle quantity change billing.
Billing behavior when quantity increases mid-cycle.
Credit behavior when quantity decreases mid-cycle.
Rollover config for unused units. If set, unused included units carry over.
Max rollover units. Omit for unlimited rollover.
Maximum rollover as a percentage (0-100) of included + prepaid grant. Mutually exclusive with max.
When rolled over units expire.
Number of periods before expiry.
Overrides fields of this item's feature for customers on this plan (e.g. a credit system's credit\_schema).
For credit system features: replaces the feature's credit\_schema entirely for customers on this plan.
ID of the metered feature that draws from this credit system.
Number of metered-feature units priced together. Defaults to one when omitted.
Named rates chosen by event properties. The most specific match sets the rate; with no match the item's own rate applies.
Event properties this entry applies to. Every key must equal the tracked property, compared as strings.
Breaks ties between dimensions that match the same number of keys. Higher wins.
Inclusive upper usage boundary for this graduated tier. The final tier must be 'inf'.
Credits consumed per billing-unit group within this tier.
Named adjustments chosen by event properties. Every match applies: factors multiply, then adds are summed.
Event properties this entry applies to. Every key must equal the tracked property, compared as strings.
Multiplies the matched rate. All matching multipliers stack.
Added to the rate after every factor is applied, in credits per billing-unit group.
Inclusive upper usage boundary for this graduated tier. The final tier must be 'inf'.
Credits consumed per billing-unit group within this tier.
Credits consumed per billing-unit group.
For AI credit system features: replaces the feature's markup chain entirely for customers on this plan. An unset level means no markup at that level rather than inheriting the feature's.
Default percentage markup for customers on this plan. Use -100 to make usage free.
Per-provider markup percentages for customers on this plan.
Per-model markup overrides for customers on this plan.
Match items linked to this feature.
Match items with this billing method (prepaid or usage\_based).
Match items with this interval. Accepts either a BillingInterval (price-side) or a ResetInterval (reset-side, includes day/hour/minute) so price-less items keyed by reset.interval can be disambiguated.
Match items with this interval\_count. Disambiguates between items that share an interval but differ in count.
Match items whose grant equals this included usage. Omitted is a wildcard.
License links to drop, keyed by license\_plan\_id. Parallel to remove\_items.
```json 200 theme={null}
{
"id": "pro",
"name": "Pro Plan",
"description": null,
"group": null,
"version": 1,
"version_slug": "v1",
"active": true,
"addOn": false,
"autoEnable": false,
"price": {
"amount": 10,
"interval": "month",
"display": {
"primaryText": "$10",
"secondaryText": "per month"
}
},
"items": [
{
"featureId": "messages",
"included": 100,
"unlimited": false,
"reset": {
"interval": "month"
},
"price": {
"amount": 0.5,
"interval": "month",
"billingUnits": 100,
"billingMethod": "usage_based",
"maxPurchase": null
},
"display": {
"primaryText": "100 messages",
"secondaryText": "then $0.5 per 100 messages"
}
},
{
"featureId": "users",
"included": 0,
"unlimited": false,
"reset": null,
"price": {
"amount": 10,
"interval": "month",
"billingUnits": 1,
"billingMethod": "prepaid",
"maxPurchase": null
},
"display": {
"primaryText": "$10 per Users"
}
}
],
"createdAt": 1771513979217,
"env": "sandbox",
"archived": false,
"baseVariantId": null,
"config": {
"ignore_past_due": false
},
"billing_controls": {},
"metadata": {}
}
```
# List all plans
Source: https://docs.useautumn.com/api-reference/plans/listPlans
openapi POST /v1/plans.list
Lists all plans in the current environment.
Use this to retrieve all plans for displaying pricing pages or managing plan configurations.
Lists all plans in the current environment.
Pass a `customer_id` to include customer-specific eligibility info like whether a free trial is available and the attach scenario (new, upgrade, downgrade).
### Common Use Cases
```typescript List all plans theme={null}
const plans = await autumn.plans.list();
```
```typescript List plans with customer eligibility theme={null}
const plans = await autumn.plans.list({
customerId: "cus_123"
});
// Each plan will include customerEligibility:
// - trialAvailable: whether customer can use the trial
// - scenario: 'new', 'upgrade', 'downgrade', etc.
```
```typescript Include archived plans theme={null}
const plans = await autumn.plans.list({
includeArchived: true
});
```
### Body Parameters
Customer ID to include eligibility info (trial availability, attach scenario).
Entity ID for entity-scoped plans.
If true, includes archived plans in the response.
If true, includes all plan versions.
### Response
Unique identifier for the plan.
Display name of the plan.
Optional description of the plan.
Group identifier for organizing related plans. Plans in the same group are mutually exclusive.
Version number of the plan. Incremented when plan configuration changes.
User-facing version identity. Defaults to v\{n} when the version is minted.
Whether this is the active version of the plan. At most one version is active.
Whether this is an add-on plan that can be attached alongside a main plan.
If true, this plan is automatically attached when a customer is created. Used for free plans.
Base recurring price for the plan. Null for free plans or usage-only plans.
Base price amount for the plan, in major currency units (e.g. dollars).
Base price amounts in additional currencies. The base 'amount' is in the org's default currency.
Three-letter Stripe-supported currency code (e.g. 'eur', 'gbp').
Price amount in this currency. Set explicitly per currency, not converted from the base amount.
Billing interval (e.g. 'month', 'year').
Number of intervals per billing cycle. Defaults to 1.
Display text for showing this price in pricing pages.
Main display text (e.g. '\$10' or '100 messages').
Secondary display text (e.g. 'per month' or 'then \$0.5 per 100').
Payment processors this base price is connected to. Omitted when unset.
Stripe price ID. For prepaid with included > 0 this is the V2 price.
Feature configurations included in this plan. Each item defines included units, pricing, and reset behavior for a feature.
Bills this many feature units when outstanding overage reaches it.
The ID of the feature this item configures.
The full feature object if expanded.
The ID of the feature, used to refer to it in other API calls like /track or /check.
The name of the feature.
The type of the feature
Singular and plural display names for the feature.
The singular display name for the feature.
The plural display name for the feature.
Credit cost schema for credit system features.
The ID of the metered feature (should be a single\_use feature).
The credit cost of the metered feature.
Whether or not the feature is archived.
Number of free units included. For consumable features, balance resets to this number each interval.
Whether the customer has unlimited access to this feature.
Whether entity-level grants contribute to a shared customer balance.
Reset configuration for consumable features. Null for non-consumable features like seats where usage persists across billing cycles.
The interval at which the feature balance resets (e.g. 'month', 'year'). For consumable features, usage resets to 0 and included units are restored.
Number of intervals between resets. Defaults to 1.
Pricing configuration for usage beyond included units. Null if feature is entirely free.
Price per billing\_units after included usage is consumed. Mutually exclusive with tiers.
Amounts in additional currencies for this flat price. The base 'amount' is in the org's default currency. Only valid with 'amount', not 'tiers' (tiered prices carry per-currency amounts on each tier).
Three-letter Stripe-supported currency code (e.g. 'eur', 'gbp').
Price amount in this currency. Set explicitly per currency, not converted from the base amount.
Tiered pricing configuration. Each tier's 'to' INCLUDES the included amount. Either 'tiers' or 'amount' is required.
Three-letter Stripe-supported currency code (e.g. 'eur', 'gbp').
Per-unit amount for this tier in this currency.
Flat amount for this tier in this currency, if the tier uses one.
Billing interval for this price. For consumable features, should match reset.interval.
Number of intervals per billing cycle. Defaults to 1.
Number of units per price increment. Usage is rounded UP to the nearest billing\_units when billed (e.g. billing\_units=100 means 101 usage rounds to 200).
'prepaid' for features like seats where customers pay upfront, 'usage\_based' for pay-as-you-go after included usage.
Maximum units a customer can purchase beyond included. E.g. if included=100 and max\_purchase=300, customer can use up to 400 total before usage is capped. Null for no limit.
Payment processors this item price is connected to. Omitted when unset.
Stripe price ID. For prepaid with included > 0 this is the V2 price.
Display text for showing this item in pricing pages.
Main display text (e.g. '\$10' or '100 messages').
Secondary display text (e.g. 'per month' or 'then \$0.5 per 100').
Rollover configuration for unused units. If set, unused included units roll over to the next period.
Maximum rollover units. Null for unlimited rollover.
Maximum rollover as a percentage (0-100) of included + prepaid grant. Mutually exclusive with max.
When rolled over units expire.
Number of periods before expiry.
Overrides fields of this item's feature for customers on this plan (e.g. a credit system's credit\_schema).
For credit system features: replaces the feature's credit\_schema entirely for customers on this plan.
ID of the metered feature that draws from this credit system.
Number of metered-feature units priced together. Defaults to one when omitted.
Named rates chosen by event properties. The most specific match sets the rate; with no match the item's own rate applies.
Event properties this entry applies to. Every key must equal the tracked property, compared as strings.
Breaks ties between dimensions that match the same number of keys. Higher wins.
Inclusive upper usage boundary for this graduated tier. The final tier must be 'inf'.
Credits consumed per billing-unit group within this tier.
Named adjustments chosen by event properties. Every match applies: factors multiply, then adds are summed.
Event properties this entry applies to. Every key must equal the tracked property, compared as strings.
Multiplies the matched rate. All matching multipliers stack.
Added to the rate after every factor is applied, in credits per billing-unit group.
Inclusive upper usage boundary for this graduated tier. The final tier must be 'inf'.
Credits consumed per billing-unit group within this tier.
Credits consumed per billing-unit group.
For AI credit system features: replaces the feature's markup chain entirely for customers on this plan. An unset level means no markup at that level rather than inheriting the feature's.
Default percentage markup for customers on this plan. Use -100 to make usage free.
Per-provider markup percentages for customers on this plan.
Per-model markup overrides for customers on this plan.
Payment processors this plan is connected to. Omitted when unset.
Stripe product ID this plan is billed under.
Extra Stripe product IDs aliased to this plan.
Every RevenueCat product that maps to this plan. Replaces the current set.
RevenueCat product ID that grants this plan when purchased.
Prepaid quantities granted when this specific RevenueCat product is purchased, in feature units.
Free trial configuration. If set, new customers can try this plan before being charged.
Number of duration\_type periods the trial lasts.
Unit of time for the trial duration ('day', 'month', 'year').
Whether a payment method is required to start the trial. If true, customer will be charged after trial ends.
Behavior when the trial ends. 'bill' charges the customer (default). 'revert' expires the trial and restores the customer's previous plan.
Unix timestamp (ms) when the plan was created.
Environment this plan belongs to ('sandbox' or 'live').
Whether the plan is archived. Archived plans cannot be attached to new customers.
Miscellaneous plan-level configuration flags.
If true, entitlements attached to this plan will still reset on schedule even when the customer's product is in a past\_due state.
Plan-level billing controls used as customer defaults.
List of auto top-up configurations per feature.
The ID of the feature (credit balance) to auto top-up.
Whether auto top-up is enabled.
When the balance drops below this threshold, an auto top-up will be purchased.
Amount of credits to add per auto top-up.
Optional rate limit to cap how often auto top-ups occur.
The time interval for the purchase limit window.
Number of intervals in the purchase limit window.
Maximum number of auto top-ups allowed within the interval.
When true, auto top-up creates a send\_invoice invoice instead of auto-charging.
List of overage spend limits per feature (caps overage spend).
Optional feature ID this spend limit applies to.
Whether the overage spend limit is enabled.
How overage\_limit is interpreted: an absolute overage cap (default) or a percentage of the main-plan allowance.
Overage cap for the feature: absolute units, or a percent (e.g. 120) when limit\_type is usage\_percentage.
When true, overage for this feature is not posted to Stripe. Usage tracking and balance resets still behave normally.
List of hard usage caps per feature (max units per interval).
The feature this usage limit applies to.
Whether this usage limit is enabled.
Maximum units allowed per interval.
Interval for the cap, aligned to the customer's billing cycle.
Window alignment. 'billing\_cycle' phases the interval to the customer's renewal time; 'utc' aligns to the UTC calendar.
When set, only usage from events whose properties match counts toward this cap. Omit to count all usage of the feature.
List of usage alert configurations per feature.
The feature ID this alert applies to.
Whether this usage alert is enabled.
The threshold value that triggers the alert. For usage or remaining, this is an absolute count. For usage\_percentage or remaining\_percentage, this is a percentage (0-100).
Whether the threshold is an absolute count or a percentage of the usage allowance or remaining balance.
What 100% means. balance: every grant on the feature. included: the plan allowance only. recurring: grants that reset. usage\_limit: the cap of the usage limit with the same feature and filter.
Only valid with basis usage\_limit. Points the alert at the usage limit carrying the same filter.
Optional user-defined label to distinguish multiple alerts on the same feature.
List of overage allowed controls per feature. When enabled, usage can exceed balance.
The feature ID this overage allowed control applies to.
Whether overage is allowed for this feature.
Arbitrary key-value metadata defined by you for your own use. Shared across all versions of the plan.
Whether the trial on this plan is available to this customer. For example, if the customer used the trial in the past, this will be false.
The customer's current status with this plan. 'active' if attached, 'scheduled' if pending activation.
Whether the customer's active instance of this plan is set to cancel.
Whether the customer is currently on a free trial of this plan.
The action that would occur if this plan were attached to the customer.
Deprecated. Use variant\_details.base\_plan\_id instead. If this is a variant, the ID of the base plan it was created from.
Details about how this variant relates to its latest base plan.
The ID of the base plan this variant was derived from.
The customization that transforms the base plan into this variant.
Base price configuration for a plan.
Base price amount for the plan, in major currency units (e.g. dollars).
Billing interval (e.g. 'month', 'year').
Number of intervals per billing cycle. Defaults to 1.
Base price amounts in additional currencies. The base 'amount' is in the org's default currency.
Three-letter Stripe-supported currency code (e.g. 'eur', 'gbp').
Price amount in this currency. Set explicitly per currency, not converted from the base amount.
Items to add to the plan.
Bills this many feature units when outstanding overage reaches it.
The ID of the feature to configure.
Number of free units included. Balance resets to this each interval for consumable features.
If true, customer has unlimited access to this feature.
Whether entity-level grants contribute to a shared customer balance.
Reset configuration for consumable features. Omit for non-consumable features like seats.
Interval at which balance resets (e.g. 'month', 'year'). For consumable features only.
Number of intervals between resets. Defaults to 1.
Pricing for usage beyond included units. Omit for free features.
Price per billing\_units after included usage. Either 'amount' or 'tiers' is required.
Amounts in additional currencies for this flat price. The base 'amount' is in the org's default currency. Only valid with 'amount', not 'tiers'.
Three-letter Stripe-supported currency code (e.g. 'eur', 'gbp').
Price amount in this currency. Set explicitly per currency, not converted from the base amount.
Tiered pricing. Either 'amount' or 'tiers' is required.
Three-letter Stripe-supported currency code (e.g. 'eur', 'gbp').
Per-unit amount for this tier in this currency.
Flat amount for this tier in this currency, if the tier uses one.
Billing interval. For consumable features, should match reset.interval.
Number of intervals per billing cycle. Defaults to 1.
Units per price increment. Usage is rounded UP when billed (e.g. billing\_units=100 means 101 rounds to 200).
'prepaid' for upfront payment (seats), 'usage\_based' for pay-as-you-go.
Max units purchasable beyond included. E.g. included=100, max\_purchase=300 allows 400 total. Null for no limit.
Proration settings for prepaid features. Controls mid-cycle quantity change billing.
Billing behavior when quantity increases mid-cycle.
Credit behavior when quantity decreases mid-cycle.
Rollover config for unused units. If set, unused included units carry over.
Max rollover units. Omit for unlimited rollover.
Maximum rollover as a percentage (0-100) of included + prepaid grant. Mutually exclusive with max.
When rolled over units expire.
Number of periods before expiry.
Overrides fields of this item's feature for customers on this plan (e.g. a credit system's credit\_schema).
For credit system features: replaces the feature's credit\_schema entirely for customers on this plan.
ID of the metered feature that draws from this credit system.
Number of metered-feature units priced together. Defaults to one when omitted.
Named rates chosen by event properties. The most specific match sets the rate; with no match the item's own rate applies.
Event properties this entry applies to. Every key must equal the tracked property, compared as strings.
Breaks ties between dimensions that match the same number of keys. Higher wins.
Inclusive upper usage boundary for this graduated tier. The final tier must be 'inf'.
Credits consumed per billing-unit group within this tier.
Named adjustments chosen by event properties. Every match applies: factors multiply, then adds are summed.
Event properties this entry applies to. Every key must equal the tracked property, compared as strings.
Multiplies the matched rate. All matching multipliers stack.
Added to the rate after every factor is applied, in credits per billing-unit group.
Inclusive upper usage boundary for this graduated tier. The final tier must be 'inf'.
Credits consumed per billing-unit group within this tier.
Credits consumed per billing-unit group.
For AI credit system features: replaces the feature's markup chain entirely for customers on this plan. An unset level means no markup at that level rather than inheriting the feature's.
Default percentage markup for customers on this plan. Use -100 to make usage free.
Per-provider markup percentages for customers on this plan.
Per-model markup overrides for customers on this plan.
Filters selecting items to remove from the plan.
Match items linked to this feature.
Match items with this billing method (prepaid or usage\_based).
Match items with this interval. Accepts either a BillingInterval (price-side) or a ResetInterval (reset-side, includes day/hour/minute) so price-less items keyed by reset.interval can be disambiguated.
Match items with this interval\_count. Disambiguates between items that share an interval but differ in count.
Match items whose grant equals this included usage. Omitted is a wildcard.
Free trial configuration for a plan.
Number of duration\_type periods the trial lasts.
Unit of time for the trial ('day', 'month', 'year').
If true, a payment method is required to start the trial and the customer is charged when it ends. Defaults to false.
Behavior when the trial ends. 'bill' charges the customer (default). 'revert' expires the trial and restores the customer's previous plan.
Override the plan's billing controls (auto top-ups, spend limits, usage limits, usage alerts, overage allowed) for this customer.
List of auto top-up configurations per feature.
The ID of the feature (credit balance) to auto top-up.
Whether auto top-up is enabled.
When the balance drops below this threshold, an auto top-up will be purchased.
Amount of credits to add per auto top-up.
Optional rate limit to cap how often auto top-ups occur. Pass count to set the current window's consumed top-ups.
The time interval for the purchase limit window.
Number of intervals in the purchase limit window.
Maximum number of auto top-ups allowed within the interval.
Set the current window's consumed auto top-up count. Omit to leave runtime state unchanged.
When true, auto top-up creates a send\_invoice invoice instead of auto-charging.
List of overage spend limits per feature (caps overage spend).
Optional feature ID this spend limit applies to.
Whether the overage spend limit is enabled.
How overage\_limit is interpreted: an absolute overage cap (default) or a percentage of the main-plan allowance.
Overage cap for the feature: absolute units, or a percent (e.g. 120) when limit\_type is usage\_percentage.
When true, overage for this feature is not posted to Stripe. Usage tracking and balance resets still behave normally.
List of hard usage caps per feature (max units per interval).
The feature this usage limit applies to.
Whether this usage limit is enabled.
Maximum units allowed per interval.
Interval for the cap, aligned to the customer's billing cycle.
Window alignment. 'billing\_cycle' phases the interval to the customer's renewal time; 'utc' aligns to the UTC calendar.
When set, only usage from events whose properties match counts toward this cap. Omit to count all usage of the feature.
List of usage alert configurations per feature.
The feature ID this alert applies to.
Whether this usage alert is enabled.
The threshold value that triggers the alert. For usage or remaining, this is an absolute count. For usage\_percentage or remaining\_percentage, this is a percentage (0-100).
Whether the threshold is an absolute count or a percentage of the usage allowance or remaining balance.
What 100% means. balance: every grant on the feature. included: the plan allowance only. recurring: grants that reset. usage\_limit: the cap of the usage limit with the same feature and filter.
Only valid with basis usage\_limit. Points the alert at the usage limit carrying the same filter.
Optional user-defined label to distinguish multiple alerts on the same feature.
List of overage allowed controls per feature. When enabled, usage can exceed balance.
The feature ID this overage allowed control applies to.
Whether overage is allowed for this feature.
License links to add or override for this customer, keyed by license\_plan\_id. Omitted fields inherit the plan catalog link (included defaults to 1 when the license is not in the catalog). A bare entry restores the license to pure catalog inheritance.
Base price configuration for a plan.
Base price amount for the plan, in major currency units (e.g. dollars).
Billing interval (e.g. 'month', 'year').
Number of intervals per billing cycle. Defaults to 1.
Base price amounts in additional currencies. The base 'amount' is in the org's default currency.
Three-letter Stripe-supported currency code (e.g. 'eur', 'gbp').
Price amount in this currency. Set explicitly per currency, not converted from the base amount.
Bills this many feature units when outstanding overage reaches it.
The ID of the feature to configure.
Number of free units included. Balance resets to this each interval for consumable features.
If true, customer has unlimited access to this feature.
Whether entity-level grants contribute to a shared customer balance.
Reset configuration for consumable features. Omit for non-consumable features like seats.
Interval at which balance resets (e.g. 'month', 'year'). For consumable features only.
Number of intervals between resets. Defaults to 1.
Pricing for usage beyond included units. Omit for free features.
Price per billing\_units after included usage. Either 'amount' or 'tiers' is required.
Amounts in additional currencies for this flat price. The base 'amount' is in the org's default currency. Only valid with 'amount', not 'tiers'.
Three-letter Stripe-supported currency code (e.g. 'eur', 'gbp').
Price amount in this currency. Set explicitly per currency, not converted from the base amount.
Tiered pricing. Either 'amount' or 'tiers' is required.
Three-letter Stripe-supported currency code (e.g. 'eur', 'gbp').
Per-unit amount for this tier in this currency.
Flat amount for this tier in this currency, if the tier uses one.
Billing interval. For consumable features, should match reset.interval.
Number of intervals per billing cycle. Defaults to 1.
Units per price increment. Usage is rounded UP when billed (e.g. billing\_units=100 means 101 rounds to 200).
'prepaid' for upfront payment (seats), 'usage\_based' for pay-as-you-go.
Max units purchasable beyond included. E.g. included=100, max\_purchase=300 allows 400 total. Null for no limit.
Proration settings for prepaid features. Controls mid-cycle quantity change billing.
Billing behavior when quantity increases mid-cycle.
Credit behavior when quantity decreases mid-cycle.
Rollover config for unused units. If set, unused included units carry over.
Max rollover units. Omit for unlimited rollover.
Maximum rollover as a percentage (0-100) of included + prepaid grant. Mutually exclusive with max.
When rolled over units expire.
Number of periods before expiry.
Overrides fields of this item's feature for customers on this plan (e.g. a credit system's credit\_schema).
For credit system features: replaces the feature's credit\_schema entirely for customers on this plan.
ID of the metered feature that draws from this credit system.
Number of metered-feature units priced together. Defaults to one when omitted.
Named rates chosen by event properties. The most specific match sets the rate; with no match the item's own rate applies.
Event properties this entry applies to. Every key must equal the tracked property, compared as strings.
Breaks ties between dimensions that match the same number of keys. Higher wins.
Inclusive upper usage boundary for this graduated tier. The final tier must be 'inf'.
Credits consumed per billing-unit group within this tier.
Named adjustments chosen by event properties. Every match applies: factors multiply, then adds are summed.
Event properties this entry applies to. Every key must equal the tracked property, compared as strings.
Multiplies the matched rate. All matching multipliers stack.
Added to the rate after every factor is applied, in credits per billing-unit group.
Inclusive upper usage boundary for this graduated tier. The final tier must be 'inf'.
Credits consumed per billing-unit group within this tier.
Credits consumed per billing-unit group.
For AI credit system features: replaces the feature's markup chain entirely for customers on this plan. An unset level means no markup at that level rather than inheriting the feature's.
Default percentage markup for customers on this plan. Use -100 to make usage free.
Per-provider markup percentages for customers on this plan.
Per-model markup overrides for customers on this plan.
Match items linked to this feature.
Match items with this billing method (prepaid or usage\_based).
Match items with this interval. Accepts either a BillingInterval (price-side) or a ResetInterval (reset-side, includes day/hour/minute) so price-less items keyed by reset.interval can be disambiguated.
Match items with this interval\_count. Disambiguates between items that share an interval but differ in count.
Match items whose grant equals this included usage. Omitted is a wildcard.
License links to drop, keyed by license\_plan\_id. Parallel to remove\_items.
Plans offered as assignable licenses under this plan. Omitted when the plan has none.
The plan offered as a license under this plan.
The exact license-plan version pinned by this link.
Version slug of the license-plan row this link points at.
Number of license assignments included with this plan for free.
Assignments are capped at the included quantity. Must be true for now; overflow billing (false) is not yet available.
The item and price diff applied to this parent-plan link.
Base price configuration for a plan.
Base price amount for the plan, in major currency units (e.g. dollars).
Billing interval (e.g. 'month', 'year').
Number of intervals per billing cycle. Defaults to 1.
Base price amounts in additional currencies. The base 'amount' is in the org's default currency.
Three-letter Stripe-supported currency code (e.g. 'eur', 'gbp').
Price amount in this currency. Set explicitly per currency, not converted from the base amount.
Bills this many feature units when outstanding overage reaches it.
The ID of the feature to configure.
Number of free units included. Balance resets to this each interval for consumable features.
If true, customer has unlimited access to this feature.
Whether entity-level grants contribute to a shared customer balance.
Reset configuration for consumable features. Omit for non-consumable features like seats.
Interval at which balance resets (e.g. 'month', 'year'). For consumable features only.
Number of intervals between resets. Defaults to 1.
Pricing for usage beyond included units. Omit for free features.
Price per billing\_units after included usage. Either 'amount' or 'tiers' is required.
Amounts in additional currencies for this flat price. The base 'amount' is in the org's default currency. Only valid with 'amount', not 'tiers'.
Three-letter Stripe-supported currency code (e.g. 'eur', 'gbp').
Price amount in this currency. Set explicitly per currency, not converted from the base amount.
Tiered pricing. Either 'amount' or 'tiers' is required.
Three-letter Stripe-supported currency code (e.g. 'eur', 'gbp').
Per-unit amount for this tier in this currency.
Flat amount for this tier in this currency, if the tier uses one.
Billing interval. For consumable features, should match reset.interval.
Number of intervals per billing cycle. Defaults to 1.
Units per price increment. Usage is rounded UP when billed (e.g. billing\_units=100 means 101 rounds to 200).
'prepaid' for upfront payment (seats), 'usage\_based' for pay-as-you-go.
Max units purchasable beyond included. E.g. included=100, max\_purchase=300 allows 400 total. Null for no limit.
Proration settings for prepaid features. Controls mid-cycle quantity change billing.
Billing behavior when quantity increases mid-cycle.
Credit behavior when quantity decreases mid-cycle.
Rollover config for unused units. If set, unused included units carry over.
Max rollover units. Omit for unlimited rollover.
Maximum rollover as a percentage (0-100) of included + prepaid grant. Mutually exclusive with max.
When rolled over units expire.
Number of periods before expiry.
Overrides fields of this item's feature for customers on this plan (e.g. a credit system's credit\_schema).
For credit system features: replaces the feature's credit\_schema entirely for customers on this plan.
ID of the metered feature that draws from this credit system.
Number of metered-feature units priced together. Defaults to one when omitted.
Named rates chosen by event properties. The most specific match sets the rate; with no match the item's own rate applies.
Event properties this entry applies to. Every key must equal the tracked property, compared as strings.
Breaks ties between dimensions that match the same number of keys. Higher wins.
Inclusive upper usage boundary for this graduated tier. The final tier must be 'inf'.
Credits consumed per billing-unit group within this tier.
Named adjustments chosen by event properties. Every match applies: factors multiply, then adds are summed.
Event properties this entry applies to. Every key must equal the tracked property, compared as strings.
Multiplies the matched rate. All matching multipliers stack.
Added to the rate after every factor is applied, in credits per billing-unit group.
Inclusive upper usage boundary for this graduated tier. The final tier must be 'inf'.
Credits consumed per billing-unit group within this tier.
Credits consumed per billing-unit group.
For AI credit system features: replaces the feature's markup chain entirely for customers on this plan. An unset level means no markup at that level rather than inheriting the feature's.
Default percentage markup for customers on this plan. Use -100 to make usage free.
Per-provider markup percentages for customers on this plan.
Per-model markup overrides for customers on this plan.
Match items linked to this feature.
Match items with this billing method (prepaid or usage\_based).
Match items with this interval. Accepts either a BillingInterval (price-side) or a ResetInterval (reset-side, includes day/hour/minute) so price-less items keyed by reset.interval can be disambiguated.
Match items with this interval\_count. Disambiguates between items that share an interval but differ in count.
Match items whose grant equals this included usage. Omitted is a wildcard.
Arbitrary key-value metadata defined by you on this link.
The effective plan for this license link — the pinned version, with the link's customize applied. Present when license plans are expanded.
Unique identifier for the plan.
Display name of the plan.
Optional description of the plan.
Group identifier for organizing related plans. Plans in the same group are mutually exclusive.
Version number of the plan. Incremented when plan configuration changes.
User-facing version identity. Defaults to v\{n} when the version is minted.
Whether this is the active version of the plan. At most one version is active.
Whether this is an add-on plan that can be attached alongside a main plan.
If true, this plan is automatically attached when a customer is created. Used for free plans.
Base recurring price for the plan. Null for free plans or usage-only plans.
Base price amount for the plan, in major currency units (e.g. dollars).
Base price amounts in additional currencies. The base 'amount' is in the org's default currency.
Three-letter Stripe-supported currency code (e.g. 'eur', 'gbp').
Price amount in this currency. Set explicitly per currency, not converted from the base amount.
Billing interval (e.g. 'month', 'year').
Number of intervals per billing cycle. Defaults to 1.
Display text for showing this price in pricing pages.
Main display text (e.g. '\$10' or '100 messages').
Secondary display text (e.g. 'per month' or 'then \$0.5 per 100').
Payment processors this base price is connected to. Omitted when unset.
Stripe price ID. For prepaid with included > 0 this is the V2 price.
Feature configurations included in this plan. Each item defines included units, pricing, and reset behavior for a feature.
Bills this many feature units when outstanding overage reaches it.
The ID of the feature this item configures.
The full feature object if expanded.
The ID of the feature, used to refer to it in other API calls like /track or /check.
The name of the feature.
The type of the feature
Singular and plural display names for the feature.
The singular display name for the feature.
The plural display name for the feature.
Credit cost schema for credit system features.
The ID of the metered feature (should be a single\_use feature).
The credit cost of the metered feature.
Whether or not the feature is archived.
Number of free units included. For consumable features, balance resets to this number each interval.
Whether the customer has unlimited access to this feature.
Whether entity-level grants contribute to a shared customer balance.
Reset configuration for consumable features. Null for non-consumable features like seats where usage persists across billing cycles.
The interval at which the feature balance resets (e.g. 'month', 'year'). For consumable features, usage resets to 0 and included units are restored.
Number of intervals between resets. Defaults to 1.
Pricing configuration for usage beyond included units. Null if feature is entirely free.
Price per billing\_units after included usage is consumed. Mutually exclusive with tiers.
Amounts in additional currencies for this flat price. The base 'amount' is in the org's default currency. Only valid with 'amount', not 'tiers' (tiered prices carry per-currency amounts on each tier).
Three-letter Stripe-supported currency code (e.g. 'eur', 'gbp').
Price amount in this currency. Set explicitly per currency, not converted from the base amount.
Tiered pricing configuration. Each tier's 'to' INCLUDES the included amount. Either 'tiers' or 'amount' is required.
Three-letter Stripe-supported currency code (e.g. 'eur', 'gbp').
Per-unit amount for this tier in this currency.
Flat amount for this tier in this currency, if the tier uses one.
Billing interval for this price. For consumable features, should match reset.interval.
Number of intervals per billing cycle. Defaults to 1.
Number of units per price increment. Usage is rounded UP to the nearest billing\_units when billed (e.g. billing\_units=100 means 101 usage rounds to 200).
'prepaid' for features like seats where customers pay upfront, 'usage\_based' for pay-as-you-go after included usage.
Maximum units a customer can purchase beyond included. E.g. if included=100 and max\_purchase=300, customer can use up to 400 total before usage is capped. Null for no limit.
Payment processors this item price is connected to. Omitted when unset.
Stripe price ID. For prepaid with included > 0 this is the V2 price.
Display text for showing this item in pricing pages.
Main display text (e.g. '\$10' or '100 messages').
Secondary display text (e.g. 'per month' or 'then \$0.5 per 100').
Rollover configuration for unused units. If set, unused included units roll over to the next period.
Maximum rollover units. Null for unlimited rollover.
Maximum rollover as a percentage (0-100) of included + prepaid grant. Mutually exclusive with max.
When rolled over units expire.
Number of periods before expiry.
Overrides fields of this item's feature for customers on this plan (e.g. a credit system's credit\_schema).
For credit system features: replaces the feature's credit\_schema entirely for customers on this plan.
ID of the metered feature that draws from this credit system.
Number of metered-feature units priced together. Defaults to one when omitted.
Named rates chosen by event properties. The most specific match sets the rate; with no match the item's own rate applies.
Event properties this entry applies to. Every key must equal the tracked property, compared as strings.
Breaks ties between dimensions that match the same number of keys. Higher wins.
Inclusive upper usage boundary for this graduated tier. The final tier must be 'inf'.
Credits consumed per billing-unit group within this tier.
Named adjustments chosen by event properties. Every match applies: factors multiply, then adds are summed.
Event properties this entry applies to. Every key must equal the tracked property, compared as strings.
Multiplies the matched rate. All matching multipliers stack.
Added to the rate after every factor is applied, in credits per billing-unit group.
Inclusive upper usage boundary for this graduated tier. The final tier must be 'inf'.
Credits consumed per billing-unit group within this tier.
Credits consumed per billing-unit group.
For AI credit system features: replaces the feature's markup chain entirely for customers on this plan. An unset level means no markup at that level rather than inheriting the feature's.
Default percentage markup for customers on this plan. Use -100 to make usage free.
Per-provider markup percentages for customers on this plan.
Per-model markup overrides for customers on this plan.
Payment processors this plan is connected to. Omitted when unset.
Stripe product ID this plan is billed under.
Extra Stripe product IDs aliased to this plan.
Every RevenueCat product that maps to this plan. Replaces the current set.
RevenueCat product ID that grants this plan when purchased.
Prepaid quantities granted when this specific RevenueCat product is purchased, in feature units.
Free trial configuration. If set, new customers can try this plan before being charged.
Number of duration\_type periods the trial lasts.
Unit of time for the trial duration ('day', 'month', 'year').
Whether a payment method is required to start the trial. If true, customer will be charged after trial ends.
Behavior when the trial ends. 'bill' charges the customer (default). 'revert' expires the trial and restores the customer's previous plan.
Unix timestamp (ms) when the plan was created.
Environment this plan belongs to ('sandbox' or 'live').
Whether the plan is archived. Archived plans cannot be attached to new customers.
Miscellaneous plan-level configuration flags.
If true, entitlements attached to this plan will still reset on schedule even when the customer's product is in a past\_due state.
Plan-level billing controls used as customer defaults.
List of auto top-up configurations per feature.
The ID of the feature (credit balance) to auto top-up.
Whether auto top-up is enabled.
When the balance drops below this threshold, an auto top-up will be purchased.
Amount of credits to add per auto top-up.
Optional rate limit to cap how often auto top-ups occur.
The time interval for the purchase limit window.
Number of intervals in the purchase limit window.
Maximum number of auto top-ups allowed within the interval.
When true, auto top-up creates a send\_invoice invoice instead of auto-charging.
List of overage spend limits per feature (caps overage spend).
Optional feature ID this spend limit applies to.
Whether the overage spend limit is enabled.
How overage\_limit is interpreted: an absolute overage cap (default) or a percentage of the main-plan allowance.
Overage cap for the feature: absolute units, or a percent (e.g. 120) when limit\_type is usage\_percentage.
When true, overage for this feature is not posted to Stripe. Usage tracking and balance resets still behave normally.
List of hard usage caps per feature (max units per interval).
The feature this usage limit applies to.
Whether this usage limit is enabled.
Maximum units allowed per interval.
Interval for the cap, aligned to the customer's billing cycle.
Window alignment. 'billing\_cycle' phases the interval to the customer's renewal time; 'utc' aligns to the UTC calendar.
When set, only usage from events whose properties match counts toward this cap. Omit to count all usage of the feature.
List of usage alert configurations per feature.
The feature ID this alert applies to.
Whether this usage alert is enabled.
The threshold value that triggers the alert. For usage or remaining, this is an absolute count. For usage\_percentage or remaining\_percentage, this is a percentage (0-100).
Whether the threshold is an absolute count or a percentage of the usage allowance or remaining balance.
What 100% means. balance: every grant on the feature. included: the plan allowance only. recurring: grants that reset. usage\_limit: the cap of the usage limit with the same feature and filter.
Only valid with basis usage\_limit. Points the alert at the usage limit carrying the same filter.
Optional user-defined label to distinguish multiple alerts on the same feature.
List of overage allowed controls per feature. When enabled, usage can exceed balance.
The feature ID this overage allowed control applies to.
Whether overage is allowed for this feature.
Arbitrary key-value metadata defined by you for your own use. Shared across all versions of the plan.
Whether the trial on this plan is available to this customer. For example, if the customer used the trial in the past, this will be false.
The customer's current status with this plan. 'active' if attached, 'scheduled' if pending activation.
Whether the customer's active instance of this plan is set to cancel.
Whether the customer is currently on a free trial of this plan.
The action that would occur if this plan were attached to the customer.
Deprecated. Use variant\_details.base\_plan\_id instead. If this is a variant, the ID of the base plan it was created from.
Details about how this variant relates to its latest base plan.
The ID of the base plan this variant was derived from.
The customization that transforms the base plan into this variant.
Base price configuration for a plan.
Base price amount for the plan, in major currency units (e.g. dollars).
Billing interval (e.g. 'month', 'year').
Number of intervals per billing cycle. Defaults to 1.
Base price amounts in additional currencies. The base 'amount' is in the org's default currency.
Three-letter Stripe-supported currency code (e.g. 'eur', 'gbp').
Price amount in this currency. Set explicitly per currency, not converted from the base amount.
Items to add to the plan.
Bills this many feature units when outstanding overage reaches it.
The ID of the feature to configure.
Number of free units included. Balance resets to this each interval for consumable features.
If true, customer has unlimited access to this feature.
Whether entity-level grants contribute to a shared customer balance.
Reset configuration for consumable features. Omit for non-consumable features like seats.
Interval at which balance resets (e.g. 'month', 'year'). For consumable features only.
Number of intervals between resets. Defaults to 1.
Pricing for usage beyond included units. Omit for free features.
Price per billing\_units after included usage. Either 'amount' or 'tiers' is required.
Amounts in additional currencies for this flat price. The base 'amount' is in the org's default currency. Only valid with 'amount', not 'tiers'.
Three-letter Stripe-supported currency code (e.g. 'eur', 'gbp').
Price amount in this currency. Set explicitly per currency, not converted from the base amount.
Tiered pricing. Either 'amount' or 'tiers' is required.
Three-letter Stripe-supported currency code (e.g. 'eur', 'gbp').
Per-unit amount for this tier in this currency.
Flat amount for this tier in this currency, if the tier uses one.
Billing interval. For consumable features, should match reset.interval.
Number of intervals per billing cycle. Defaults to 1.
Units per price increment. Usage is rounded UP when billed (e.g. billing\_units=100 means 101 rounds to 200).
'prepaid' for upfront payment (seats), 'usage\_based' for pay-as-you-go.
Max units purchasable beyond included. E.g. included=100, max\_purchase=300 allows 400 total. Null for no limit.
Proration settings for prepaid features. Controls mid-cycle quantity change billing.
Billing behavior when quantity increases mid-cycle.
Credit behavior when quantity decreases mid-cycle.
Rollover config for unused units. If set, unused included units carry over.
Max rollover units. Omit for unlimited rollover.
Maximum rollover as a percentage (0-100) of included + prepaid grant. Mutually exclusive with max.
When rolled over units expire.
Number of periods before expiry.
Overrides fields of this item's feature for customers on this plan (e.g. a credit system's credit\_schema).
For credit system features: replaces the feature's credit\_schema entirely for customers on this plan.
ID of the metered feature that draws from this credit system.
Number of metered-feature units priced together. Defaults to one when omitted.
Named rates chosen by event properties. The most specific match sets the rate; with no match the item's own rate applies.
Event properties this entry applies to. Every key must equal the tracked property, compared as strings.
Breaks ties between dimensions that match the same number of keys. Higher wins.
Inclusive upper usage boundary for this graduated tier. The final tier must be 'inf'.
Credits consumed per billing-unit group within this tier.
Named adjustments chosen by event properties. Every match applies: factors multiply, then adds are summed.
Event properties this entry applies to. Every key must equal the tracked property, compared as strings.
Multiplies the matched rate. All matching multipliers stack.
Added to the rate after every factor is applied, in credits per billing-unit group.
Inclusive upper usage boundary for this graduated tier. The final tier must be 'inf'.
Credits consumed per billing-unit group within this tier.
Credits consumed per billing-unit group.
For AI credit system features: replaces the feature's markup chain entirely for customers on this plan. An unset level means no markup at that level rather than inheriting the feature's.
Default percentage markup for customers on this plan. Use -100 to make usage free.
Per-provider markup percentages for customers on this plan.
Per-model markup overrides for customers on this plan.
Filters selecting items to remove from the plan.
Match items linked to this feature.
Match items with this billing method (prepaid or usage\_based).
Match items with this interval. Accepts either a BillingInterval (price-side) or a ResetInterval (reset-side, includes day/hour/minute) so price-less items keyed by reset.interval can be disambiguated.
Match items with this interval\_count. Disambiguates between items that share an interval but differ in count.
Match items whose grant equals this included usage. Omitted is a wildcard.
Free trial configuration for a plan.
Number of duration\_type periods the trial lasts.
Unit of time for the trial ('day', 'month', 'year').
If true, a payment method is required to start the trial and the customer is charged when it ends. Defaults to false.
Behavior when the trial ends. 'bill' charges the customer (default). 'revert' expires the trial and restores the customer's previous plan.
Override the plan's billing controls (auto top-ups, spend limits, usage limits, usage alerts, overage allowed) for this customer.
List of auto top-up configurations per feature.
The ID of the feature (credit balance) to auto top-up.
Whether auto top-up is enabled.
When the balance drops below this threshold, an auto top-up will be purchased.
Amount of credits to add per auto top-up.
Optional rate limit to cap how often auto top-ups occur. Pass count to set the current window's consumed top-ups.
The time interval for the purchase limit window.
Number of intervals in the purchase limit window.
Maximum number of auto top-ups allowed within the interval.
Set the current window's consumed auto top-up count. Omit to leave runtime state unchanged.
When true, auto top-up creates a send\_invoice invoice instead of auto-charging.
List of overage spend limits per feature (caps overage spend).
Optional feature ID this spend limit applies to.
Whether the overage spend limit is enabled.
How overage\_limit is interpreted: an absolute overage cap (default) or a percentage of the main-plan allowance.
Overage cap for the feature: absolute units, or a percent (e.g. 120) when limit\_type is usage\_percentage.
When true, overage for this feature is not posted to Stripe. Usage tracking and balance resets still behave normally.
List of hard usage caps per feature (max units per interval).
The feature this usage limit applies to.
Whether this usage limit is enabled.
Maximum units allowed per interval.
Interval for the cap, aligned to the customer's billing cycle.
Window alignment. 'billing\_cycle' phases the interval to the customer's renewal time; 'utc' aligns to the UTC calendar.
When set, only usage from events whose properties match counts toward this cap. Omit to count all usage of the feature.
List of usage alert configurations per feature.
The feature ID this alert applies to.
Whether this usage alert is enabled.
The threshold value that triggers the alert. For usage or remaining, this is an absolute count. For usage\_percentage or remaining\_percentage, this is a percentage (0-100).
Whether the threshold is an absolute count or a percentage of the usage allowance or remaining balance.
What 100% means. balance: every grant on the feature. included: the plan allowance only. recurring: grants that reset. usage\_limit: the cap of the usage limit with the same feature and filter.
Only valid with basis usage\_limit. Points the alert at the usage limit carrying the same filter.
Optional user-defined label to distinguish multiple alerts on the same feature.
List of overage allowed controls per feature. When enabled, usage can exceed balance.
The feature ID this overage allowed control applies to.
Whether overage is allowed for this feature.
License links to add or override for this customer, keyed by license\_plan\_id. Omitted fields inherit the plan catalog link (included defaults to 1 when the license is not in the catalog). A bare entry restores the license to pure catalog inheritance.
Base price configuration for a plan.
Base price amount for the plan, in major currency units (e.g. dollars).
Billing interval (e.g. 'month', 'year').
Number of intervals per billing cycle. Defaults to 1.
Base price amounts in additional currencies. The base 'amount' is in the org's default currency.
Three-letter Stripe-supported currency code (e.g. 'eur', 'gbp').
Price amount in this currency. Set explicitly per currency, not converted from the base amount.
Bills this many feature units when outstanding overage reaches it.
The ID of the feature to configure.
Number of free units included. Balance resets to this each interval for consumable features.
If true, customer has unlimited access to this feature.
Whether entity-level grants contribute to a shared customer balance.
Reset configuration for consumable features. Omit for non-consumable features like seats.
Interval at which balance resets (e.g. 'month', 'year'). For consumable features only.
Number of intervals between resets. Defaults to 1.
Pricing for usage beyond included units. Omit for free features.
Price per billing\_units after included usage. Either 'amount' or 'tiers' is required.
Amounts in additional currencies for this flat price. The base 'amount' is in the org's default currency. Only valid with 'amount', not 'tiers'.
Three-letter Stripe-supported currency code (e.g. 'eur', 'gbp').
Price amount in this currency. Set explicitly per currency, not converted from the base amount.
Tiered pricing. Either 'amount' or 'tiers' is required.
Three-letter Stripe-supported currency code (e.g. 'eur', 'gbp').
Per-unit amount for this tier in this currency.
Flat amount for this tier in this currency, if the tier uses one.
Billing interval. For consumable features, should match reset.interval.
Number of intervals per billing cycle. Defaults to 1.
Units per price increment. Usage is rounded UP when billed (e.g. billing\_units=100 means 101 rounds to 200).
'prepaid' for upfront payment (seats), 'usage\_based' for pay-as-you-go.
Max units purchasable beyond included. E.g. included=100, max\_purchase=300 allows 400 total. Null for no limit.
Proration settings for prepaid features. Controls mid-cycle quantity change billing.
Billing behavior when quantity increases mid-cycle.
Credit behavior when quantity decreases mid-cycle.
Rollover config for unused units. If set, unused included units carry over.
Max rollover units. Omit for unlimited rollover.
Maximum rollover as a percentage (0-100) of included + prepaid grant. Mutually exclusive with max.
When rolled over units expire.
Number of periods before expiry.
Overrides fields of this item's feature for customers on this plan (e.g. a credit system's credit\_schema).
For credit system features: replaces the feature's credit\_schema entirely for customers on this plan.
ID of the metered feature that draws from this credit system.
Number of metered-feature units priced together. Defaults to one when omitted.
Named rates chosen by event properties. The most specific match sets the rate; with no match the item's own rate applies.
Event properties this entry applies to. Every key must equal the tracked property, compared as strings.
Breaks ties between dimensions that match the same number of keys. Higher wins.
Inclusive upper usage boundary for this graduated tier. The final tier must be 'inf'.
Credits consumed per billing-unit group within this tier.
Named adjustments chosen by event properties. Every match applies: factors multiply, then adds are summed.
Event properties this entry applies to. Every key must equal the tracked property, compared as strings.
Multiplies the matched rate. All matching multipliers stack.
Added to the rate after every factor is applied, in credits per billing-unit group.
Inclusive upper usage boundary for this graduated tier. The final tier must be 'inf'.
Credits consumed per billing-unit group within this tier.
Credits consumed per billing-unit group.
For AI credit system features: replaces the feature's markup chain entirely for customers on this plan. An unset level means no markup at that level rather than inheriting the feature's.
Default percentage markup for customers on this plan. Use -100 to make usage free.
Per-provider markup percentages for customers on this plan.
Per-model markup overrides for customers on this plan.
Match items linked to this feature.
Match items with this billing method (prepaid or usage\_based).
Match items with this interval. Accepts either a BillingInterval (price-side) or a ResetInterval (reset-side, includes day/hour/minute) so price-less items keyed by reset.interval can be disambiguated.
Match items with this interval\_count. Disambiguates between items that share an interval but differ in count.
Match items whose grant equals this included usage. Omitted is a wildcard.
License links to drop, keyed by license\_plan\_id. Parallel to remove\_items.
Variant plans derived from this base plan. Omitted when the plan has none.
The plan ID of the variant derived from this base plan.
Display name of the variant plan.
The variant's declared divergence from its base plan — exactly what you would re-submit to recreate it.
Base price configuration for a plan.
Base price amount for the plan, in major currency units (e.g. dollars).
Billing interval (e.g. 'month', 'year').
Number of intervals per billing cycle. Defaults to 1.
Base price amounts in additional currencies. The base 'amount' is in the org's default currency.
Three-letter Stripe-supported currency code (e.g. 'eur', 'gbp').
Price amount in this currency. Set explicitly per currency, not converted from the base amount.
Items to add to the plan.
Bills this many feature units when outstanding overage reaches it.
The ID of the feature to configure.
Number of free units included. Balance resets to this each interval for consumable features.
If true, customer has unlimited access to this feature.
Whether entity-level grants contribute to a shared customer balance.
Reset configuration for consumable features. Omit for non-consumable features like seats.
Interval at which balance resets (e.g. 'month', 'year'). For consumable features only.
Number of intervals between resets. Defaults to 1.
Pricing for usage beyond included units. Omit for free features.
Price per billing\_units after included usage. Either 'amount' or 'tiers' is required.
Amounts in additional currencies for this flat price. The base 'amount' is in the org's default currency. Only valid with 'amount', not 'tiers'.
Three-letter Stripe-supported currency code (e.g. 'eur', 'gbp').
Price amount in this currency. Set explicitly per currency, not converted from the base amount.
Tiered pricing. Either 'amount' or 'tiers' is required.
Three-letter Stripe-supported currency code (e.g. 'eur', 'gbp').
Per-unit amount for this tier in this currency.
Flat amount for this tier in this currency, if the tier uses one.
Billing interval. For consumable features, should match reset.interval.
Number of intervals per billing cycle. Defaults to 1.
Units per price increment. Usage is rounded UP when billed (e.g. billing\_units=100 means 101 rounds to 200).
'prepaid' for upfront payment (seats), 'usage\_based' for pay-as-you-go.
Max units purchasable beyond included. E.g. included=100, max\_purchase=300 allows 400 total. Null for no limit.
Proration settings for prepaid features. Controls mid-cycle quantity change billing.
Billing behavior when quantity increases mid-cycle.
Credit behavior when quantity decreases mid-cycle.
Rollover config for unused units. If set, unused included units carry over.
Max rollover units. Omit for unlimited rollover.
Maximum rollover as a percentage (0-100) of included + prepaid grant. Mutually exclusive with max.
When rolled over units expire.
Number of periods before expiry.
Overrides fields of this item's feature for customers on this plan (e.g. a credit system's credit\_schema).
For credit system features: replaces the feature's credit\_schema entirely for customers on this plan.
ID of the metered feature that draws from this credit system.
Number of metered-feature units priced together. Defaults to one when omitted.
Named rates chosen by event properties. The most specific match sets the rate; with no match the item's own rate applies.
Event properties this entry applies to. Every key must equal the tracked property, compared as strings.
Breaks ties between dimensions that match the same number of keys. Higher wins.
Inclusive upper usage boundary for this graduated tier. The final tier must be 'inf'.
Credits consumed per billing-unit group within this tier.
Named adjustments chosen by event properties. Every match applies: factors multiply, then adds are summed.
Event properties this entry applies to. Every key must equal the tracked property, compared as strings.
Multiplies the matched rate. All matching multipliers stack.
Added to the rate after every factor is applied, in credits per billing-unit group.
Inclusive upper usage boundary for this graduated tier. The final tier must be 'inf'.
Credits consumed per billing-unit group within this tier.
Credits consumed per billing-unit group.
For AI credit system features: replaces the feature's markup chain entirely for customers on this plan. An unset level means no markup at that level rather than inheriting the feature's.
Default percentage markup for customers on this plan. Use -100 to make usage free.
Per-provider markup percentages for customers on this plan.
Per-model markup overrides for customers on this plan.
Filters selecting items to remove from the plan.
Match items linked to this feature.
Match items with this billing method (prepaid or usage\_based).
Match items with this interval. Accepts either a BillingInterval (price-side) or a ResetInterval (reset-side, includes day/hour/minute) so price-less items keyed by reset.interval can be disambiguated.
Match items with this interval\_count. Disambiguates between items that share an interval but differ in count.
Match items whose grant equals this included usage. Omitted is a wildcard.
Free trial configuration for a plan.
Number of duration\_type periods the trial lasts.
Unit of time for the trial ('day', 'month', 'year').
If true, a payment method is required to start the trial and the customer is charged when it ends. Defaults to false.
Behavior when the trial ends. 'bill' charges the customer (default). 'revert' expires the trial and restores the customer's previous plan.
Override the plan's billing controls (auto top-ups, spend limits, usage limits, usage alerts, overage allowed) for this customer.
List of auto top-up configurations per feature.
The ID of the feature (credit balance) to auto top-up.
Whether auto top-up is enabled.
When the balance drops below this threshold, an auto top-up will be purchased.
Amount of credits to add per auto top-up.
Optional rate limit to cap how often auto top-ups occur. Pass count to set the current window's consumed top-ups.
The time interval for the purchase limit window.
Number of intervals in the purchase limit window.
Maximum number of auto top-ups allowed within the interval.
Set the current window's consumed auto top-up count. Omit to leave runtime state unchanged.
When true, auto top-up creates a send\_invoice invoice instead of auto-charging.
List of overage spend limits per feature (caps overage spend).
Optional feature ID this spend limit applies to.
Whether the overage spend limit is enabled.
How overage\_limit is interpreted: an absolute overage cap (default) or a percentage of the main-plan allowance.
Overage cap for the feature: absolute units, or a percent (e.g. 120) when limit\_type is usage\_percentage.
When true, overage for this feature is not posted to Stripe. Usage tracking and balance resets still behave normally.
List of hard usage caps per feature (max units per interval).
The feature this usage limit applies to.
Whether this usage limit is enabled.
Maximum units allowed per interval.
Interval for the cap, aligned to the customer's billing cycle.
Window alignment. 'billing\_cycle' phases the interval to the customer's renewal time; 'utc' aligns to the UTC calendar.
When set, only usage from events whose properties match counts toward this cap. Omit to count all usage of the feature.
List of usage alert configurations per feature.
The feature ID this alert applies to.
Whether this usage alert is enabled.
The threshold value that triggers the alert. For usage or remaining, this is an absolute count. For usage\_percentage or remaining\_percentage, this is a percentage (0-100).
Whether the threshold is an absolute count or a percentage of the usage allowance or remaining balance.
What 100% means. balance: every grant on the feature. included: the plan allowance only. recurring: grants that reset. usage\_limit: the cap of the usage limit with the same feature and filter.
Only valid with basis usage\_limit. Points the alert at the usage limit carrying the same filter.
Optional user-defined label to distinguish multiple alerts on the same feature.
List of overage allowed controls per feature. When enabled, usage can exceed balance.
The feature ID this overage allowed control applies to.
Whether overage is allowed for this feature.
License links to add or override for this customer, keyed by license\_plan\_id. Omitted fields inherit the plan catalog link (included defaults to 1 when the license is not in the catalog). A bare entry restores the license to pure catalog inheritance.
Base price configuration for a plan.
Base price amount for the plan, in major currency units (e.g. dollars).
Billing interval (e.g. 'month', 'year').
Number of intervals per billing cycle. Defaults to 1.
Base price amounts in additional currencies. The base 'amount' is in the org's default currency.
Three-letter Stripe-supported currency code (e.g. 'eur', 'gbp').
Price amount in this currency. Set explicitly per currency, not converted from the base amount.
Bills this many feature units when outstanding overage reaches it.
The ID of the feature to configure.
Number of free units included. Balance resets to this each interval for consumable features.
If true, customer has unlimited access to this feature.
Whether entity-level grants contribute to a shared customer balance.
Reset configuration for consumable features. Omit for non-consumable features like seats.
Interval at which balance resets (e.g. 'month', 'year'). For consumable features only.
Number of intervals between resets. Defaults to 1.
Pricing for usage beyond included units. Omit for free features.
Price per billing\_units after included usage. Either 'amount' or 'tiers' is required.
Amounts in additional currencies for this flat price. The base 'amount' is in the org's default currency. Only valid with 'amount', not 'tiers'.
Three-letter Stripe-supported currency code (e.g. 'eur', 'gbp').
Price amount in this currency. Set explicitly per currency, not converted from the base amount.
Tiered pricing. Either 'amount' or 'tiers' is required.
Three-letter Stripe-supported currency code (e.g. 'eur', 'gbp').
Per-unit amount for this tier in this currency.
Flat amount for this tier in this currency, if the tier uses one.
Billing interval. For consumable features, should match reset.interval.
Number of intervals per billing cycle. Defaults to 1.
Units per price increment. Usage is rounded UP when billed (e.g. billing\_units=100 means 101 rounds to 200).
'prepaid' for upfront payment (seats), 'usage\_based' for pay-as-you-go.
Max units purchasable beyond included. E.g. included=100, max\_purchase=300 allows 400 total. Null for no limit.
Proration settings for prepaid features. Controls mid-cycle quantity change billing.
Billing behavior when quantity increases mid-cycle.
Credit behavior when quantity decreases mid-cycle.
Rollover config for unused units. If set, unused included units carry over.
Max rollover units. Omit for unlimited rollover.
Maximum rollover as a percentage (0-100) of included + prepaid grant. Mutually exclusive with max.
When rolled over units expire.
Number of periods before expiry.
Overrides fields of this item's feature for customers on this plan (e.g. a credit system's credit\_schema).
For credit system features: replaces the feature's credit\_schema entirely for customers on this plan.
ID of the metered feature that draws from this credit system.
Number of metered-feature units priced together. Defaults to one when omitted.
Named rates chosen by event properties. The most specific match sets the rate; with no match the item's own rate applies.
Event properties this entry applies to. Every key must equal the tracked property, compared as strings.
Breaks ties between dimensions that match the same number of keys. Higher wins.
Inclusive upper usage boundary for this graduated tier. The final tier must be 'inf'.
Credits consumed per billing-unit group within this tier.
Named adjustments chosen by event properties. Every match applies: factors multiply, then adds are summed.
Event properties this entry applies to. Every key must equal the tracked property, compared as strings.
Multiplies the matched rate. All matching multipliers stack.
Added to the rate after every factor is applied, in credits per billing-unit group.
Inclusive upper usage boundary for this graduated tier. The final tier must be 'inf'.
Credits consumed per billing-unit group within this tier.
Credits consumed per billing-unit group.
For AI credit system features: replaces the feature's markup chain entirely for customers on this plan. An unset level means no markup at that level rather than inheriting the feature's.
Default percentage markup for customers on this plan. Use -100 to make usage free.
Per-provider markup percentages for customers on this plan.
Per-model markup overrides for customers on this plan.
Match items linked to this feature.
Match items with this billing method (prepaid or usage\_based).
Match items with this interval. Accepts either a BillingInterval (price-side) or a ResetInterval (reset-side, includes day/hour/minute) so price-less items keyed by reset.interval can be disambiguated.
Match items with this interval\_count. Disambiguates between items that share an interval but differ in count.
Match items whose grant equals this included usage. Omitted is a wildcard.
License links to drop, keyed by license\_plan\_id. Parallel to remove\_items.
The variant's fully resolved plan (base + customize applied). Present when variants are expanded.
Unique identifier for the plan.
Display name of the plan.
Optional description of the plan.
Group identifier for organizing related plans. Plans in the same group are mutually exclusive.
Version number of the plan. Incremented when plan configuration changes.
User-facing version identity. Defaults to v\{n} when the version is minted.
Whether this is the active version of the plan. At most one version is active.
Whether this is an add-on plan that can be attached alongside a main plan.
If true, this plan is automatically attached when a customer is created. Used for free plans.
Base recurring price for the plan. Null for free plans or usage-only plans.
Base price amount for the plan, in major currency units (e.g. dollars).
Base price amounts in additional currencies. The base 'amount' is in the org's default currency.
Three-letter Stripe-supported currency code (e.g. 'eur', 'gbp').
Price amount in this currency. Set explicitly per currency, not converted from the base amount.
Billing interval (e.g. 'month', 'year').
Number of intervals per billing cycle. Defaults to 1.
Display text for showing this price in pricing pages.
Main display text (e.g. '\$10' or '100 messages').
Secondary display text (e.g. 'per month' or 'then \$0.5 per 100').
Payment processors this base price is connected to. Omitted when unset.
Stripe price ID. For prepaid with included > 0 this is the V2 price.
Feature configurations included in this plan. Each item defines included units, pricing, and reset behavior for a feature.
Bills this many feature units when outstanding overage reaches it.
The ID of the feature this item configures.
The full feature object if expanded.
The ID of the feature, used to refer to it in other API calls like /track or /check.
The name of the feature.
The type of the feature
Singular and plural display names for the feature.
The singular display name for the feature.
The plural display name for the feature.
Credit cost schema for credit system features.
The ID of the metered feature (should be a single\_use feature).
The credit cost of the metered feature.
Whether or not the feature is archived.
Number of free units included. For consumable features, balance resets to this number each interval.
Whether the customer has unlimited access to this feature.
Whether entity-level grants contribute to a shared customer balance.
Reset configuration for consumable features. Null for non-consumable features like seats where usage persists across billing cycles.
The interval at which the feature balance resets (e.g. 'month', 'year'). For consumable features, usage resets to 0 and included units are restored.
Number of intervals between resets. Defaults to 1.
Pricing configuration for usage beyond included units. Null if feature is entirely free.
Price per billing\_units after included usage is consumed. Mutually exclusive with tiers.
Amounts in additional currencies for this flat price. The base 'amount' is in the org's default currency. Only valid with 'amount', not 'tiers' (tiered prices carry per-currency amounts on each tier).
Three-letter Stripe-supported currency code (e.g. 'eur', 'gbp').
Price amount in this currency. Set explicitly per currency, not converted from the base amount.
Tiered pricing configuration. Each tier's 'to' INCLUDES the included amount. Either 'tiers' or 'amount' is required.
Three-letter Stripe-supported currency code (e.g. 'eur', 'gbp').
Per-unit amount for this tier in this currency.
Flat amount for this tier in this currency, if the tier uses one.
Billing interval for this price. For consumable features, should match reset.interval.
Number of intervals per billing cycle. Defaults to 1.
Number of units per price increment. Usage is rounded UP to the nearest billing\_units when billed (e.g. billing\_units=100 means 101 usage rounds to 200).
'prepaid' for features like seats where customers pay upfront, 'usage\_based' for pay-as-you-go after included usage.
Maximum units a customer can purchase beyond included. E.g. if included=100 and max\_purchase=300, customer can use up to 400 total before usage is capped. Null for no limit.
Payment processors this item price is connected to. Omitted when unset.
Stripe price ID. For prepaid with included > 0 this is the V2 price.
Display text for showing this item in pricing pages.
Main display text (e.g. '\$10' or '100 messages').
Secondary display text (e.g. 'per month' or 'then \$0.5 per 100').
Rollover configuration for unused units. If set, unused included units roll over to the next period.
Maximum rollover units. Null for unlimited rollover.
Maximum rollover as a percentage (0-100) of included + prepaid grant. Mutually exclusive with max.
When rolled over units expire.
Number of periods before expiry.
Overrides fields of this item's feature for customers on this plan (e.g. a credit system's credit\_schema).
For credit system features: replaces the feature's credit\_schema entirely for customers on this plan.
ID of the metered feature that draws from this credit system.
Number of metered-feature units priced together. Defaults to one when omitted.
Named rates chosen by event properties. The most specific match sets the rate; with no match the item's own rate applies.
Event properties this entry applies to. Every key must equal the tracked property, compared as strings.
Breaks ties between dimensions that match the same number of keys. Higher wins.
Inclusive upper usage boundary for this graduated tier. The final tier must be 'inf'.
Credits consumed per billing-unit group within this tier.
Named adjustments chosen by event properties. Every match applies: factors multiply, then adds are summed.
Event properties this entry applies to. Every key must equal the tracked property, compared as strings.
Multiplies the matched rate. All matching multipliers stack.
Added to the rate after every factor is applied, in credits per billing-unit group.
Inclusive upper usage boundary for this graduated tier. The final tier must be 'inf'.
Credits consumed per billing-unit group within this tier.
Credits consumed per billing-unit group.
For AI credit system features: replaces the feature's markup chain entirely for customers on this plan. An unset level means no markup at that level rather than inheriting the feature's.
Default percentage markup for customers on this plan. Use -100 to make usage free.
Per-provider markup percentages for customers on this plan.
Per-model markup overrides for customers on this plan.
Payment processors this plan is connected to. Omitted when unset.
Stripe product ID this plan is billed under.
Extra Stripe product IDs aliased to this plan.
Every RevenueCat product that maps to this plan. Replaces the current set.
RevenueCat product ID that grants this plan when purchased.
Prepaid quantities granted when this specific RevenueCat product is purchased, in feature units.
Free trial configuration. If set, new customers can try this plan before being charged.
Number of duration\_type periods the trial lasts.
Unit of time for the trial duration ('day', 'month', 'year').
Whether a payment method is required to start the trial. If true, customer will be charged after trial ends.
Behavior when the trial ends. 'bill' charges the customer (default). 'revert' expires the trial and restores the customer's previous plan.
Unix timestamp (ms) when the plan was created.
Environment this plan belongs to ('sandbox' or 'live').
Whether the plan is archived. Archived plans cannot be attached to new customers.
Miscellaneous plan-level configuration flags.
If true, entitlements attached to this plan will still reset on schedule even when the customer's product is in a past\_due state.
Plan-level billing controls used as customer defaults.
List of auto top-up configurations per feature.
The ID of the feature (credit balance) to auto top-up.
Whether auto top-up is enabled.
When the balance drops below this threshold, an auto top-up will be purchased.
Amount of credits to add per auto top-up.
Optional rate limit to cap how often auto top-ups occur.
The time interval for the purchase limit window.
Number of intervals in the purchase limit window.
Maximum number of auto top-ups allowed within the interval.
When true, auto top-up creates a send\_invoice invoice instead of auto-charging.
List of overage spend limits per feature (caps overage spend).
Optional feature ID this spend limit applies to.
Whether the overage spend limit is enabled.
How overage\_limit is interpreted: an absolute overage cap (default) or a percentage of the main-plan allowance.
Overage cap for the feature: absolute units, or a percent (e.g. 120) when limit\_type is usage\_percentage.
When true, overage for this feature is not posted to Stripe. Usage tracking and balance resets still behave normally.
List of hard usage caps per feature (max units per interval).
The feature this usage limit applies to.
Whether this usage limit is enabled.
Maximum units allowed per interval.
Interval for the cap, aligned to the customer's billing cycle.
Window alignment. 'billing\_cycle' phases the interval to the customer's renewal time; 'utc' aligns to the UTC calendar.
When set, only usage from events whose properties match counts toward this cap. Omit to count all usage of the feature.
List of usage alert configurations per feature.
The feature ID this alert applies to.
Whether this usage alert is enabled.
The threshold value that triggers the alert. For usage or remaining, this is an absolute count. For usage\_percentage or remaining\_percentage, this is a percentage (0-100).
Whether the threshold is an absolute count or a percentage of the usage allowance or remaining balance.
What 100% means. balance: every grant on the feature. included: the plan allowance only. recurring: grants that reset. usage\_limit: the cap of the usage limit with the same feature and filter.
Only valid with basis usage\_limit. Points the alert at the usage limit carrying the same filter.
Optional user-defined label to distinguish multiple alerts on the same feature.
List of overage allowed controls per feature. When enabled, usage can exceed balance.
The feature ID this overage allowed control applies to.
Whether overage is allowed for this feature.
Arbitrary key-value metadata defined by you for your own use. Shared across all versions of the plan.
Whether the trial on this plan is available to this customer. For example, if the customer used the trial in the past, this will be false.
The customer's current status with this plan. 'active' if attached, 'scheduled' if pending activation.
Whether the customer's active instance of this plan is set to cancel.
Whether the customer is currently on a free trial of this plan.
The action that would occur if this plan were attached to the customer.
Deprecated. Use variant\_details.base\_plan\_id instead. If this is a variant, the ID of the base plan it was created from.
```json 200 theme={null}
{
"list": [
{
"id": "pro",
"name": "Pro Plan",
"description": null,
"group": null,
"version": 1,
"version_slug": "v1",
"active": true,
"addOn": false,
"autoEnable": false,
"price": {
"amount": 10,
"interval": "month",
"display": {
"primaryText": "$10",
"secondaryText": "per month"
}
},
"items": [
{
"featureId": "messages",
"included": 100,
"unlimited": false,
"reset": {
"interval": "month"
},
"price": {
"amount": 0.5,
"interval": "month",
"billingUnits": 100,
"billingMethod": "usage_based",
"maxPurchase": null
},
"display": {
"primaryText": "100 messages",
"secondaryText": "then $0.5 per 100 messages"
}
},
{
"featureId": "users",
"included": 0,
"unlimited": false,
"reset": null,
"price": {
"amount": 10,
"interval": "month",
"billingUnits": 1,
"billingMethod": "prepaid",
"maxPurchase": null
},
"display": {
"primaryText": "$10 per Users"
}
}
],
"createdAt": 1771513979217,
"env": "sandbox",
"archived": false,
"baseVariantId": null,
"config": {
"ignore_past_due": false
},
"billing_controls": {},
"metadata": {},
"licenses": [
{
"license_plan_id": "seat",
"version": 1,
"version_slug": "v1",
"included": 3
}
]
}
]
}
```
# Update a plan
Source: https://docs.useautumn.com/api-reference/plans/updatePlan
openapi POST /v1/plans.update
Updates an existing plan. Creates a new version unless `disableVersion` is set.
Use this to modify plan properties, pricing, or feature configurations. See [Adding features to plans](/documentation/pricing/plan-features) for item configuration.
Updates an existing plan. By default, creates a new version of the plan. See [Adding features to plans](/documentation/concepts/plan-items) for item configuration.
Updates create a new plan version by default. Existing customers remain on their current version until their subscription renews or they explicitly upgrade.
### Updating Items
When updating `items`, you must provide the complete items array. The new array replaces the existing configuration entirely.
To update a single feature's configuration while keeping others unchanged, include all existing items with the modified values.
### Common Use Cases
```typescript Update plan price theme={null}
await autumn.plans.update({
planId: "pro_plan",
price: { amount: 15, interval: "month" }
});
```
```typescript Remove base price (usage-only plan) theme={null}
await autumn.plans.update({
planId: "pro_plan",
price: null // Removes the base price
});
```
```typescript Update feature's included amount theme={null}
await autumn.plans.update({
planId: "pro_plan",
items: [
{
featureId: "messages",
included: 2000, // Increased from 1000
reset: { interval: "month" }
}
]
});
```
```typescript Archive a plan theme={null}
await autumn.plans.update({
planId: "old_plan",
archived: true
});
```
```typescript Rename a plan theme={null}
await autumn.plans.update({
planId: "pro_plan",
name: "Pro Plan (Updated)",
newPlanId: "pro_plan_v2" // Optional: change the plan ID
});
```
### Body Parameters
The ID of the plan to update.
Display name of the plan.
Whether the plan is an add-on.
Whether the plan is automatically enabled.
Base price configuration for a plan.
Base price amount for the plan, in major currency units (e.g. dollars).
Billing interval (e.g. 'month', 'year').
Number of intervals per billing cycle. Defaults to 1.
Base price amounts in additional currencies. The base 'amount' is in the org's default currency.
Three-letter Stripe-supported currency code (e.g. 'eur', 'gbp').
Price amount in this currency. Set explicitly per currency, not converted from the base amount.
Feature configurations for this plan. Each item defines included units, pricing, and reset behavior.
Bills this many feature units when outstanding overage reaches it.
The ID of the feature to configure.
Number of free units included. Balance resets to this each interval for consumable features.
If true, customer has unlimited access to this feature.
Whether entity-level grants contribute to a shared customer balance.
Reset configuration for consumable features. Omit for non-consumable features like seats.
Interval at which balance resets (e.g. 'month', 'year'). For consumable features only.
Number of intervals between resets. Defaults to 1.
Pricing for usage beyond included units. Omit for free features.
Price per billing\_units after included usage. Either 'amount' or 'tiers' is required.
Amounts in additional currencies for this flat price. The base 'amount' is in the org's default currency. Only valid with 'amount', not 'tiers'.
Three-letter Stripe-supported currency code (e.g. 'eur', 'gbp').
Price amount in this currency. Set explicitly per currency, not converted from the base amount.
Tiered pricing. Either 'amount' or 'tiers' is required.
Per-currency amounts for this tier. Tier boundaries ('to') are shared across all currencies.
Three-letter Stripe-supported currency code (e.g. 'eur', 'gbp').
Per-unit amount for this tier in this currency.
Flat amount for this tier in this currency, if the tier uses one.
Billing interval. For consumable features, should match reset.interval.
Number of intervals per billing cycle. Defaults to 1.
Units per price increment. Usage is rounded UP when billed (e.g. billing\_units=100 means 101 rounds to 200).
'prepaid' for upfront payment (seats), 'usage\_based' for pay-as-you-go.
Max units purchasable beyond included. E.g. included=100, max\_purchase=300 allows 400 total. Null for no limit.
Proration settings for prepaid features. Controls mid-cycle quantity change billing.
Billing behavior when quantity increases mid-cycle.
Credit behavior when quantity decreases mid-cycle.
Rollover config for unused units. If set, unused included units carry over.
Max rollover units. Omit for unlimited rollover.
Maximum rollover as a percentage (0-100) of included + prepaid grant. Mutually exclusive with max.
When rolled over units expire.
Number of periods before expiry.
Overrides fields of this item's feature for customers on this plan (e.g. a credit system's credit\_schema).
For credit system features: replaces the feature's credit\_schema entirely for customers on this plan.
ID of the metered feature that draws from this credit system.
Number of metered-feature units priced together. Defaults to one when omitted.
Named rates chosen by event properties. The most specific match sets the rate; with no match the item's own rate applies.
Event properties this entry applies to. Every key must equal the tracked property, compared as strings.
Breaks ties between dimensions that match the same number of keys. Higher wins.
Inclusive upper usage boundary for this graduated tier. The final tier must be 'inf'.
Credits consumed per billing-unit group within this tier.
Named adjustments chosen by event properties. Every match applies: factors multiply, then adds are summed.
Event properties this entry applies to. Every key must equal the tracked property, compared as strings.
Multiplies the matched rate. All matching multipliers stack.
Added to the rate after every factor is applied, in credits per billing-unit group.
Inclusive upper usage boundary for this graduated tier. The final tier must be 'inf'.
Credits consumed per billing-unit group within this tier.
Credits consumed per billing-unit group.
For AI credit system features: replaces the feature's markup chain entirely for customers on this plan. An unset level means no markup at that level rather than inheriting the feature's.
Default percentage markup for customers on this plan. Use -100 to make usage free.
Per-provider markup percentages for customers on this plan.
Per-model markup overrides for customers on this plan.
Plans offered as assignable licenses under this plan. The full set replaces existing links.
Base price configuration for a plan.
Base price amount for the plan, in major currency units (e.g. dollars).
Billing interval (e.g. 'month', 'year').
Number of intervals per billing cycle. Defaults to 1.
Base price amounts in additional currencies. The base 'amount' is in the org's default currency.
Three-letter Stripe-supported currency code (e.g. 'eur', 'gbp').
Price amount in this currency. Set explicitly per currency, not converted from the base amount.
Bills this many feature units when outstanding overage reaches it.
The ID of the feature to configure.
Number of free units included. Balance resets to this each interval for consumable features.
If true, customer has unlimited access to this feature.
Whether entity-level grants contribute to a shared customer balance.
Reset configuration for consumable features. Omit for non-consumable features like seats.
Interval at which balance resets (e.g. 'month', 'year'). For consumable features only.
Number of intervals between resets. Defaults to 1.
Pricing for usage beyond included units. Omit for free features.
Price per billing\_units after included usage. Either 'amount' or 'tiers' is required.
Amounts in additional currencies for this flat price. The base 'amount' is in the org's default currency. Only valid with 'amount', not 'tiers'.
Three-letter Stripe-supported currency code (e.g. 'eur', 'gbp').
Price amount in this currency. Set explicitly per currency, not converted from the base amount.
Tiered pricing. Either 'amount' or 'tiers' is required.
Per-currency amounts for this tier. Tier boundaries ('to') are shared across all currencies.
Three-letter Stripe-supported currency code (e.g. 'eur', 'gbp').
Per-unit amount for this tier in this currency.
Flat amount for this tier in this currency, if the tier uses one.
Billing interval. For consumable features, should match reset.interval.
Number of intervals per billing cycle. Defaults to 1.
Units per price increment. Usage is rounded UP when billed (e.g. billing\_units=100 means 101 rounds to 200).
'prepaid' for upfront payment (seats), 'usage\_based' for pay-as-you-go.
Max units purchasable beyond included. E.g. included=100, max\_purchase=300 allows 400 total. Null for no limit.
Proration settings for prepaid features. Controls mid-cycle quantity change billing.
Billing behavior when quantity increases mid-cycle.
Credit behavior when quantity decreases mid-cycle.
Rollover config for unused units. If set, unused included units carry over.
Max rollover units. Omit for unlimited rollover.
Maximum rollover as a percentage (0-100) of included + prepaid grant. Mutually exclusive with max.
When rolled over units expire.
Number of periods before expiry.
Overrides fields of this item's feature for customers on this plan (e.g. a credit system's credit\_schema).
For credit system features: replaces the feature's credit\_schema entirely for customers on this plan.
ID of the metered feature that draws from this credit system.
Number of metered-feature units priced together. Defaults to one when omitted.
Named rates chosen by event properties. The most specific match sets the rate; with no match the item's own rate applies.
Event properties this entry applies to. Every key must equal the tracked property, compared as strings.
Breaks ties between dimensions that match the same number of keys. Higher wins.
Inclusive upper usage boundary for this graduated tier. The final tier must be 'inf'.
Credits consumed per billing-unit group within this tier.
Named adjustments chosen by event properties. Every match applies: factors multiply, then adds are summed.
Event properties this entry applies to. Every key must equal the tracked property, compared as strings.
Multiplies the matched rate. All matching multipliers stack.
Added to the rate after every factor is applied, in credits per billing-unit group.
Inclusive upper usage boundary for this graduated tier. The final tier must be 'inf'.
Credits consumed per billing-unit group within this tier.
Credits consumed per billing-unit group.
For AI credit system features: replaces the feature's markup chain entirely for customers on this plan. An unset level means no markup at that level rather than inheriting the feature's.
Default percentage markup for customers on this plan. Use -100 to make usage free.
Per-provider markup percentages for customers on this plan.
Per-model markup overrides for customers on this plan.
Match items linked to this feature.
Match items with this billing method (prepaid or usage\_based).
Match items with this interval. Accepts either a BillingInterval (price-side) or a ResetInterval (reset-side, includes day/hour/minute) so price-less items keyed by reset.interval can be disambiguated.
Match items with this interval\_count. Disambiguates between items that share an interval but differ in count.
Match items whose grant equals this included usage. Omitted is a wildcard.
Free trial configuration for a plan.
Number of duration\_type periods the trial lasts.
Unit of time for the trial ('day', 'month', 'year').
If true, a payment method is required to start the trial and the customer is charged when it ends. Defaults to false.
Behavior when the trial ends. 'bill' charges the customer (default). 'revert' expires the trial and restores the customer's previous plan.
Miscellaneous plan-level configuration flags.
If true, entitlements attached to this plan will still reset on schedule even when the customer's product is in a past\_due state.
Plan-level billing controls used as customer defaults.
List of auto top-up configurations per feature.
The ID of the feature (credit balance) to auto top-up.
Whether auto top-up is enabled.
When the balance drops below this threshold, an auto top-up will be purchased.
Amount of credits to add per auto top-up.
Optional rate limit to cap how often auto top-ups occur. Pass count to set the current window's consumed top-ups.
The time interval for the purchase limit window.
Number of intervals in the purchase limit window.
Maximum number of auto top-ups allowed within the interval.
Set the current window's consumed auto top-up count. Omit to leave runtime state unchanged.
When true, auto top-up creates a send\_invoice invoice instead of auto-charging.
List of overage spend limits per feature (caps overage spend).
Optional feature ID this spend limit applies to.
Whether the overage spend limit is enabled.
How overage\_limit is interpreted: an absolute overage cap (default) or a percentage of the main-plan allowance.
Overage cap for the feature: absolute units, or a percent (e.g. 120) when limit\_type is usage\_percentage.
When true, overage for this feature is not posted to Stripe. Usage tracking and balance resets still behave normally.
List of hard usage caps per feature (max units per interval).
The feature this usage limit applies to.
Whether this usage limit is enabled.
Maximum units allowed per interval.
Interval for the cap, aligned to the customer's billing cycle.
Window alignment. 'billing\_cycle' phases the interval to the customer's renewal time; 'utc' aligns to the UTC calendar.
When set, only usage from events whose properties match counts toward this cap. Omit to count all usage of the feature.
List of usage alert configurations per feature.
The feature ID this alert applies to.
Whether this usage alert is enabled.
The threshold value that triggers the alert. For usage or remaining, this is an absolute count. For usage\_percentage or remaining\_percentage, this is a percentage (0-100).
Whether the threshold is an absolute count or a percentage of the usage allowance or remaining balance.
What 100% means. balance: every grant on the feature. included: the plan allowance only. recurring: grants that reset. usage\_limit: the cap of the usage limit with the same feature and filter.
Only valid with basis usage\_limit. Points the alert at the usage limit carrying the same filter.
Optional user-defined label to distinguish multiple alerts on the same feature.
List of overage allowed controls per feature. When enabled, usage can exceed balance.
The feature ID this overage allowed control applies to.
Whether overage is allowed for this feature.
Arbitrary key-value metadata defined by you for your own use (e.g. UI copy, feature highlights). Values can be any JSON-serializable value. Shared across all versions of the plan.
The base plan this plan should be linked to as a variant. Set to null to detach it from its base plan.
The new ID to use for the plan. Can only be updated if the plan has not been used by any customers.
Apply the update diff to all versions of this plan. Mutually exclusive with disable\_version.
Force versioning even when no customers exist. Mutually exclusive with disable\_version.
Variant plan IDs to apply this update to. Empty or omitted means no propagation.
Parent plan versions that should receive this license-plan update.
Additive variant updates for this base plan. Missing variants are created when name is provided.
The variant plan ID to update or create.
Display name to use when creating the variant if it does not exist.
The exact customize patch to apply to this variant.
Base price configuration for a plan.
Base price amount for the plan, in major currency units (e.g. dollars).
Billing interval (e.g. 'month', 'year').
Number of intervals per billing cycle. Defaults to 1.
Base price amounts in additional currencies. The base 'amount' is in the org's default currency.
Three-letter Stripe-supported currency code (e.g. 'eur', 'gbp').
Price amount in this currency. Set explicitly per currency, not converted from the base amount.
Items to add to the plan.
Bills this many feature units when outstanding overage reaches it.
The ID of the feature to configure.
Number of free units included. Balance resets to this each interval for consumable features.
If true, customer has unlimited access to this feature.
Whether entity-level grants contribute to a shared customer balance.
Reset configuration for consumable features. Omit for non-consumable features like seats.
Interval at which balance resets (e.g. 'month', 'year'). For consumable features only.
Number of intervals between resets. Defaults to 1.
Pricing for usage beyond included units. Omit for free features.
Price per billing\_units after included usage. Either 'amount' or 'tiers' is required.
Amounts in additional currencies for this flat price. The base 'amount' is in the org's default currency. Only valid with 'amount', not 'tiers'.
Three-letter Stripe-supported currency code (e.g. 'eur', 'gbp').
Price amount in this currency. Set explicitly per currency, not converted from the base amount.
Tiered pricing. Either 'amount' or 'tiers' is required.
Per-currency amounts for this tier. Tier boundaries ('to') are shared across all currencies.
Three-letter Stripe-supported currency code (e.g. 'eur', 'gbp').
Per-unit amount for this tier in this currency.
Flat amount for this tier in this currency, if the tier uses one.
Billing interval. For consumable features, should match reset.interval.
Number of intervals per billing cycle. Defaults to 1.
Units per price increment. Usage is rounded UP when billed (e.g. billing\_units=100 means 101 rounds to 200).
'prepaid' for upfront payment (seats), 'usage\_based' for pay-as-you-go.
Max units purchasable beyond included. E.g. included=100, max\_purchase=300 allows 400 total. Null for no limit.
Proration settings for prepaid features. Controls mid-cycle quantity change billing.
Billing behavior when quantity increases mid-cycle.
Credit behavior when quantity decreases mid-cycle.
Rollover config for unused units. If set, unused included units carry over.
Max rollover units. Omit for unlimited rollover.
Maximum rollover as a percentage (0-100) of included + prepaid grant. Mutually exclusive with max.
When rolled over units expire.
Number of periods before expiry.
Overrides fields of this item's feature for customers on this plan (e.g. a credit system's credit\_schema).
For credit system features: replaces the feature's credit\_schema entirely for customers on this plan.
ID of the metered feature that draws from this credit system.
Number of metered-feature units priced together. Defaults to one when omitted.
Named rates chosen by event properties. The most specific match sets the rate; with no match the item's own rate applies.
Event properties this entry applies to. Every key must equal the tracked property, compared as strings.
Breaks ties between dimensions that match the same number of keys. Higher wins.
Inclusive upper usage boundary for this graduated tier. The final tier must be 'inf'.
Credits consumed per billing-unit group within this tier.
Named adjustments chosen by event properties. Every match applies: factors multiply, then adds are summed.
Event properties this entry applies to. Every key must equal the tracked property, compared as strings.
Multiplies the matched rate. All matching multipliers stack.
Added to the rate after every factor is applied, in credits per billing-unit group.
Inclusive upper usage boundary for this graduated tier. The final tier must be 'inf'.
Credits consumed per billing-unit group within this tier.
Credits consumed per billing-unit group.
For AI credit system features: replaces the feature's markup chain entirely for customers on this plan. An unset level means no markup at that level rather than inheriting the feature's.
Default percentage markup for customers on this plan. Use -100 to make usage free.
Per-provider markup percentages for customers on this plan.
Per-model markup overrides for customers on this plan.
Filters selecting items to remove from the plan.
Match items linked to this feature.
Match items with this billing method (prepaid or usage\_based).
Match items with this interval. Accepts either a BillingInterval (price-side) or a ResetInterval (reset-side, includes day/hour/minute) so price-less items keyed by reset.interval can be disambiguated.
Match items with this interval\_count. Disambiguates between items that share an interval but differ in count.
Match items whose grant equals this included usage. Omitted is a wildcard.
Free trial configuration for a plan.
Number of duration\_type periods the trial lasts.
Unit of time for the trial ('day', 'month', 'year').
If true, a payment method is required to start the trial and the customer is charged when it ends. Defaults to false.
Behavior when the trial ends. 'bill' charges the customer (default). 'revert' expires the trial and restores the customer's previous plan.
Override the plan's billing controls (auto top-ups, spend limits, usage limits, usage alerts, overage allowed) for this customer.
List of auto top-up configurations per feature.
The ID of the feature (credit balance) to auto top-up.
Whether auto top-up is enabled.
When the balance drops below this threshold, an auto top-up will be purchased.
Amount of credits to add per auto top-up.
Optional rate limit to cap how often auto top-ups occur. Pass count to set the current window's consumed top-ups.
The time interval for the purchase limit window.
Number of intervals in the purchase limit window.
Maximum number of auto top-ups allowed within the interval.
Set the current window's consumed auto top-up count. Omit to leave runtime state unchanged.
When true, auto top-up creates a send\_invoice invoice instead of auto-charging.
List of overage spend limits per feature (caps overage spend).
Optional feature ID this spend limit applies to.
Whether the overage spend limit is enabled.
How overage\_limit is interpreted: an absolute overage cap (default) or a percentage of the main-plan allowance.
Overage cap for the feature: absolute units, or a percent (e.g. 120) when limit\_type is usage\_percentage.
When true, overage for this feature is not posted to Stripe. Usage tracking and balance resets still behave normally.
List of hard usage caps per feature (max units per interval).
The feature this usage limit applies to.
Whether this usage limit is enabled.
Maximum units allowed per interval.
Interval for the cap, aligned to the customer's billing cycle.
Window alignment. 'billing\_cycle' phases the interval to the customer's renewal time; 'utc' aligns to the UTC calendar.
When set, only usage from events whose properties match counts toward this cap. Omit to count all usage of the feature.
List of usage alert configurations per feature.
The feature ID this alert applies to.
Whether this usage alert is enabled.
The threshold value that triggers the alert. For usage or remaining, this is an absolute count. For usage\_percentage or remaining\_percentage, this is a percentage (0-100).
Whether the threshold is an absolute count or a percentage of the usage allowance or remaining balance.
What 100% means. balance: every grant on the feature. included: the plan allowance only. recurring: grants that reset. usage\_limit: the cap of the usage limit with the same feature and filter.
Only valid with basis usage\_limit. Points the alert at the usage limit carrying the same filter.
Optional user-defined label to distinguish multiple alerts on the same feature.
List of overage allowed controls per feature. When enabled, usage can exceed balance.
The feature ID this overage allowed control applies to.
Whether overage is allowed for this feature.
License links to add or override for this customer, keyed by license\_plan\_id. Omitted fields inherit the plan catalog link (included defaults to 1 when the license is not in the catalog). A bare entry restores the license to pure catalog inheritance.
Base price configuration for a plan.
Base price amount for the plan, in major currency units (e.g. dollars).
Billing interval (e.g. 'month', 'year').
Number of intervals per billing cycle. Defaults to 1.
Base price amounts in additional currencies. The base 'amount' is in the org's default currency.
Three-letter Stripe-supported currency code (e.g. 'eur', 'gbp').
Price amount in this currency. Set explicitly per currency, not converted from the base amount.
Bills this many feature units when outstanding overage reaches it.
The ID of the feature to configure.
Number of free units included. Balance resets to this each interval for consumable features.
If true, customer has unlimited access to this feature.
Whether entity-level grants contribute to a shared customer balance.
Reset configuration for consumable features. Omit for non-consumable features like seats.
Interval at which balance resets (e.g. 'month', 'year'). For consumable features only.
Number of intervals between resets. Defaults to 1.
Pricing for usage beyond included units. Omit for free features.
Price per billing\_units after included usage. Either 'amount' or 'tiers' is required.
Amounts in additional currencies for this flat price. The base 'amount' is in the org's default currency. Only valid with 'amount', not 'tiers'.
Three-letter Stripe-supported currency code (e.g. 'eur', 'gbp').
Price amount in this currency. Set explicitly per currency, not converted from the base amount.
Tiered pricing. Either 'amount' or 'tiers' is required.
Per-currency amounts for this tier. Tier boundaries ('to') are shared across all currencies.
Three-letter Stripe-supported currency code (e.g. 'eur', 'gbp').
Per-unit amount for this tier in this currency.
Flat amount for this tier in this currency, if the tier uses one.
Billing interval. For consumable features, should match reset.interval.
Number of intervals per billing cycle. Defaults to 1.
Units per price increment. Usage is rounded UP when billed (e.g. billing\_units=100 means 101 rounds to 200).
'prepaid' for upfront payment (seats), 'usage\_based' for pay-as-you-go.
Max units purchasable beyond included. E.g. included=100, max\_purchase=300 allows 400 total. Null for no limit.
Proration settings for prepaid features. Controls mid-cycle quantity change billing.
Billing behavior when quantity increases mid-cycle.
Credit behavior when quantity decreases mid-cycle.
Rollover config for unused units. If set, unused included units carry over.
Max rollover units. Omit for unlimited rollover.
Maximum rollover as a percentage (0-100) of included + prepaid grant. Mutually exclusive with max.
When rolled over units expire.
Number of periods before expiry.
Overrides fields of this item's feature for customers on this plan (e.g. a credit system's credit\_schema).
For credit system features: replaces the feature's credit\_schema entirely for customers on this plan.
ID of the metered feature that draws from this credit system.
Number of metered-feature units priced together. Defaults to one when omitted.
Named rates chosen by event properties. The most specific match sets the rate; with no match the item's own rate applies.
Event properties this entry applies to. Every key must equal the tracked property, compared as strings.
Breaks ties between dimensions that match the same number of keys. Higher wins.
Inclusive upper usage boundary for this graduated tier. The final tier must be 'inf'.
Credits consumed per billing-unit group within this tier.
Named adjustments chosen by event properties. Every match applies: factors multiply, then adds are summed.
Event properties this entry applies to. Every key must equal the tracked property, compared as strings.
Multiplies the matched rate. All matching multipliers stack.
Added to the rate after every factor is applied, in credits per billing-unit group.
Inclusive upper usage boundary for this graduated tier. The final tier must be 'inf'.
Credits consumed per billing-unit group within this tier.
Credits consumed per billing-unit group.
For AI credit system features: replaces the feature's markup chain entirely for customers on this plan. An unset level means no markup at that level rather than inheriting the feature's.
Default percentage markup for customers on this plan. Use -100 to make usage free.
Per-provider markup percentages for customers on this plan.
Per-model markup overrides for customers on this plan.
Match items linked to this feature.
Match items with this billing method (prepaid or usage\_based).
Match items with this interval. Accepts either a BillingInterval (price-side) or a ResetInterval (reset-side, includes day/hour/minute) so price-less items keyed by reset.interval can be disambiguated.
Match items with this interval\_count. Disambiguates between items that share an interval but differ in count.
Match items whose grant equals this included usage. Omitted is a wildcard.
License links to drop, keyed by license\_plan\_id. Parallel to remove\_items.
Edit this variant in place instead of versioning it for this update.
Force this variant update to create a new version.
Migration draft options for an in-place direct variant update.
Whether this is the org's default plan. Cannot be true on a variant.
### Response
Unique identifier for the plan.
Display name of the plan.
Optional description of the plan.
Group identifier for organizing related plans. Plans in the same group are mutually exclusive.
Version number of the plan. Incremented when plan configuration changes.
User-facing version identity. Defaults to v\{n} when the version is minted.
Whether this is the active version of the plan. At most one version is active.
Whether this is an add-on plan that can be attached alongside a main plan.
If true, this plan is automatically attached when a customer is created. Used for free plans.
Base recurring price for the plan. Null for free plans or usage-only plans.
Base price amount for the plan, in major currency units (e.g. dollars).
Base price amounts in additional currencies. The base 'amount' is in the org's default currency.
Three-letter Stripe-supported currency code (e.g. 'eur', 'gbp').
Price amount in this currency. Set explicitly per currency, not converted from the base amount.
Billing interval (e.g. 'month', 'year').
Number of intervals per billing cycle. Defaults to 1.
Display text for showing this price in pricing pages.
Main display text (e.g. '\$10' or '100 messages').
Secondary display text (e.g. 'per month' or 'then \$0.5 per 100').
Payment processors this base price is connected to. Omitted when unset.
Stripe price ID. For prepaid with included > 0 this is the V2 price.
Feature configurations included in this plan. Each item defines included units, pricing, and reset behavior for a feature.
Bills this many feature units when outstanding overage reaches it.
The ID of the feature this item configures.
The full feature object if expanded.
The ID of the feature, used to refer to it in other API calls like /track or /check.
The name of the feature.
The type of the feature
Singular and plural display names for the feature.
The singular display name for the feature.
The plural display name for the feature.
Credit cost schema for credit system features.
The ID of the metered feature (should be a single\_use feature).
The credit cost of the metered feature.
Whether or not the feature is archived.
Number of free units included. For consumable features, balance resets to this number each interval.
Whether the customer has unlimited access to this feature.
Whether entity-level grants contribute to a shared customer balance.
Reset configuration for consumable features. Null for non-consumable features like seats where usage persists across billing cycles.
The interval at which the feature balance resets (e.g. 'month', 'year'). For consumable features, usage resets to 0 and included units are restored.
Number of intervals between resets. Defaults to 1.
Pricing configuration for usage beyond included units. Null if feature is entirely free.
Price per billing\_units after included usage is consumed. Mutually exclusive with tiers.
Amounts in additional currencies for this flat price. The base 'amount' is in the org's default currency. Only valid with 'amount', not 'tiers' (tiered prices carry per-currency amounts on each tier).
Three-letter Stripe-supported currency code (e.g. 'eur', 'gbp').
Price amount in this currency. Set explicitly per currency, not converted from the base amount.
Tiered pricing configuration. Each tier's 'to' INCLUDES the included amount. Either 'tiers' or 'amount' is required.
Three-letter Stripe-supported currency code (e.g. 'eur', 'gbp').
Per-unit amount for this tier in this currency.
Flat amount for this tier in this currency, if the tier uses one.
Billing interval for this price. For consumable features, should match reset.interval.
Number of intervals per billing cycle. Defaults to 1.
Number of units per price increment. Usage is rounded UP to the nearest billing\_units when billed (e.g. billing\_units=100 means 101 usage rounds to 200).
'prepaid' for features like seats where customers pay upfront, 'usage\_based' for pay-as-you-go after included usage.
Maximum units a customer can purchase beyond included. E.g. if included=100 and max\_purchase=300, customer can use up to 400 total before usage is capped. Null for no limit.
Payment processors this item price is connected to. Omitted when unset.
Stripe price ID. For prepaid with included > 0 this is the V2 price.
Display text for showing this item in pricing pages.
Main display text (e.g. '\$10' or '100 messages').
Secondary display text (e.g. 'per month' or 'then \$0.5 per 100').
Rollover configuration for unused units. If set, unused included units roll over to the next period.
Maximum rollover units. Null for unlimited rollover.
Maximum rollover as a percentage (0-100) of included + prepaid grant. Mutually exclusive with max.
When rolled over units expire.
Number of periods before expiry.
Overrides fields of this item's feature for customers on this plan (e.g. a credit system's credit\_schema).
For credit system features: replaces the feature's credit\_schema entirely for customers on this plan.
ID of the metered feature that draws from this credit system.
Number of metered-feature units priced together. Defaults to one when omitted.
Named rates chosen by event properties. The most specific match sets the rate; with no match the item's own rate applies.
Event properties this entry applies to. Every key must equal the tracked property, compared as strings.
Breaks ties between dimensions that match the same number of keys. Higher wins.
Inclusive upper usage boundary for this graduated tier. The final tier must be 'inf'.
Credits consumed per billing-unit group within this tier.
Named adjustments chosen by event properties. Every match applies: factors multiply, then adds are summed.
Event properties this entry applies to. Every key must equal the tracked property, compared as strings.
Multiplies the matched rate. All matching multipliers stack.
Added to the rate after every factor is applied, in credits per billing-unit group.
Inclusive upper usage boundary for this graduated tier. The final tier must be 'inf'.
Credits consumed per billing-unit group within this tier.
Credits consumed per billing-unit group.
For AI credit system features: replaces the feature's markup chain entirely for customers on this plan. An unset level means no markup at that level rather than inheriting the feature's.
Default percentage markup for customers on this plan. Use -100 to make usage free.
Per-provider markup percentages for customers on this plan.
Per-model markup overrides for customers on this plan.
Payment processors this plan is connected to. Omitted when unset.
Stripe product ID this plan is billed under.
Extra Stripe product IDs aliased to this plan.
Every RevenueCat product that maps to this plan. Replaces the current set.
RevenueCat product ID that grants this plan when purchased.
Prepaid quantities granted when this specific RevenueCat product is purchased, in feature units.
Free trial configuration. If set, new customers can try this plan before being charged.
Number of duration\_type periods the trial lasts.
Unit of time for the trial duration ('day', 'month', 'year').
Whether a payment method is required to start the trial. If true, customer will be charged after trial ends.
Behavior when the trial ends. 'bill' charges the customer (default). 'revert' expires the trial and restores the customer's previous plan.
Unix timestamp (ms) when the plan was created.
Environment this plan belongs to ('sandbox' or 'live').
Whether the plan is archived. Archived plans cannot be attached to new customers.
Miscellaneous plan-level configuration flags.
If true, entitlements attached to this plan will still reset on schedule even when the customer's product is in a past\_due state.
Plan-level billing controls used as customer defaults.
List of auto top-up configurations per feature.
The ID of the feature (credit balance) to auto top-up.
Whether auto top-up is enabled.
When the balance drops below this threshold, an auto top-up will be purchased.
Amount of credits to add per auto top-up.
Optional rate limit to cap how often auto top-ups occur.
The time interval for the purchase limit window.
Number of intervals in the purchase limit window.
Maximum number of auto top-ups allowed within the interval.
When true, auto top-up creates a send\_invoice invoice instead of auto-charging.
List of overage spend limits per feature (caps overage spend).
Optional feature ID this spend limit applies to.
Whether the overage spend limit is enabled.
How overage\_limit is interpreted: an absolute overage cap (default) or a percentage of the main-plan allowance.
Overage cap for the feature: absolute units, or a percent (e.g. 120) when limit\_type is usage\_percentage.
When true, overage for this feature is not posted to Stripe. Usage tracking and balance resets still behave normally.
List of hard usage caps per feature (max units per interval).
The feature this usage limit applies to.
Whether this usage limit is enabled.
Maximum units allowed per interval.
Interval for the cap, aligned to the customer's billing cycle.
Window alignment. 'billing\_cycle' phases the interval to the customer's renewal time; 'utc' aligns to the UTC calendar.
When set, only usage from events whose properties match counts toward this cap. Omit to count all usage of the feature.
List of usage alert configurations per feature.
The feature ID this alert applies to.
Whether this usage alert is enabled.
The threshold value that triggers the alert. For usage or remaining, this is an absolute count. For usage\_percentage or remaining\_percentage, this is a percentage (0-100).
Whether the threshold is an absolute count or a percentage of the usage allowance or remaining balance.
What 100% means. balance: every grant on the feature. included: the plan allowance only. recurring: grants that reset. usage\_limit: the cap of the usage limit with the same feature and filter.
Only valid with basis usage\_limit. Points the alert at the usage limit carrying the same filter.
Optional user-defined label to distinguish multiple alerts on the same feature.
List of overage allowed controls per feature. When enabled, usage can exceed balance.
The feature ID this overage allowed control applies to.
Whether overage is allowed for this feature.
Arbitrary key-value metadata defined by you for your own use. Shared across all versions of the plan.
Whether the trial on this plan is available to this customer. For example, if the customer used the trial in the past, this will be false.
The customer's current status with this plan. 'active' if attached, 'scheduled' if pending activation.
Whether the customer's active instance of this plan is set to cancel.
Whether the customer is currently on a free trial of this plan.
The action that would occur if this plan were attached to the customer.
Deprecated. Use variant\_details.base\_plan\_id instead. If this is a variant, the ID of the base plan it was created from.
Details about how this variant relates to its latest base plan.
The ID of the base plan this variant was derived from.
The customization that transforms the base plan into this variant.
Base price configuration for a plan.
Base price amount for the plan, in major currency units (e.g. dollars).
Billing interval (e.g. 'month', 'year').
Number of intervals per billing cycle. Defaults to 1.
Base price amounts in additional currencies. The base 'amount' is in the org's default currency.
Three-letter Stripe-supported currency code (e.g. 'eur', 'gbp').
Price amount in this currency. Set explicitly per currency, not converted from the base amount.
Items to add to the plan.
Bills this many feature units when outstanding overage reaches it.
The ID of the feature to configure.
Number of free units included. Balance resets to this each interval for consumable features.
If true, customer has unlimited access to this feature.
Whether entity-level grants contribute to a shared customer balance.
Reset configuration for consumable features. Omit for non-consumable features like seats.
Interval at which balance resets (e.g. 'month', 'year'). For consumable features only.
Number of intervals between resets. Defaults to 1.
Pricing for usage beyond included units. Omit for free features.
Price per billing\_units after included usage. Either 'amount' or 'tiers' is required.
Amounts in additional currencies for this flat price. The base 'amount' is in the org's default currency. Only valid with 'amount', not 'tiers'.
Three-letter Stripe-supported currency code (e.g. 'eur', 'gbp').
Price amount in this currency. Set explicitly per currency, not converted from the base amount.
Tiered pricing. Either 'amount' or 'tiers' is required.
Three-letter Stripe-supported currency code (e.g. 'eur', 'gbp').
Per-unit amount for this tier in this currency.
Flat amount for this tier in this currency, if the tier uses one.
Billing interval. For consumable features, should match reset.interval.
Number of intervals per billing cycle. Defaults to 1.
Units per price increment. Usage is rounded UP when billed (e.g. billing\_units=100 means 101 rounds to 200).
'prepaid' for upfront payment (seats), 'usage\_based' for pay-as-you-go.
Max units purchasable beyond included. E.g. included=100, max\_purchase=300 allows 400 total. Null for no limit.
Proration settings for prepaid features. Controls mid-cycle quantity change billing.
Billing behavior when quantity increases mid-cycle.
Credit behavior when quantity decreases mid-cycle.
Rollover config for unused units. If set, unused included units carry over.
Max rollover units. Omit for unlimited rollover.
Maximum rollover as a percentage (0-100) of included + prepaid grant. Mutually exclusive with max.
When rolled over units expire.
Number of periods before expiry.
Overrides fields of this item's feature for customers on this plan (e.g. a credit system's credit\_schema).
For credit system features: replaces the feature's credit\_schema entirely for customers on this plan.
ID of the metered feature that draws from this credit system.
Number of metered-feature units priced together. Defaults to one when omitted.
Named rates chosen by event properties. The most specific match sets the rate; with no match the item's own rate applies.
Event properties this entry applies to. Every key must equal the tracked property, compared as strings.
Breaks ties between dimensions that match the same number of keys. Higher wins.
Inclusive upper usage boundary for this graduated tier. The final tier must be 'inf'.
Credits consumed per billing-unit group within this tier.
Named adjustments chosen by event properties. Every match applies: factors multiply, then adds are summed.
Event properties this entry applies to. Every key must equal the tracked property, compared as strings.
Multiplies the matched rate. All matching multipliers stack.
Added to the rate after every factor is applied, in credits per billing-unit group.
Inclusive upper usage boundary for this graduated tier. The final tier must be 'inf'.
Credits consumed per billing-unit group within this tier.
Credits consumed per billing-unit group.
For AI credit system features: replaces the feature's markup chain entirely for customers on this plan. An unset level means no markup at that level rather than inheriting the feature's.
Default percentage markup for customers on this plan. Use -100 to make usage free.
Per-provider markup percentages for customers on this plan.
Per-model markup overrides for customers on this plan.
Filters selecting items to remove from the plan.
Match items linked to this feature.
Match items with this billing method (prepaid or usage\_based).
Match items with this interval. Accepts either a BillingInterval (price-side) or a ResetInterval (reset-side, includes day/hour/minute) so price-less items keyed by reset.interval can be disambiguated.
Match items with this interval\_count. Disambiguates between items that share an interval but differ in count.
Match items whose grant equals this included usage. Omitted is a wildcard.
Free trial configuration for a plan.
Number of duration\_type periods the trial lasts.
Unit of time for the trial ('day', 'month', 'year').
If true, a payment method is required to start the trial and the customer is charged when it ends. Defaults to false.
Behavior when the trial ends. 'bill' charges the customer (default). 'revert' expires the trial and restores the customer's previous plan.
Override the plan's billing controls (auto top-ups, spend limits, usage limits, usage alerts, overage allowed) for this customer.
List of auto top-up configurations per feature.
The ID of the feature (credit balance) to auto top-up.
Whether auto top-up is enabled.
When the balance drops below this threshold, an auto top-up will be purchased.
Amount of credits to add per auto top-up.
Optional rate limit to cap how often auto top-ups occur. Pass count to set the current window's consumed top-ups.
The time interval for the purchase limit window.
Number of intervals in the purchase limit window.
Maximum number of auto top-ups allowed within the interval.
Set the current window's consumed auto top-up count. Omit to leave runtime state unchanged.
When true, auto top-up creates a send\_invoice invoice instead of auto-charging.
List of overage spend limits per feature (caps overage spend).
Optional feature ID this spend limit applies to.
Whether the overage spend limit is enabled.
How overage\_limit is interpreted: an absolute overage cap (default) or a percentage of the main-plan allowance.
Overage cap for the feature: absolute units, or a percent (e.g. 120) when limit\_type is usage\_percentage.
When true, overage for this feature is not posted to Stripe. Usage tracking and balance resets still behave normally.
List of hard usage caps per feature (max units per interval).
The feature this usage limit applies to.
Whether this usage limit is enabled.
Maximum units allowed per interval.
Interval for the cap, aligned to the customer's billing cycle.
Window alignment. 'billing\_cycle' phases the interval to the customer's renewal time; 'utc' aligns to the UTC calendar.
When set, only usage from events whose properties match counts toward this cap. Omit to count all usage of the feature.
List of usage alert configurations per feature.
The feature ID this alert applies to.
Whether this usage alert is enabled.
The threshold value that triggers the alert. For usage or remaining, this is an absolute count. For usage\_percentage or remaining\_percentage, this is a percentage (0-100).
Whether the threshold is an absolute count or a percentage of the usage allowance or remaining balance.
What 100% means. balance: every grant on the feature. included: the plan allowance only. recurring: grants that reset. usage\_limit: the cap of the usage limit with the same feature and filter.
Only valid with basis usage\_limit. Points the alert at the usage limit carrying the same filter.
Optional user-defined label to distinguish multiple alerts on the same feature.
List of overage allowed controls per feature. When enabled, usage can exceed balance.
The feature ID this overage allowed control applies to.
Whether overage is allowed for this feature.
License links to add or override for this customer, keyed by license\_plan\_id. Omitted fields inherit the plan catalog link (included defaults to 1 when the license is not in the catalog). A bare entry restores the license to pure catalog inheritance.
Base price configuration for a plan.
Base price amount for the plan, in major currency units (e.g. dollars).
Billing interval (e.g. 'month', 'year').
Number of intervals per billing cycle. Defaults to 1.
Base price amounts in additional currencies. The base 'amount' is in the org's default currency.
Three-letter Stripe-supported currency code (e.g. 'eur', 'gbp').
Price amount in this currency. Set explicitly per currency, not converted from the base amount.
Bills this many feature units when outstanding overage reaches it.
The ID of the feature to configure.
Number of free units included. Balance resets to this each interval for consumable features.
If true, customer has unlimited access to this feature.
Whether entity-level grants contribute to a shared customer balance.
Reset configuration for consumable features. Omit for non-consumable features like seats.
Interval at which balance resets (e.g. 'month', 'year'). For consumable features only.
Number of intervals between resets. Defaults to 1.
Pricing for usage beyond included units. Omit for free features.
Price per billing\_units after included usage. Either 'amount' or 'tiers' is required.
Amounts in additional currencies for this flat price. The base 'amount' is in the org's default currency. Only valid with 'amount', not 'tiers'.
Three-letter Stripe-supported currency code (e.g. 'eur', 'gbp').
Price amount in this currency. Set explicitly per currency, not converted from the base amount.
Tiered pricing. Either 'amount' or 'tiers' is required.
Three-letter Stripe-supported currency code (e.g. 'eur', 'gbp').
Per-unit amount for this tier in this currency.
Flat amount for this tier in this currency, if the tier uses one.
Billing interval. For consumable features, should match reset.interval.
Number of intervals per billing cycle. Defaults to 1.
Units per price increment. Usage is rounded UP when billed (e.g. billing\_units=100 means 101 rounds to 200).
'prepaid' for upfront payment (seats), 'usage\_based' for pay-as-you-go.
Max units purchasable beyond included. E.g. included=100, max\_purchase=300 allows 400 total. Null for no limit.
Proration settings for prepaid features. Controls mid-cycle quantity change billing.
Billing behavior when quantity increases mid-cycle.
Credit behavior when quantity decreases mid-cycle.
Rollover config for unused units. If set, unused included units carry over.
Max rollover units. Omit for unlimited rollover.
Maximum rollover as a percentage (0-100) of included + prepaid grant. Mutually exclusive with max.
When rolled over units expire.
Number of periods before expiry.
Overrides fields of this item's feature for customers on this plan (e.g. a credit system's credit\_schema).
For credit system features: replaces the feature's credit\_schema entirely for customers on this plan.
ID of the metered feature that draws from this credit system.
Number of metered-feature units priced together. Defaults to one when omitted.
Named rates chosen by event properties. The most specific match sets the rate; with no match the item's own rate applies.
Event properties this entry applies to. Every key must equal the tracked property, compared as strings.
Breaks ties between dimensions that match the same number of keys. Higher wins.
Inclusive upper usage boundary for this graduated tier. The final tier must be 'inf'.
Credits consumed per billing-unit group within this tier.
Named adjustments chosen by event properties. Every match applies: factors multiply, then adds are summed.
Event properties this entry applies to. Every key must equal the tracked property, compared as strings.
Multiplies the matched rate. All matching multipliers stack.
Added to the rate after every factor is applied, in credits per billing-unit group.
Inclusive upper usage boundary for this graduated tier. The final tier must be 'inf'.
Credits consumed per billing-unit group within this tier.
Credits consumed per billing-unit group.
For AI credit system features: replaces the feature's markup chain entirely for customers on this plan. An unset level means no markup at that level rather than inheriting the feature's.
Default percentage markup for customers on this plan. Use -100 to make usage free.
Per-provider markup percentages for customers on this plan.
Per-model markup overrides for customers on this plan.
Match items linked to this feature.
Match items with this billing method (prepaid or usage\_based).
Match items with this interval. Accepts either a BillingInterval (price-side) or a ResetInterval (reset-side, includes day/hour/minute) so price-less items keyed by reset.interval can be disambiguated.
Match items with this interval\_count. Disambiguates between items that share an interval but differ in count.
Match items whose grant equals this included usage. Omitted is a wildcard.
License links to drop, keyed by license\_plan\_id. Parallel to remove\_items.
```json 200 theme={null}
{
"id": "pro",
"name": "Pro Plan",
"description": null,
"group": null,
"version": 1,
"version_slug": "v1",
"active": true,
"addOn": false,
"autoEnable": false,
"price": {
"amount": 10,
"interval": "month",
"display": {
"primaryText": "$10",
"secondaryText": "per month"
}
},
"items": [
{
"featureId": "messages",
"included": 100,
"unlimited": false,
"reset": {
"interval": "month"
},
"price": {
"amount": 0.5,
"interval": "month",
"billingUnits": 100,
"billingMethod": "usage_based",
"maxPurchase": null
},
"display": {
"primaryText": "100 messages",
"secondaryText": "then $0.5 per 100 messages"
}
},
{
"featureId": "users",
"included": 0,
"unlimited": false,
"reset": null,
"price": {
"amount": 10,
"interval": "month",
"billingUnits": 1,
"billingMethod": "prepaid",
"maxPurchase": null
},
"display": {
"primaryText": "$10 per Users"
}
}
],
"createdAt": 1771513979217,
"env": "sandbox",
"archived": false,
"baseVariantId": null,
"config": {
"ignore_past_due": false
},
"billing_controls": {},
"metadata": {}
}
```
# Create Organization
Source: https://docs.useautumn.com/api-reference/platform/create-organization
platform POST /platform/organizations
Creates a new organization for a platform tenant. Reuses existing users and organizations if they already exist.
Creates a new organization for a platform tenant. If a user with the provided email already exists, it will be reused. If an organization with the slug already exists for this user, it will be reused.
# List Organizations
Source: https://docs.useautumn.com/api-reference/platform/list-orgs
platform GET /platform/organizations
Lists all organizations created by your master organization. Supports pagination.
Lists all organizations created by your master organization. Supports pagination to handle large numbers of tenant organizations.
Only returns organizations that were created by your master organization through the Platform API. Organization slugs in the response do not include the master org ID prefix.
# List Users
Source: https://docs.useautumn.com/api-reference/platform/list-users
platform GET /platform/users
Lists all users created by your master organization. Supports pagination and optional expansion of related organizations.
Lists all users created by your master organization. Supports pagination and optional expansion of related organizations.
# Generate Stripe OAuth URL
Source: https://docs.useautumn.com/api-reference/platform/oauth-url
platform POST /platform/oauth_url
Generates a Stripe Connect OAuth URL for a platform organization. Use this to allow your tenants to connect their Stripe accounts.
Generates a Stripe Connect OAuth URL for a platform organization. Use this to allow your tenants to connect their Stripe accounts through the OAuth flow.
## OAuth Flow
After generating the OAuth URL:
1. Redirect your tenant to the `oauth_url`
2. User authorizes their Stripe account
3. Stripe redirects to Autumn's callback URL
4. Autumn processes the authorization and redirects to your `redirect_url`
5. Your `redirect_url` will receive query parameters:
* `success=true` or `success=false`
* `message=...` (if error occurred)
OAuth state is stored in Upstash with a 10-minute expiry. The organization must have been created via the platform API before generating an OAuth URL.
# Overview
Source: https://docs.useautumn.com/api-reference/platform/overview
Manage Autumn on behalf of your users in a multi-tenant flow
**Private Preview** - This feature is currently in private preview. Contact us at [hey@useautumn.com](mailto:hey@useautumn.com) if you would like access!
## What is the Platform API?
The Platform API is for users who want to manage Autumn on behalf of their users (for example, AI app builders) in a multi-tenant flow.
## How it Works
### 1. Create an Organization
Create an Autumn organization linked to a user email. This generates API keys that your user can use to interact with Autumn's billing features.
### 2. Integrate
Each organization created through Step 1 already has a Stripe account connected to their sandbox environment. As such, you can freely integrate and test Autumn without additional Stripe credentials. When you're ready to go to prod, you can then connect your user's Stripe account through the Step 3.
### 3. Link Stripe Account
Connect your user's Stripe account using one of two methods:
**Option A: OAuth Flow**
Call our [Generate Stripe OAuth URL](/api-reference/platform/oauth-url) endpoint, which generates a link that lets the user connect their Stripe account directly.
**Option B: Direct Account ID**
If you have your own Stripe Connect platform, simply pass us the Stripe account ID using the [Update Connected Stripe Account](/api-reference/platform/update-stripe) endpoint and we'll handle the rest.
# Update Connected Stripe Account
Source: https://docs.useautumn.com/api-reference/platform/update-stripe
platform POST /platform/organizations/stripe
Updates a platform organization's Stripe Connect configuration. Associates a Stripe account ID with the organization using your master Stripe credentials.
Updates a platform organization's Stripe Connect configuration. Associates a Stripe account ID with the organization using your master Stripe credentials.
## When to Use This Endpoint
Use this endpoint when you want to manage Stripe accounts on behalf of your tenants using your own Stripe Connect credentials, rather than having them go through the OAuth flow.
## Validation
* Your organization must have the corresponding Stripe secret key connected (test/live)
* The endpoint validates that your master Stripe account can access the provided account ID
* If validation fails, you'll receive a descriptive error message
The `master_org_id` is automatically set to your organization ID. All Stripe operations for the tenant will use your master Stripe credentials with the tenant's account ID.
At least one of `test_account_id` or `live_account_id` must be provided in the request.
# Create Referral Code
Source: https://docs.useautumn.com/api-reference/referrals/createReferralCode
openapi POST /v1/referrals.create_code
Create or fetch a referral code for a customer in a referral program.
### Body Parameters
The unique identifier of the customer
ID of your referral program
### Response
The referral code that can be shared with customers
Your unique identifier for the customer
The timestamp of when the referral code was created
```json 200 theme={null}
{
"code": "",
"customer_id": "",
"created_at": 123
}
```
# Create Referral Program
Source: https://docs.useautumn.com/api-reference/referrals/createReferralProgram
openapi POST /v1/referral_programs.create
Create a referral program linked to an existing reward.
### Body Parameters
When the reward is granted: on redemption, or when the redeemer checks out.
Who receives the reward: the referrer only, or both parties.
A positive redemption limit, or null for unlimited redemptions.
Required when redeem\_on is checkout. Plan IDs must be unique.
Whether checkouts that start a trial should skip granting the reward.
Address an existing referral program by its stable id. Omit when creating — the server generates one.
### Response
The unique identifier for the referral program.
The ID of the reward granted when a code is redeemed.
When the reward is granted: on redemption, or when the redeemer checks out.
Who receives the reward: the referrer only, or both parties.
The maximum number of times a referral code can be redeemed.
The plans whose checkout triggers the reward. Only used when redeem\_on is checkout.
Whether checkouts that start a trial should skip granting the reward.
The Unix timestamp (in milliseconds) when the referral program was created.
```json 200 theme={null}
{
"id": "refer_a_friend",
"reward_id": "beta_credits_grant",
"redeem_on": "customer_creation",
"received_by": "referrer",
"max_redemptions": 10,
"plan_ids": null,
"exclude_trial": false,
"created_at": 1718000000000
}
```
# Delete Referral Program
Source: https://docs.useautumn.com/api-reference/referrals/deleteReferralProgram
openapi POST /v1/referral_programs.delete
Delete a referral program.
### Body Parameters
The ID of the referral program.
### Response
```json 200 theme={null}
{
"success": true
}
```
# Get Referral Program
Source: https://docs.useautumn.com/api-reference/referrals/getReferralProgram
openapi POST /v1/referral_programs.get
Fetch a referral program by ID.
### Body Parameters
The ID of the referral program.
### Response
The unique identifier for the referral program.
The ID of the reward granted when a code is redeemed.
When the reward is granted: on redemption, or when the redeemer checks out.
Who receives the reward: the referrer only, or both parties.
The maximum number of times a referral code can be redeemed.
The plans whose checkout triggers the reward. Only used when redeem\_on is checkout.
Whether checkouts that start a trial should skip granting the reward.
The Unix timestamp (in milliseconds) when the referral program was created.
```json 200 theme={null}
{
"id": "refer_a_friend",
"reward_id": "beta_credits_grant",
"redeem_on": "customer_creation",
"received_by": "referrer",
"max_redemptions": 10,
"plan_ids": null,
"exclude_trial": false,
"created_at": 1718000000000
}
```
# List Referral Programs
Source: https://docs.useautumn.com/api-reference/referrals/listReferralPrograms
openapi POST /v1/referral_programs.list
List the referral programs configured for the org.
### Response
The unique identifier for the referral program.
The ID of the reward granted when a code is redeemed.
When the reward is granted: on redemption, or when the redeemer checks out.
Who receives the reward: the referrer only, or both parties.
The maximum number of times a referral code can be redeemed.
The plans whose checkout triggers the reward. Only used when redeem\_on is checkout.
Whether checkouts that start a trial should skip granting the reward.
The Unix timestamp (in milliseconds) when the referral program was created.
```json 200 theme={null}
{
"list": [
{
"id": "refer_a_friend",
"reward_id": "beta_credits_grant",
"redeem_on": "customer_creation",
"received_by": "referrer",
"max_redemptions": 10,
"plan_ids": null,
"exclude_trial": false,
"created_at": 1718000000000
}
]
}
```
# Redeem Referral Code
Source: https://docs.useautumn.com/api-reference/referrals/redeemReferralCode
openapi POST /v1/referrals.redeem_code
Redeem a referral code for a customer.
### Body Parameters
The referral code to redeem
The unique identifier of the customer redeeming the code
### Response
The ID of the redemption event
Your unique identifier for the customer
The ID of the reward that will be granted
```json 200 theme={null}
{
"id": "",
"customer_id": "",
"reward_id": ""
}
```
# Update Referral Program
Source: https://docs.useautumn.com/api-reference/referrals/updateReferralProgram
openapi POST /v1/referral_programs.update
Update a referral program. Omitted fields keep their current value.
### Body Parameters
The ID of the referral program.
The ID of the reward granted when a code is redeemed.
When the reward is granted: on redemption, or when the redeemer checks out.
Who receives the reward: the referrer only, or both parties.
A positive redemption limit. Omit to leave unchanged; null removes it.
Required when redeem\_on is checkout. Plan IDs must be unique. Omit to leave unchanged; null removes them.
Omit to leave unchanged; null removes it.
### Response
The unique identifier for the referral program.
The ID of the reward granted when a code is redeemed.
When the reward is granted: on redemption, or when the redeemer checks out.
Who receives the reward: the referrer only, or both parties.
The maximum number of times a referral code can be redeemed.
The plans whose checkout triggers the reward. Only used when redeem\_on is checkout.
Whether checkouts that start a trial should skip granting the reward.
The Unix timestamp (in milliseconds) when the referral program was created.
```json 200 theme={null}
{
"id": "refer_a_friend",
"reward_id": "beta_credits_grant",
"redeem_on": "customer_creation",
"received_by": "referrer",
"max_redemptions": 10,
"plan_ids": null,
"exclude_trial": false,
"created_at": 1718000000000
}
```
# Create Reward
Source: https://docs.useautumn.com/api-reference/rewards/createReward
openapi POST /v1/rewards.create
Create a coupon or feature grant.
### Body Parameters
Provide exactly one of coupon or feature\_grant, not both.
Use a positive integer length for months, and null for one\_off or forever.
Plan IDs must be unique.
Promo code values must be unique.
Address an existing reward by its stable id. Omit when creating — the server generates one.
Percentage discounts must be at most 100; fixed discounts must be positive.
Provide exactly one of coupon or feature\_grant, not both.
Feature IDs must be unique.
A non-negative amount to grant, or null for boolean features.
The unit of time the grant lasts.
The positive integer count of periods before the grant expires.
Promo code values must be unique.
A positive redemption limit, or null for unlimited uses.
Address an existing reward by its stable id. Omit when creating — the server generates one.
### Response
The unique identifier for the coupon.
A human-readable name for the coupon.
The type of discount: percentage\_discount, fixed\_discount, or invoice\_credits.
The discount value. A percentage for percentage\_discount, or an amount for fixed\_discount / invoice\_credits.
How long the coupon applies once redeemed.
The unit of time the duration is measured in.
The number of `type` periods the duration lasts, or null when the type has no length (e.g. one\_off, forever).
The plan IDs the coupon applies to, or null when it applies to all plans.
The promo code customers enter to redeem the coupon.
Maximum number of times this promo code can be redeemed across all customers, or null for unlimited.
Whether this promo code can only be applied to a customer's first transaction.
The Unix timestamp (in milliseconds) when the coupon was created.
The unique identifier for the feature grant.
A human-readable name for the feature grant.
The feature ID this grant applies to.
The amount of the feature granted, or null for boolean features.
How long the granted amount lasts before expiring, or null for a permanent grant.
The unit of time the grant lasts.
The positive integer count of periods before the grant expires.
The promo code customers enter to redeem the feature grant.
Maximum number of times this promo code can be redeemed, or null for unlimited.
The Unix timestamp (in milliseconds) when the feature grant was created.
# Delete Reward
Source: https://docs.useautumn.com/api-reference/rewards/deleteReward
openapi POST /v1/rewards.delete
Delete a coupon or feature grant.
### Body Parameters
The ID of the coupon or feature grant.
### Response
```json 200 theme={null}
{
"success": true
}
```
# Get Reward
Source: https://docs.useautumn.com/api-reference/rewards/getReward
openapi POST /v1/rewards.get
Fetch a coupon or feature grant by ID.
### Body Parameters
The ID of the coupon or feature grant.
### Response
The unique identifier for the coupon.
A human-readable name for the coupon.
The type of discount: percentage\_discount, fixed\_discount, or invoice\_credits.
The discount value. A percentage for percentage\_discount, or an amount for fixed\_discount / invoice\_credits.
How long the coupon applies once redeemed.
The unit of time the duration is measured in.
The number of `type` periods the duration lasts, or null when the type has no length (e.g. one\_off, forever).
The plan IDs the coupon applies to, or null when it applies to all plans.
The promo codes customers can use to redeem the coupon.
The promo code customers enter to redeem the coupon.
Maximum number of times this promo code can be redeemed across all customers, or null for unlimited.
Whether this promo code can only be applied to a customer's first transaction.
The Unix timestamp (in milliseconds) when the coupon was created.
The unique identifier for the feature grant.
A human-readable name for the feature grant.
The feature grants awarded when the grant is redeemed.
The feature ID this grant applies to.
The amount of the feature granted, or null for boolean features.
How long the granted amount lasts before expiring, or null for a permanent grant.
The unit of time the grant lasts.
The positive integer count of periods before the grant expires.
The promo codes customers can use to redeem the feature grant.
The promo code customers enter to redeem the feature grant.
Maximum number of times this promo code can be redeemed, or null for unlimited.
The Unix timestamp (in milliseconds) when the feature grant was created.
```json 200 theme={null}
{
"coupon": {
"id": "summer_sale",
"name": "Summer Sale",
"type": "percentage_discount",
"value": 20,
"duration": {
"type": "months",
"length": 3
},
"plan_ids": [
"pro",
"starter"
],
"promo_codes": [
{
"code": "SUMMER20",
"global_max_redemption": 100,
"first_time_transaction": false
}
],
"created_at": 1718000000000
}
}
```
# List Rewards
Source: https://docs.useautumn.com/api-reference/rewards/listRewards
openapi POST /v1/rewards.list
List the coupons and feature grants configured for the org.
### Response
The list of coupons configured for the organization.
The unique identifier for the coupon.
A human-readable name for the coupon.
The type of discount: percentage\_discount, fixed\_discount, or invoice\_credits.
The discount value. A percentage for percentage\_discount, or an amount for fixed\_discount / invoice\_credits.
How long the coupon applies once redeemed.
The unit of time the duration is measured in.
The number of `type` periods the duration lasts, or null when the type has no length (e.g. one\_off, forever).
The plan IDs the coupon applies to, or null when it applies to all plans.
The promo codes customers can use to redeem the coupon.
The promo code customers enter to redeem the coupon.
Maximum number of times this promo code can be redeemed across all customers, or null for unlimited.
Whether this promo code can only be applied to a customer's first transaction.
The Unix timestamp (in milliseconds) when the coupon was created.
The list of feature grants configured for the organization.
The unique identifier for the feature grant.
A human-readable name for the feature grant.
The feature grants awarded when the grant is redeemed.
The feature ID this grant applies to.
The amount of the feature granted, or null for boolean features.
How long the granted amount lasts before expiring, or null for a permanent grant.
The unit of time the grant lasts.
The positive integer count of periods before the grant expires.
The promo codes customers can use to redeem the feature grant.
The promo code customers enter to redeem the feature grant.
Maximum number of times this promo code can be redeemed, or null for unlimited.
The Unix timestamp (in milliseconds) when the feature grant was created.
```json 200 theme={null}
{
"coupons": [],
"feature_grants": []
}
```
# Redeem Reward Code
Source: https://docs.useautumn.com/api-reference/rewards/redeemRewardCode
openapi POST /v1/rewards.redeem
Redeem a reward promo code for a customer.
### Body Parameters
The reward promo code to redeem
The unique identifier of the customer redeeming the code
### Response
The ID of the redeemed reward
The feature balances granted to the customer
The ID of the feature granted by the reward
The balance granted for the feature
```json 200 theme={null}
{
"reward_id": "reward_789",
"entitlements_granted": [
{
"feature_id": "messages",
"balance": 100
}
]
}
```
# Update Reward
Source: https://docs.useautumn.com/api-reference/rewards/updateReward
openapi POST /v1/rewards.update
Update a coupon or feature grant. Omitted fields keep their current value.
### Body Parameters
The ID of the coupon or feature grant.
Plan IDs must be unique. Null applies the coupon to all plans.
Replaces the existing promo codes when provided.
Replaces the existing grants when provided.
How long the granted amount lasts before expiring, or null for a permanent grant.
The unit of time the grant lasts.
The positive integer count of periods before the grant expires.
Replaces the existing promo codes when provided.
### Response
The unique identifier for the coupon.
A human-readable name for the coupon.
The type of discount: percentage\_discount, fixed\_discount, or invoice\_credits.
The discount value. A percentage for percentage\_discount, or an amount for fixed\_discount / invoice\_credits.
How long the coupon applies once redeemed.
The unit of time the duration is measured in.
The number of `type` periods the duration lasts, or null when the type has no length (e.g. one\_off, forever).
The plan IDs the coupon applies to, or null when it applies to all plans.
The promo code customers enter to redeem the coupon.
Maximum number of times this promo code can be redeemed across all customers, or null for unlimited.
Whether this promo code can only be applied to a customer's first transaction.
The Unix timestamp (in milliseconds) when the coupon was created.
The unique identifier for the feature grant.
A human-readable name for the feature grant.
The feature ID this grant applies to.
The amount of the feature granted, or null for boolean features.
How long the granted amount lasts before expiring, or null for a permanent grant.
The unit of time the grant lasts.
The positive integer count of periods before the grant expires.
The promo code customers enter to redeem the feature grant.
Maximum number of times this promo code can be redeemed, or null for unlimited.
The Unix timestamp (in milliseconds) when the feature grant was created.
```json 200 theme={null}
{
"feature_grant": {
"id": "beta_credits_grant",
"name": "Beta Tester Credits",
"promo_codes": [
{
"code": "BETA2024",
"max_uses": 500
}
],
"grants": [
{
"feature_id": "credits",
"included": 1000,
"expiry": {
"type": "month",
"length": 1
}
}
],
"created_at": 1718000000000
}
}
```
# Limit Reached
Source: https://docs.useautumn.com/api-reference/webhooks/balancesLimitReached
api/openapi.yml webhook balances.limit_reached
Fired when a customer reaches the limit for a feature (included allowance, max purchase, spend limit, or a usage-limit billing control).
### Payload Fields
The ID of the customer who hit the limit.
The entity ID, if the limit was reached on a specific entity.
The feature ID whose limit was reached.
Which limit was hit: included allowance, max purchase cap, spend limit, or a usage-limit billing control.
The filter of the usage limit that blocked, when a filtered cap was hit.
The usage limit that blocked, with its live window. Present only when limit\_type is usage\_limit.
Maximum units allowed per interval.
Interval of the cap.
Window alignment the cap was configured with.
Units consumed in the current window, after this event.
Units left in the current window, never below zero.
Start of the current window, in milliseconds since epoch.
End of the current window, in milliseconds since epoch.
# Usage Alert Triggered
Source: https://docs.useautumn.com/api-reference/webhooks/balancesUsageAlertTriggered
api/openapi.yml webhook balances.usage_alert_triggered
Fired when a customer crosses a configured usage alert threshold.
### Payload Fields
The ID of the customer whose usage alert was triggered.
The feature ID the alert applies to.
The entity ID the alert applies to, if the usage was entity-scoped.
Details of the usage alert that was triggered.
User-defined label for the alert, if provided.
The threshold value that was crossed.
Whether the threshold is an absolute usage count or a percentage.
What 100% meant for this alert.
The balance the alert measured.
Units consumed on the feature, after this event.
Every grant on the feature: included, prepaid and rollover.
Grants from plan allowances only.
The alert's denominator minus usage. Clamped at zero for included and recurring; balance can go negative on overage.
# Auto Top-Up Failed
Source: https://docs.useautumn.com/api-reference/webhooks/billingAutoTopupFailed
api/openapi.yml webhook billing.auto_topup_failed
Fired when an automatic top-up is blocked, declined, or fails before granting additional prepaid balance.
### Payload Fields
The ID of the customer whose auto top-up failed.
The feature ID that Autumn attempted to auto top-up.
Machine-readable reason the automatic top-up did not grant balance.
The normalized amount of balance Autumn attempted to grant, when a matching auto top-up config was available.
The configured balance threshold for the auto top-up, when available.
The customer's remaining balance for the feature at the time the failure was detected, when available.
Whether the auto top-up was configured to create a send\_invoice invoice instead of auto-charging.
Sanitized provider or Autumn error metadata, when the failure came from an exception or declined charge.
Machine-readable error code when one is available (for example, a Stripe or Autumn error code).
Sanitized error message with details about why the auto top-up failed.
Provider error type when one is available.
Stripe decline code when the failure came from a card decline.
# Auto Top-Up Succeeded
Source: https://docs.useautumn.com/api-reference/webhooks/billingAutoTopupSucceeded
api/openapi.yml webhook billing.auto_topup_succeeded
Fired when an automatic top-up grants additional prepaid balance.
### Payload Fields
The ID of the customer whose balance was topped up.
The feature ID that was automatically topped up.
The normalized amount of balance granted by the top-up.
The configured balance threshold that triggered the top-up.
The customer's remaining balance for the feature after the top-up.
Whether the auto top-up created a send\_invoice invoice instead of auto-charging.
The invoice created for the auto top-up.
The Stripe invoice ID. Use this as a stable dedupe key.
The status of the invoice. "paid" for auto-charged top-ups; "open" for invoice-mode top-ups where credits were granted but the invoice has not yet been paid.
The total amount of the invoice in the smallest currency unit (e.g. cents for USD), matching Stripe's invoice.total.
The ISO currency code for the invoice.
URL to the hosted invoice page, if available.
# Plans Updated
Source: https://docs.useautumn.com/api-reference/webhooks/billingUpdated
api/openapi.yml webhook billing.updated
Fired when a customer's plans change — activated, scheduled, updated, or expired. Each event carries a `plan_changes` array describing what happened and a `tags` array (e.g. `trial_ended`, `phase_changed`) describing why.
### Payload Fields
The ID of the customer whose plans changed.
The ID of the entity, if the changes are scoped to a specific entity.
The plans that were activated, scheduled, updated, or expired.
The ID of the entity this plan is scoped to, or null when the plan is customer-level. A single event can carry changes for several entities.
The lifecycle action applied to this plan: activated (newly active on the customer), scheduled (queued for a future start), updated (mutated in place), or expired (ended).
The subscription as it stands after this change. Present when the plan is billed as a recurring subscription.
The ID of the customer plan.
The current status of the subscription on the customer.
Whether the subscription has overdue payments.
When the subscription started, in milliseconds since the Unix epoch.
When the subscription was canceled, in milliseconds since the Unix epoch, or null if not canceled.
When the subscription ends, in milliseconds since the Unix epoch, or null if no expiry is set.
When the trial ends, in milliseconds since the Unix epoch. Null when not actively trialing.
Start of the current billing period, or null if not applicable.
End of the current billing period, or null if not applicable.
The purchase as it stands after this change. Present when the plan is a one-off purchase.
The ID of the customer plan.
The current status of the purchase on the customer.
When the purchase ends, in milliseconds since the Unix epoch, or null if no expiry is set.
Sparse map of lifecycle scalar fields whose values changed, holding their previous values. Null when the plan is newly activated or scheduled, or when no lifecycle field changed.
The current status of the subscription on the customer.
Whether the subscription has overdue payments.
When the subscription was canceled, in milliseconds since the Unix epoch, or null if not canceled.
When the subscription ends, in milliseconds since the Unix epoch, or null if no expiry is set.
When the trial ends, in milliseconds since the Unix epoch. Null when not actively trialing.
Content-level change to the plan definition for this customer plan (items, base price, free trial).
The plan after the change. Omitted unless the caller expands it.
Unique identifier for the plan.
Display name of the plan.
Optional description of the plan.
Group identifier for organizing related plans. Plans in the same group are mutually exclusive.
Version number of the plan. Incremented when plan configuration changes.
User-facing version identity. Defaults to v\{n} when the version is minted.
Whether this is the active version of the plan. At most one version is active.
Whether this is an add-on plan that can be attached alongside a main plan.
If true, this plan is automatically attached when a customer is created. Used for free plans.
Base recurring price for the plan. Null for free plans or usage-only plans.
Base price amount for the plan, in major currency units (e.g. dollars).
Base price amounts in additional currencies. The base 'amount' is in the org's default currency.
Three-letter Stripe-supported currency code (e.g. 'eur', 'gbp').
Price amount in this currency. Set explicitly per currency, not converted from the base amount.
Billing interval (e.g. 'month', 'year').
Number of intervals per billing cycle. Defaults to 1.
Display text for showing this price in pricing pages.
Main display text (e.g. '\$10' or '100 messages').
Secondary display text (e.g. 'per month' or 'then \$0.5 per 100').
Payment processors this base price is connected to. Omitted when unset.
Stripe price ID. For prepaid with included > 0 this is the V2 price.
Feature configurations included in this plan. Each item defines included units, pricing, and reset behavior for a feature.
Bills this many feature units when outstanding overage reaches it.
The ID of the feature this item configures.
The full feature object if expanded.
The ID of the feature, used to refer to it in other API calls like /track or /check.
The name of the feature.
The type of the feature
Singular and plural display names for the feature.
The singular display name for the feature.
The plural display name for the feature.
Credit cost schema for credit system features.
The ID of the metered feature (should be a single\_use feature).
The credit cost of the metered feature.
Whether or not the feature is archived.
Number of free units included. For consumable features, balance resets to this number each interval.
Whether the customer has unlimited access to this feature.
Whether entity-level grants contribute to a shared customer balance.
Reset configuration for consumable features. Null for non-consumable features like seats where usage persists across billing cycles.
The interval at which the feature balance resets (e.g. 'month', 'year'). For consumable features, usage resets to 0 and included units are restored.
Number of intervals between resets. Defaults to 1.
Pricing configuration for usage beyond included units. Null if feature is entirely free.
Price per billing\_units after included usage is consumed. Mutually exclusive with tiers.
Amounts in additional currencies for this flat price. The base 'amount' is in the org's default currency. Only valid with 'amount', not 'tiers' (tiered prices carry per-currency amounts on each tier).
Three-letter Stripe-supported currency code (e.g. 'eur', 'gbp').
Price amount in this currency. Set explicitly per currency, not converted from the base amount.
Tiered pricing configuration. Each tier's 'to' INCLUDES the included amount. Either 'tiers' or 'amount' is required.
Three-letter Stripe-supported currency code (e.g. 'eur', 'gbp').
Per-unit amount for this tier in this currency.
Flat amount for this tier in this currency, if the tier uses one.
Billing interval for this price. For consumable features, should match reset.interval.
Number of intervals per billing cycle. Defaults to 1.
Number of units per price increment. Usage is rounded UP to the nearest billing\_units when billed (e.g. billing\_units=100 means 101 usage rounds to 200).
'prepaid' for features like seats where customers pay upfront, 'usage\_based' for pay-as-you-go after included usage.
Maximum units a customer can purchase beyond included. E.g. if included=100 and max\_purchase=300, customer can use up to 400 total before usage is capped. Null for no limit.
Payment processors this item price is connected to. Omitted when unset.
Stripe price ID. For prepaid with included > 0 this is the V2 price.
Display text for showing this item in pricing pages.
Main display text (e.g. '\$10' or '100 messages').
Secondary display text (e.g. 'per month' or 'then \$0.5 per 100').
Rollover configuration for unused units. If set, unused included units roll over to the next period.
Maximum rollover units. Null for unlimited rollover.
Maximum rollover as a percentage (0-100) of included + prepaid grant. Mutually exclusive with max.
When rolled over units expire.
Number of periods before expiry.
Overrides fields of this item's feature for customers on this plan (e.g. a credit system's credit\_schema).
For credit system features: replaces the feature's credit\_schema entirely for customers on this plan.
ID of the metered feature that draws from this credit system.
Number of metered-feature units priced together. Defaults to one when omitted.
Named rates chosen by event properties. The most specific match sets the rate; with no match the item's own rate applies.
Event properties this entry applies to. Every key must equal the tracked property, compared as strings.
Breaks ties between dimensions that match the same number of keys. Higher wins.
Inclusive upper usage boundary for this graduated tier. The final tier must be 'inf'.
Credits consumed per billing-unit group within this tier.
Named adjustments chosen by event properties. Every match applies: factors multiply, then adds are summed.
Event properties this entry applies to. Every key must equal the tracked property, compared as strings.
Multiplies the matched rate. All matching multipliers stack.
Added to the rate after every factor is applied, in credits per billing-unit group.
Inclusive upper usage boundary for this graduated tier. The final tier must be 'inf'.
Credits consumed per billing-unit group within this tier.
Credits consumed per billing-unit group.
For AI credit system features: replaces the feature's markup chain entirely for customers on this plan. An unset level means no markup at that level rather than inheriting the feature's.
Default percentage markup for customers on this plan. Use -100 to make usage free.
Per-provider markup percentages for customers on this plan.
Per-model markup overrides for customers on this plan.
Payment processors this plan is connected to. Omitted when unset.
Stripe product ID this plan is billed under.
Extra Stripe product IDs aliased to this plan.
Every RevenueCat product that maps to this plan. Replaces the current set.
RevenueCat product ID that grants this plan when purchased.
Prepaid quantities granted when this specific RevenueCat product is purchased, in feature units.
Free trial configuration. If set, new customers can try this plan before being charged.
Number of duration\_type periods the trial lasts.
Unit of time for the trial duration ('day', 'month', 'year').
Whether a payment method is required to start the trial. If true, customer will be charged after trial ends.
Behavior when the trial ends. 'bill' charges the customer (default). 'revert' expires the trial and restores the customer's previous plan.
Unix timestamp (ms) when the plan was created.
Environment this plan belongs to ('sandbox' or 'live').
Whether the plan is archived. Archived plans cannot be attached to new customers.
Miscellaneous plan-level configuration flags.
If true, entitlements attached to this plan will still reset on schedule even when the customer's product is in a past\_due state.
Plan-level billing controls used as customer defaults.
List of auto top-up configurations per feature.
The ID of the feature (credit balance) to auto top-up.
Whether auto top-up is enabled.
When the balance drops below this threshold, an auto top-up will be purchased.
Amount of credits to add per auto top-up.
Optional rate limit to cap how often auto top-ups occur.
The time interval for the purchase limit window.
Number of intervals in the purchase limit window.
Maximum number of auto top-ups allowed within the interval.
When true, auto top-up creates a send\_invoice invoice instead of auto-charging.
List of overage spend limits per feature (caps overage spend).
Optional feature ID this spend limit applies to.
Whether the overage spend limit is enabled.
How overage\_limit is interpreted: an absolute overage cap (default) or a percentage of the main-plan allowance.
Overage cap for the feature: absolute units, or a percent (e.g. 120) when limit\_type is usage\_percentage.
When true, overage for this feature is not posted to Stripe. Usage tracking and balance resets still behave normally.
List of hard usage caps per feature (max units per interval).
The feature this usage limit applies to.
Whether this usage limit is enabled.
Maximum units allowed per interval.
Interval for the cap, aligned to the customer's billing cycle.
Window alignment. 'billing\_cycle' phases the interval to the customer's renewal time; 'utc' aligns to the UTC calendar.
When set, only usage from events whose properties match counts toward this cap. Omit to count all usage of the feature.
List of usage alert configurations per feature.
The feature ID this alert applies to.
Whether this usage alert is enabled.
The threshold value that triggers the alert. For usage or remaining, this is an absolute count. For usage\_percentage or remaining\_percentage, this is a percentage (0-100).
Whether the threshold is an absolute count or a percentage of the usage allowance or remaining balance.
What 100% means. balance: every grant on the feature. included: the plan allowance only. recurring: grants that reset. usage\_limit: the cap of the usage limit with the same feature and filter.
Only valid with basis usage\_limit. Points the alert at the usage limit carrying the same filter.
Optional user-defined label to distinguish multiple alerts on the same feature.
List of overage allowed controls per feature. When enabled, usage can exceed balance.
The feature ID this overage allowed control applies to.
Whether overage is allowed for this feature.
Arbitrary key-value metadata defined by you for your own use. Shared across all versions of the plan.
Whether the trial on this plan is available to this customer. For example, if the customer used the trial in the past, this will be false.
The customer's current status with this plan. 'active' if attached, 'scheduled' if pending activation.
Whether the customer's active instance of this plan is set to cancel.
Whether the customer is currently on a free trial of this plan.
The action that would occur if this plan were attached to the customer.
Deprecated. Use variant\_details.base\_plan\_id instead. If this is a variant, the ID of the base plan it was created from.
Details about how this variant relates to its latest base plan.
The ID of the base plan this variant was derived from.
The customization that transforms the base plan into this variant.
Base price configuration for a plan.
Base price amount for the plan, in major currency units (e.g. dollars).
Billing interval (e.g. 'month', 'year').
Base price amounts in additional currencies. The base 'amount' is in the org's default currency.
Three-letter Stripe-supported currency code (e.g. 'eur', 'gbp').
Price amount in this currency. Set explicitly per currency, not converted from the base amount.
Items to add to the plan.
Bills this many feature units when outstanding overage reaches it.
The ID of the feature to configure.
Number of free units included. Balance resets to this each interval for consumable features.
If true, customer has unlimited access to this feature.
Whether entity-level grants contribute to a shared customer balance.
Reset configuration for consumable features. Omit for non-consumable features like seats.
Interval at which balance resets (e.g. 'month', 'year'). For consumable features only.
Pricing for usage beyond included units. Omit for free features.
Price per billing\_units after included usage. Either 'amount' or 'tiers' is required.
Amounts in additional currencies for this flat price. The base 'amount' is in the org's default currency. Only valid with 'amount', not 'tiers'.
Three-letter Stripe-supported currency code (e.g. 'eur', 'gbp').
Price amount in this currency. Set explicitly per currency, not converted from the base amount.
Tiered pricing. Either 'amount' or 'tiers' is required.
Three-letter Stripe-supported currency code (e.g. 'eur', 'gbp').
Per-unit amount for this tier in this currency.
Flat amount for this tier in this currency, if the tier uses one.
Billing interval. For consumable features, should match reset.interval.
Number of intervals per billing cycle. Defaults to 1.
Units per price increment. Usage is rounded UP when billed (e.g. billing\_units=100 means 101 rounds to 200).
'prepaid' for upfront payment (seats), 'usage\_based' for pay-as-you-go.
Max units purchasable beyond included. E.g. included=100, max\_purchase=300 allows 400 total. Null for no limit.
Proration settings for prepaid features. Controls mid-cycle quantity change billing.
Billing behavior when quantity increases mid-cycle.
Credit behavior when quantity decreases mid-cycle.
Rollover config for unused units. If set, unused included units carry over.
Max rollover units. Omit for unlimited rollover.
Maximum rollover as a percentage (0-100) of included + prepaid grant. Mutually exclusive with max.
When rolled over units expire.
Number of periods before expiry.
Overrides fields of this item's feature for customers on this plan (e.g. a credit system's credit\_schema).
For credit system features: replaces the feature's credit\_schema entirely for customers on this plan.
ID of the metered feature that draws from this credit system.
Number of metered-feature units priced together. Defaults to one when omitted.
Named rates chosen by event properties. The most specific match sets the rate; with no match the item's own rate applies.
Event properties this entry applies to. Every key must equal the tracked property, compared as strings.
Breaks ties between dimensions that match the same number of keys. Higher wins.
Inclusive upper usage boundary for this graduated tier. The final tier must be 'inf'.
Credits consumed per billing-unit group within this tier.
Named adjustments chosen by event properties. Every match applies: factors multiply, then adds are summed.
Event properties this entry applies to. Every key must equal the tracked property, compared as strings.
Multiplies the matched rate. All matching multipliers stack.
Added to the rate after every factor is applied, in credits per billing-unit group.
Inclusive upper usage boundary for this graduated tier. The final tier must be 'inf'.
Credits consumed per billing-unit group within this tier.
Credits consumed per billing-unit group.
For AI credit system features: replaces the feature's markup chain entirely for customers on this plan. An unset level means no markup at that level rather than inheriting the feature's.
Default percentage markup for customers on this plan. Use -100 to make usage free.
Per-provider markup percentages for customers on this plan.
Per-model markup overrides for customers on this plan.
Filters selecting items to remove from the plan.
Match items linked to this feature.
Match items with this billing method (prepaid or usage\_based).
Match items with this interval. Accepts either a BillingInterval (price-side) or a ResetInterval (reset-side, includes day/hour/minute) so price-less items keyed by reset.interval can be disambiguated.
Match items with this interval\_count. Disambiguates between items that share an interval but differ in count.
Match items whose grant equals this included usage. Omitted is a wildcard.
Free trial configuration for a plan.
Number of duration\_type periods the trial lasts.
Unit of time for the trial ('day', 'month', 'year').
If true, a payment method is required to start the trial and the customer is charged when it ends. Defaults to false.
Override the plan's billing controls (auto top-ups, spend limits, usage limits, usage alerts, overage allowed) for this customer.
The ID of the feature (credit balance) to auto top-up.
Whether auto top-up is enabled.
When the balance drops below this threshold, an auto top-up will be purchased.
Amount of credits to add per auto top-up.
Optional rate limit to cap how often auto top-ups occur. Pass count to set the current window's consumed top-ups.
The time interval for the purchase limit window.
Number of intervals in the purchase limit window.
Maximum number of auto top-ups allowed within the interval.
Set the current window's consumed auto top-up count. Omit to leave runtime state unchanged.
When true, auto top-up creates a send\_invoice invoice instead of auto-charging.
Optional feature ID this spend limit applies to.
Whether the overage spend limit is enabled.
How overage\_limit is interpreted: an absolute overage cap (default) or a percentage of the main-plan allowance.
Overage cap for the feature: absolute units, or a percent (e.g. 120) when limit\_type is usage\_percentage.
When true, overage for this feature is not posted to Stripe. Usage tracking and balance resets still behave normally.
The feature this usage limit applies to.
Whether this usage limit is enabled.
Maximum units allowed per interval.
Interval for the cap, aligned to the customer's billing cycle.
Window alignment. 'billing\_cycle' phases the interval to the customer's renewal time; 'utc' aligns to the UTC calendar.
When set, only usage from events whose properties match counts toward this cap. Omit to count all usage of the feature.
The feature ID this alert applies to.
Whether this usage alert is enabled.
The threshold value that triggers the alert. For usage or remaining, this is an absolute count. For usage\_percentage or remaining\_percentage, this is a percentage (0-100).
Whether the threshold is an absolute count or a percentage of the usage allowance or remaining balance.
What 100% means. balance: every grant on the feature. included: the plan allowance only. recurring: grants that reset. usage\_limit: the cap of the usage limit with the same feature and filter.
Only valid with basis usage\_limit. Points the alert at the usage limit carrying the same filter.
Optional user-defined label to distinguish multiple alerts on the same feature.
The feature ID this overage allowed control applies to.
Whether overage is allowed for this feature.
License links to add or override for this customer, keyed by license\_plan\_id. Omitted fields inherit the plan catalog link (included defaults to 1 when the license is not in the catalog). A bare entry restores the license to pure catalog inheritance.
Base price configuration for a plan.
Base price amount for the plan, in major currency units (e.g. dollars).
Billing interval (e.g. 'month', 'year').
Base price amounts in additional currencies. The base 'amount' is in the org's default currency.
Three-letter Stripe-supported currency code (e.g. 'eur', 'gbp').
Price amount in this currency. Set explicitly per currency, not converted from the base amount.
Bills this many feature units when outstanding overage reaches it.
The ID of the feature to configure.
Number of free units included. Balance resets to this each interval for consumable features.
If true, customer has unlimited access to this feature.
Whether entity-level grants contribute to a shared customer balance.
Reset configuration for consumable features. Omit for non-consumable features like seats.
Interval at which balance resets (e.g. 'month', 'year'). For consumable features only.
Pricing for usage beyond included units. Omit for free features.
Price per billing\_units after included usage. Either 'amount' or 'tiers' is required.
Amounts in additional currencies for this flat price. The base 'amount' is in the org's default currency. Only valid with 'amount', not 'tiers'.
Three-letter Stripe-supported currency code (e.g. 'eur', 'gbp').
Price amount in this currency. Set explicitly per currency, not converted from the base amount.
Tiered pricing. Either 'amount' or 'tiers' is required.
Three-letter Stripe-supported currency code (e.g. 'eur', 'gbp').
Per-unit amount for this tier in this currency.
Flat amount for this tier in this currency, if the tier uses one.
Billing interval. For consumable features, should match reset.interval.
Number of intervals per billing cycle. Defaults to 1.
Units per price increment. Usage is rounded UP when billed (e.g. billing\_units=100 means 101 rounds to 200).
'prepaid' for upfront payment (seats), 'usage\_based' for pay-as-you-go.
Max units purchasable beyond included. E.g. included=100, max\_purchase=300 allows 400 total. Null for no limit.
Proration settings for prepaid features. Controls mid-cycle quantity change billing.
Billing behavior when quantity increases mid-cycle.
Credit behavior when quantity decreases mid-cycle.
Rollover config for unused units. If set, unused included units carry over.
Max rollover units. Omit for unlimited rollover.
Maximum rollover as a percentage (0-100) of included + prepaid grant. Mutually exclusive with max.
When rolled over units expire.
Number of periods before expiry.
Overrides fields of this item's feature for customers on this plan (e.g. a credit system's credit\_schema).
For credit system features: replaces the feature's credit\_schema entirely for customers on this plan.
ID of the metered feature that draws from this credit system.
Number of metered-feature units priced together. Defaults to one when omitted.
Named rates chosen by event properties. The most specific match sets the rate; with no match the item's own rate applies.
Event properties this entry applies to. Every key must equal the tracked property, compared as strings.
Breaks ties between dimensions that match the same number of keys. Higher wins.
Inclusive upper usage boundary for this graduated tier. The final tier must be 'inf'.
Credits consumed per billing-unit group within this tier.
Named adjustments chosen by event properties. Every match applies: factors multiply, then adds are summed.
Event properties this entry applies to. Every key must equal the tracked property, compared as strings.
Multiplies the matched rate. All matching multipliers stack.
Added to the rate after every factor is applied, in credits per billing-unit group.
Inclusive upper usage boundary for this graduated tier. The final tier must be 'inf'.
Credits consumed per billing-unit group within this tier.
Credits consumed per billing-unit group.
For AI credit system features: replaces the feature's markup chain entirely for customers on this plan. An unset level means no markup at that level rather than inheriting the feature's.
Default percentage markup for customers on this plan. Use -100 to make usage free.
Per-provider markup percentages for customers on this plan.
Per-model markup overrides for customers on this plan.
Match items linked to this feature.
Match items with this billing method (prepaid or usage\_based).
Match items with this interval. Accepts either a BillingInterval (price-side) or a ResetInterval (reset-side, includes day/hour/minute) so price-less items keyed by reset.interval can be disambiguated.
Match items with this interval\_count. Disambiguates between items that share an interval but differ in count.
Match items whose grant equals this included usage. Omitted is a wildcard.
License links to drop, keyed by license\_plan\_id. Parallel to remove\_items.
Sparse map of scalar plan fields that changed, holding their previous values. Null when the plan is new.
Unique identifier for the plan.
Display name of the plan.
Optional description of the plan.
Group identifier for organizing related plans. Plans in the same group are mutually exclusive.
Whether this is an add-on plan that can be attached alongside a main plan.
If true, this plan is automatically attached when a customer is created. Used for free plans.
Miscellaneous plan-level configuration flags.
If true, entitlements attached to this plan will still reset on schedule even when the customer's product is in a past\_due state.
Whether this is the active version of the plan. At most one version is active.
Whether the plan is archived. Archived plans cannot be attached to new customers.
Arbitrary key-value metadata defined by you for your own use. Shared across all versions of the plan.
Previous payment processors when they changed. Null when the plan had none.
Stripe product ID this plan is billed under.
Extra Stripe product IDs aliased to this plan.
Every RevenueCat product that maps to this plan. Replaces the current set.
RevenueCat product ID that grants this plan when purchased.
Prepaid quantities granted when this specific RevenueCat product is purchased, in feature units.
Previous free trial when it changed. Null when the plan had none.
Number of duration\_type periods the trial lasts.
Unit of time for the trial duration ('day', 'month', 'year').
Whether a payment method is required to start the trial. If true, customer will be charged after trial ends.
Behavior when the trial ends. 'bill' charges the customer (default). 'revert' expires the trial and restores the customer's previous plan.
Sparse previous billing\_controls — only keys that changed. Null when unset; a null lane was unset before.
List of auto top-up configurations per feature.
The ID of the feature (credit balance) to auto top-up.
Whether auto top-up is enabled.
When the balance drops below this threshold, an auto top-up will be purchased.
Amount of credits to add per auto top-up.
Optional rate limit to cap how often auto top-ups occur.
The time interval for the purchase limit window.
Number of intervals in the purchase limit window.
Maximum number of auto top-ups allowed within the interval.
When true, auto top-up creates a send\_invoice invoice instead of auto-charging.
List of overage spend limits per feature (caps overage spend).
Optional feature ID this spend limit applies to.
Whether the overage spend limit is enabled.
How overage\_limit is interpreted: an absolute overage cap (default) or a percentage of the main-plan allowance.
Overage cap for the feature: absolute units, or a percent (e.g. 120) when limit\_type is usage\_percentage.
When true, overage for this feature is not posted to Stripe. Usage tracking and balance resets still behave normally.
List of hard usage caps per feature (max units per interval).
The feature this usage limit applies to.
Whether this usage limit is enabled.
Maximum units allowed per interval.
Interval for the cap, aligned to the customer's billing cycle.
Window alignment. 'billing\_cycle' phases the interval to the customer's renewal time; 'utc' aligns to the UTC calendar.
When set, only usage from events whose properties match counts toward this cap. Omit to count all usage of the feature.
List of usage alert configurations per feature.
The feature ID this alert applies to.
Whether this usage alert is enabled.
The threshold value that triggers the alert. For usage or remaining, this is an absolute count. For usage\_percentage or remaining\_percentage, this is a percentage (0-100).
Whether the threshold is an absolute count or a percentage of the usage allowance or remaining balance.
What 100% means. balance: every grant on the feature. included: the plan allowance only. recurring: grants that reset. usage\_limit: the cap of the usage limit with the same feature and filter.
Only valid with basis usage\_limit. Points the alert at the usage limit carrying the same filter.
Optional user-defined label to distinguish multiple alerts on the same feature.
List of overage allowed controls per feature. When enabled, usage can exceed balance.
The feature ID this overage allowed control applies to.
Whether overage is allowed for this feature.
Present when the plan's price changed.
Base recurring price for the plan. Null for free plans or usage-only plans.
Base price amount for the plan, in major currency units (e.g. dollars).
Base price amounts in additional currencies. The base 'amount' is in the org's default currency.
Three-letter Stripe-supported currency code (e.g. 'eur', 'gbp').
Price amount in this currency. Set explicitly per currency, not converted from the base amount.
Billing interval (e.g. 'month', 'year').
Number of intervals per billing cycle. Defaults to 1.
Display text for showing this price in pricing pages.
Main display text (e.g. '\$10' or '100 messages').
Secondary display text (e.g. 'per month' or 'then \$0.5 per 100').
Payment processors this base price is connected to. Omitted when unset.
Stripe price ID. For prepaid with included > 0 this is the V2 price.
The plan's price after the change.
Base price amount for the plan, in major currency units (e.g. dollars).
Base price amounts in additional currencies. The base 'amount' is in the org's default currency.
Three-letter Stripe-supported currency code (e.g. 'eur', 'gbp').
Price amount in this currency. Set explicitly per currency, not converted from the base amount.
Billing interval (e.g. 'month', 'year').
Number of intervals per billing cycle. Defaults to 1.
Display text for showing this price in pricing pages.
Main display text (e.g. '\$10' or '100 messages').
Secondary display text (e.g. 'per month' or 'then \$0.5 per 100').
Payment processors this base price is connected to. Omitted when unset.
Stripe price ID. For prepaid with included > 0 this is the V2 price.
Present when the plan's free trial changed.
The plan's free trial before the change. Null when none.
Number of duration\_type periods the trial lasts.
Unit of time for the trial duration ('day', 'month', 'year').
Whether a payment method is required to start the trial. If true, customer will be charged after trial ends.
Behavior when the trial ends. 'bill' charges the customer (default). 'revert' expires the trial and restores the customer's previous plan.
The plan's free trial after the change. Null when none.
Number of duration\_type periods the trial lasts.
Unit of time for the trial duration ('day', 'month', 'year').
Whether a payment method is required to start the trial. If true, customer will be charged after trial ends.
Behavior when the trial ends. 'bill' charges the customer (default). 'revert' expires the trial and restores the customer's previous plan.
Feature items added to or removed from the plan.
Whether the item was added to or removed from the plan.
The ID of the feature that was added or removed.
The plan item snapshot that was added or removed.
Bills this many feature units when outstanding overage reaches it.
The ID of the feature this item configures.
The full feature object if expanded.
The ID of the feature, used to refer to it in other API calls like /track or /check.
The name of the feature.
The type of the feature
Singular and plural display names for the feature.
The singular display name for the feature.
The plural display name for the feature.
Credit cost schema for credit system features.
The ID of the metered feature (should be a single\_use feature).
The credit cost of the metered feature.
Whether or not the feature is archived.
Number of free units included. For consumable features, balance resets to this number each interval.
Whether the customer has unlimited access to this feature.
Whether entity-level grants contribute to a shared customer balance.
Reset configuration for consumable features. Null for non-consumable features like seats where usage persists across billing cycles.
The interval at which the feature balance resets (e.g. 'month', 'year'). For consumable features, usage resets to 0 and included units are restored.
Number of intervals between resets. Defaults to 1.
Pricing configuration for usage beyond included units. Null if feature is entirely free.
Price per billing\_units after included usage is consumed. Mutually exclusive with tiers.
Amounts in additional currencies for this flat price. The base 'amount' is in the org's default currency. Only valid with 'amount', not 'tiers' (tiered prices carry per-currency amounts on each tier).
Three-letter Stripe-supported currency code (e.g. 'eur', 'gbp').
Price amount in this currency. Set explicitly per currency, not converted from the base amount.
Tiered pricing configuration. Each tier's 'to' INCLUDES the included amount. Either 'tiers' or 'amount' is required.
Three-letter Stripe-supported currency code (e.g. 'eur', 'gbp').
Per-unit amount for this tier in this currency.
Flat amount for this tier in this currency, if the tier uses one.
Billing interval for this price. For consumable features, should match reset.interval.
Number of intervals per billing cycle. Defaults to 1.
Number of units per price increment. Usage is rounded UP to the nearest billing\_units when billed (e.g. billing\_units=100 means 101 usage rounds to 200).
'prepaid' for features like seats where customers pay upfront, 'usage\_based' for pay-as-you-go after included usage.
Maximum units a customer can purchase beyond included. E.g. if included=100 and max\_purchase=300, customer can use up to 400 total before usage is capped. Null for no limit.
Payment processors this item price is connected to. Omitted when unset.
Stripe price ID. For prepaid with included > 0 this is the V2 price.
Display text for showing this item in pricing pages.
Main display text (e.g. '\$10' or '100 messages').
Secondary display text (e.g. 'per month' or 'then \$0.5 per 100').
Rollover configuration for unused units. If set, unused included units roll over to the next period.
Maximum rollover units. Null for unlimited rollover.
Maximum rollover as a percentage (0-100) of included + prepaid grant. Mutually exclusive with max.
When rolled over units expire.
Number of periods before expiry.
Overrides fields of this item's feature for customers on this plan (e.g. a credit system's credit\_schema).
For credit system features: replaces the feature's credit\_schema entirely for customers on this plan.
ID of the metered feature that draws from this credit system.
Number of metered-feature units priced together. Defaults to one when omitted.
Named rates chosen by event properties. The most specific match sets the rate; with no match the item's own rate applies.
Event properties this entry applies to. Every key must equal the tracked property, compared as strings.
Breaks ties between dimensions that match the same number of keys. Higher wins.
Inclusive upper usage boundary for this graduated tier. The final tier must be 'inf'.
Credits consumed per billing-unit group within this tier.
Named adjustments chosen by event properties. Every match applies: factors multiply, then adds are summed.
Event properties this entry applies to. Every key must equal the tracked property, compared as strings.
Multiplies the matched rate. All matching multipliers stack.
Added to the rate after every factor is applied, in credits per billing-unit group.
Inclusive upper usage boundary for this graduated tier. The final tier must be 'inf'.
Credits consumed per billing-unit group within this tier.
Credits consumed per billing-unit group.
For AI credit system features: replaces the feature's markup chain entirely for customers on this plan. An unset level means no markup at that level rather than inheriting the feature's.
Default percentage markup for customers on this plan. Use -100 to make usage free.
Per-provider markup percentages for customers on this plan.
Per-model markup overrides for customers on this plan.
Params that would transform the previous plan into the current one, including license upserts/removes.
Base price configuration for a plan.
Base price amount for the plan, in major currency units (e.g. dollars).
Billing interval (e.g. 'month', 'year').
Base price amounts in additional currencies. The base 'amount' is in the org's default currency.
Three-letter Stripe-supported currency code (e.g. 'eur', 'gbp').
Price amount in this currency. Set explicitly per currency, not converted from the base amount.
Items to add to the plan.
Bills this many feature units when outstanding overage reaches it.
The ID of the feature to configure.
Number of free units included. Balance resets to this each interval for consumable features.
If true, customer has unlimited access to this feature.
Whether entity-level grants contribute to a shared customer balance.
Reset configuration for consumable features. Omit for non-consumable features like seats.
Interval at which balance resets (e.g. 'month', 'year'). For consumable features only.
Pricing for usage beyond included units. Omit for free features.
Price per billing\_units after included usage. Either 'amount' or 'tiers' is required.
Amounts in additional currencies for this flat price. The base 'amount' is in the org's default currency. Only valid with 'amount', not 'tiers'.
Three-letter Stripe-supported currency code (e.g. 'eur', 'gbp').
Price amount in this currency. Set explicitly per currency, not converted from the base amount.
Tiered pricing. Either 'amount' or 'tiers' is required.
Three-letter Stripe-supported currency code (e.g. 'eur', 'gbp').
Per-unit amount for this tier in this currency.
Flat amount for this tier in this currency, if the tier uses one.
Billing interval. For consumable features, should match reset.interval.
Number of intervals per billing cycle. Defaults to 1.
Units per price increment. Usage is rounded UP when billed (e.g. billing\_units=100 means 101 rounds to 200).
'prepaid' for upfront payment (seats), 'usage\_based' for pay-as-you-go.
Max units purchasable beyond included. E.g. included=100, max\_purchase=300 allows 400 total. Null for no limit.
Proration settings for prepaid features. Controls mid-cycle quantity change billing.
Billing behavior when quantity increases mid-cycle.
Credit behavior when quantity decreases mid-cycle.
Rollover config for unused units. If set, unused included units carry over.
Max rollover units. Omit for unlimited rollover.
Maximum rollover as a percentage (0-100) of included + prepaid grant. Mutually exclusive with max.
When rolled over units expire.
Number of periods before expiry.
Overrides fields of this item's feature for customers on this plan (e.g. a credit system's credit\_schema).
For credit system features: replaces the feature's credit\_schema entirely for customers on this plan.
ID of the metered feature that draws from this credit system.
Number of metered-feature units priced together. Defaults to one when omitted.
Named rates chosen by event properties. The most specific match sets the rate; with no match the item's own rate applies.
Event properties this entry applies to. Every key must equal the tracked property, compared as strings.
Breaks ties between dimensions that match the same number of keys. Higher wins.
Inclusive upper usage boundary for this graduated tier. The final tier must be 'inf'.
Credits consumed per billing-unit group within this tier.
Named adjustments chosen by event properties. Every match applies: factors multiply, then adds are summed.
Event properties this entry applies to. Every key must equal the tracked property, compared as strings.
Multiplies the matched rate. All matching multipliers stack.
Added to the rate after every factor is applied, in credits per billing-unit group.
Inclusive upper usage boundary for this graduated tier. The final tier must be 'inf'.
Credits consumed per billing-unit group within this tier.
Credits consumed per billing-unit group.
For AI credit system features: replaces the feature's markup chain entirely for customers on this plan. An unset level means no markup at that level rather than inheriting the feature's.
Default percentage markup for customers on this plan. Use -100 to make usage free.
Per-provider markup percentages for customers on this plan.
Per-model markup overrides for customers on this plan.
Filters selecting items to remove from the plan.
Match items linked to this feature.
Match items with this billing method (prepaid or usage\_based).
Match items with this interval. Accepts either a BillingInterval (price-side) or a ResetInterval (reset-side, includes day/hour/minute) so price-less items keyed by reset.interval can be disambiguated.
Match items with this interval\_count. Disambiguates between items that share an interval but differ in count.
Match items whose grant equals this included usage. Omitted is a wildcard.
Free trial configuration for a plan.
Number of duration\_type periods the trial lasts.
Unit of time for the trial ('day', 'month', 'year').
If true, a payment method is required to start the trial and the customer is charged when it ends. Defaults to false.
Override the plan's billing controls (auto top-ups, spend limits, usage limits, usage alerts, overage allowed) for this customer.
The ID of the feature (credit balance) to auto top-up.
Whether auto top-up is enabled.
When the balance drops below this threshold, an auto top-up will be purchased.
Amount of credits to add per auto top-up.
Optional rate limit to cap how often auto top-ups occur. Pass count to set the current window's consumed top-ups.
The time interval for the purchase limit window.
Number of intervals in the purchase limit window.
Maximum number of auto top-ups allowed within the interval.
Set the current window's consumed auto top-up count. Omit to leave runtime state unchanged.
When true, auto top-up creates a send\_invoice invoice instead of auto-charging.
Optional feature ID this spend limit applies to.
Whether the overage spend limit is enabled.
How overage\_limit is interpreted: an absolute overage cap (default) or a percentage of the main-plan allowance.
Overage cap for the feature: absolute units, or a percent (e.g. 120) when limit\_type is usage\_percentage.
When true, overage for this feature is not posted to Stripe. Usage tracking and balance resets still behave normally.
The feature this usage limit applies to.
Whether this usage limit is enabled.
Maximum units allowed per interval.
Interval for the cap, aligned to the customer's billing cycle.
Window alignment. 'billing\_cycle' phases the interval to the customer's renewal time; 'utc' aligns to the UTC calendar.
When set, only usage from events whose properties match counts toward this cap. Omit to count all usage of the feature.
The feature ID this alert applies to.
Whether this usage alert is enabled.
The threshold value that triggers the alert. For usage or remaining, this is an absolute count. For usage\_percentage or remaining\_percentage, this is a percentage (0-100).
Whether the threshold is an absolute count or a percentage of the usage allowance or remaining balance.
What 100% means. balance: every grant on the feature. included: the plan allowance only. recurring: grants that reset. usage\_limit: the cap of the usage limit with the same feature and filter.
Only valid with basis usage\_limit. Points the alert at the usage limit carrying the same filter.
Optional user-defined label to distinguish multiple alerts on the same feature.
The feature ID this overage allowed control applies to.
Whether overage is allowed for this feature.
planLicenses created or overridden. Same shape as customize.upsert\_licenses / licenses\[] entries.
Base price configuration for a plan.
Base price amount for the plan, in major currency units (e.g. dollars).
Billing interval (e.g. 'month', 'year').
Base price amounts in additional currencies. The base 'amount' is in the org's default currency.
Three-letter Stripe-supported currency code (e.g. 'eur', 'gbp').
Price amount in this currency. Set explicitly per currency, not converted from the base amount.
Bills this many feature units when outstanding overage reaches it.
The ID of the feature to configure.
Number of free units included. Balance resets to this each interval for consumable features.
If true, customer has unlimited access to this feature.
Whether entity-level grants contribute to a shared customer balance.
Reset configuration for consumable features. Omit for non-consumable features like seats.
Interval at which balance resets (e.g. 'month', 'year'). For consumable features only.
Pricing for usage beyond included units. Omit for free features.
Price per billing\_units after included usage. Either 'amount' or 'tiers' is required.
Amounts in additional currencies for this flat price. The base 'amount' is in the org's default currency. Only valid with 'amount', not 'tiers'.
Three-letter Stripe-supported currency code (e.g. 'eur', 'gbp').
Price amount in this currency. Set explicitly per currency, not converted from the base amount.
Tiered pricing. Either 'amount' or 'tiers' is required.
Three-letter Stripe-supported currency code (e.g. 'eur', 'gbp').
Per-unit amount for this tier in this currency.
Flat amount for this tier in this currency, if the tier uses one.
Billing interval. For consumable features, should match reset.interval.
Number of intervals per billing cycle. Defaults to 1.
Units per price increment. Usage is rounded UP when billed (e.g. billing\_units=100 means 101 rounds to 200).
'prepaid' for upfront payment (seats), 'usage\_based' for pay-as-you-go.
Max units purchasable beyond included. E.g. included=100, max\_purchase=300 allows 400 total. Null for no limit.
Proration settings for prepaid features. Controls mid-cycle quantity change billing.
Billing behavior when quantity increases mid-cycle.
Credit behavior when quantity decreases mid-cycle.
Rollover config for unused units. If set, unused included units carry over.
Max rollover units. Omit for unlimited rollover.
Maximum rollover as a percentage (0-100) of included + prepaid grant. Mutually exclusive with max.
When rolled over units expire.
Number of periods before expiry.
Overrides fields of this item's feature for customers on this plan (e.g. a credit system's credit\_schema).
For credit system features: replaces the feature's credit\_schema entirely for customers on this plan.
ID of the metered feature that draws from this credit system.
Number of metered-feature units priced together. Defaults to one when omitted.
Named rates chosen by event properties. The most specific match sets the rate; with no match the item's own rate applies.
Event properties this entry applies to. Every key must equal the tracked property, compared as strings.
Breaks ties between dimensions that match the same number of keys. Higher wins.
Inclusive upper usage boundary for this graduated tier. The final tier must be 'inf'.
Credits consumed per billing-unit group within this tier.
Named adjustments chosen by event properties. Every match applies: factors multiply, then adds are summed.
Event properties this entry applies to. Every key must equal the tracked property, compared as strings.
Multiplies the matched rate. All matching multipliers stack.
Added to the rate after every factor is applied, in credits per billing-unit group.
Inclusive upper usage boundary for this graduated tier. The final tier must be 'inf'.
Credits consumed per billing-unit group within this tier.
Credits consumed per billing-unit group.
For AI credit system features: replaces the feature's markup chain entirely for customers on this plan. An unset level means no markup at that level rather than inheriting the feature's.
Default percentage markup for customers on this plan. Use -100 to make usage free.
Per-provider markup percentages for customers on this plan.
Per-model markup overrides for customers on this plan.
Match items linked to this feature.
Match items with this billing method (prepaid or usage\_based).
Match items with this interval. Accepts either a BillingInterval (price-side) or a ResetInterval (reset-side, includes day/hour/minute) so price-less items keyed by reset.interval can be disambiguated.
Match items with this interval\_count. Disambiguates between items that share an interval but differ in count.
Match items whose grant equals this included usage. Omitted is a wildcard.
planLicenses dropped from this plan.
planLicenses created, updated, or removed on this plan. Omitted when none. Nested plan\_change is core-only.
The plan offered as a license under this plan.
The exact license-plan version pinned by this link.
Version slug of the license-plan row this link points at.
Number of license assignments included with this plan for free.
Arbitrary key-value metadata defined by you on this link.
The effective plan for this license link — the pinned version, with the link's customize applied. Present when license plans are expanded.
Unique identifier for the plan.
Display name of the plan.
Optional description of the plan.
Group identifier for organizing related plans. Plans in the same group are mutually exclusive.
Version number of the plan. Incremented when plan configuration changes.
User-facing version identity. Defaults to v\{n} when the version is minted.
Whether this is the active version of the plan. At most one version is active.
Whether this is an add-on plan that can be attached alongside a main plan.
If true, this plan is automatically attached when a customer is created. Used for free plans.
Base recurring price for the plan. Null for free plans or usage-only plans.
Base price amount for the plan, in major currency units (e.g. dollars).
Base price amounts in additional currencies. The base 'amount' is in the org's default currency.
Three-letter Stripe-supported currency code (e.g. 'eur', 'gbp').
Price amount in this currency. Set explicitly per currency, not converted from the base amount.
Billing interval (e.g. 'month', 'year').
Number of intervals per billing cycle. Defaults to 1.
Display text for showing this price in pricing pages.
Main display text (e.g. '\$10' or '100 messages').
Secondary display text (e.g. 'per month' or 'then \$0.5 per 100').
Payment processors this base price is connected to. Omitted when unset.
Stripe price ID. For prepaid with included > 0 this is the V2 price.
Feature configurations included in this plan. Each item defines included units, pricing, and reset behavior for a feature.
Bills this many feature units when outstanding overage reaches it.
The ID of the feature this item configures.
The full feature object if expanded.
The ID of the feature, used to refer to it in other API calls like /track or /check.
The name of the feature.
The type of the feature
Singular and plural display names for the feature.
The singular display name for the feature.
The plural display name for the feature.
Credit cost schema for credit system features.
The ID of the metered feature (should be a single\_use feature).
The credit cost of the metered feature.
Whether or not the feature is archived.
Number of free units included. For consumable features, balance resets to this number each interval.
Whether the customer has unlimited access to this feature.
Whether entity-level grants contribute to a shared customer balance.
Reset configuration for consumable features. Null for non-consumable features like seats where usage persists across billing cycles.
The interval at which the feature balance resets (e.g. 'month', 'year'). For consumable features, usage resets to 0 and included units are restored.
Number of intervals between resets. Defaults to 1.
Pricing configuration for usage beyond included units. Null if feature is entirely free.
Price per billing\_units after included usage is consumed. Mutually exclusive with tiers.
Amounts in additional currencies for this flat price. The base 'amount' is in the org's default currency. Only valid with 'amount', not 'tiers' (tiered prices carry per-currency amounts on each tier).
Three-letter Stripe-supported currency code (e.g. 'eur', 'gbp').
Price amount in this currency. Set explicitly per currency, not converted from the base amount.
Tiered pricing configuration. Each tier's 'to' INCLUDES the included amount. Either 'tiers' or 'amount' is required.
Three-letter Stripe-supported currency code (e.g. 'eur', 'gbp').
Per-unit amount for this tier in this currency.
Flat amount for this tier in this currency, if the tier uses one.
Billing interval for this price. For consumable features, should match reset.interval.
Number of intervals per billing cycle. Defaults to 1.
Number of units per price increment. Usage is rounded UP to the nearest billing\_units when billed (e.g. billing\_units=100 means 101 usage rounds to 200).
'prepaid' for features like seats where customers pay upfront, 'usage\_based' for pay-as-you-go after included usage.
Maximum units a customer can purchase beyond included. E.g. if included=100 and max\_purchase=300, customer can use up to 400 total before usage is capped. Null for no limit.
Payment processors this item price is connected to. Omitted when unset.
Stripe price ID. For prepaid with included > 0 this is the V2 price.
Display text for showing this item in pricing pages.
Main display text (e.g. '\$10' or '100 messages').
Secondary display text (e.g. 'per month' or 'then \$0.5 per 100').
Rollover configuration for unused units. If set, unused included units roll over to the next period.
Maximum rollover units. Null for unlimited rollover.
Maximum rollover as a percentage (0-100) of included + prepaid grant. Mutually exclusive with max.
When rolled over units expire.
Number of periods before expiry.
Overrides fields of this item's feature for customers on this plan (e.g. a credit system's credit\_schema).
For credit system features: replaces the feature's credit\_schema entirely for customers on this plan.
ID of the metered feature that draws from this credit system.
Number of metered-feature units priced together. Defaults to one when omitted.
Named rates chosen by event properties. The most specific match sets the rate; with no match the item's own rate applies.
Event properties this entry applies to. Every key must equal the tracked property, compared as strings.
Breaks ties between dimensions that match the same number of keys. Higher wins.
Inclusive upper usage boundary for this graduated tier. The final tier must be 'inf'.
Credits consumed per billing-unit group within this tier.
Named adjustments chosen by event properties. Every match applies: factors multiply, then adds are summed.
Event properties this entry applies to. Every key must equal the tracked property, compared as strings.
Multiplies the matched rate. All matching multipliers stack.
Added to the rate after every factor is applied, in credits per billing-unit group.
Inclusive upper usage boundary for this graduated tier. The final tier must be 'inf'.
Credits consumed per billing-unit group within this tier.
Credits consumed per billing-unit group.
For AI credit system features: replaces the feature's markup chain entirely for customers on this plan. An unset level means no markup at that level rather than inheriting the feature's.
Default percentage markup for customers on this plan. Use -100 to make usage free.
Per-provider markup percentages for customers on this plan.
Per-model markup overrides for customers on this plan.
Payment processors this plan is connected to. Omitted when unset.
Stripe product ID this plan is billed under.
Extra Stripe product IDs aliased to this plan.
Every RevenueCat product that maps to this plan. Replaces the current set.
RevenueCat product ID that grants this plan when purchased.
Prepaid quantities granted when this specific RevenueCat product is purchased, in feature units.
Free trial configuration. If set, new customers can try this plan before being charged.
Number of duration\_type periods the trial lasts.
Unit of time for the trial duration ('day', 'month', 'year').
Whether a payment method is required to start the trial. If true, customer will be charged after trial ends.
Behavior when the trial ends. 'bill' charges the customer (default). 'revert' expires the trial and restores the customer's previous plan.
Unix timestamp (ms) when the plan was created.
Environment this plan belongs to ('sandbox' or 'live').
Whether the plan is archived. Archived plans cannot be attached to new customers.
Miscellaneous plan-level configuration flags.
If true, entitlements attached to this plan will still reset on schedule even when the customer's product is in a past\_due state.
Plan-level billing controls used as customer defaults.
List of auto top-up configurations per feature.
The ID of the feature (credit balance) to auto top-up.
Whether auto top-up is enabled.
When the balance drops below this threshold, an auto top-up will be purchased.
Amount of credits to add per auto top-up.
Optional rate limit to cap how often auto top-ups occur.
The time interval for the purchase limit window.
Number of intervals in the purchase limit window.
Maximum number of auto top-ups allowed within the interval.
When true, auto top-up creates a send\_invoice invoice instead of auto-charging.
List of overage spend limits per feature (caps overage spend).
Optional feature ID this spend limit applies to.
Whether the overage spend limit is enabled.
How overage\_limit is interpreted: an absolute overage cap (default) or a percentage of the main-plan allowance.
Overage cap for the feature: absolute units, or a percent (e.g. 120) when limit\_type is usage\_percentage.
When true, overage for this feature is not posted to Stripe. Usage tracking and balance resets still behave normally.
List of hard usage caps per feature (max units per interval).
The feature this usage limit applies to.
Whether this usage limit is enabled.
Maximum units allowed per interval.
Interval for the cap, aligned to the customer's billing cycle.
Window alignment. 'billing\_cycle' phases the interval to the customer's renewal time; 'utc' aligns to the UTC calendar.
When set, only usage from events whose properties match counts toward this cap. Omit to count all usage of the feature.
List of usage alert configurations per feature.
The feature ID this alert applies to.
Whether this usage alert is enabled.
The threshold value that triggers the alert. For usage or remaining, this is an absolute count. For usage\_percentage or remaining\_percentage, this is a percentage (0-100).
Whether the threshold is an absolute count or a percentage of the usage allowance or remaining balance.
What 100% means. balance: every grant on the feature. included: the plan allowance only. recurring: grants that reset. usage\_limit: the cap of the usage limit with the same feature and filter.
Only valid with basis usage\_limit. Points the alert at the usage limit carrying the same filter.
Optional user-defined label to distinguish multiple alerts on the same feature.
List of overage allowed controls per feature. When enabled, usage can exceed balance.
The feature ID this overage allowed control applies to.
Whether overage is allowed for this feature.
Arbitrary key-value metadata defined by you for your own use. Shared across all versions of the plan.
Whether the trial on this plan is available to this customer. For example, if the customer used the trial in the past, this will be false.
The customer's current status with this plan. 'active' if attached, 'scheduled' if pending activation.
Whether the customer's active instance of this plan is set to cancel.
Whether the customer is currently on a free trial of this plan.
The action that would occur if this plan were attached to the customer.
Deprecated. Use variant\_details.base\_plan\_id instead. If this is a variant, the ID of the base plan it was created from.
Details about how this variant relates to its latest base plan.
The ID of the base plan this variant was derived from.
The customization that transforms the base plan into this variant.
Base price configuration for a plan.
Base price amount for the plan, in major currency units (e.g. dollars).
Billing interval (e.g. 'month', 'year').
Base price amounts in additional currencies. The base 'amount' is in the org's default currency.
Three-letter Stripe-supported currency code (e.g. 'eur', 'gbp').
Price amount in this currency. Set explicitly per currency, not converted from the base amount.
Items to add to the plan.
Bills this many feature units when outstanding overage reaches it.
The ID of the feature to configure.
Number of free units included. Balance resets to this each interval for consumable features.
If true, customer has unlimited access to this feature.
Whether entity-level grants contribute to a shared customer balance.
Reset configuration for consumable features. Omit for non-consumable features like seats.
Interval at which balance resets (e.g. 'month', 'year'). For consumable features only.
Pricing for usage beyond included units. Omit for free features.
Price per billing\_units after included usage. Either 'amount' or 'tiers' is required.
Amounts in additional currencies for this flat price. The base 'amount' is in the org's default currency. Only valid with 'amount', not 'tiers'.
Three-letter Stripe-supported currency code (e.g. 'eur', 'gbp').
Price amount in this currency. Set explicitly per currency, not converted from the base amount.
Tiered pricing. Either 'amount' or 'tiers' is required.
Three-letter Stripe-supported currency code (e.g. 'eur', 'gbp').
Per-unit amount for this tier in this currency.
Flat amount for this tier in this currency, if the tier uses one.
Billing interval. For consumable features, should match reset.interval.
Number of intervals per billing cycle. Defaults to 1.
Units per price increment. Usage is rounded UP when billed (e.g. billing\_units=100 means 101 rounds to 200).
'prepaid' for upfront payment (seats), 'usage\_based' for pay-as-you-go.
Max units purchasable beyond included. E.g. included=100, max\_purchase=300 allows 400 total. Null for no limit.
Proration settings for prepaid features. Controls mid-cycle quantity change billing.
Billing behavior when quantity increases mid-cycle.
Credit behavior when quantity decreases mid-cycle.
Rollover config for unused units. If set, unused included units carry over.
Max rollover units. Omit for unlimited rollover.
Maximum rollover as a percentage (0-100) of included + prepaid grant. Mutually exclusive with max.
When rolled over units expire.
Number of periods before expiry.
Overrides fields of this item's feature for customers on this plan (e.g. a credit system's credit\_schema).
For credit system features: replaces the feature's credit\_schema entirely for customers on this plan.
ID of the metered feature that draws from this credit system.
Number of metered-feature units priced together. Defaults to one when omitted.
Named rates chosen by event properties. The most specific match sets the rate; with no match the item's own rate applies.
Event properties this entry applies to. Every key must equal the tracked property, compared as strings.
Breaks ties between dimensions that match the same number of keys. Higher wins.
Inclusive upper usage boundary for this graduated tier. The final tier must be 'inf'.
Credits consumed per billing-unit group within this tier.
Named adjustments chosen by event properties. Every match applies: factors multiply, then adds are summed.
Event properties this entry applies to. Every key must equal the tracked property, compared as strings.
Multiplies the matched rate. All matching multipliers stack.
Added to the rate after every factor is applied, in credits per billing-unit group.
Inclusive upper usage boundary for this graduated tier. The final tier must be 'inf'.
Credits consumed per billing-unit group within this tier.
Credits consumed per billing-unit group.
For AI credit system features: replaces the feature's markup chain entirely for customers on this plan. An unset level means no markup at that level rather than inheriting the feature's.
Default percentage markup for customers on this plan. Use -100 to make usage free.
Per-provider markup percentages for customers on this plan.
Per-model markup overrides for customers on this plan.
Filters selecting items to remove from the plan.
Match items linked to this feature.
Match items with this billing method (prepaid or usage\_based).
Match items with this interval. Accepts either a BillingInterval (price-side) or a ResetInterval (reset-side, includes day/hour/minute) so price-less items keyed by reset.interval can be disambiguated.
Match items with this interval\_count. Disambiguates between items that share an interval but differ in count.
Match items whose grant equals this included usage. Omitted is a wildcard.
Free trial configuration for a plan.
Number of duration\_type periods the trial lasts.
Unit of time for the trial ('day', 'month', 'year').
If true, a payment method is required to start the trial and the customer is charged when it ends. Defaults to false.
Override the plan's billing controls (auto top-ups, spend limits, usage limits, usage alerts, overage allowed) for this customer.
The ID of the feature (credit balance) to auto top-up.
Whether auto top-up is enabled.
When the balance drops below this threshold, an auto top-up will be purchased.
Amount of credits to add per auto top-up.
Optional rate limit to cap how often auto top-ups occur. Pass count to set the current window's consumed top-ups.
The time interval for the purchase limit window.
Number of intervals in the purchase limit window.
Maximum number of auto top-ups allowed within the interval.
Set the current window's consumed auto top-up count. Omit to leave runtime state unchanged.
When true, auto top-up creates a send\_invoice invoice instead of auto-charging.
Optional feature ID this spend limit applies to.
Whether the overage spend limit is enabled.
How overage\_limit is interpreted: an absolute overage cap (default) or a percentage of the main-plan allowance.
Overage cap for the feature: absolute units, or a percent (e.g. 120) when limit\_type is usage\_percentage.
When true, overage for this feature is not posted to Stripe. Usage tracking and balance resets still behave normally.
The feature this usage limit applies to.
Whether this usage limit is enabled.
Maximum units allowed per interval.
Interval for the cap, aligned to the customer's billing cycle.
Window alignment. 'billing\_cycle' phases the interval to the customer's renewal time; 'utc' aligns to the UTC calendar.
When set, only usage from events whose properties match counts toward this cap. Omit to count all usage of the feature.
The feature ID this alert applies to.
Whether this usage alert is enabled.
The threshold value that triggers the alert. For usage or remaining, this is an absolute count. For usage\_percentage or remaining\_percentage, this is a percentage (0-100).
Whether the threshold is an absolute count or a percentage of the usage allowance or remaining balance.
What 100% means. balance: every grant on the feature. included: the plan allowance only. recurring: grants that reset. usage\_limit: the cap of the usage limit with the same feature and filter.
Only valid with basis usage\_limit. Points the alert at the usage limit carrying the same filter.
Optional user-defined label to distinguish multiple alerts on the same feature.
The feature ID this overage allowed control applies to.
Whether overage is allowed for this feature.
License links to add or override for this customer, keyed by license\_plan\_id. Omitted fields inherit the plan catalog link (included defaults to 1 when the license is not in the catalog). A bare entry restores the license to pure catalog inheritance.
Base price configuration for a plan.
Base price amount for the plan, in major currency units (e.g. dollars).
Billing interval (e.g. 'month', 'year').
Base price amounts in additional currencies. The base 'amount' is in the org's default currency.
Three-letter Stripe-supported currency code (e.g. 'eur', 'gbp').
Price amount in this currency. Set explicitly per currency, not converted from the base amount.
Bills this many feature units when outstanding overage reaches it.
The ID of the feature to configure.
Number of free units included. Balance resets to this each interval for consumable features.
If true, customer has unlimited access to this feature.
Whether entity-level grants contribute to a shared customer balance.
Reset configuration for consumable features. Omit for non-consumable features like seats.
Interval at which balance resets (e.g. 'month', 'year'). For consumable features only.
Pricing for usage beyond included units. Omit for free features.
Price per billing\_units after included usage. Either 'amount' or 'tiers' is required.
Amounts in additional currencies for this flat price. The base 'amount' is in the org's default currency. Only valid with 'amount', not 'tiers'.
Three-letter Stripe-supported currency code (e.g. 'eur', 'gbp').
Price amount in this currency. Set explicitly per currency, not converted from the base amount.
Tiered pricing. Either 'amount' or 'tiers' is required.
Three-letter Stripe-supported currency code (e.g. 'eur', 'gbp').
Per-unit amount for this tier in this currency.
Flat amount for this tier in this currency, if the tier uses one.
Billing interval. For consumable features, should match reset.interval.
Number of intervals per billing cycle. Defaults to 1.
Units per price increment. Usage is rounded UP when billed (e.g. billing\_units=100 means 101 rounds to 200).
'prepaid' for upfront payment (seats), 'usage\_based' for pay-as-you-go.
Max units purchasable beyond included. E.g. included=100, max\_purchase=300 allows 400 total. Null for no limit.
Proration settings for prepaid features. Controls mid-cycle quantity change billing.
Billing behavior when quantity increases mid-cycle.
Credit behavior when quantity decreases mid-cycle.
Rollover config for unused units. If set, unused included units carry over.
Max rollover units. Omit for unlimited rollover.
Maximum rollover as a percentage (0-100) of included + prepaid grant. Mutually exclusive with max.
When rolled over units expire.
Number of periods before expiry.
Overrides fields of this item's feature for customers on this plan (e.g. a credit system's credit\_schema).
For credit system features: replaces the feature's credit\_schema entirely for customers on this plan.
ID of the metered feature that draws from this credit system.
Number of metered-feature units priced together. Defaults to one when omitted.
Named rates chosen by event properties. The most specific match sets the rate; with no match the item's own rate applies.
Event properties this entry applies to. Every key must equal the tracked property, compared as strings.
Breaks ties between dimensions that match the same number of keys. Higher wins.
Inclusive upper usage boundary for this graduated tier. The final tier must be 'inf'.
Credits consumed per billing-unit group within this tier.
Named adjustments chosen by event properties. Every match applies: factors multiply, then adds are summed.
Event properties this entry applies to. Every key must equal the tracked property, compared as strings.
Multiplies the matched rate. All matching multipliers stack.
Added to the rate after every factor is applied, in credits per billing-unit group.
Inclusive upper usage boundary for this graduated tier. The final tier must be 'inf'.
Credits consumed per billing-unit group within this tier.
Credits consumed per billing-unit group.
For AI credit system features: replaces the feature's markup chain entirely for customers on this plan. An unset level means no markup at that level rather than inheriting the feature's.
Default percentage markup for customers on this plan. Use -100 to make usage free.
Per-provider markup percentages for customers on this plan.
Per-model markup overrides for customers on this plan.
Match items linked to this feature.
Match items with this billing method (prepaid or usage\_based).
Match items with this interval. Accepts either a BillingInterval (price-side) or a ResetInterval (reset-side, includes day/hour/minute) so price-less items keyed by reset.interval can be disambiguated.
Match items with this interval\_count. Disambiguates between items that share an interval but differ in count.
Match items whose grant equals this included usage. Omitted is a wildcard.
License links to drop, keyed by license\_plan\_id. Parallel to remove\_items.
created = new planLicense; updated = row or effective content changed; removed = dropped.
Previous included / prepaid\_only / version. Null when created or removed, or when no row scalar changed.
The exact license-plan version pinned by this link.
Version slug of the license-plan row this link points at.
Number of license assignments included with this plan for free.
Diff of the license's effective plan. Null when created, removed, or the effective content is unchanged.
The plan after the change. Omitted unless the caller expands it.
Unique identifier for the plan.
Display name of the plan.
Optional description of the plan.
Group identifier for organizing related plans. Plans in the same group are mutually exclusive.
Version number of the plan. Incremented when plan configuration changes.
User-facing version identity. Defaults to v\{n} when the version is minted.
Whether this is the active version of the plan. At most one version is active.
Whether this is an add-on plan that can be attached alongside a main plan.
If true, this plan is automatically attached when a customer is created. Used for free plans.
Base recurring price for the plan. Null for free plans or usage-only plans.
Base price amount for the plan, in major currency units (e.g. dollars).
Base price amounts in additional currencies. The base 'amount' is in the org's default currency.
Three-letter Stripe-supported currency code (e.g. 'eur', 'gbp').
Price amount in this currency. Set explicitly per currency, not converted from the base amount.
Billing interval (e.g. 'month', 'year').
Number of intervals per billing cycle. Defaults to 1.
Display text for showing this price in pricing pages.
Main display text (e.g. '\$10' or '100 messages').
Secondary display text (e.g. 'per month' or 'then \$0.5 per 100').
Payment processors this base price is connected to. Omitted when unset.
Stripe price ID. For prepaid with included > 0 this is the V2 price.
Feature configurations included in this plan. Each item defines included units, pricing, and reset behavior for a feature.
Bills this many feature units when outstanding overage reaches it.
The ID of the feature this item configures.
The full feature object if expanded.
The ID of the feature, used to refer to it in other API calls like /track or /check.
The name of the feature.
The type of the feature
Singular and plural display names for the feature.
The singular display name for the feature.
The plural display name for the feature.
Credit cost schema for credit system features.
The ID of the metered feature (should be a single\_use feature).
The credit cost of the metered feature.
Whether or not the feature is archived.
Number of free units included. For consumable features, balance resets to this number each interval.
Whether the customer has unlimited access to this feature.
Whether entity-level grants contribute to a shared customer balance.
Reset configuration for consumable features. Null for non-consumable features like seats where usage persists across billing cycles.
The interval at which the feature balance resets (e.g. 'month', 'year'). For consumable features, usage resets to 0 and included units are restored.
Number of intervals between resets. Defaults to 1.
Pricing configuration for usage beyond included units. Null if feature is entirely free.
Price per billing\_units after included usage is consumed. Mutually exclusive with tiers.
Amounts in additional currencies for this flat price. The base 'amount' is in the org's default currency. Only valid with 'amount', not 'tiers' (tiered prices carry per-currency amounts on each tier).
Three-letter Stripe-supported currency code (e.g. 'eur', 'gbp').
Price amount in this currency. Set explicitly per currency, not converted from the base amount.
Tiered pricing configuration. Each tier's 'to' INCLUDES the included amount. Either 'tiers' or 'amount' is required.
Three-letter Stripe-supported currency code (e.g. 'eur', 'gbp').
Per-unit amount for this tier in this currency.
Flat amount for this tier in this currency, if the tier uses one.
Billing interval for this price. For consumable features, should match reset.interval.
Number of intervals per billing cycle. Defaults to 1.
Number of units per price increment. Usage is rounded UP to the nearest billing\_units when billed (e.g. billing\_units=100 means 101 usage rounds to 200).
'prepaid' for features like seats where customers pay upfront, 'usage\_based' for pay-as-you-go after included usage.
Maximum units a customer can purchase beyond included. E.g. if included=100 and max\_purchase=300, customer can use up to 400 total before usage is capped. Null for no limit.
Payment processors this item price is connected to. Omitted when unset.
Stripe price ID. For prepaid with included > 0 this is the V2 price.
Display text for showing this item in pricing pages.
Main display text (e.g. '\$10' or '100 messages').
Secondary display text (e.g. 'per month' or 'then \$0.5 per 100').
Rollover configuration for unused units. If set, unused included units roll over to the next period.
Maximum rollover units. Null for unlimited rollover.
Maximum rollover as a percentage (0-100) of included + prepaid grant. Mutually exclusive with max.
When rolled over units expire.
Number of periods before expiry.
Overrides fields of this item's feature for customers on this plan (e.g. a credit system's credit\_schema).
For credit system features: replaces the feature's credit\_schema entirely for customers on this plan.
ID of the metered feature that draws from this credit system.
Number of metered-feature units priced together. Defaults to one when omitted.
Named rates chosen by event properties. The most specific match sets the rate; with no match the item's own rate applies.
Event properties this entry applies to. Every key must equal the tracked property, compared as strings.
Breaks ties between dimensions that match the same number of keys. Higher wins.
Inclusive upper usage boundary for this graduated tier. The final tier must be 'inf'.
Credits consumed per billing-unit group within this tier.
Named adjustments chosen by event properties. Every match applies: factors multiply, then adds are summed.
Event properties this entry applies to. Every key must equal the tracked property, compared as strings.
Multiplies the matched rate. All matching multipliers stack.
Added to the rate after every factor is applied, in credits per billing-unit group.
Inclusive upper usage boundary for this graduated tier. The final tier must be 'inf'.
Credits consumed per billing-unit group within this tier.
Credits consumed per billing-unit group.
For AI credit system features: replaces the feature's markup chain entirely for customers on this plan. An unset level means no markup at that level rather than inheriting the feature's.
Default percentage markup for customers on this plan. Use -100 to make usage free.
Per-provider markup percentages for customers on this plan.
Per-model markup overrides for customers on this plan.
Payment processors this plan is connected to. Omitted when unset.
Stripe product ID this plan is billed under.
Extra Stripe product IDs aliased to this plan.
Every RevenueCat product that maps to this plan. Replaces the current set.
RevenueCat product ID that grants this plan when purchased.
Prepaid quantities granted when this specific RevenueCat product is purchased, in feature units.
Free trial configuration. If set, new customers can try this plan before being charged.
Number of duration\_type periods the trial lasts.
Unit of time for the trial duration ('day', 'month', 'year').
Whether a payment method is required to start the trial. If true, customer will be charged after trial ends.
Behavior when the trial ends. 'bill' charges the customer (default). 'revert' expires the trial and restores the customer's previous plan.
Unix timestamp (ms) when the plan was created.
Environment this plan belongs to ('sandbox' or 'live').
Whether the plan is archived. Archived plans cannot be attached to new customers.
Miscellaneous plan-level configuration flags.
If true, entitlements attached to this plan will still reset on schedule even when the customer's product is in a past\_due state.
Plan-level billing controls used as customer defaults.
List of auto top-up configurations per feature.
The ID of the feature (credit balance) to auto top-up.
Whether auto top-up is enabled.
When the balance drops below this threshold, an auto top-up will be purchased.
Amount of credits to add per auto top-up.
Optional rate limit to cap how often auto top-ups occur.
The time interval for the purchase limit window.
Number of intervals in the purchase limit window.
Maximum number of auto top-ups allowed within the interval.
When true, auto top-up creates a send\_invoice invoice instead of auto-charging.
List of overage spend limits per feature (caps overage spend).
Optional feature ID this spend limit applies to.
Whether the overage spend limit is enabled.
How overage\_limit is interpreted: an absolute overage cap (default) or a percentage of the main-plan allowance.
Overage cap for the feature: absolute units, or a percent (e.g. 120) when limit\_type is usage\_percentage.
When true, overage for this feature is not posted to Stripe. Usage tracking and balance resets still behave normally.
List of hard usage caps per feature (max units per interval).
The feature this usage limit applies to.
Whether this usage limit is enabled.
Maximum units allowed per interval.
Interval for the cap, aligned to the customer's billing cycle.
Window alignment. 'billing\_cycle' phases the interval to the customer's renewal time; 'utc' aligns to the UTC calendar.
When set, only usage from events whose properties match counts toward this cap. Omit to count all usage of the feature.
List of usage alert configurations per feature.
The feature ID this alert applies to.
Whether this usage alert is enabled.
The threshold value that triggers the alert. For usage or remaining, this is an absolute count. For usage\_percentage or remaining\_percentage, this is a percentage (0-100).
Whether the threshold is an absolute count or a percentage of the usage allowance or remaining balance.
What 100% means. balance: every grant on the feature. included: the plan allowance only. recurring: grants that reset. usage\_limit: the cap of the usage limit with the same feature and filter.
Only valid with basis usage\_limit. Points the alert at the usage limit carrying the same filter.
Optional user-defined label to distinguish multiple alerts on the same feature.
List of overage allowed controls per feature. When enabled, usage can exceed balance.
The feature ID this overage allowed control applies to.
Whether overage is allowed for this feature.
Arbitrary key-value metadata defined by you for your own use. Shared across all versions of the plan.
Whether the trial on this plan is available to this customer. For example, if the customer used the trial in the past, this will be false.
The customer's current status with this plan. 'active' if attached, 'scheduled' if pending activation.
Whether the customer's active instance of this plan is set to cancel.
Whether the customer is currently on a free trial of this plan.
The action that would occur if this plan were attached to the customer.
Deprecated. Use variant\_details.base\_plan\_id instead. If this is a variant, the ID of the base plan it was created from.
Details about how this variant relates to its latest base plan.
The ID of the base plan this variant was derived from.
The customization that transforms the base plan into this variant.
Base price configuration for a plan.
Base price amount for the plan, in major currency units (e.g. dollars).
Billing interval (e.g. 'month', 'year').
Base price amounts in additional currencies. The base 'amount' is in the org's default currency.
Three-letter Stripe-supported currency code (e.g. 'eur', 'gbp').
Price amount in this currency. Set explicitly per currency, not converted from the base amount.
Items to add to the plan.
Bills this many feature units when outstanding overage reaches it.
The ID of the feature to configure.
Number of free units included. Balance resets to this each interval for consumable features.
If true, customer has unlimited access to this feature.
Whether entity-level grants contribute to a shared customer balance.
Reset configuration for consumable features. Omit for non-consumable features like seats.
Interval at which balance resets (e.g. 'month', 'year'). For consumable features only.
Pricing for usage beyond included units. Omit for free features.
Price per billing\_units after included usage. Either 'amount' or 'tiers' is required.
Amounts in additional currencies for this flat price. The base 'amount' is in the org's default currency. Only valid with 'amount', not 'tiers'.
Three-letter Stripe-supported currency code (e.g. 'eur', 'gbp').
Price amount in this currency. Set explicitly per currency, not converted from the base amount.
Tiered pricing. Either 'amount' or 'tiers' is required.
Three-letter Stripe-supported currency code (e.g. 'eur', 'gbp').
Per-unit amount for this tier in this currency.
Flat amount for this tier in this currency, if the tier uses one.
Billing interval. For consumable features, should match reset.interval.
Number of intervals per billing cycle. Defaults to 1.
Units per price increment. Usage is rounded UP when billed (e.g. billing\_units=100 means 101 rounds to 200).
'prepaid' for upfront payment (seats), 'usage\_based' for pay-as-you-go.
Max units purchasable beyond included. E.g. included=100, max\_purchase=300 allows 400 total. Null for no limit.
Proration settings for prepaid features. Controls mid-cycle quantity change billing.
Billing behavior when quantity increases mid-cycle.
Credit behavior when quantity decreases mid-cycle.
Rollover config for unused units. If set, unused included units carry over.
Max rollover units. Omit for unlimited rollover.
Maximum rollover as a percentage (0-100) of included + prepaid grant. Mutually exclusive with max.
When rolled over units expire.
Number of periods before expiry.
Overrides fields of this item's feature for customers on this plan (e.g. a credit system's credit\_schema).
For credit system features: replaces the feature's credit\_schema entirely for customers on this plan.
ID of the metered feature that draws from this credit system.
Number of metered-feature units priced together. Defaults to one when omitted.
Named rates chosen by event properties. The most specific match sets the rate; with no match the item's own rate applies.
Event properties this entry applies to. Every key must equal the tracked property, compared as strings.
Breaks ties between dimensions that match the same number of keys. Higher wins.
Inclusive upper usage boundary for this graduated tier. The final tier must be 'inf'.
Credits consumed per billing-unit group within this tier.
Named adjustments chosen by event properties. Every match applies: factors multiply, then adds are summed.
Event properties this entry applies to. Every key must equal the tracked property, compared as strings.
Multiplies the matched rate. All matching multipliers stack.
Added to the rate after every factor is applied, in credits per billing-unit group.
Inclusive upper usage boundary for this graduated tier. The final tier must be 'inf'.
Credits consumed per billing-unit group within this tier.
Credits consumed per billing-unit group.
For AI credit system features: replaces the feature's markup chain entirely for customers on this plan. An unset level means no markup at that level rather than inheriting the feature's.
Default percentage markup for customers on this plan. Use -100 to make usage free.
Per-provider markup percentages for customers on this plan.
Per-model markup overrides for customers on this plan.
Filters selecting items to remove from the plan.
Match items linked to this feature.
Match items with this billing method (prepaid or usage\_based).
Match items with this interval. Accepts either a BillingInterval (price-side) or a ResetInterval (reset-side, includes day/hour/minute) so price-less items keyed by reset.interval can be disambiguated.
Match items with this interval\_count. Disambiguates between items that share an interval but differ in count.
Match items whose grant equals this included usage. Omitted is a wildcard.
Free trial configuration for a plan.
Number of duration\_type periods the trial lasts.
Unit of time for the trial ('day', 'month', 'year').
If true, a payment method is required to start the trial and the customer is charged when it ends. Defaults to false.
Override the plan's billing controls (auto top-ups, spend limits, usage limits, usage alerts, overage allowed) for this customer.
The ID of the feature (credit balance) to auto top-up.
Whether auto top-up is enabled.
When the balance drops below this threshold, an auto top-up will be purchased.
Amount of credits to add per auto top-up.
Optional rate limit to cap how often auto top-ups occur. Pass count to set the current window's consumed top-ups.
The time interval for the purchase limit window.
Number of intervals in the purchase limit window.
Maximum number of auto top-ups allowed within the interval.
Set the current window's consumed auto top-up count. Omit to leave runtime state unchanged.
When true, auto top-up creates a send\_invoice invoice instead of auto-charging.
Optional feature ID this spend limit applies to.
Whether the overage spend limit is enabled.
How overage\_limit is interpreted: an absolute overage cap (default) or a percentage of the main-plan allowance.
Overage cap for the feature: absolute units, or a percent (e.g. 120) when limit\_type is usage\_percentage.
When true, overage for this feature is not posted to Stripe. Usage tracking and balance resets still behave normally.
The feature this usage limit applies to.
Whether this usage limit is enabled.
Maximum units allowed per interval.
Interval for the cap, aligned to the customer's billing cycle.
Window alignment. 'billing\_cycle' phases the interval to the customer's renewal time; 'utc' aligns to the UTC calendar.
When set, only usage from events whose properties match counts toward this cap. Omit to count all usage of the feature.
The feature ID this alert applies to.
Whether this usage alert is enabled.
The threshold value that triggers the alert. For usage or remaining, this is an absolute count. For usage\_percentage or remaining\_percentage, this is a percentage (0-100).
Whether the threshold is an absolute count or a percentage of the usage allowance or remaining balance.
What 100% means. balance: every grant on the feature. included: the plan allowance only. recurring: grants that reset. usage\_limit: the cap of the usage limit with the same feature and filter.
Only valid with basis usage\_limit. Points the alert at the usage limit carrying the same filter.
Optional user-defined label to distinguish multiple alerts on the same feature.
The feature ID this overage allowed control applies to.
Whether overage is allowed for this feature.
License links to add or override for this customer, keyed by license\_plan\_id. Omitted fields inherit the plan catalog link (included defaults to 1 when the license is not in the catalog). A bare entry restores the license to pure catalog inheritance.
Base price configuration for a plan.
Base price amount for the plan, in major currency units (e.g. dollars).
Billing interval (e.g. 'month', 'year').
Base price amounts in additional currencies. The base 'amount' is in the org's default currency.
Three-letter Stripe-supported currency code (e.g. 'eur', 'gbp').
Price amount in this currency. Set explicitly per currency, not converted from the base amount.
Bills this many feature units when outstanding overage reaches it.
The ID of the feature to configure.
Number of free units included. Balance resets to this each interval for consumable features.
If true, customer has unlimited access to this feature.
Whether entity-level grants contribute to a shared customer balance.
Reset configuration for consumable features. Omit for non-consumable features like seats.
Interval at which balance resets (e.g. 'month', 'year'). For consumable features only.
Pricing for usage beyond included units. Omit for free features.
Price per billing\_units after included usage. Either 'amount' or 'tiers' is required.
Amounts in additional currencies for this flat price. The base 'amount' is in the org's default currency. Only valid with 'amount', not 'tiers'.
Three-letter Stripe-supported currency code (e.g. 'eur', 'gbp').
Price amount in this currency. Set explicitly per currency, not converted from the base amount.
Tiered pricing. Either 'amount' or 'tiers' is required.
Three-letter Stripe-supported currency code (e.g. 'eur', 'gbp').
Per-unit amount for this tier in this currency.
Flat amount for this tier in this currency, if the tier uses one.
Billing interval. For consumable features, should match reset.interval.
Number of intervals per billing cycle. Defaults to 1.
Units per price increment. Usage is rounded UP when billed (e.g. billing\_units=100 means 101 rounds to 200).
'prepaid' for upfront payment (seats), 'usage\_based' for pay-as-you-go.
Max units purchasable beyond included. E.g. included=100, max\_purchase=300 allows 400 total. Null for no limit.
Proration settings for prepaid features. Controls mid-cycle quantity change billing.
Billing behavior when quantity increases mid-cycle.
Credit behavior when quantity decreases mid-cycle.
Rollover config for unused units. If set, unused included units carry over.
Max rollover units. Omit for unlimited rollover.
Maximum rollover as a percentage (0-100) of included + prepaid grant. Mutually exclusive with max.
When rolled over units expire.
Number of periods before expiry.
Overrides fields of this item's feature for customers on this plan (e.g. a credit system's credit\_schema).
For credit system features: replaces the feature's credit\_schema entirely for customers on this plan.
ID of the metered feature that draws from this credit system.
Number of metered-feature units priced together. Defaults to one when omitted.
Named rates chosen by event properties. The most specific match sets the rate; with no match the item's own rate applies.
Event properties this entry applies to. Every key must equal the tracked property, compared as strings.
Breaks ties between dimensions that match the same number of keys. Higher wins.
Inclusive upper usage boundary for this graduated tier. The final tier must be 'inf'.
Credits consumed per billing-unit group within this tier.
Named adjustments chosen by event properties. Every match applies: factors multiply, then adds are summed.
Event properties this entry applies to. Every key must equal the tracked property, compared as strings.
Multiplies the matched rate. All matching multipliers stack.
Added to the rate after every factor is applied, in credits per billing-unit group.
Inclusive upper usage boundary for this graduated tier. The final tier must be 'inf'.
Credits consumed per billing-unit group within this tier.
Credits consumed per billing-unit group.
For AI credit system features: replaces the feature's markup chain entirely for customers on this plan. An unset level means no markup at that level rather than inheriting the feature's.
Default percentage markup for customers on this plan. Use -100 to make usage free.
Per-provider markup percentages for customers on this plan.
Per-model markup overrides for customers on this plan.
Match items linked to this feature.
Match items with this billing method (prepaid or usage\_based).
Match items with this interval. Accepts either a BillingInterval (price-side) or a ResetInterval (reset-side, includes day/hour/minute) so price-less items keyed by reset.interval can be disambiguated.
Match items with this interval\_count. Disambiguates between items that share an interval but differ in count.
Match items whose grant equals this included usage. Omitted is a wildcard.
License links to drop, keyed by license\_plan\_id. Parallel to remove\_items.
Sparse map of scalar plan fields that changed, holding their previous values. Null when the plan is new.
Unique identifier for the plan.
Display name of the plan.
Optional description of the plan.
Group identifier for organizing related plans. Plans in the same group are mutually exclusive.
Whether this is an add-on plan that can be attached alongside a main plan.
If true, this plan is automatically attached when a customer is created. Used for free plans.
Miscellaneous plan-level configuration flags.
If true, entitlements attached to this plan will still reset on schedule even when the customer's product is in a past\_due state.
Whether this is the active version of the plan. At most one version is active.
Whether the plan is archived. Archived plans cannot be attached to new customers.
Arbitrary key-value metadata defined by you for your own use. Shared across all versions of the plan.
Previous payment processors when they changed. Null when the plan had none.
Stripe product ID this plan is billed under.
Extra Stripe product IDs aliased to this plan.
Every RevenueCat product that maps to this plan. Replaces the current set.
RevenueCat product ID that grants this plan when purchased.
Prepaid quantities granted when this specific RevenueCat product is purchased, in feature units.
Previous free trial when it changed. Null when the plan had none.
Number of duration\_type periods the trial lasts.
Unit of time for the trial duration ('day', 'month', 'year').
Whether a payment method is required to start the trial. If true, customer will be charged after trial ends.
Behavior when the trial ends. 'bill' charges the customer (default). 'revert' expires the trial and restores the customer's previous plan.
Sparse previous billing\_controls — only keys that changed. Null when unset; a null lane was unset before.
List of auto top-up configurations per feature.
The ID of the feature (credit balance) to auto top-up.
Whether auto top-up is enabled.
When the balance drops below this threshold, an auto top-up will be purchased.
Amount of credits to add per auto top-up.
Optional rate limit to cap how often auto top-ups occur.
The time interval for the purchase limit window.
Number of intervals in the purchase limit window.
Maximum number of auto top-ups allowed within the interval.
When true, auto top-up creates a send\_invoice invoice instead of auto-charging.
List of overage spend limits per feature (caps overage spend).
Optional feature ID this spend limit applies to.
Whether the overage spend limit is enabled.
How overage\_limit is interpreted: an absolute overage cap (default) or a percentage of the main-plan allowance.
Overage cap for the feature: absolute units, or a percent (e.g. 120) when limit\_type is usage\_percentage.
When true, overage for this feature is not posted to Stripe. Usage tracking and balance resets still behave normally.
List of hard usage caps per feature (max units per interval).
The feature this usage limit applies to.
Whether this usage limit is enabled.
Maximum units allowed per interval.
Interval for the cap, aligned to the customer's billing cycle.
Window alignment. 'billing\_cycle' phases the interval to the customer's renewal time; 'utc' aligns to the UTC calendar.
When set, only usage from events whose properties match counts toward this cap. Omit to count all usage of the feature.
List of usage alert configurations per feature.
The feature ID this alert applies to.
Whether this usage alert is enabled.
The threshold value that triggers the alert. For usage or remaining, this is an absolute count. For usage\_percentage or remaining\_percentage, this is a percentage (0-100).
Whether the threshold is an absolute count or a percentage of the usage allowance or remaining balance.
What 100% means. balance: every grant on the feature. included: the plan allowance only. recurring: grants that reset. usage\_limit: the cap of the usage limit with the same feature and filter.
Only valid with basis usage\_limit. Points the alert at the usage limit carrying the same filter.
Optional user-defined label to distinguish multiple alerts on the same feature.
List of overage allowed controls per feature. When enabled, usage can exceed balance.
The feature ID this overage allowed control applies to.
Whether overage is allowed for this feature.
Present when the plan's price changed.
Base recurring price for the plan. Null for free plans or usage-only plans.
Base price amount for the plan, in major currency units (e.g. dollars).
Base price amounts in additional currencies. The base 'amount' is in the org's default currency.
Three-letter Stripe-supported currency code (e.g. 'eur', 'gbp').
Price amount in this currency. Set explicitly per currency, not converted from the base amount.
Billing interval (e.g. 'month', 'year').
Number of intervals per billing cycle. Defaults to 1.
Display text for showing this price in pricing pages.
Main display text (e.g. '\$10' or '100 messages').
Secondary display text (e.g. 'per month' or 'then \$0.5 per 100').
Payment processors this base price is connected to. Omitted when unset.
Stripe price ID. For prepaid with included > 0 this is the V2 price.
The plan's price after the change.
Base price amount for the plan, in major currency units (e.g. dollars).
Base price amounts in additional currencies. The base 'amount' is in the org's default currency.
Three-letter Stripe-supported currency code (e.g. 'eur', 'gbp').
Price amount in this currency. Set explicitly per currency, not converted from the base amount.
Billing interval (e.g. 'month', 'year').
Number of intervals per billing cycle. Defaults to 1.
Display text for showing this price in pricing pages.
Main display text (e.g. '\$10' or '100 messages').
Secondary display text (e.g. 'per month' or 'then \$0.5 per 100').
Payment processors this base price is connected to. Omitted when unset.
Stripe price ID. For prepaid with included > 0 this is the V2 price.
Present when the plan's free trial changed.
The plan's free trial before the change. Null when none.
Number of duration\_type periods the trial lasts.
Unit of time for the trial duration ('day', 'month', 'year').
Whether a payment method is required to start the trial. If true, customer will be charged after trial ends.
Behavior when the trial ends. 'bill' charges the customer (default). 'revert' expires the trial and restores the customer's previous plan.
The plan's free trial after the change. Null when none.
Number of duration\_type periods the trial lasts.
Unit of time for the trial duration ('day', 'month', 'year').
Whether a payment method is required to start the trial. If true, customer will be charged after trial ends.
Behavior when the trial ends. 'bill' charges the customer (default). 'revert' expires the trial and restores the customer's previous plan.
Feature items added to or removed from the plan.
Whether the item was added to or removed from the plan.
The ID of the feature that was added or removed.
The plan item snapshot that was added or removed.
Bills this many feature units when outstanding overage reaches it.
The ID of the feature this item configures.
The full feature object if expanded.
The ID of the feature, used to refer to it in other API calls like /track or /check.
The name of the feature.
The type of the feature
Singular and plural display names for the feature.
The singular display name for the feature.
The plural display name for the feature.
Credit cost schema for credit system features.
The ID of the metered feature (should be a single\_use feature).
The credit cost of the metered feature.
Whether or not the feature is archived.
Number of free units included. For consumable features, balance resets to this number each interval.
Whether the customer has unlimited access to this feature.
Whether entity-level grants contribute to a shared customer balance.
Reset configuration for consumable features. Null for non-consumable features like seats where usage persists across billing cycles.
The interval at which the feature balance resets (e.g. 'month', 'year'). For consumable features, usage resets to 0 and included units are restored.
Number of intervals between resets. Defaults to 1.
Pricing configuration for usage beyond included units. Null if feature is entirely free.
Price per billing\_units after included usage is consumed. Mutually exclusive with tiers.
Amounts in additional currencies for this flat price. The base 'amount' is in the org's default currency. Only valid with 'amount', not 'tiers' (tiered prices carry per-currency amounts on each tier).
Three-letter Stripe-supported currency code (e.g. 'eur', 'gbp').
Price amount in this currency. Set explicitly per currency, not converted from the base amount.
Tiered pricing configuration. Each tier's 'to' INCLUDES the included amount. Either 'tiers' or 'amount' is required.
Three-letter Stripe-supported currency code (e.g. 'eur', 'gbp').
Per-unit amount for this tier in this currency.
Flat amount for this tier in this currency, if the tier uses one.
Billing interval for this price. For consumable features, should match reset.interval.
Number of intervals per billing cycle. Defaults to 1.
Number of units per price increment. Usage is rounded UP to the nearest billing\_units when billed (e.g. billing\_units=100 means 101 usage rounds to 200).
'prepaid' for features like seats where customers pay upfront, 'usage\_based' for pay-as-you-go after included usage.
Maximum units a customer can purchase beyond included. E.g. if included=100 and max\_purchase=300, customer can use up to 400 total before usage is capped. Null for no limit.
Payment processors this item price is connected to. Omitted when unset.
Stripe price ID. For prepaid with included > 0 this is the V2 price.
Display text for showing this item in pricing pages.
Main display text (e.g. '\$10' or '100 messages').
Secondary display text (e.g. 'per month' or 'then \$0.5 per 100').
Rollover configuration for unused units. If set, unused included units roll over to the next period.
Maximum rollover units. Null for unlimited rollover.
Maximum rollover as a percentage (0-100) of included + prepaid grant. Mutually exclusive with max.
When rolled over units expire.
Number of periods before expiry.
Overrides fields of this item's feature for customers on this plan (e.g. a credit system's credit\_schema).
For credit system features: replaces the feature's credit\_schema entirely for customers on this plan.
ID of the metered feature that draws from this credit system.
Number of metered-feature units priced together. Defaults to one when omitted.
Named rates chosen by event properties. The most specific match sets the rate; with no match the item's own rate applies.
Event properties this entry applies to. Every key must equal the tracked property, compared as strings.
Breaks ties between dimensions that match the same number of keys. Higher wins.
Inclusive upper usage boundary for this graduated tier. The final tier must be 'inf'.
Credits consumed per billing-unit group within this tier.
Named adjustments chosen by event properties. Every match applies: factors multiply, then adds are summed.
Event properties this entry applies to. Every key must equal the tracked property, compared as strings.
Multiplies the matched rate. All matching multipliers stack.
Added to the rate after every factor is applied, in credits per billing-unit group.
Inclusive upper usage boundary for this graduated tier. The final tier must be 'inf'.
Credits consumed per billing-unit group within this tier.
Credits consumed per billing-unit group.
For AI credit system features: replaces the feature's markup chain entirely for customers on this plan. An unset level means no markup at that level rather than inheriting the feature's.
Default percentage markup for customers on this plan. Use -100 to make usage free.
Per-provider markup percentages for customers on this plan.
Per-model markup overrides for customers on this plan.
Params that would transform the previous plan into the current one. Omitted when nothing customizable changed.
Base price configuration for a plan.
Base price amount for the plan, in major currency units (e.g. dollars).
Billing interval (e.g. 'month', 'year').
Base price amounts in additional currencies. The base 'amount' is in the org's default currency.
Three-letter Stripe-supported currency code (e.g. 'eur', 'gbp').
Price amount in this currency. Set explicitly per currency, not converted from the base amount.
Items to add to the plan.
Bills this many feature units when outstanding overage reaches it.
The ID of the feature to configure.
Number of free units included. Balance resets to this each interval for consumable features.
If true, customer has unlimited access to this feature.
Whether entity-level grants contribute to a shared customer balance.
Reset configuration for consumable features. Omit for non-consumable features like seats.
Interval at which balance resets (e.g. 'month', 'year'). For consumable features only.
Pricing for usage beyond included units. Omit for free features.
Price per billing\_units after included usage. Either 'amount' or 'tiers' is required.
Amounts in additional currencies for this flat price. The base 'amount' is in the org's default currency. Only valid with 'amount', not 'tiers'.
Three-letter Stripe-supported currency code (e.g. 'eur', 'gbp').
Price amount in this currency. Set explicitly per currency, not converted from the base amount.
Tiered pricing. Either 'amount' or 'tiers' is required.
Three-letter Stripe-supported currency code (e.g. 'eur', 'gbp').
Per-unit amount for this tier in this currency.
Flat amount for this tier in this currency, if the tier uses one.
Billing interval. For consumable features, should match reset.interval.
Number of intervals per billing cycle. Defaults to 1.
Units per price increment. Usage is rounded UP when billed (e.g. billing\_units=100 means 101 rounds to 200).
'prepaid' for upfront payment (seats), 'usage\_based' for pay-as-you-go.
Max units purchasable beyond included. E.g. included=100, max\_purchase=300 allows 400 total. Null for no limit.
Proration settings for prepaid features. Controls mid-cycle quantity change billing.
Billing behavior when quantity increases mid-cycle.
Credit behavior when quantity decreases mid-cycle.
Rollover config for unused units. If set, unused included units carry over.
Max rollover units. Omit for unlimited rollover.
Maximum rollover as a percentage (0-100) of included + prepaid grant. Mutually exclusive with max.
When rolled over units expire.
Number of periods before expiry.
Overrides fields of this item's feature for customers on this plan (e.g. a credit system's credit\_schema).
For credit system features: replaces the feature's credit\_schema entirely for customers on this plan.
ID of the metered feature that draws from this credit system.
Number of metered-feature units priced together. Defaults to one when omitted.
Named rates chosen by event properties. The most specific match sets the rate; with no match the item's own rate applies.
Event properties this entry applies to. Every key must equal the tracked property, compared as strings.
Breaks ties between dimensions that match the same number of keys. Higher wins.
Inclusive upper usage boundary for this graduated tier. The final tier must be 'inf'.
Credits consumed per billing-unit group within this tier.
Named adjustments chosen by event properties. Every match applies: factors multiply, then adds are summed.
Event properties this entry applies to. Every key must equal the tracked property, compared as strings.
Multiplies the matched rate. All matching multipliers stack.
Added to the rate after every factor is applied, in credits per billing-unit group.
Inclusive upper usage boundary for this graduated tier. The final tier must be 'inf'.
Credits consumed per billing-unit group within this tier.
Credits consumed per billing-unit group.
For AI credit system features: replaces the feature's markup chain entirely for customers on this plan. An unset level means no markup at that level rather than inheriting the feature's.
Default percentage markup for customers on this plan. Use -100 to make usage free.
Per-provider markup percentages for customers on this plan.
Per-model markup overrides for customers on this plan.
Filters selecting items to remove from the plan.
Match items linked to this feature.
Match items with this billing method (prepaid or usage\_based).
Match items with this interval. Accepts either a BillingInterval (price-side) or a ResetInterval (reset-side, includes day/hour/minute) so price-less items keyed by reset.interval can be disambiguated.
Match items with this interval\_count. Disambiguates between items that share an interval but differ in count.
Match items whose grant equals this included usage. Omitted is a wildcard.
Free trial configuration for a plan.
Number of duration\_type periods the trial lasts.
Unit of time for the trial ('day', 'month', 'year').
If true, a payment method is required to start the trial and the customer is charged when it ends. Defaults to false.
Override the plan's billing controls (auto top-ups, spend limits, usage limits, usage alerts, overage allowed) for this customer.
The ID of the feature (credit balance) to auto top-up.
Whether auto top-up is enabled.
When the balance drops below this threshold, an auto top-up will be purchased.
Amount of credits to add per auto top-up.
Optional rate limit to cap how often auto top-ups occur. Pass count to set the current window's consumed top-ups.
The time interval for the purchase limit window.
Number of intervals in the purchase limit window.
Maximum number of auto top-ups allowed within the interval.
Set the current window's consumed auto top-up count. Omit to leave runtime state unchanged.
When true, auto top-up creates a send\_invoice invoice instead of auto-charging.
Optional feature ID this spend limit applies to.
Whether the overage spend limit is enabled.
How overage\_limit is interpreted: an absolute overage cap (default) or a percentage of the main-plan allowance.
Overage cap for the feature: absolute units, or a percent (e.g. 120) when limit\_type is usage\_percentage.
When true, overage for this feature is not posted to Stripe. Usage tracking and balance resets still behave normally.
The feature this usage limit applies to.
Whether this usage limit is enabled.
Maximum units allowed per interval.
Interval for the cap, aligned to the customer's billing cycle.
Window alignment. 'billing\_cycle' phases the interval to the customer's renewal time; 'utc' aligns to the UTC calendar.
When set, only usage from events whose properties match counts toward this cap. Omit to count all usage of the feature.
The feature ID this alert applies to.
Whether this usage alert is enabled.
The threshold value that triggers the alert. For usage or remaining, this is an absolute count. For usage\_percentage or remaining\_percentage, this is a percentage (0-100).
Whether the threshold is an absolute count or a percentage of the usage allowance or remaining balance.
What 100% means. balance: every grant on the feature. included: the plan allowance only. recurring: grants that reset. usage\_limit: the cap of the usage limit with the same feature and filter.
Only valid with basis usage\_limit. Points the alert at the usage limit carrying the same filter.
Optional user-defined label to distinguish multiple alerts on the same feature.
The feature ID this overage allowed control applies to.
Whether overage is allowed for this feature.
License links to add or override for this customer, keyed by license\_plan\_id. Omitted fields inherit the plan catalog link (included defaults to 1 when the license is not in the catalog). A bare entry restores the license to pure catalog inheritance.
Base price configuration for a plan.
Base price amount for the plan, in major currency units (e.g. dollars).
Billing interval (e.g. 'month', 'year').
Base price amounts in additional currencies. The base 'amount' is in the org's default currency.
Three-letter Stripe-supported currency code (e.g. 'eur', 'gbp').
Price amount in this currency. Set explicitly per currency, not converted from the base amount.
Bills this many feature units when outstanding overage reaches it.
The ID of the feature to configure.
Number of free units included. Balance resets to this each interval for consumable features.
If true, customer has unlimited access to this feature.
Whether entity-level grants contribute to a shared customer balance.
Reset configuration for consumable features. Omit for non-consumable features like seats.
Interval at which balance resets (e.g. 'month', 'year'). For consumable features only.
Pricing for usage beyond included units. Omit for free features.
Price per billing\_units after included usage. Either 'amount' or 'tiers' is required.
Amounts in additional currencies for this flat price. The base 'amount' is in the org's default currency. Only valid with 'amount', not 'tiers'.
Three-letter Stripe-supported currency code (e.g. 'eur', 'gbp').
Price amount in this currency. Set explicitly per currency, not converted from the base amount.
Tiered pricing. Either 'amount' or 'tiers' is required.
Three-letter Stripe-supported currency code (e.g. 'eur', 'gbp').
Per-unit amount for this tier in this currency.
Flat amount for this tier in this currency, if the tier uses one.
Billing interval. For consumable features, should match reset.interval.
Number of intervals per billing cycle. Defaults to 1.
Units per price increment. Usage is rounded UP when billed (e.g. billing\_units=100 means 101 rounds to 200).
'prepaid' for upfront payment (seats), 'usage\_based' for pay-as-you-go.
Max units purchasable beyond included. E.g. included=100, max\_purchase=300 allows 400 total. Null for no limit.
Proration settings for prepaid features. Controls mid-cycle quantity change billing.
Billing behavior when quantity increases mid-cycle.
Credit behavior when quantity decreases mid-cycle.
Rollover config for unused units. If set, unused included units carry over.
Max rollover units. Omit for unlimited rollover.
Maximum rollover as a percentage (0-100) of included + prepaid grant. Mutually exclusive with max.
When rolled over units expire.
Number of periods before expiry.
Overrides fields of this item's feature for customers on this plan (e.g. a credit system's credit\_schema).
For credit system features: replaces the feature's credit\_schema entirely for customers on this plan.
ID of the metered feature that draws from this credit system.
Number of metered-feature units priced together. Defaults to one when omitted.
Named rates chosen by event properties. The most specific match sets the rate; with no match the item's own rate applies.
Event properties this entry applies to. Every key must equal the tracked property, compared as strings.
Breaks ties between dimensions that match the same number of keys. Higher wins.
Inclusive upper usage boundary for this graduated tier. The final tier must be 'inf'.
Credits consumed per billing-unit group within this tier.
Named adjustments chosen by event properties. Every match applies: factors multiply, then adds are summed.
Event properties this entry applies to. Every key must equal the tracked property, compared as strings.
Multiplies the matched rate. All matching multipliers stack.
Added to the rate after every factor is applied, in credits per billing-unit group.
Inclusive upper usage boundary for this graduated tier. The final tier must be 'inf'.
Credits consumed per billing-unit group within this tier.
Credits consumed per billing-unit group.
For AI credit system features: replaces the feature's markup chain entirely for customers on this plan. An unset level means no markup at that level rather than inheriting the feature's.
Default percentage markup for customers on this plan. Use -100 to make usage free.
Per-provider markup percentages for customers on this plan.
Per-model markup overrides for customers on this plan.
Match items linked to this feature.
Match items with this billing method (prepaid or usage\_based).
Match items with this interval. Accepts either a BillingInterval (price-side) or a ResetInterval (reset-side, includes day/hour/minute) so price-less items keyed by reset.interval can be disambiguated.
Match items with this interval\_count. Disambiguates between items that share an interval but differ in count.
Match items whose grant equals this included usage. Omitted is a wildcard.
License links to drop, keyed by license\_plan\_id. Parallel to remove\_items.
Deprecated — use plan\_change.item\_changes. Features that were added to or removed from this plan.
Whether the item was added to or removed from the plan.
The ID of the feature that was added or removed.
The plan item snapshot that was added or removed.
Bills this many feature units when outstanding overage reaches it.
The ID of the feature this item configures.
The full feature object if expanded.
The ID of the feature, used to refer to it in other API calls like /track or /check.
The name of the feature.
The type of the feature
Singular and plural display names for the feature.
The singular display name for the feature.
The plural display name for the feature.
Credit cost schema for credit system features.
The ID of the metered feature (should be a single\_use feature).
The credit cost of the metered feature.
Whether or not the feature is archived.
Number of free units included. For consumable features, balance resets to this number each interval.
Whether the customer has unlimited access to this feature.
Whether entity-level grants contribute to a shared customer balance.
Reset configuration for consumable features. Null for non-consumable features like seats where usage persists across billing cycles.
The interval at which the feature balance resets (e.g. 'month', 'year'). For consumable features, usage resets to 0 and included units are restored.
Number of intervals between resets. Defaults to 1.
Pricing configuration for usage beyond included units. Null if feature is entirely free.
Price per billing\_units after included usage is consumed. Mutually exclusive with tiers.
Amounts in additional currencies for this flat price. The base 'amount' is in the org's default currency. Only valid with 'amount', not 'tiers' (tiered prices carry per-currency amounts on each tier).
Three-letter Stripe-supported currency code (e.g. 'eur', 'gbp').
Price amount in this currency. Set explicitly per currency, not converted from the base amount.
Tiered pricing configuration. Each tier's 'to' INCLUDES the included amount. Either 'tiers' or 'amount' is required.
Three-letter Stripe-supported currency code (e.g. 'eur', 'gbp').
Per-unit amount for this tier in this currency.
Flat amount for this tier in this currency, if the tier uses one.
Billing interval for this price. For consumable features, should match reset.interval.
Number of intervals per billing cycle. Defaults to 1.
Number of units per price increment. Usage is rounded UP to the nearest billing\_units when billed (e.g. billing\_units=100 means 101 usage rounds to 200).
'prepaid' for features like seats where customers pay upfront, 'usage\_based' for pay-as-you-go after included usage.
Maximum units a customer can purchase beyond included. E.g. if included=100 and max\_purchase=300, customer can use up to 400 total before usage is capped. Null for no limit.
Payment processors this item price is connected to. Omitted when unset.
Stripe price ID. For prepaid with included > 0 this is the V2 price.
Display text for showing this item in pricing pages.
Main display text (e.g. '\$10' or '100 messages').
Secondary display text (e.g. 'per month' or 'then \$0.5 per 100').
Rollover configuration for unused units. If set, unused included units roll over to the next period.
Maximum rollover units. Null for unlimited rollover.
Maximum rollover as a percentage (0-100) of included + prepaid grant. Mutually exclusive with max.
When rolled over units expire.
Number of periods before expiry.
Overrides fields of this item's feature for customers on this plan (e.g. a credit system's credit\_schema).
For credit system features: replaces the feature's credit\_schema entirely for customers on this plan.
ID of the metered feature that draws from this credit system.
Number of metered-feature units priced together. Defaults to one when omitted.
Named rates chosen by event properties. The most specific match sets the rate; with no match the item's own rate applies.
Event properties this entry applies to. Every key must equal the tracked property, compared as strings.
Breaks ties between dimensions that match the same number of keys. Higher wins.
Inclusive upper usage boundary for this graduated tier. The final tier must be 'inf'.
Credits consumed per billing-unit group within this tier.
Named adjustments chosen by event properties. Every match applies: factors multiply, then adds are summed.
Event properties this entry applies to. Every key must equal the tracked property, compared as strings.
Multiplies the matched rate. All matching multipliers stack.
Added to the rate after every factor is applied, in credits per billing-unit group.
Inclusive upper usage boundary for this graduated tier. The final tier must be 'inf'.
Credits consumed per billing-unit group within this tier.
Credits consumed per billing-unit group.
For AI credit system features: replaces the feature's markup chain entirely for customers on this plan. An unset level means no markup at that level rather than inheriting the feature's.
Default percentage markup for customers on this plan. Use -100 to make usage free.
Per-provider markup percentages for customers on this plan.
Per-model markup overrides for customers on this plan.
Reason tags describing why this event fired (e.g. 'trial\_ended', 'phase\_changed'). Always present; empty when no specific reason applies.
# Invoice Finalized
Source: https://docs.useautumn.com/api-reference/webhooks/invoiceFinalized
api/openapi.yml webhook invoice.finalized
Fired when a Stripe invoice is finalized and its line items have been reconciled. The body is the invoice as returned by `invoices.list`, with `items` populated and each item carrying a per-entity `entities` breakdown.
### Payload Fields
Array of plan IDs included in this invoice
The Stripe invoice ID
The billing processor that owns this invoice.
The status of the invoice
The total amount of the invoice
The currency code for the invoice
Timestamp when the invoice was created
URL to the Stripe-hosted invoice page
The Autumn invoice ID
The ID of the customer this invoice belongs to. Null for customers created without an ID.
The ID of the entity this invoice belongs to, if entity-scoped
The amount paid on the invoice. Null on invoices recorded before amounts paid were tracked.
The total amount refunded on the invoice
Line items on the invoice, one per line as shown in Stripe. Capped at 100. Empty for invoices recorded before line item storage.
Description of the invoice line item
Timestamp when the billing period starts
Timestamp when the billing period ends
The plan this line item came from. Null for lines with no Autumn plan behind them.
The ID of the feature associated with this line item
The name of the feature associated with this line item
Quantity actually charged on this line. Null on fixed-price lines.
Amount charged on this line, pre-discount and pre-tax. Negative for credits.
How this line splits by entity. Empty for customer-level lines. Only populated for invoices finalized after entity attribution shipped.
The entity this share of the line item is attributed to
Quantity charged to this entity. Null on fixed-price lines.
Amount attributed to this entity, pre-discount and pre-tax
# Resource Deleted
Source: https://docs.useautumn.com/api-reference/webhooks/vercelResourcesDeleted
api/openapi.yml webhook vercel.resources.deleted
When a Vercel resource is deleted, you'll need to handle de-provisioning any API keys or other non-Autumn controlled data for this user.
### Payload Fields
The resource that was deleted.
The unique identifier of the deleted resource.
The Vercel integration configuration ID.
# Resource Provisioned
Source: https://docs.useautumn.com/api-reference/webhooks/vercelResourcesProvisioned
api/openapi.yml webhook vercel.resources.provisioned
When a Vercel resource is created, you'll need to provision a secret key for your service. Then you can use the provided access token to patch the resource's secrets.
### Payload Fields
The resource that was provisioned.
The unique identifier of the provisioned resource.
The display name of the provisioned resource.
The Vercel integration configuration ID.
An access token that can be used to patch the resource's secrets.
# Rotate Secrets
Source: https://docs.useautumn.com/api-reference/webhooks/vercelResourcesRotateSecrets
api/openapi.yml webhook vercel.resources.rotate_secrets
This event is sent when Vercel requires a resource's secrets to be rotated.
### Payload Fields
The resource whose secrets should be rotated.
The unique identifier of the resource.
The Vercel integration configuration ID.
The raw request body from Vercel's rotation request.
# Webhook Event
Source: https://docs.useautumn.com/api-reference/webhooks/vercelWebhooksEvent
api/openapi.yml webhook vercel.webhooks.event
Passthrough webhook for Vercel events.
### Payload Fields
The Vercel integration configuration ID.
The raw Vercel webhook event payload.
# Changelog
Source: https://docs.useautumn.com/changelog/changelog
Some new things we've shipped at Autumn HQ
## `atmn` 2.0
The new [`atmn` CLI](/cli/getting-started) is out of nightly and published as `atmn@2`. `atmn init` sets up a repo in one go: it connects to Autumn (sign in, or keyless with no account), creates an `autumn/` folder with `autumn.config.ts`, `features.ts`, `plans.ts` and `rewards.ts`, adds `atmn` to your `package.json`, pulls your existing catalog and installs the agent skills. `atmn push` always previews first and applies with `--yes`. A new `atmn api` command calls any public endpoint from the terminal. Coupons, feature grants, referral programs and organization settings can now be declared in the config alongside features and plans. Configs from `atmn` 1.x are refused with a message pointing at the upgrade steps; see [upgrading from 1.x](/cli/getting-started#upgrading-from-1x). The [CLI reference](/cli/commands) and [config reference](/cli/config) are rewritten for the release.
## Rate cards and dimensions for everyone
Billing units, graduated tiers, per-row dimensions and plan-item rate-card overrides are no longer admin-only in the dashboard. Dimensions now live inside each rate-card row: **Add dimension** sits beside **Add Tier** and reveals that row's tables, a populated row shows its tables with a **Remove dimensions** action, and collapsed rows count their dimensions. Picking a feature on a new row opens it for editing straight away, and the only row in a rate card can be removed (an empty card is still rejected on save). The Stripe product field has left the feature sheets; feature-level Stripe products are managed through the CLI mappings. Customizing a customer's rate card from the dashboard now reaches the server: plan diffs compare and carry `feature_override`. The CLI config reference and the [credit systems guide](/documentation/modelling-pricing/credit-systems#rate-cards-and-dimensions) document billing units, tiers, dimensions and multipliers — [#3413](https://github.com/useautumn/autumn/pull/3413)
## Credit dimensions and multipliers
[Credit systems](/documentation/modelling-pricing/credit-systems) can now price a single feature at different rates based on event properties. Each rate-card row accepts named `dimensions` that match on properties (with a flat or graduated rate and optional priority) and `multipliers` that scale the rate by a factor or additive adjustment. The most specific matching dimension sets the rate, multipliers scale it, and the winning dimension becomes the usage-attribution key. `check`, `track`, and `finalize` all price by the event's properties, invoice credits bill one line per (feature, dimension) with the dimension named on the line, and the dashboard rate-card editor gains a **Dimensions** switch with per-row editors. Rate cards, dimensions, and multipliers are validated at save time — ambiguous same-specificity dimensions and multipliers that could drive the price negative are rejected. `credit_schema` items round-trip `dimensions` and `multipliers` (with `credit_cost` naming) through the API and the `atmn` CLI — [#3216](https://github.com/useautumn/autumn/pull/3216), [#3217](https://github.com/useautumn/autumn/pull/3217), [#3218](https://github.com/useautumn/autumn/pull/3218), [#3220](https://github.com/useautumn/autumn/pull/3220), [#3226](https://github.com/useautumn/autumn/pull/3226), [#3228](https://github.com/useautumn/autumn/pull/3228)
## Threshold billing
Plan items accept a new optional `threshold_billing: { threshold }` config that triggers a charge each time usage crosses the threshold. Crossing a threshold charges exactly one chunk (leaving the remainder), and a failed threshold invoice marks the product `past_due` and blocks usage on that plan until the invoice is paid. Prepaid, unlimited, and tiered pricing are rejected; positive thresholds only. The config carries through the API, persistence, and comparison paths — [#3331](https://github.com/useautumn/autumn/pull/3331), [#3332](https://github.com/useautumn/autumn/pull/3332)
## The new `atmn` CLI
The new [`atmn`](/cli/getting-started) CLI (in nightly, since released as `atmn@2`) manages your catalog — features, plans, plan versions, rewards, referral programs, and a subset of org settings — as TypeScript. `atmn init` scaffolds auth, config path, an initial pull, and a skills folder in one command. `atmn push` takes a config all the way to a live catalog (preview → render → apply), with `--dry-run` stopping after preview. `atmn pull` restores plans and versions with stable `internalId`s, elides values equal to their spec default, and refuses to touch dynamic (non-literal) fixtures. Push backfills minted IDs into fixtures so round-trips preserve identity. Config-wide linting runs up-front and reports every problem at once with field breadcrumbs. `atmn env` prints the resolved organization, environment, user, key, sandbox, and server URL. A new `settings` block manages org config flags PATCH-shaped, and `atmn sandbox use` switches sandboxes. Bundled skills scaffold hint-based prompting with `--headless`/`-c` — [#3235](https://github.com/useautumn/autumn/pull/3235), [#3254](https://github.com/useautumn/autumn/pull/3254), [#3261](https://github.com/useautumn/autumn/pull/3261), [#3262](https://github.com/useautumn/autumn/pull/3262), [#3266](https://github.com/useautumn/autumn/pull/3266), [#3330](https://github.com/useautumn/autumn/pull/3330), [#3335](https://github.com/useautumn/autumn/pull/3335), [#3351](https://github.com/useautumn/autumn/pull/3351), [#3360](https://github.com/useautumn/autumn/pull/3360), [#3370](https://github.com/useautumn/autumn/pull/3370), [#3374](https://github.com/useautumn/autumn/pull/3374)
## Writable usage counters
Customer and entity update endpoints now persist explicitly supplied `usage` values to durable usage windows in the same transaction as any limit-config change. `UsageLimitUpdateSchema` accepts writable usage-limit updates, including usage-only entries (`feature_id` + `usage`) that reject limit-configuration fields. Positive usage without a configured limit returns a 400. Customer billing sheets in the dashboard now let you set current usage when creating or editing usage limits, including plan-inherited caps — [#3339](https://github.com/useautumn/autumn/pull/3339), [#3340](https://github.com/useautumn/autumn/pull/3340), [#3342](https://github.com/useautumn/autumn/pull/3342)
## API v2.4: leaner customer reads and paged lists
From API v2.4, customer-level reads no longer fold in entity subscriptions and balances — use the entities endpoints when you need them — and every list endpoint caps page size at 200. API v2.3 keeps the previous behavior via version gating — [#3271](https://github.com/useautumn/autumn/pull/3271)
* [Rewards and referral programs](/documentation/modelling-pricing/rewards) can now be declared in `atmn` config and managed by `atmn push`; free-product and invoice-credit rewards are intentionally out of scope and left untouched — [#3330](https://github.com/useautumn/autumn/pull/3330)
* Trial expiry now also fires [`customer.products.updated`](/api-reference/webhooks/billingUpdated) with `scenario: expired` (previously only `billing.updated` `trial_ended`), so downstream listeners see the fallback plan take effect — [#3353](https://github.com/useautumn/autumn/pull/3353)
* `check.lock` accepts a new `overage_behavior` of `reject` (default, unchanged), `cap`, or `overflow`; the choice is persisted on the lock receipt and honoured by `finalize` for over-lock deductions — [#3359](https://github.com/useautumn/autumn/pull/3359)
* The OAuth allowlist now includes `customers:write`, `features:write`, `plans:write`, and `apiKeys:write`, so the new `atmn` login no longer fails with `invalid_scope` — [#3354](https://github.com/useautumn/autumn/pull/3354)
* The plan-level `allow_overdue_entitlements` opt-out is removed; overdue access blocking is now purely org-level, and past-due plans are blocked whenever the org block is on. Requests containing the removed field fail validation — [#3352](https://github.com/useautumn/autumn/pull/3352)
* The per-feature auto-top-up attempt limit moves into Rate Limit Overrides as `auto_topup_attempts` (default 2 per 10 minutes); existing `maxAutoTopupAttempts` values are not migrated and silently fall back to default — [#3357](https://github.com/useautumn/autumn/pull/3357), [#3327](https://github.com/useautumn/autumn/pull/3327), [#3329](https://github.com/useautumn/autumn/pull/3329)
* Catalog features can be addressed by a nullable `internal_id` in `catalogV2.update` for stable references across renames (a differing `feature_id` is a rename, an unknown id returns 400). Previews and results include `internal_id` for features and plans — [#3263](https://github.com/useautumn/autumn/pull/3263)
* Analytics `bin_size=month` queries are served from new monthly rollups for complete calendar months, reading hourly rollups only for the partial months at either end. Non-UTC viewers hit the same path because month bins now request UTC (period labels are unchanged), and custom date ranges gain week and month granularity — [#3376](https://github.com/useautumn/autumn/pull/3376), [#3377](https://github.com/useautumn/autumn/pull/3377)
* Expired plan balances now appear in the dashboard when the Plans filter includes **Expired** (view-only), and expired loose balances render greyed out when `include_expired_loose` is set. API responses are unchanged — [#3066](https://github.com/useautumn/autumn/pull/3066)
* Consumed standalone balances with a scheduled reset stay in the customer dashboard's active view; zero-balance standalone entitlements are classified as expired only when `next_reset_at` is null. Drained standalone entitlements now also appear in the dashboard's Expired view — [#3325](https://github.com/useautumn/autumn/pull/3325), [#3326](https://github.com/useautumn/autumn/pull/3326), [#3323](https://github.com/useautumn/autumn/pull/3323)
* The dashboard uses a standalone balance's external ID as its source label when no plan is attached (e.g. goodwill), falling back to **No plan** only when the external ID is missing — [#3356](https://github.com/useautumn/autumn/pull/3356)
* A new customer-scoped rate limit caps `POST /v1/entities.list` at 10 rps per customer (the org-wide 50 rps cap remains), so a single large customer can no longer saturate the database with expensive entity-list queries — [#3273](https://github.com/useautumn/autumn/pull/3273)
* Paid invoice-credit plans no longer add an empty metered credit row to Stripe renewal invoices when a fixed recurring item on the same customer product supplies the same interval. Existing subscriptions pick up the removal on their next subscription-item update; historical invoices are unchanged — [#3379](https://github.com/useautumn/autumn/pull/3379)
* Retrying `attach` or `multi_attach` against an existing open invoice now returns that invoice and its `payment_url` instead of a 409 conflict, resuming the original payment rather than creating a replacement — [#3364](https://github.com/useautumn/autumn/pull/3364)
* Catalog `new_version` push no longer fails with "historical version has customers" when an unpromoted draft version sits above the active row; the active row can mint new versions again — [#3362](https://github.com/useautumn/autumn/pull/3362)
* Pooled license grants are now derived from purchased seats × per-seat grant, including unassigned capacity, instead of only assigned-seat contributions. Usage is preserved across quantity changes, resets, and scheduled activation. License-quantity updates fall back to the catalog credit when stored invoice rows lag behind the pool, and a free parent plan linked to an unpriced pooled license plan now mints its pooled balance on every default-plan path — [#3272](https://github.com/useautumn/autumn/pull/3272), [#3321](https://github.com/useautumn/autumn/pull/3321), [#3316](https://github.com/useautumn/autumn/pull/3316)
* When a plan has both a recurring and a one-off prepaid price for the same feature, `feature_quantities` now applies only to the recurring one, fixing a double-charge/double-grant on attach and mis-routing on update — [#3243](https://github.com/useautumn/autumn/pull/3243)
* Catalog push now rejects up front when a coupon references a plan being renamed or removed in the same request, preventing partially-applied writes where the rename committed and the reward writer then threw — [#3348](https://github.com/useautumn/autumn/pull/3348)
* Variant license overlays (`customize.remove_licenses` / `upsert_licenses`) round-trip through catalog reads and diffs, so `atmn pull` and repeated pushes no longer lose `remove_licenses` or spuriously re-add links. Slug-less nested `variants[]` entries resolve against the base row they sit under, and the CLI backfills `internalId` and `versionSlug` onto inline variants on push and pull — [#3347](https://github.com/useautumn/autumn/pull/3347), [#3344](https://github.com/useautumn/autumn/pull/3344), [#3346](https://github.com/useautumn/autumn/pull/3346)
## Usage alerts can measure what you choose
Usage alerts gain a `basis` field that defines what 100% means: the full `balance` (the default, unchanged), the plan's `included` grants, `recurring` grants, or a `usage_limit` window, plus an optional filter that targets a specific usage limit. The [`balances.usage_alert_triggered`](/api-reference/webhooks/balancesUsageAlertTriggered) webhook now carries the alert's basis and the measured window, and [`balances.limit_reached`](/api-reference/webhooks/balancesLimitReached) includes a `usage_limit` block describing the blocking cap with its live window bounds. The dashboard adds a **Measured against** dropdown on plan, customer, and entity alert forms. Existing alerts keep the `balance` behavior with no migration required.
## Map plans to existing Stripe and RevenueCat products
Catalog plans now accept a `processors` object so Autumn can reuse your existing Stripe catalog instead of minting new objects. Set `processors.stripe` once on a plan and the product mapping fans out to every version and variant, supply a `price_id` to adopt an existing Stripe price (unknown IDs return a 400 instead of silently minting a replacement), or pass `null` to unlink a mapping. RevenueCat product mappings move into the same envelope via `processors.revenuecat`. The dashboard plan page gains a plan-level Stripe product mapping and per-version Stripe price pickers under Advanced.
## Full-state catalog pushes and stable row IDs
Catalog rows now carry a stable `internal_id`, so configs that rename a `plan_id` or `version_slug` keep addressing the same row (the old plan ID survives as an alias). One update request can state multiple versions of the same plan at once, and unknown version slugs mint a new version instead of returning a 400. Setting `skip_deletions: false` treats the payload as the complete desired catalog: omitted plans and features are removed, restating an archived plan revives it, and `skip_plan_ids` / `skip_feature_ids` exempt entries from removal.
## Plans show as pending before payment
Plans attached via Stripe Checkout or invoice mode with `enable_plan_immediately: false` now appear on the customer immediately with a new `Pending` status, instead of being invisible until payment lands. A pending plan grants nothing; it promotes to active when the invoice is paid or the checkout session completes, and expires if the invoice is voided or the session expires.
## Custom rate cards per plan
Plan items on [credit systems](/documentation/modelling-pricing/credit-systems) accept a new `feature_override`, letting a plan reprice or re-member a credit schema without forking the feature. Overrides are honored across track and check rates, membership, subscription updates, and invoice credits. The plan editor gains a **Custom rate card** section, and customer balances show a read-only view of the override.
## Pooled balances for license plans
License plans now support pooled balances: each license link mints a pool, and all seats under it contribute to one shared balance that check, track, resets, and rollovers read like any other. Seat adds, removals, and amount changes flow through, and reducing seat quantity shrinks the pool by expiring unused seats first. The `atmn` CLI also round-trips `pooled` and `entityFeatureId` on plan items through push and pull.
* The attach sheet now defaults trial-end behavior to **Revert to previous plan** instead of billing, with an explanatory **On trial end** select replacing the old checkbox; plans setting `on_end: "bill"` are still respected — [#3190](https://github.com/useautumn/autumn/pull/3190)
* The Add Reward modal can now find coupons by pasting a Stripe promotion code, discount amounts are formatted as currency, and the applied-coupon chip gains a details tooltip — [#3237](https://github.com/useautumn/autumn/pull/3237)
* The credit-system rate card editor is redesigned into accordion rows with compact summaries ("1 credit per 100 messages") that expand into a full editor — [#3204](https://github.com/useautumn/autumn/pull/3204)
* Catalog license links now stay anchored to the exact child version they were created against, pinnable via `version_slug`; variant propagation is pin-only (the `propagate.*.versioning` strategies are removed in favor of explicit version pins), and the plan page adds per-version variant propagation plus a persistent all-variants view — [#3166](https://github.com/useautumn/autumn/pull/3166), [#3167](https://github.com/useautumn/autumn/pull/3167), [#3168](https://github.com/useautumn/autumn/pull/3168)
* The balance edit sheet explains that manual edits are one-off adjustments that reset on the next cycle, with a tooltip pointing to lasting alternatives — [#3140](https://github.com/useautumn/autumn/pull/3140)
* `rewards:read` and `rewards:write` join the default OAuth resource scopes, so MCP and OAuth clients can list and create rewards; a Rewards row appears in the scope selector — [#3143](https://github.com/useautumn/autumn/pull/3143)
* Usage tracked just before a Stripe invoice, subscription, or checkout webhook no longer appears to revert: pending balance deductions are flushed to Postgres before the cached customer view is refreshed — [#3230](https://github.com/useautumn/autumn/pull/3230), [#3232](https://github.com/useautumn/autumn/pull/3232)
* Expired Stripe Checkout sessions now invalidate the cached customer, so plans attached with `enable_product_immediately` no longer linger as phantom active plans — [#3241](https://github.com/useautumn/autumn/pull/3241)
* Cancelling a plan pending on a checkout session clears the checkout reservation, so re-attaching opens a fresh session instead of returning an expired payment link — [#3238](https://github.com/useautumn/autumn/pull/3238)
* Custom-price checkouts no longer crash on completion, and `customer.products.updated` / `billing.updated` webhooks again include the activated paid plan after checkout — [#3225](https://github.com/useautumn/autumn/pull/3225), [#3214](https://github.com/useautumn/autumn/pull/3214)
* A RevenueCat renewal of a past-due cancelled product now clears the stale cancellation fields instead of reporting the live subscription as cancelled — [#3171](https://github.com/useautumn/autumn/pull/3171)
* Cancelling a RevenueCat-managed subscription from the dashboard with **No Billing Changes** no longer returns a 409; Autumn-only cancels bypass the external-provider guard — [#3208](https://github.com/useautumn/autumn/pull/3208)
* Current-billing-cycle analytics now use the exact stored cycle boundaries instead of treating the cycle as a rolling window — [#3179](https://github.com/useautumn/autumn/pull/3179)
* Concurrent lazy usage-window resets no longer stampede the same rows and time out check requests; each customer's roll is guarded by a lock — [#3187](https://github.com/useautumn/autumn/pull/3187)
* License plan transitions reset entitlement usage to the incoming grant unless carry-over is enabled, editing a linked license plan's items no longer fails with a foreign-key error, and [`plans.list`](/api-reference/plans/listPlans) includes license prices when classifying upgrades vs downgrades — [#3255](https://github.com/useautumn/autumn/pull/3255), [#3233](https://github.com/useautumn/autumn/pull/3233), [#3236](https://github.com/useautumn/autumn/pull/3236)
* Sequential seat quantity updates no longer double-count historical refunds when reconstructing prorated invoice credits — [#3256](https://github.com/useautumn/autumn/pull/3256)
* Editing one phase of a generated billing schedule no longer replaces or loses other phases, custom prices, or a requested first-phase start date — [#3203](https://github.com/useautumn/autumn/pull/3203), [#3211](https://github.com/useautumn/autumn/pull/3211)
* The attach review sheet no longer claims to be "pausing" the outgoing plan on plain upgrades with no trial configured — [#3206](https://github.com/useautumn/autumn/pull/3206)
* The customer page's Plans table grows with the selected page size instead of adding an inner scrollbar — [#3198](https://github.com/useautumn/autumn/pull/3198)
* Prepaid prices no longer incorrectly inherit a Stripe usage meter from a reused product-only price match — [#3146](https://github.com/useautumn/autumn/pull/3146)
* The customer page no longer shows the RevenueCat badge when a customer only has expired RevenueCat-backed products — [#3018](https://github.com/useautumn/autumn/pull/3018)
## Plan versions in the dashboard
The plan page now lets you work with [versions](/documentation/customers/versioning) directly. A version selector lists every version with its slug and marks the active one, **Promote to active** moves the pointer to an older version without editing content, and version slugs are editable under **More settings**. When a plan change mints a new version, the dialog asks for the new version's slug up front and surfaces slug collisions in the preview instead of failing on save.
## Rename plan IDs without breaking API calls
Renaming a plan's ID (e.g. `pro` → `pro-new`) now keeps the old ID as an alias, so existing API calls, request bodies, and Stripe checkout metadata that reference the old ID keep resolving. Responses always return the live ID. Renaming again replaces the previous alias, and the dashboard's plan change dialog explains which alias will stop working before you confirm.
## Stripe pass-through params on subscription updates
[`billing.update`](/api-reference/billing/billingUpdate) and [`billing.multi_update`](/api-reference/billing/multiUpdate) accept a new `subscription_params` object that is forwarded onto the underlying Stripe `subscriptions.update` or `subscriptions.cancel` call, with Autumn-owned keys winning any collisions. Multi-update also accepts `refund_last_payment` at the request root for cancel-immediately updates, applying the refund across every update in the call.
## Stripe Prices are reused across customers
When two customers on the same plan end up with identical pricing — including matching custom fixed, usage-based, and prepaid prices — Autumn now reuses the existing Stripe Price instead of minting a duplicate, keeping your Stripe catalog clean. Minted Stripe Prices are also named by kind (Base, Prepaid, Usage-based), and only genuine attach-time customizations get a `(custom)` suffix.
## Trials no longer require a card by default
New [free trials](/documentation/modelling-pricing/trials) default to `card_required: false`, and the card requirement is now visible where the trial is configured. A top-level `free_trial` on [`billing.attach`](/api-reference/billing/attach) is honoured instead of being silently dropped, and free plans no longer report `card_required: true` when signup never asks for a card.
## Default net terms for invoice-mode billing
Organizations billing via `send_invoice` can set a `default_net_terms_days` org setting that fills in `days_until_due` on generated invoices when neither the request nor the invoice template specifies net terms. Precedence is request `net_terms_days` → invoice template → org default → the unchanged 30-day fallback, and it applies across attach, multi-attach, updates, schedules, and plan migrations.
* Analytics usage charts now support pinned tooltips: click a bar to pin it, and when grouped by customer or entity, tooltip rows link straight to the customer or entity page — [#3083](https://github.com/useautumn/autumn/pull/3083)
* [`billing.multi_attach`](/api-reference/billing/multiAttach) supports `billing_cycle_anchor: "now"` to reset the billing cycle, with a matching toggle under More Options in the dashboard attach sheet — [#2986](https://github.com/useautumn/autumn/pull/2986), [#2987](https://github.com/useautumn/autumn/pull/2987)
* Unlimited usage is now surfaced in API responses instead of being hidden behind a null balance — [#2970](https://github.com/useautumn/autumn/pull/2970)
* The customer list's Balance filter and Features sort now default to the `usage` basis, and unlimited balances get consistent semantics per basis: usage counts real consumption on unlimited rows, while remaining/granted comparisons handle unlimited holders explicitly — [#3065](https://github.com/useautumn/autumn/pull/3065), [#3026](https://github.com/useautumn/autumn/pull/3026)
* The customer products Status filter is now a multi-select with a combined active + expired view — [#2957](https://github.com/useautumn/autumn/pull/2957)
* A product scheduled to cancel now offers **Cancel Immediately** and **Manage Cancellation** in its row actions, so you no longer have to uncancel first and cancel again — [#3134](https://github.com/useautumn/autumn/pull/3134), [#3135](https://github.com/useautumn/autumn/pull/3135)
* MCP OAuth now supports named sandboxes: the consent screen's environment picker lists them, and issued credentials stay bound to the selected sandbox across refreshes — [#3025](https://github.com/useautumn/autumn/pull/3025)
* The Verify Stripe sheet's shared-customer warning now links each colliding Autumn customer by name instead of listing plain IDs — [#2953](https://github.com/useautumn/autumn/pull/2953)
* `atmn push` now forwards `archived: true` from `autumn.config.ts`, so `atmn pull` → `atmn push` round-trips archived plans correctly — [#3009](https://github.com/useautumn/autumn/pull/3009)
* Renaming a plan's version slug in the dashboard no longer silently mints a new version; metadata-only saves now edit the existing version — [#3110](https://github.com/useautumn/autumn/pull/3110)
* [`billing.updated`](/api-reference/webhooks/billingUpdated) webhooks now carry `entity_id` when a scheduled downgrade on an entity-scoped plan takes effect, not just on the original cancel call — [#3062](https://github.com/useautumn/autumn/pull/3062)
* The analytics usage chart keeps idle periods on the x-axis, so a 30-day range with usage in only 5 days renders all 30 buckets — [#3032](https://github.com/useautumn/autumn/pull/3032)
* Cancelling at end of cycle with a scheduled downgrade now correctly attaches the free default plan — [#3027](https://github.com/useautumn/autumn/pull/3027)
* `proration_behavior: "none"` is treated as a no-op on new subscriptions instead of returning a 400 — [#2980](https://github.com/useautumn/autumn/pull/2980)
* Billing controls now persist when cleared from Plan Settings, and creating a control no longer fails when a lane was previously unset — [#3004](https://github.com/useautumn/autumn/pull/3004), [#3005](https://github.com/useautumn/autumn/pull/3005)
* Catalog updates no longer fail with a foreign-key error when expired customers still reference a plan's items — [#3095](https://github.com/useautumn/autumn/pull/3095)
* Plan grant changes during migrations only rewrite balances that match the original allowance, so customized grants are preserved instead of duplicated — [#2965](https://github.com/useautumn/autumn/pull/2965)
* Auto top-ups hold their billing lock for the full charge and extend queue visibility, closing a race that could double-charge on message redelivery — [#2962](https://github.com/useautumn/autumn/pull/2962)
* Legacy rollover caps of `max: 0` are treated as uncapped when saving a plan instead of failing validation — [#2955](https://github.com/useautumn/autumn/pull/2955)
* The per-unit selector in graduated pricing tier rows no longer collapses to an unreadable sliver — [#3099](https://github.com/useautumn/autumn/pull/3099)
* The Export customers sheet shows the correct customer count again — [#2967](https://github.com/useautumn/autumn/pull/2967)
## Deduction aggregations on events.aggregate
[`events.aggregate`](/api-reference/events/aggregateEvents) now accepts `aggregate_on: "deducted"` alongside a `customer_id` and returns a per-balance breakdown of what each tracked feature actually consumed from each balance. Existing usage totals are unchanged, `group_by` and `max_groups` still apply (overflow rolls up as `Other`), and the customer analytics view has a new toggle to chart the breakdown directly.
## UTC-anchored usage limits
Usage limits can now reset on the UTC calendar instead of the customer's billing cycle. Set `anchor: "utc"` on any limit (or flip **Anchor to UTC time** in the plan editor or customer usage-limit sheet) and the window uses calendar bounds, doesn't refill on plan changes, and takes precedence when two same-rate limits tie. Existing limits keep the `billing_cycle` behavior with no migration required.
## Expire plans during an attach
[`billing.attach`](/api-reference/billing/attach) accepts a new `remove_plan_ids` array so you can expire one or more active plans in the same call that adds a new one. Removals respect the attach's entity scope, run in a single reconciliation with Stripe, and can act as the carry-over source for usage and balances when there is no same-group predecessor. The attach sheet in the dashboard has a matching **Remove a product** picker next to **Add another product**, with inline greying for plans already being replaced or queued for removal.
## Choose payment methods on Autumn invoices
Organizations on invoice mode (`send_invoice`) can now pick which payment methods appear on the Stripe invoices Autumn generates. **Settings → Invoices → Payment methods** exposes a multi-select for card, bank transfer, ACH, SEPA, Bacs, Canadian pre-authorized debit, and Link. The selection is applied via `payment_settings.payment_method_types` on every invoice the subscription generates. Leaving the setting untouched preserves your Stripe account defaults exactly as before.
## Stripe sync verification in the dashboard
Customer pages now auto-run `billing.verify` in the background and surface a header warning icon only when drift is detected. Clicking it opens a **Verify Stripe** sheet with an **In sync / Warning / Mismatched** badge per subscription and a compact table of the exact fields that differ. The sheet also flags an account-level warning when more than one Autumn customer points at the same Stripe customer and lists the colliding IDs. You can also now clear a customer's Stripe ID by passing `null` or `""` through [`customers.update`](/api-reference/customers/updateCustomer).
* `rollovers[].granted` is now returned on balance responses across check, track, `trackTokens`, import, customer, and entity endpoints so you can see the original rolled-over amount before consumption — [#2671](https://github.com/useautumn/autumn/pull/2671)
* Customer expand now supports `invoice_previews`, returning preview line items and discounts inline — [#2671](https://github.com/useautumn/autumn/pull/2671)
* Create-schedule accepts `unscheduled_plans` (`preserve_add_ons` is deprecated and ignored) — [#2671](https://github.com/useautumn/autumn/pull/2671)
* Feature grants now accept `0` explicitly; only negative amounts are rejected, and boolean features skip allowance entirely — [#2671](https://github.com/useautumn/autumn/pull/2671)
* [`customers.list`](/api-reference/customers/listCustomers) now accepts `sort_order`, and the dashboard customers table exposes created-at sorting — [#2662](https://github.com/useautumn/autumn/pull/2662)
* Customer balance sheet adds a **Pooling** criteria filter so you can slice per-entity vs pooled balances — [#2810](https://github.com/useautumn/autumn/pull/2810)
* Flags now render as a plain section label when a customer has no catalog features, and the Flags/Full Catalog tabs only appear when there is catalog to switch to — [#2690](https://github.com/useautumn/autumn/pull/2690)
* Customer export menu and the created-date filter chip are re-aligned to shared list-action styling, with a clearer active-range label — [#2693](https://github.com/useautumn/autumn/pull/2693)
* Check requests are more resilient under load: the fail-open budget now counts middleware time, and slow primary-pool hydrations race a delayed backup read on the general pool so a single slow lookup no longer trips the timeout — [#2800](https://github.com/useautumn/autumn/pull/2800), [#2721](https://github.com/useautumn/autumn/pull/2721)
* Failed-check fallbacks now log an explicit reason (`route_timeout`, `org_rate_limit`, or `dependency_error`) so you can tell why a check failed open — [#2800](https://github.com/useautumn/autumn/pull/2800)
* SQS workers wait for Redis warmup and settle in-flight requests before shutdown, eliminating spurious `SQS batch accumulator is shutting down` rejections around deploys and recycles — [#2691](https://github.com/useautumn/autumn/pull/2691), [#2695](https://github.com/useautumn/autumn/pull/2695), [#2702](https://github.com/useautumn/autumn/pull/2702)
* Retained entitlements now reset their cycle anchor when a subscription update resets the billing cycle, and reinitialize usage from the final plan when `carry_over_usages.enabled` is `false`; scheduled cancellations are preserved — [#2804](https://github.com/useautumn/autumn/pull/2804)
* `additional_currencies` is now included on feature price items so multi-currency prices round-trip through types and comparators correctly — [#2799](https://github.com/useautumn/autumn/pull/2799)
* Customer balance cells no longer render `0 used` for empty entitlements or `+0 overage` for fully spent prepaid packs; only genuinely negative balances enter the used / overage label — [#2719](https://github.com/useautumn/autumn/pull/2719)
* `atmn` CLI login (1.1.20+) no longer fails with `invalid_scope` when requesting the new `rewards:read` / `rewards:write` scopes — [#2796](https://github.com/useautumn/autumn/pull/2796)
* Variant base plan links are preserved when copying between environments so pulled catalogs stay linked — [#2640](https://github.com/useautumn/autumn/pull/2640)
* `atmn pull` now preserves an explicit variant removal filter `intervalCount: 1` so the generated config round-trips cleanly through `atmn push` — [#2689](https://github.com/useautumn/autumn/pull/2689)
## Pooled balances
A single balance can now be shared across every entity on a customer. Toggle **Pooled balance** on any finite metered plan item and per-entity grants flow into one shared pool that every entity draws down from. Pools reset on the parent subscription's `invoice.created`, on lazy schedules, or never — matching the entitlement lifecycle you already picked — and rollovers carry over cleanly across plan changes and trials. Pooled entitlements show up under `pooled_customer_entitlements` in [`customers.get`](/api-reference/customers/getCustomer), and you can list every contributing entity through the new `pooled_balances.list_contributions` endpoint.
## Scoped multi-plan attach
[`billing.multi_attach`](/api-reference/billing/multiAttach) and [`billing.multi_attach.preview`](/api-reference/billing/previewMultiAttach) now support explicit scopes on each plan you send. Choose `inherited`, `customer`, or `per_entity` per plan to control who a plan attaches to across an entity tree, and Autumn plans the schedule so parent and entity-level plans stay consistent through a single billing action.
## Product-scoped license discounts
Coupons and discounts can now target specific licensed products, and Autumn keeps them applied through every subsequent update. Percent and fixed discounts stack in the same order as your preview, refunds and upgrades pull credits from the stored discounted invoice rows instead of recomputing them, and Stripe subscription updates preserve the original `percent_off` so your dashboard and invoices stay in sync.
## Reliable Stripe webhook processing
Load-bearing Stripe webhooks — `checkout.session.completed`, cycle `invoice.created`, `invoice.paid`, `customer.updated`, and non-Autumn subscription events — now acknowledge Stripe only after processing succeeds, so a failed webhook is automatically retried instead of being silently dropped. Any early-acked failures are also replayed through a durable queue, and Autumn-originated Stripe calls carry an idempotency key so we never process our own writes as inbound events.
## Fixed duplicate checkout subscriptions
A rare race where an attach could produce two active Stripe subscriptions is now closed. Checkout reservations live for the full session lifetime (matching Stripe's `expires_at`), same-parameter [`billing.attach`](/api-reference/billing/attach) retries return the pending Checkout URL instead of creating a new session, and `checkout.session.completed` now serializes with in-flight attaches under a shared billing lock. Repeated attaches with different parameters expire any unpaid session first, then proceed.
* License seat assignment is now idempotent — retrying a batch that already contains assigned entities returns success without consuming pool capacity — [#2414](https://github.com/useautumn/autumn/pull/2414)
* Negative balances now carry over into the new plan when `carry_over_balances` is enabled, so any prior overage reduces the new allowance instead of being dropped — [#2431](https://github.com/useautumn/autumn/pull/2431)
* Track events are now batched into a single SQS send per batch, cutting per-event overhead and improving throughput under bursty usage — [#2489](https://github.com/useautumn/autumn/pull/2489)
* Async Track processing can be enabled per organization from the admin dashboard, replacing the previous hardcoded allowlist — [#2375](https://github.com/useautumn/autumn/pull/2375)
* Auto top-up jobs now retry when they hit a billing lock instead of dropping the run — [#2416](https://github.com/useautumn/autumn/pull/2416)
* Stripe imports now recognize product aliases in your catalog mappings, so linked products keep their references across renames — [#2500](https://github.com/useautumn/autumn/pull/2500)
* Tiered price hydration is now consistent across attach, update, and preview flows — [#2500](https://github.com/useautumn/autumn/pull/2500)
* New `.well-known/oauth-protected-resource` endpoint improves OAuth discovery for MCP clients — [#2500](https://github.com/useautumn/autumn/pull/2500)
* Billing verification now separates identity, shape, and totals mismatches into `warn` vs `error` severities so real drift is easier to spot — [#2500](https://github.com/useautumn/autumn/pull/2500)
* Dashboard Edge Config admin now shows live per-config status (paused queues, ramp percentages, blocked orgs) at a glance — [#2406](https://github.com/useautumn/autumn/pull/2406)
* Entity usage is no longer double-counted when a customer has overlapping add-ons — entities already covered by an active product are excluded from add-on aggregation — [#2496](https://github.com/useautumn/autumn/pull/2496)
* MCP OAuth refresh now stays within the originally granted scopes and no longer forwards a `resource` parameter that some issuers reject — [#2501](https://github.com/useautumn/autumn/pull/2501)
* Unknown `.well-known/*` requests return `404` instead of the 401 session-auth error — [#2499](https://github.com/useautumn/autumn/pull/2499)
* Property-rollup completeness now checks event counts (not net sums), so gate-dropped groups are detected correctly — [#2491](https://github.com/useautumn/autumn/pull/2491)
* Stranded checkout reservations after out-of-order `invoice.paid` and `checkout.session.completed` webhooks are now released, ending sporadic 423 lock errors on the next attach — [#2433](https://github.com/useautumn/autumn/pull/2433)
* Partial SQS batch-delete failures now retry only the failed entries with bounded backoff, so successful jobs are no longer redelivered — [#2415](https://github.com/useautumn/autumn/pull/2415)
* Stripe writes now carry idempotency keys so transient retries can't accidentally create duplicate sessions or transfers — [#2500](https://github.com/useautumn/autumn/pull/2500)
* Batch balance resets warn at 30 minutes and give up at 45 to avoid indefinite stalls behind a wedged message — [#2416](https://github.com/useautumn/autumn/pull/2416)
## License plan customization & propagation
License plans are now fully customizable per parent. You can override items, prices, and included seat counts on individual license plans, and Autumn rebases those overrides automatically when the base license plan changes — Stripe items and subscription lifecycle stay in sync. [`plans.update`](/api-reference/plans/updatePlan) accepts a `licenses[].customize` block per parent, and responses now include the effective `customize` payload on each license link. Pair with the new `include_license_parents` on [`plans.preview_update`](/api-reference/plans/updatePlan) to see downstream impacts before saving.
## Overflow tracking on usage
[`track`](/api-reference/core/track), [`track_tokens`](/api-reference/core/trackTokens), and [`batchTrack`](/api-reference/core/batchTrack) now accept `overage_behavior: "overflow"`, deducting the full amount past zero and letting balances go negative. Usage-window caps are bypassed, but customer and entity spend limits still clamp — useful when you want to record real usage even when a customer has run out of included balance.
## Writable auto top-up purchase counter
You can now reset or set the runtime purchase counter for [auto top-ups](/documentation/modelling-pricing/auto-top-ups) directly through [`customers.update`](/api-reference/customers/updateCustomer). Pass `billing_controls.auto_topups[].purchase_limit.count` to nudge or reset a customer's purchase count without waiting for the interval to roll over. `count > limit` is rejected with a clean 400, and active windows are preserved.
## Automatic recovery for failed customer creation
Customer create and get-or-create requests that hit rate limits or transient database/Redis errors are now automatically queued and replayed in the background, with globally serialized concurrency and deterministic dedupe. Requests come back with their original semantics and Autumn records whether the replay created or fetched the customer — no more one-off failures during traffic spikes.
## License transitions & drop handling
Plan transitions that drop a license pool (e.g. Team → Pro) now release the affected seat assignments and restore pool capacity in a single atomic step, unblocking migrations that previously errored out. The Attach Product preview warns you when a transition will remove licenses and lists the entities that will be released. Assignments carried across matched successor pools stay intact.
* License catalog updates preview and apply cleanly across parent-plan versioning and in-place edits, preserving existing customer license definitions — [#2288](https://github.com/useautumn/autumn/pull/2288)
* Row-batched license transitions preserve quantities, billing state, and Stripe linkage across immediate and scheduled changes — [#2306](https://github.com/useautumn/autumn/pull/2306)
* Child license plan propagation now previews linked parent-plan impacts and supports explicit propagation targets — [#2295](https://github.com/useautumn/autumn/pull/2295)
* Auto top-up thresholds can now be negative, so you can trigger top-ups once a balance dips below zero — [#2354](https://github.com/useautumn/autumn/pull/2354)
* New Stripe customers imported via `stripe_id` on customer creation now pull in eligible subscriptions and schedules automatically — [#2308](https://github.com/useautumn/autumn/pull/2308)
* Customer dashboard plan filters now resolve in milliseconds instead of tens of seconds on large orgs — [#2362](https://github.com/useautumn/autumn/pull/2362)
* Create-schedule previews now show unavoidable immediate charges (initial subscription lines, automatic tax, invoice credits) so previews match the final invoice — [#2329](https://github.com/useautumn/autumn/pull/2329)
* Attach form plan-schedule preview now defaults to **immediate** when unset, matching the UI — [#2345](https://github.com/useautumn/autumn/pull/2345)
* Long checkout URLs in the dashboard truncate from the end with a proper ellipsis instead of clipping both sides — [#2344](https://github.com/useautumn/autumn/pull/2344)
* License assignments are now treated as active only when their pool link has an active parent, so dropped and matched pool transitions behave consistently — [#2353](https://github.com/useautumn/autumn/pull/2353)
* Same-batch customized license plan previews no longer crash on virtual catalog products (empty prices/entitlements) — [#2343](https://github.com/useautumn/autumn/pull/2343)
* Catalog sync tolerates partial product collections, missing entitlements, and missing prices without erroring — [#2317](https://github.com/useautumn/autumn/pull/2317), [#2319](https://github.com/useautumn/autumn/pull/2319), [#2322](https://github.com/useautumn/autumn/pull/2322), [#2324](https://github.com/useautumn/autumn/pull/2324)
* Versioned license schedules and matched plan versions are preserved through Stripe sync — [#2297](https://github.com/useautumn/autumn/pull/2297), [#2284](https://github.com/useautumn/autumn/pull/2284)
* OAuth organization list deduplicates when a user has multiple memberships in the same org — [#2346](https://github.com/useautumn/autumn/pull/2346)
* MCP `getCurrentOrganization` schema now matches the `organization/me` API response, adding `id` and tolerating a missing `user` — [#2140](https://github.com/useautumn/autumn/pull/2140)
* Rate limits on establish routes now return a standard `429` (no `Retry-After`); check and track routes still fail open — [#2384](https://github.com/useautumn/autumn/pull/2384)
* Concurrent migrations no longer duplicate customer plans — [#2282](https://github.com/useautumn/autumn/pull/2282)
* Versioned license pricing renders correctly in the plan dashboard — [#2291](https://github.com/useautumn/autumn/pull/2291)
## Multi-currency pricing and billing
Plans can now be priced in **multiple currencies** end-to-end. Add `base_currency` and `additional_currencies` to any fixed, tiered, or usage-based price, and customers get billed in their resolved currency across checkout, invoices, top-ups, refunds, upgrades, and previews. Customers pick up a `currency` field that locks on their first paid attach — pass `currency` on [`billing.attach`](/api-reference/billing/attach) or [`billing.multi_attach`](/api-reference/billing/multiAttach) to choose, and attaches in a different currency return a clean `currency_mismatch` 400. Reach out to enable the `multi_currency` org flag.
## Licenses
The full **licenses** stack is live: plans can offer other plans as assignable seats with `included` free counts, prepaid seat quantities, and per-customer overrides. New endpoints — [`licenses.attach`](/api-reference/licenses/attachLicense), [`licenses.release`](/api-reference/licenses/releaseLicense), [`licenses.list`](/api-reference/licenses/listLicenses), and [`licenses.list_assignments`](/api-reference/licenses/listLicenseAssignments) — let you provision, release, and inspect seats on entities, with balance tracking and dashboard management for the whole lifecycle. Priced licenses require the license plan to be attached to the customer first (via [`billing.attach`](/api-reference/billing/attach)); free licenses assign directly.
## List invoices endpoint
Fetch a customer's invoices programmatically with the new [`invoices.list`](/api-reference/invoices/listInvoices) endpoint — the same data the dashboard uses, now available on the API for building portals, reconciliation flows, and audit tooling.
## Pay down overages on one-off add-ons
One-off prepaid add-ons now **pay down existing overages** at attach time, so a customer who's already over their included balance immediately settles the outstanding usage on their next invoice instead of waiting for the cycle to close. Behavior is gated by the price's `persist_free_overage` flag for finer control.
## Back-sync carry usage on Stripe imports
When you import an existing Stripe subscription that's mid-cycle on a usage feature, Autumn now **carries the already-consumed usage** into the new customer product so balances line up with what the customer has actually used, instead of resetting on import.
## Invoice-mode start for usage-in-arrears
Subscriptions with usage-in-arrears pricing can now be started directly in **invoice mode** — useful for large customers you're billing outside checkout — without needing a card on file up front.
## Attach-time currency selection
The [`billing.attach`](/api-reference/billing/attach) flow now accepts a `currency` parameter, and dashboard attach/preview sheets show amounts in the customer's currency. Pair with multi-currency plans to sell in EUR, GBP, or any additional currency you configure.
* Rollovers now carry to the best-candidate bucket on plan updates, so leftover balance doesn't disappear when you switch a customer between plans — [#2266](https://github.com/useautumn/autumn/pull/2266)
* Multi-currency plan updates work through preview, save, and migration flows — [#2236](https://github.com/useautumn/autumn/pull/2236)
* Multi-currency Stripe sync now imports historical subscriptions in their original currency — [#2227](https://github.com/useautumn/autumn/pull/2227)
* Attach schedule now always defaults to **immediate**, so plans go live on save unless you explicitly schedule them — [#2232](https://github.com/useautumn/autumn/pull/2232)
* Analytics dashboard refetches on window focus, so numbers stay fresh when you tab back in — [#2241](https://github.com/useautumn/autumn/pull/2241)
* `billing.updated` webhooks now fire after the Stripe customer ID is persisted, so downstream consumers always see the linked Stripe record — [#2267](https://github.com/useautumn/autumn/pull/2267)
* Plan **variants** now stamp their own `previous_price` history, so each variant keeps an independent price trail — [#2238](https://github.com/useautumn/autumn/pull/2238)
* Consent screen shows the Autumn brand logo in the org selector — [#2249](https://github.com/useautumn/autumn/pull/2249)
* Faster reset cron and invoice cron for large workspaces — [#2222](https://github.com/useautumn/autumn/pull/2222), [#2257](https://github.com/useautumn/autumn/pull/2257)
* Coupon **scope** updates now apply cleanly to existing subscriptions instead of only new ones — [#2260](https://github.com/useautumn/autumn/pull/2260)
* Catalog updates that reference customers across plan versions no longer error — [#2244](https://github.com/useautumn/autumn/pull/2244)
* Non-consumable prepaid quantities update correctly on plan changes — [#2220](https://github.com/useautumn/autumn/pull/2220)
* Dashboard no longer shows false "unsaved changes" errors when saving plans — [#2276](https://github.com/useautumn/autumn/pull/2276)
* Entity creation is serialized per customer, avoiding duplicate rows under concurrent attaches — [#2242](https://github.com/useautumn/autumn/pull/2242)
* Pending invoice cleanup cron backs off gracefully instead of retrying tight — [#2239](https://github.com/useautumn/autumn/pull/2239)
## Multi-update billing endpoint
Cancel or uncancel multiple plans for a customer in a **single atomic request** with the new [`billing.multi_update`](/api-reference/billing/multiUpdate) endpoint. Updates are grouped per Stripe subscription and executed as one merged plan, so proration and invoicing land as a single combined result. Preview it first with [`billing.preview_multi_update`](/api-reference/billing/previewMultiUpdate) to see per-subscription and combined totals.
## Plan-inherited billing controls on customer reads
API v2.3 customer and entity reads now include **plan-inherited** [billing controls](/documentation/customers/billing-controls) — `usage_limits`, `spend_limits`, `overage_allowed`, `auto_topups`, and `usage_alerts` — alongside customer-level overrides, with each entry tagged `source: "customer" | "plan"`. Inherited usage limits also return the current-window usage. Older clients keep the previous response shape.
## Eve: new default AI agent for Slack and dashboard chat
Eve is now the default agent harness for Slack and the dashboard streaming chat, with in-thread approvals, follow-up questions, richer status updates, and interactive **catalog decision cards** for versioning and variant changes. Rejecting an approval in Slack or the web app now also clears the underlying suspension cleanly.
## Auto top-up failure webhook
Subscribe to the new [`billing.auto_topup.failed`](/api-reference/webhooks/billingAutoTopupFailed) webhook to react to auto top-up charges that don't go through — pause features, notify the customer, or fall back to manual top-up.
## Expiring free recurring balances
Free recurring balances can now carry an **`expires_at`** timestamp, and the [`balances.update`](/api-reference/balances/updateBalance) endpoint accepts `expires_at` so you can extend or shorten grants after the fact. The dashboard has matching controls in the balance sheet.
## Licenses (early)
Foundational support for **licenses** has landed: a new licenses model, API schema, and a `licenses` field on the [`plans.list`](/api-reference/plans/listPlans) response. Reach out if you'd like to try it early.
## RevenueCat: email and fingerprint identifiers
The [RevenueCat integration](/documentation/external-providers/revenuecat) now recognizes `autumn_customer_email` and `autumn_customer_fingerprint` subscriber attributes on incoming webhooks, so you can match RevenueCat purchases to Autumn customers by email or fingerprint instead of only by ID.
## Any-shape customer import
[`billing.import`](/api-reference/billing/import) can now ingest customers from **any billing processor in any shape** — the processor and per-item `billable.processor` are configurable, and identity updates honor `dry_run`. Email-only `customer_data` payloads are validated before import runs.
## Property filters on usage limits
[Usage limits](/documentation/modelling-pricing/spend-limits) now support **property filters**, so a single limit can target a subset of events (for example, only requests to a specific model or region) instead of the whole feature. `balances.limit_reached` also now fires for plan-level and percentage-based spend and usage limits.
## Copyable sandboxes
Spin up a new sandbox as a **copy** of an existing one, so you can branch off staging or QA without rebuilding your catalog from scratch.
## billing.updated on manual sync
Manual sync operations now emit the [`billing.updated`](/api-reference/webhooks/billingUpdated) webhook, so downstream consumers stay in sync when you re-pull state from Stripe by hand.
* `set_usage` now composes with usage windows: setting a balance no longer errors when a feature has an active window, and window caps still hold after the reset — [#2205](https://github.com/useautumn/autumn/pull/2205)
* Auto top-up expand path returns `purchase_limit` for plan-inherited entries too — [#2205](https://github.com/useautumn/autumn/pull/2205)
* Refund-last-payment is now exposed on the API — [#2179](https://github.com/useautumn/autumn/pull/2179)
* Slack app: additional options for matching a Slack user to an Autumn user — [#2100](https://github.com/useautumn/autumn/pull/2100)
* Archived plans now include an `archived` flag when pulled via the CLI — [#2152](https://github.com/useautumn/autumn/pull/2152)
* Webhook tags: customer and entity IDs are sanitized to the Svix charset so deliveries don't fail on unusual characters — [#2150](https://github.com/useautumn/autumn/pull/2150)
* Free first schedule phase is now supported in plan schedules — [#2137](https://github.com/useautumn/autumn/pull/2137)
* Refreshed checkout favicon — [#2162](https://github.com/useautumn/autumn/pull/2162), [#2161](https://github.com/useautumn/autumn/pull/2161)
* Cleaner subscription sheet tooltips, coupon error messages, and plan ID chip in mappings — [#2157](https://github.com/useautumn/autumn/pull/2157)
* Renewal edge case that could mis-schedule the next cycle is fixed — [#2200](https://github.com/useautumn/autumn/pull/2200)
* Manual `tax_rate_id` is now applied to one-time and deferred charges, not just recurring items — [#2204](https://github.com/useautumn/autumn/pull/2204)
* `check` with a lock correctly returns `allowed: false` when the customer has no entitlement — [#2174](https://github.com/useautumn/autumn/pull/2174)
* Promo minimum validation is now consistent across all billing flows — [#2168](https://github.com/useautumn/autumn/pull/2168)
* ACH processing invoices are handled correctly through the past-due flow — [#2167](https://github.com/useautumn/autumn/pull/2167), [#2128](https://github.com/useautumn/autumn/pull/2128), [#2053](https://github.com/useautumn/autumn/pull/2053)
* Skip overage billing when no overage is due, avoiding empty invoice items — [#2190](https://github.com/useautumn/autumn/pull/2190), [#2182](https://github.com/useautumn/autumn/pull/2182)
* Cardinality gate no longer false-fires on legitimate usage — [#2184](https://github.com/useautumn/autumn/pull/2184)
* Scheduled customer products now resync `starts_at` when a Stripe schedule is updated — [#2177](https://github.com/useautumn/autumn/pull/2177)
* Filter button on the customers page is visible even when a customer only has expired products — [#2165](https://github.com/useautumn/autumn/pull/2165)
* Variant Stripe product renames now propagate correctly — [#2149](https://github.com/useautumn/autumn/pull/2149)
* Product cron trial expiry now paginates correctly at scale — [#2144](https://github.com/useautumn/autumn/pull/2144)
* Schedule phase billing anchors are reset when the phase changes; Stripe anchor reset day is clamped to valid values — [#2133](https://github.com/useautumn/autumn/pull/2133), [#2115](https://github.com/useautumn/autumn/pull/2115)
* Discount upgrades apply cleanly to the upgraded plan — [#1815](https://github.com/useautumn/autumn/pull/1815)
* `billing.import` correctly updates `customer_data` and filters one-off / usage-based balances — [#2154](https://github.com/useautumn/autumn/pull/2154), [#2156](https://github.com/useautumn/autumn/pull/2156)
* Assorted usage-window, coupon, and sync-back fixes — [#2159](https://github.com/useautumn/autumn/pull/2159), [#2186](https://github.com/useautumn/autumn/pull/2186)
## Multiple sandbox environments per org
Organizations can now spin up **multiple sandboxes** alongside production — each with its own API keys, teams, color, and icon — so you can isolate staging, QA, demo, and per-engineer environments without juggling accounts. Provision, switch, edit, and tear down sandboxes directly from the dashboard.
## Per-customer JWT credentials
Issue and rotate **per-customer JWT credentials** for the frontend SDK. State is now persisted in Postgres, so credentials survive restarts and can be managed cleanly per customer.
## Percentage-based spend limits
[Spend limits](/documentation/modelling-pricing/spend-limits) now support a `usage_percentage` mode, letting you cap overage as a percentage of included usage instead of an absolute number — useful for plans where the included quota changes between tiers.
## Plan metadata
Attach arbitrary **metadata to plans** and read it back through the API. Use it to tag plans with internal flags, feature gates, or marketing copy without forking your pricing model.
## List rewards endpoint
New [rewards endpoint](/api-reference/rewards/redeemRewardCode) returns both coupons and feature grants in a single paginated response, making it easier to render available rewards in your own UI.
## Track events with custom timestamps
The `track` endpoint now accepts an explicit `timestamp` field, so you can backfill events or record usage that happened earlier without losing chronological accuracy.
## Plan billing controls
Custom plans get a refreshed **billing controls** panel — clearer toggles, keyboard-focusable tooltips, simplified auto top-up resolution, and improved copy throughout. See [custom plans](/documentation/customers/custom-plans).
## Dual-auth Stripe keys
You can now connect Stripe using **either** OAuth or a restricted API key, and switch between them per organization. The Stripe Keys UI has been redesigned around the new dual-auth flow, with cleaner copy and a smoother delete experience.
* Add interval filter to the customers list page — [#2038](https://github.com/useautumn/autumn/pull/2038)
* "Create more" mode in the create-entity dialog for bulk entity setup — [#1988](https://github.com/useautumn/autumn/pull/1988)
* Plan editor: cleaner update logic and feature-creation flow — [#2035](https://github.com/useautumn/autumn/pull/2035)
* Net payment terms UI refreshed inside the invoice settings accordion — [#2034](https://github.com/useautumn/autumn/pull/2034)
* Customizable buttons in transactional emails — [#1991](https://github.com/useautumn/autumn/pull/1991)
* Customer IDs now accept colons for namespaced identifiers — [#1995](https://github.com/useautumn/autumn/pull/1995)
* Mobile dashboard cleanup, including card-style tables on small screens — [#2013](https://github.com/useautumn/autumn/pull/2013)
* [RevenueCat import](/documentation/external-providers/revenuecat): paginated product list and raw-mapping escape hatch for custom field mapping — [#2040](https://github.com/useautumn/autumn/pull/2040)
* MCP OAuth now grants Leaf scopes when only OIDC scopes are requested — [#2012](https://github.com/useautumn/autumn/pull/2012), [#2023](https://github.com/useautumn/autumn/pull/2023)
* Website content negotiation: canonical URLs serve markdown to clients that ask for it — [#2004](https://github.com/useautumn/autumn/pull/2004), [#2007](https://github.com/useautumn/autumn/pull/2007), [#2009](https://github.com/useautumn/autumn/pull/2009)
* Cleaner Stripe connect dialog and improved Stripe-related copy across the dashboard — [#2020](https://github.com/useautumn/autumn/pull/2020), [#2047](https://github.com/useautumn/autumn/pull/2047)
* Customer portal now has rate limiting to protect against abuse — [#2033](https://github.com/useautumn/autumn/pull/2033)
* Auto top-ups now charge the most recently attached plan's one-off price — [#2049](https://github.com/useautumn/autumn/pull/2049)
* Event table filtering corrected so filters apply to the right columns — [#2005](https://github.com/useautumn/autumn/pull/2005)
* Long event values no longer overflow the events table — [#2048](https://github.com/useautumn/autumn/pull/2048)
* Trialing customers downgrading to Free are correctly anchored to trial end — [#2000](https://github.com/useautumn/autumn/pull/2000)
* Sync no longer adds phantom allowance for imported prepaid Stripe items, and carries prepaid usage correctly when expiring a plan — [#1978](https://github.com/useautumn/autumn/pull/1978)
* Hourly rollovers now enforce the configured max cap on the reset cron — [#2022](https://github.com/useautumn/autumn/pull/2022)
* Rewards: reject duplicate reward IDs and promo codes, and clean up promos on delete — [#2031](https://github.com/useautumn/autumn/pull/2031)
* Event ranking window aligned with the chart for accurate top-events lists — [#2003](https://github.com/useautumn/autumn/pull/2003)
* Separate billing intervals render correctly in the plan editor — [#2001](https://github.com/useautumn/autumn/pull/2001), [#2042](https://github.com/useautumn/autumn/pull/2042), [#2043](https://github.com/useautumn/autumn/pull/2043)
* Prevent horizontal overscroll on the marketing site — [#2019](https://github.com/useautumn/autumn/pull/2019)
* MCP and Leaf auth edge cases resolved — [#2026](https://github.com/useautumn/autumn/pull/2026)
## Autumn Lakehouse
Stream every event, balance change, and invoice straight into your own data warehouse via the new **Autumn Lakehouse**. Connect once and query Autumn data with the SQL engine of your choice — Snowflake, BigQuery, DuckDB, Athena, Spark, or anything else that speaks Apache Iceberg.
See the [Lakehouse overview](/documentation/lakehouse/overview) and [connecting guide](/documentation/lakehouse/connecting) to get started.
## Instant customer products table
The customer detail page now renders its products table immediately, with the rest of the list paginated in the background. Loading a customer with hundreds of products is no longer a wait.
## Weekly analytics granularity
Analytics now supports a **weekly** bin size, and granularity options are tailored per time range (no more greyed-out choices). The granularity picker has moved into the time-period dropdown for fewer clicks.
## Plan version migrations: filter compiler & migrate dialog
Plan version migrations get a new **filter compiler** for targeting exactly the customers you want, a refreshed migrate dialog, and clearer visibility into billing changes before you commit. See [custom plans](/documentation/customers/custom-plans).
## Rewards: boolean grants & first-time conditions
Rewards can now grant **boolean features** (e.g. unlock an add-on as a perk) and can be gated to a customer's **first-time** purchase only. Useful for launch promos and onboarding incentives.
## OpenRouter support in the AI gateway
The Autumn [AI gateway](/documentation/external-providers/openrouter) now supports OpenRouter as a provider, so you can meter and bill OpenRouter usage the same way as direct OpenAI, Anthropic, and others.
* New `carry_over_usages` option on [`billing.update`](/api-reference/billing/billingUpdate) to preserve usage across plan changes — [#1974](https://github.com/useautumn/autumn/pull/1974)
* New `next_reset_at` parameter on [create balance](/api-reference/balances/createBalance) for scheduling the first reset — [#1950](https://github.com/useautumn/autumn/pull/1950)
* Long-lived Stripe checkout sessions so links stay valid for longer — [#1976](https://github.com/useautumn/autumn/pull/1976)
* Consolidated customer header actions, entity-scoped views, and direct Stripe Connect links from the customer page — [#1964](https://github.com/useautumn/autumn/pull/1964)
* Separate billing intervals per price component — [#1961](https://github.com/useautumn/autumn/pull/1961)
* Discounts now support a max-redemptions cap — [#1939](https://github.com/useautumn/autumn/pull/1939)
* Past-due cancellations void the open invoice immediately — [#1948](https://github.com/useautumn/autumn/pull/1948)
* Option to ignore past-due state and preserve the subscription — [#1963](https://github.com/useautumn/autumn/pull/1963)
* Clearer error messages across the dashboard and API — [#1943](https://github.com/useautumn/autumn/pull/1943)
* Refreshed reward selectors and coupon update confirmation — [#1928](https://github.com/useautumn/autumn/pull/1928)
* Org logos now upload to S3 with reliable hosting — [#1225](https://github.com/useautumn/autumn/pull/1225)
* Custom buttons in the dashboard — [#1987](https://github.com/useautumn/autumn/pull/1987)
* AI credit systems are now treated as generic credit systems in the plan editor — [#1903](https://github.com/useautumn/autumn/pull/1903)
* Patch migrations no longer skip custom products — [#1953](https://github.com/useautumn/autumn/pull/1953)
* Multi-entity granted amounts now display correctly in balance sub-rows — [#1947](https://github.com/useautumn/autumn/pull/1947)
* Free-trial dedup is now scoped per entity so each entity gets its own trial — [#1956](https://github.com/useautumn/autumn/pull/1956)
* `billing.updated` webhook now fires on trial-to-paid conversion — [#1972](https://github.com/useautumn/autumn/pull/1972)
* Tax and discounts now render correctly in [attach preview](/api-reference/billing/previewAttach) — [#1944](https://github.com/useautumn/autumn/pull/1944)
* [`createSchedule`](/api-reference/billing/createSchedule) phases now snap to the cycle boundary — [#1975](https://github.com/useautumn/autumn/pull/1975)
* Checkout page no longer renders blank on certain React versions — [#1937](https://github.com/useautumn/autumn/pull/1937)
* Usage limits now respect the AI credit dimension — [#1912](https://github.com/useautumn/autumn/pull/1912)
* Onboarding fee no longer double-charges in edge cases — [#1946](https://github.com/useautumn/autumn/pull/1946)
* Environment selection and org switching in the dashboard — [#1952](https://github.com/useautumn/autumn/pull/1952), [#1970](https://github.com/useautumn/autumn/pull/1970)
* Copy entity ID and allow duplicate plans in the sync editor — [#1957](https://github.com/useautumn/autumn/pull/1957)
* Sync expire no longer fails on certain customer states — [#1967](https://github.com/useautumn/autumn/pull/1967)
* Batch operations are now idempotent — [#1981](https://github.com/useautumn/autumn/pull/1981)
* Slack admin and dashboard gate fixes — [#1986](https://github.com/useautumn/autumn/pull/1986), [#1984](https://github.com/useautumn/autumn/pull/1984)
* CLI auth and Claude OAuth flows — [#1926](https://github.com/useautumn/autumn/pull/1926), [#1925](https://github.com/useautumn/autumn/pull/1925)
* `atmn` CLI now exits with a non-zero code on interactive push/pull errors — [#1927](https://github.com/useautumn/autumn/pull/1927)
* Copy product API call no longer fires with missing required fields — [#1585](https://github.com/useautumn/autumn/pull/1585)
* Keyboard shortcut and scroll fixes in the dashboard — [#1915](https://github.com/useautumn/autumn/pull/1915), [#1942](https://github.com/useautumn/autumn/pull/1942)
## Autumn MCP server
Autumn now ships an official **Model Context Protocol (MCP) server**, so AI assistants like Claude Desktop and Cursor can read and act on your Autumn data directly. The server is generated against the public API and respects your existing API key scopes (`customers:read`, `plans:read`, `billing:read`, `billing:write`) — no new permission model to learn.
Install it as a Claude Desktop extension or wire it into Cursor with a single deeplink. Use it to look up customers, inspect plans, preview attaches, and run billing updates from your assistant.
## Org-level usage alerts
Usage alerts can now be configured **once at the org level** and applied across every customer, instead of being attached plan by plan. Set a threshold and channel from settings, and Autumn fires alerts whenever any customer crosses the bar. The [`balances.usage_alert.triggered` webhook](/api-reference/webhooks/balancesUsageAlertTriggered) fires for both per-plan and org-level alerts.
## Vercel Marketplace: invoice mode and resource logs
The Vercel integration now supports **invoice-mode billing** end to end and surfaces **per-resource logs** in the dashboard, so you can debug a Vercel customer's provisioning, auto top-ups, and invoice flow without leaving Autumn. The frontend was rebuilt around the new resource model, with fallbacks for identity edge cases.
See the [Vercel Marketplace guide](/documentation/external-providers/vercel-marketplace).
* Official Autumn MCP server for Claude Desktop, Cursor, and other MCP clients — [#1715](https://github.com/useautumn/autumn/pull/1715), [#1740](https://github.com/useautumn/autumn/pull/1740), [#1741](https://github.com/useautumn/autumn/pull/1741)
* Org-level usage alerts with shared thresholds across customers — [#1707](https://github.com/useautumn/autumn/pull/1707)
* Vercel Marketplace invoice mode, resource logs, and refreshed frontend — [#1711](https://github.com/useautumn/autumn/pull/1711)
* Preflight tax-address check before charging customers in taxable regions — [#1699](https://github.com/useautumn/autumn/pull/1699)
* Automatically void uncollectible Stripe invoices instead of leaving them open — [#1732](https://github.com/useautumn/autumn/pull/1732)
* New plan-version filters for [custom-plan migrations](/documentation/customers/custom-plans) — [#1718](https://github.com/useautumn/autumn/pull/1718)
* Faster customer detail loads and smoother large entity lists — [#1712](https://github.com/useautumn/autumn/pull/1712)
* Customer list filter by entity ID — [#1688](https://github.com/useautumn/autumn/pull/1688)
* Refreshed dashboard theme and appearance controls — [#1679](https://github.com/useautumn/autumn/pull/1679)
* Optimised product counts in the customer table — [#1690](https://github.com/useautumn/autumn/pull/1690)
* Mobile fixes for the customer list view — [#1689](https://github.com/useautumn/autumn/pull/1689)
* Stripe checkout no longer drops carry-over balances on plan changes — [#1708](https://github.com/useautumn/autumn/pull/1708)
* Trial grants are now excluded from reward eligibility — [#1730](https://github.com/useautumn/autumn/pull/1730)
* RevenueCat sync no longer fails with "entities not found" — [#1729](https://github.com/useautumn/autumn/pull/1729)
* Tax IDs now render correctly in the attach preview — [#1728](https://github.com/useautumn/autumn/pull/1728)
* Invalid email addresses are now rejected with a clearer error — [#1722](https://github.com/useautumn/autumn/pull/1722)
* Sandbox usage alerts now respect their configured threshold — [#1706](https://github.com/useautumn/autumn/pull/1706)
* Proration toggle now shows even when the customer has a past trial — [#1704](https://github.com/useautumn/autumn/pull/1704)
* One-off prepaid items upgrade correctly without double carry-over — [#1676](https://github.com/useautumn/autumn/pull/1676), [#1695](https://github.com/useautumn/autumn/pull/1695)
* Subscription metadata is preserved through checkout — [#1719](https://github.com/useautumn/autumn/pull/1719)
* Price dropdown no longer loses its selected value when reopened — [#1720](https://github.com/useautumn/autumn/pull/1720)
* Vercel auto top-ups no longer fail to process the resulting invoice — multiple fixes ([#1725](https://github.com/useautumn/autumn/pull/1725))
## Batch track and async track
Two new ways to record usage when you don't need an immediate balance read:
* [`POST /v1/balances.batch_track`](/api-reference/core/batchTrack) — enqueue up to **1000 usage events** in one request. Returns 202 immediately; balances are deducted by background workers.
* **`async: true`** on the existing [`POST /v1/balances.track`](/api-reference/core/track) — same fire-and-forget shape for single-event callers that want the speed without switching to the batch endpoint.
Both paths are intended for high-volume metering (event logging, per-action usage counters) where you'd previously be limited by the synchronous deduction's HTTP round-trip. Partial enqueue failures are logged server-side and do NOT surface as errors to the client — see the [batch track reference](/api-reference/core/batchTrack#partial-failure-semantics) for the trade-off.
## `billing.updated` webhook
A new **`billing.updated`** webhook fires whenever a customer's plans change — attaches, renewals, schedule activations, trial conversions, plan updates, and expirations all flow through a single event. The payload includes the customer, optional entity, and an array of `plan_changes` describing what was activated, scheduled, updated, or expired, with previous-state diffs.
Use it to drive provisioning, lifecycle emails, CRM sync, and revenue reporting from one webhook instead of stitching together multiple events.
See the [`billing.updated` webhook reference](/api-reference/webhooks/billingUpdated).
## Cursor-based pagination and list endpoints (API v2.3)
The API is now at **v2.3**, introducing cursor-based pagination across list endpoints. Two new endpoints ship with it:
* [`POST /v1/entities.list`](/api-reference/entities/listEntities) — list a customer's entities with filters and cursor pagination.
* [`POST /v1/events.list`](/api-reference/events/listEvents) — paginate raw event history for a customer or feature.
Cursor pagination replaces offset-based paging on heavy endpoints, giving stable results even while data changes between pages. Pass `start_cursor` to continue from a previous page.
## Manual auto top-ups from the dashboard
You can now trigger an auto top-up for a customer directly from the dashboard, without waiting for the balance to cross the configured threshold. Useful for support flows, manual credit grants, or testing top-up wiring end to end.
See the [auto top-ups guide](/documentation/modelling-pricing/auto-top-ups).
## Passkey sign-in for the dashboard
Dashboard accounts now support **passkeys (WebAuthn)**. Register a passkey from your account settings to sign in with Face ID, Touch ID, Windows Hello, or a hardware key — no password required. Sign-in autofill is enabled so browsers can prompt for a passkey on the login screen.
## Vercel resource pre-provisioning
For Vercel Marketplace installs, Autumn now provisions the customer product the moment a resource is created, using a Stripe preauth instead of waiting for the first invoice. New Vercel customers land in your dashboard with their plan attached and entitlements ready immediately.
See the [Vercel Marketplace guide](/documentation/external-providers/vercel-marketplace).
## `plan_id` in analytics
Analytics queries now group and filter by `plan_id`, so revenue, usage, and event charts can be sliced per plan. Plan selection in the dashboard analytics views drives the new dimension end to end.
## Customer API logs workbench
The dashboard's customer detail view now includes a **workbench panel** showing recent API requests for that customer — endpoint, status, latency, and payload — so you can debug integrations without leaving the customer.
## Schedule editor: copy from previous phase
When customizing a scheduled phase, you can now click **Copy from previous phase** to seed the product selector with the prior phase's items, then adjust from there. Faster than rebuilding a multi-item phase from scratch.
## Trial `on_end` behaviour for attach
`billing.attach` accepts a new option to control what happens when a trial ends — convert to the paid plan, expire, or hand off to another product. The setting respects entity scoping so trials on one entity no longer disrupt others on the same customer.
See the [attach API reference](/api-reference/billing/attach).
* `billing.updated` webhook with unified `plan_changes` payload — [#1637](https://github.com/useautumn/autumn/pull/1637)
* API v2.3 with cursor-based pagination — [#1596](https://github.com/useautumn/autumn/pull/1596)
* `POST /v1/entities.list` endpoint — [#1505](https://github.com/useautumn/autumn/pull/1505), [#1513](https://github.com/useautumn/autumn/pull/1513)
* Paginated `POST /v1/events.list` endpoint — [#1596](https://github.com/useautumn/autumn/pull/1596)
* Manual auto top-up trigger in dashboard — [#1532](https://github.com/useautumn/autumn/pull/1532)
* Passkey (WebAuthn) sign-in and settings UI — [#1587](https://github.com/useautumn/autumn/pull/1587)
* Vercel resource pre-provisioning with Stripe preauth — [#1578](https://github.com/useautumn/autumn/pull/1578)
* `plan_id` dimension in analytics charts and tables — [#1568](https://github.com/useautumn/autumn/pull/1568), [#1613](https://github.com/useautumn/autumn/pull/1613)
* Customer API logs workbench panel — [#1525](https://github.com/useautumn/autumn/pull/1525)
* "Copy from previous phase" button in the schedule editor — [#1556](https://github.com/useautumn/autumn/pull/1556)
* Trial `on_end` option on `billing.attach`, with entity-aware behaviour — [#1554](https://github.com/useautumn/autumn/pull/1554), [#1581](https://github.com/useautumn/autumn/pull/1581)
* Live normalisation of expired auto top-up purchase-limit windows — [#1520](https://github.com/useautumn/autumn/pull/1520)
* Command bar favourites for impersonating frequent orgs and users — [#1597](https://github.com/useautumn/autumn/pull/1597)
* Settings page redesign with clearer navigation — [#1555](https://github.com/useautumn/autumn/pull/1555)
* Dashboard analytics chart and table polish — [#1599](https://github.com/useautumn/autumn/pull/1599), [#1613](https://github.com/useautumn/autumn/pull/1613)
* Stripe webhook race condition that could double-process events — [#1620](https://github.com/useautumn/autumn/pull/1620)
* Checkout session race condition under high concurrency — [#1548](https://github.com/useautumn/autumn/pull/1548)
* Attach now respects `tax_rate_id` overrides — [#1641](https://github.com/useautumn/autumn/pull/1641)
* Attach correctly handles no-op billing changes — [#1586](https://github.com/useautumn/autumn/pull/1586)
* Schedule sync no longer produces empty phases or duplicate items — [#1501](https://github.com/useautumn/autumn/pull/1501), [#1574](https://github.com/useautumn/autumn/pull/1574), [#1575](https://github.com/useautumn/autumn/pull/1575)
* Schedule customize flow now correctly handles removed base prices on free plans — [#1556](https://github.com/useautumn/autumn/pull/1556)
* Entity sync edge cases and item-log alignment fixed — [#1607](https://github.com/useautumn/autumn/pull/1607), [#1614](https://github.com/useautumn/autumn/pull/1614)
* Custom item delete and ghost item issues in the plan editor — [#1517](https://github.com/useautumn/autumn/pull/1517), [#1628](https://github.com/useautumn/autumn/pull/1628), [#1629](https://github.com/useautumn/autumn/pull/1629)
* Cancel flow now handles plans with a future `starts_at` — [#1507](https://github.com/useautumn/autumn/pull/1507)
* Revert trial issue when reversing a recent attach — [#1635](https://github.com/useautumn/autumn/pull/1635)
* Vercel: Stripe Tax disabled when org has no tax config; metadata is now optional — [#1558](https://github.com/useautumn/autumn/pull/1558)
* Various Vercel marketplace bug fixes — [#1579](https://github.com/useautumn/autumn/pull/1579)
* Duplicate Stripe customer ID handling — [#1528](https://github.com/useautumn/autumn/pull/1528)
* Cache invalidation correctness on customer and plan edits — [#1531](https://github.com/useautumn/autumn/pull/1531), [#1612](https://github.com/useautumn/autumn/pull/1612)
* Dashboard customer cache freshness — [#1612](https://github.com/useautumn/autumn/pull/1612)
* Plan analytics: per-item parse failures no longer drop valid deductions; `$plan_id` alias normalised — [#1608](https://github.com/useautumn/autumn/pull/1608)
* `list events` hook returns the correct response type — [#1633](https://github.com/useautumn/autumn/pull/1633)
* Shadow flag evaluation fixes — [#1632](https://github.com/useautumn/autumn/pull/1632)
* Webhook tag filtering improvements — [#1617](https://github.com/useautumn/autumn/pull/1617)
* No-op plan PATCH now exits cleanly without spurious updates — [#1628](https://github.com/useautumn/autumn/pull/1628)
* Database pool sizing and connection limits raised for higher throughput — [#1625](https://github.com/useautumn/autumn/pull/1625), [#1643](https://github.com/useautumn/autumn/pull/1643)
## Scheduled subscriptions with `starts_at`
You can now schedule a plan to start at a future date by passing a `starts_at` Unix timestamp (milliseconds) to `billing.attach`. Future-dated attaches create a Stripe subscription schedule that activates on the start date — perfect for delayed onboarding, contract renewals, or sales-led handoffs.
Pair `starts_at` with `ends_at` to grant access for a fixed window. One-off products now also support `ends_at` and are automatically cleaned up when the window expires.
See the [attach API reference](/api-reference/billing/attach).
## Auto top-up succeeded webhook
A new **`billing.auto_topup_succeeded`** webhook fires whenever an auto top-up is processed for a customer. The payload includes the customer ID, feature ID, quantity granted, threshold that triggered the top-up, post-top-up balance, and the full Stripe invoice (status, total, currency, hosted URL, and PDF link).
Useful for sending receipts, syncing top-ups to your own ledger, or alerting customers that their card was charged. Supports both auto-charged and `send_invoice` modes.
See the [auto top-up webhook reference](/api-reference/webhooks/billingAutoTopupSucceeded) and the [auto top-ups guide](/documentation/modelling-pricing/auto-top-ups).
## Promo codes in Autumn Checkout
Customers can now apply promo codes directly in Autumn Checkout. The order summary surfaces a collapsed promo trigger that expands into an input — applied codes show their discount and expiry inline, and the totals update before confirmation.
## Discounts and coupons in subscription updates
The dashboard's subscription update flow now supports applying discounts. Existing coupons are visible in the subscription detail sheet, and you can attach a discount when changing a plan or quantities.
## Tax and invoice credits in attach preview
`billing.preview_attach` now returns two new optional fields:
* **`tax`**: Tax breakdown for the immediate charge (total, inclusive/exclusive amounts, currency, calculation status). Powered by Stripe Tax — contact us to enable the tax flag on your organisation.
* **`invoice_credits`**: The customer's available Stripe invoice credit balance, so you can show "Account credit" line items in custom checkouts.
See the [preview attach reference](/api-reference/billing/previewAttach).
## `balances` field in `track` responses
The `/track` endpoint now returns the affected feature balances — including a per-plan `breakdown` of grants, prepaid credits, usage, remaining, and rollovers — directly in the response. This removes the need for a follow-up `check` call after recording usage.
See the [track endpoint](/api-reference/core/track).
## `processors` field on customer responses
Customer endpoints (`get`, `getOrCreate`, `update`, `list`) now return a `processors` object listing every payment processor the customer is connected to: Stripe, Vercel, and RevenueCat. The field is omitted for customers not yet present in any processor.
You can also filter `customers.list` by processor with the new `processors` query parameter.
## Auto top-up purchase limits in customer expand
Expand `billing_controls.auto_topups.purchase_limit` on customer endpoints to retrieve the configured top-up rate limit, the current count of top-ups in the period, and the next reset timestamp. Useful for showing customers how close they are to their auto top-up cap.
## RevenueCat invoice sync
RevenueCat-billed subscriptions now record full invoices on initial purchase, renewal, and refund events. Invoices appear alongside Stripe invoices in customer responses and the dashboard, giving you a unified view of revenue across processors.
* `starts_at` parameter on `billing.attach` for scheduled subscription start dates - [#1411](https://github.com/useautumn/autumn/pull/1411), [#1467](https://github.com/useautumn/autumn/pull/1467), [#1476](https://github.com/useautumn/autumn/pull/1476)
* `ends_at` on one-off products with automatic expiry cron - [#1476](https://github.com/useautumn/autumn/pull/1476)
* `billing.auto_topup_succeeded` webhook - [#1429](https://github.com/useautumn/autumn/pull/1429)
* Promo code support in Autumn Checkout - [#1446](https://github.com/useautumn/autumn/pull/1446)
* Discount support on subscription updates and coupon display in subscription detail - [#1463](https://github.com/useautumn/autumn/pull/1463)
* Tax preview in `billing.preview_attach` - [#1417](https://github.com/useautumn/autumn/pull/1417), [#1424](https://github.com/useautumn/autumn/pull/1424)
* Invoice credits preview in `billing.preview_attach` - [#1464](https://github.com/useautumn/autumn/pull/1464)
* `balances` field returned in `/track` responses - [#1470](https://github.com/useautumn/autumn/pull/1470)
* `processors` field and `processors` filter on customer endpoints - [#1490](https://github.com/useautumn/autumn/pull/1490)
* `billing_controls.auto_topups.purchase_limit` expand on customer endpoints - [#1423](https://github.com/useautumn/autumn/pull/1423)
* RevenueCat invoice recording on initial purchase, renewal, and refund - [#1490](https://github.com/useautumn/autumn/pull/1490)
* OpenAPI spec, SDKs, and dashboard updated with `starts_at` / `ends_at` fields - [#1485](https://github.com/useautumn/autumn/pull/1485)
* Checkout `enable_immediately` flow improvements - [#1415](https://github.com/useautumn/autumn/pull/1415)
* API key sheet and table UI cleanup
* Proration settings now visible during cross-entity free-to-paid attach - [#1491](https://github.com/useautumn/autumn/pull/1491)
* Dashboard org switcher now lists the full set of organizations - [#1475](https://github.com/useautumn/autumn/pull/1475)
* Balance validation no longer rejects valid edits - [#1477](https://github.com/useautumn/autumn/pull/1477)
* Schedule sync edge cases fixed - [#1443](https://github.com/useautumn/autumn/pull/1443)
* Orphaned customer products cleaned up correctly - [#1440](https://github.com/useautumn/autumn/pull/1440)
* Auto-sync paid feature mapping on plan edits - [#1448](https://github.com/useautumn/autumn/pull/1448)
* Member toolbar z-index fixed in the dashboard - [#1449](https://github.com/useautumn/autumn/pull/1449)
* Prepaid price v2 fixes - [#1451](https://github.com/useautumn/autumn/pull/1451)
* Vercel customer filtering when no Stripe is connected - [#1455](https://github.com/useautumn/autumn/pull/1455), [#1458](https://github.com/useautumn/autumn/pull/1458)
## Usage alerts and `balances.limit_reached` webhook
You can now configure **usage alerts** on customers and entities to get notified when usage crosses a threshold. Alerts are set via `billingControls.usageAlerts` and fire a `balances.usage_alert_triggered` webhook. Supports both absolute usage counts and percentage-of-allowance thresholds.
A new **`balances.limit_reached`** webhook fires when a customer hits a usage limit — whether it's the included allowance, a max purchase cap, or a spend limit. See the [webhooks reference](/documentation/webhooks) and [spend limits & usage alerts guide](/documentation/modelling-pricing/spend-limits) for details.
## Express, Elysia, and Web Standard adapters for `autumn-js`
The `autumn-js` SDK now ships adapters for Express, Elysia, and any framework that uses the Fetch API `Request`/`Response` objects. You can set up the `autumnHandler` in your backend with a single import — no manual request parsing required.
* **Express**: Import from `autumn-js/express` and mount with `app.use()`. Requires `express.json()` before the handler
* **Elysia / Web Standard**: Import from `autumn-js/fetch` and use with Elysia's `.mount()`, Cloudflare Workers, Deno, or any Fetch-based runtime
* **Existing adapters**: Next.js (`autumn-js/next`) and Hono (`autumn-js/hono`) continue to work as before
See the [setup guide](/documentation/getting-started/setup) for framework-specific code examples.
## Explicit customer creation required for `check` and `track`
The `/check` and `/track` endpoints no longer auto-create customers. If you call these endpoints with a `customer_id` that doesn't exist, the API now returns a `customer_not_found` error instead of silently creating the customer.
This change encourages explicit customer lifecycle management and prevents accidental customer creation from typos or stale IDs.
* **Create customers first**: Call [`customers.getOrCreate`](/documentation/customers/creating-customers) during signup or login before using `check` or `track`
* **Handle the error**: If a customer doesn't exist, the API returns error code `customer_not_found`
## `autumn-js` SDK 1.0.0
The `autumn-js` SDK has been promoted from beta to stable at version `1.0.0`.
## New framework adapters
The `autumn-js` SDK now includes adapters for Express, Elysia, and any Web Standard compatible runtime (Cloudflare Workers, Deno). Import from the adapter that matches your backend:
| Framework | Import path |
| --------------------- | ------------------- |
| Next.js | `autumn-js/next` |
| Hono | `autumn-js/hono` |
| Elysia / Web Standard | `autumn-js/fetch` |
| Express | `autumn-js/express` |
| Other | `autumn-js/backend` |
See the [setup guide](/documentation/getting-started/setup) and the [`autumnHandler` reference](/react/hooks/autumn-handler) for full examples.
* Express adapter for `autumnHandler` via `autumn-js/express` - [#979](https://github.com/useautumn/autumn/pull/979)
* Web Standard adapter for `autumnHandler` via `autumn-js/fetch` (Elysia, Cloudflare Workers, Deno) - [#979](https://github.com/useautumn/autumn/pull/979)
* Explicit customer creation required for `check` and `track` endpoints - [#968](https://github.com/useautumn/autumn/pull/968)
* `autumn-js` SDK promoted to `1.0.0` stable release - [#968](https://github.com/useautumn/autumn/pull/968)
* New Express, Elysia, and Web Standard adapters for `autumnHandler` - [#985](https://github.com/useautumn/autumn/pull/985)
* Improved API reference field descriptions for preview endpoints - [#985](https://github.com/useautumn/autumn/pull/985)
* `checkout_session_params.subscription_data` (including `metadata`) is now properly deep-merged with Autumn's internal parameters instead of being overwritten - [#996](https://github.com/useautumn/autumn/pull/996)
## Balance and usage carry-over on plan upgrades
You can now preserve a customer's remaining balances and usage when they upgrade plans. Two new parameters on `billing.attach` give you fine-grained control over what happens to consumable features during an immediate upgrade.
* **`carry_over_balances`**: Unused credits or balances from the old plan are carried forward to the new one — so customers don't lose what they've already paid for
* **`carry_over_usages`**: Prior usage is deducted from the new plan's allowance, preventing customers from getting a free reset on upgrade
* **Per-feature control**: Optionally scope carry-over to specific features using `feature_ids`
See the [attach API reference](/api-reference/billing/attach) for details.
## Feature flags in customer and entity responses
Boolean features are now returned as a dedicated `flags` object on customer and entity API responses. This makes it easier to check on/off feature access without calling the `check` endpoint separately.
* **Separate from balances**: Flags live under `flags` in the response, clearly separated from consumable balances
* **Available everywhere**: Returned on customer get, list, entity get, and entity create endpoints
* **Includes metadata**: Each flag shows the originating plan, expiration, and feature ID
See the [check endpoint](/api-reference/core/check) and [customer endpoints](/api-reference/customers/getOrCreateCustomer) for the updated response format.
* Balance carry-over on immediate plan upgrades via `carry_over_balances` - [#861](https://github.com/useautumn/autumn/pull/861)
* Usage carry-over on immediate plan upgrades via `carry_over_usages` - [#875](https://github.com/useautumn/autumn/pull/875)
* Boolean features returned as `flags` in customer and entity objects - [#950](https://github.com/useautumn/autumn/pull/950)
* Updated API, SDKs, and frontend with new flag fields - [#951](https://github.com/useautumn/autumn/pull/951)
* Fixed customer retrieval query causing errors in certain configurations - [#958](https://github.com/useautumn/autumn/pull/958), [#959](https://github.com/useautumn/autumn/pull/959)
* Fixed trial upgrade reliability when unsetting trial periods - [#958](https://github.com/useautumn/autumn/pull/958)
## Autumn Checkout
We've launched Autumn Checkout — a hosted confirm-before-charge flow that gives customers a clear preview before completing their purchase.
When a customer with a saved payment method subscribes or updates their plan, they're now sent to Autumn Checkout instead of being charged directly. This lets them review exact pricing — including prorations, usage charges, and discounts — before confirming.
* **Preview before you pay**: Customers see immediate charges and next-cycle estimates before confirming
* **Works everywhere**: Supports new subscriptions, plan upgrades, and quantity updates
* **Handles edge cases**: Built-in flows for 3DS authentication, payment failures, and action-required states
* **No API changes**: Just follow the `paymentUrl` returned by `billing.attach` or `billing.update`
When you call `billing.attach` or `billing.update`, the returned `paymentUrl` routes customers to:
* **Stripe Checkout** — if they don't have a saved payment method
* **Autumn Checkout** — if they do, so they can review and confirm the charge
After confirmation, customers are redirected to your `successUrl`.
## Volume-Based Tiered Pricing
You can now choose between graduated and volume-based tiered pricing for your plans. With volume pricing, the entire usage quantity falls into a single tier instead of splitting across tiers — useful for models where the per-unit price depends on total consumption.
* **Two tier modes**: Choose graduated (split across tiers) or volume (single tier applies to all units)
* **Backward compatible**: Existing graduated plans work without changes; volume is opt-in via `tier_behavior`
* **Full stack**: Supported in the plan editor, attach/checkout previews, Stripe invoices, and the API
## Batch Attach
Attach multiple plans to a customer in a single API request. Each plan can have its own customization, feature quantities, and trial settings — all validated and applied atomically with a distributed lock.
* **One request, multiple plans**: Attach several plans at once with per-plan customization
* **Preview support**: Preview the combined batch before committing via `/billing.preview_multi_attach`
* **Concurrency safe**: Distributed lock prevents conflicting concurrent attaches
## Lazy Entitlement Resets
Entitlement resets now happen lazily on read, so customers see fresh balances instantly without waiting for a cron cycle. An atomic Postgres function and Redis Lua script prevent double-resets under concurrency.
* **Instant resets**: Stale entitlements are reset the moment they're fetched
* **Atomic & safe**: Per-row locking in Postgres and atomic Redis Lua patching prevent double-resets
* **Hardened cron fallback**: Batch reset cron bounded with max iterations and timeouts
- Volume-based tiered pricing alongside graduated pricing - [#765](https://github.com/useautumn/autumn/pull/765)
- Batch attach: attach multiple plans in one request - [#815](https://github.com/useautumn/autumn/pull/815)
- Lazy entitlement resets for instant balance refreshes - [#800](https://github.com/useautumn/autumn/pull/800), [#802](https://github.com/useautumn/autumn/pull/802)
- Atomic Redis updates for customer data and entities (CRDT-safe) - [#812](https://github.com/useautumn/autumn/pull/812), [#813](https://github.com/useautumn/autumn/pull/813)
- Mobile navigation with sticky top bar and slide-in sidebar - [#760](https://github.com/useautumn/autumn/pull/760)
- 12/24-hour date and time picker for balance reset scheduling - [#760](https://github.com/useautumn/autumn/pull/760)
- Stripe coupon support in attach discount dropdown - [#819](https://github.com/useautumn/autumn/pull/819)
- Metadata on Stripe invoice line items (product ID, price ID, coupon IDs) - [#817](https://github.com/useautumn/autumn/pull/817)
- RPC router for Plans (create/get/update/delete) - [#750](https://github.com/useautumn/autumn/pull/750)
- RPC router for Features (list/get/create/update/delete) - [#762](https://github.com/useautumn/autumn/pull/762)
- Hardened reset cron with bounded batches and timeouts - [#808](https://github.com/useautumn/autumn/pull/808)
- Customer filter and UI cleanups - [#755](https://github.com/useautumn/autumn/pull/755)
- Unit tests GitHub Action - [#801](https://github.com/useautumn/autumn/pull/801)
* Fixed scheduled switches failing when a Stripe coupon was deleted - [#759](https://github.com/useautumn/autumn/pull/759)
* Fixed events table showing empty - [#822](https://github.com/useautumn/autumn/pull/822)
* Fixed customer balance UI - [#816](https://github.com/useautumn/autumn/pull/816)
* Fixed balance subrow to always show /granted - [#779](https://github.com/useautumn/autumn/pull/779), [#780](https://github.com/useautumn/autumn/pull/780)
* Fixed attach dashboard one-off products - [#789](https://github.com/useautumn/autumn/pull/789)
* Fixed create customer body expand - [#787](https://github.com/useautumn/autumn/pull/787)
* Fixed Vercel marketplace status not ready - [#778](https://github.com/useautumn/autumn/pull/778)
* Fixed discounts on upgrades in legacy attach - [#772](https://github.com/useautumn/autumn/pull/772)
* Fixed invoice without payment method - [#770](https://github.com/useautumn/autumn/pull/770)
* Fixed SQS client restart - [#767](https://github.com/useautumn/autumn/pull/767), [#768](https://github.com/useautumn/autumn/pull/768)
* Fixed impersonation - [#793](https://github.com/useautumn/autumn/pull/793)
* Fixed reset for past-due customer entitlements - [#805](https://github.com/useautumn/autumn/pull/805), [#806](https://github.com/useautumn/autumn/pull/806)
* Fixed zero denominator issue - [#746](https://github.com/useautumn/autumn/pull/746)
* Fixed Vercel transfer request blocking - [#744](https://github.com/useautumn/autumn/pull/744)
* Fixed discounts on scheduled subscriptions - [#742](https://github.com/useautumn/autumn/pull/742)
* Fixed invoice cron race condition - [#747](https://github.com/useautumn/autumn/pull/747)
* Fixed custom plan detection in subscription updates - [#784](https://github.com/useautumn/autumn/pull/784)
* Fixed success URL handling for v2 attach checkout - [#786](https://github.com/useautumn/autumn/pull/786)
* Fixed preview attach concurrency lock - [#758](https://github.com/useautumn/autumn/pull/758)
* New `POST /billing.multi_attach` and `POST /billing.preview_multi_attach` for batch plan attaches - [#815](https://github.com/useautumn/autumn/pull/815)
* New `POST /billing.setup_payment` for collecting payment methods before plan attach - [#797](https://github.com/useautumn/autumn/pull/797)
* New attach/update subscription V1 params: `plan_id`, `feature_quantities`, `customize`, `free_trial`, `transition_rules` - [#749](https://github.com/useautumn/autumn/pull/749), [#752](https://github.com/useautumn/autumn/pull/752)
* RPC endpoints for Plans: `/plans.create`, `/plans.get`, `/plans.update`, `/plans.delete` - [#750](https://github.com/useautumn/autumn/pull/750)
* RPC endpoints for Features: `/features.list`, `/features.get`, `/features.create`, `/features.update`, `/features.delete` - [#762](https://github.com/useautumn/autumn/pull/762)
* Added `PATCH /customers/:customer_id` for partial updates - [#774](https://github.com/useautumn/autumn/pull/774)
* Metadata added to Stripe invoice line items - [#817](https://github.com/useautumn/autumn/pull/817)
* V2 API docs with multi-version OpenAPI specs and SDK generation pipeline - [#773](https://github.com/useautumn/autumn/pull/773)
## Dynamic onboarding prompts
We've added a new in-app onboarding guide to help you get your billing set up in less than 30 minutes.
* **Docs in app**: Access documentation directly within the dashboard
* **3 prompts → full billing setup**: Complete your entire billing configuration in just 3 steps
* **Dynamic code snippets**: Get code snippets and prompts tailored to your specific pricing config
* **Real-time updates**: See your progress update as you complete each step
* Code cleanup and refactoring in Stripe billing plan evaluation system - [#525](https://github.com/useautumn/autumn/pull/525)
* Added `customerId` to request context for improved tracking and observability - [#520](https://github.com/useautumn/autumn/pull/520)
* Improved cache verification workflow with free product filtering and Sentry alert tags - [#519](https://github.com/useautumn/autumn/pull/519)
* Major Redis Lua refactor with cache versioning, filtering, and safer updates - [#512](https://github.com/useautumn/autumn/pull/512)
* Fixed multi-region cache deletion to delete from all configured regions - [#539](https://github.com/useautumn/autumn/pull/539)
* Fixed import path casing issue for createProrationinvoice - [#537](https://github.com/useautumn/autumn/pull/537)
* Fixed TypeScript type compatibility in BullMQ worker - [#538](https://github.com/useautumn/autumn/pull/538)
* Fixed type annotations in OpenAPI definitions and RevenueCat mappings - [#533](https://github.com/useautumn/autumn/pull/533), [#534](https://github.com/useautumn/autumn/pull/534)
* Fixed migration logic for product downgrades and cancellations - [#529](https://github.com/useautumn/autumn/pull/529)
* Fixed subscription migration to prevent auto-uncanceling during version updates - [#527](https://github.com/useautumn/autumn/pull/527)
* Fixed `included_usage` calculation in V1.2 API backward compatibility layer - [#526](https://github.com/useautumn/autumn/pull/526)
* Implemented Redis-first caching for add-to-balance operations - [#524](https://github.com/useautumn/autumn/pull/524)
* Simplified Stripe webhook cache refresh strategy - [#523](https://github.com/useautumn/autumn/pull/523)
* Removed redundant `plan_version` field from subscription API schema - [#522](https://github.com/useautumn/autumn/pull/522)
* Fixed duplicate features in plan editor when closing edit feature sheet - [#508](https://github.com/useautumn/autumn/pull/508)
* Added `entity_id` parameter support to legacy balance update endpoint - [#532](https://github.com/useautumn/autumn/pull/532)
* Added `/configs/push` and `/configs/nuke` endpoints for managing organization configuration in sandbox environments - [#521](https://github.com/useautumn/autumn/pull/521)
* Implemented idempotency protection for billing endpoints using `idempotency-key` header - [#516](https://github.com/useautumn/autumn/pull/516)
* Added new `POST /customers/list` V2 endpoint with plan filtering, subscription status filtering, and search functionality - [#518](https://github.com/useautumn/autumn/pull/518), [#517](https://github.com/useautumn/autumn/pull/517)
## Add to balance in the dashboard
Merry Christmas! 🎄
You can now add to a customer's balance directly from the dashboard. This is useful for giving extra credits to a customer.
You can input a positive or negative value in this field.
* Balance management enhancements with atomic "Add to Balance" feature - [#503](https://github.com/useautumn/autumn/pull/503)
* Product copy workflow streamlined with direct environment selection - [#501](https://github.com/useautumn/autumn/pull/501)
* Plan feature sheet with discard/update actions and change detection - [#499](https://github.com/useautumn/autumn/pull/499)
* Base price display logic centralized into reusable utility - [#488](https://github.com/useautumn/autumn/pull/488)
* Stripe secret key authentication always available, improved UI - [#491](https://github.com/useautumn/autumn/pull/491)
* Console logs removed from production builds for cleaner output - [#487](https://github.com/useautumn/autumn/pull/487)
* Sign-in flow simplified by removing onboarding redirect logic - [#484](https://github.com/useautumn/autumn/pull/484)
* Enter key handler added for email sign-in and cache improvements - [#483](https://github.com/useautumn/autumn/pull/483)
* Plan editor UI enhanced with better pricing configuration - [#481](https://github.com/useautumn/autumn/pull/481)
* Hono dependency pinned to exact version for build consistency - [#494](https://github.com/useautumn/autumn/pull/494)
* UI refinements and number formatting improvements - [#500](https://github.com/useautumn/autumn/pull/500)
* Add-on products no longer carry usage from main products - [#502](https://github.com/useautumn/autumn/pull/502)
* Base price display component type handling fixed - [#496](https://github.com/useautumn/autumn/pull/496)
* Invoice checkout cache invalidation fixed for null customer IDs - [#490](https://github.com/useautumn/autumn/pull/490)
* One-off products properly handled during subscription upgrades - [#489](https://github.com/useautumn/autumn/pull/489)
* Sandbox redirect logic restored for non-deployed organizations - [#486](https://github.com/useautumn/autumn/pull/486)
* Dashboard checkout success URL fixed for production environments - [#485](https://github.com/useautumn/autumn/pull/485)
* Transfer endpoint cache clearing URL pattern corrected - [#482](https://github.com/useautumn/autumn/pull/482)
* Cache race condition in attach flow resolved with timestamp guards - [#479](https://github.com/useautumn/autumn/pull/479)
* RevenueCat payment processor integration added and reverted - [#497](https://github.com/useautumn/autumn/pull/497), [#495](https://github.com/useautumn/autumn/pull/495), [#435](https://github.com/useautumn/autumn/pull/435), [#493](https://github.com/useautumn/autumn/pull/493)
* Added manual secret key override to Hono `autumnHandler`
* Added `checkoutSessionParams` to `PricingTable` component from `autumn-js/react`
* Added `new_billing_subscription` to the `attach` endpoint, allowing you to create a new Stripe subscription instead of combining with an existing one
## RevenueCat integration
We just released a new integration with RevenueCat, to let you manage your mobile app subscriptions and billing with Autumn.
This is especially helpful for users that have a mix of web and mobile users, and want to manage their billing in one place.
* **RevenueCat integration**: [Documentation](/documentation/external-providers/revenuecat)
This is currently in beta, please reach out to us on [Discord](https://discord.gg/STqxY92zuS) or email us at [hey@useautumn.com](mailto:hey@useautumn.com) to get access.
## List and aggregate events endpoints
We just released two new endpoints to retrieve usage data that your customers have sent to Autumn.
You can use this to display a billing event log, and a timeseries chart of usage data, so you can provide first-class billing observability out of the box!
* **List Events**: [React hooks](/react/hooks/useListEvents) and [API reference](/api-reference/events/list-events)
* **Aggregate Events**: [React hooks](/react/hooks/useAggregateEvents) and [API reference](/api-reference/events/aggregate-events)
## Stripe customer portal link within the customer page
You can now open a customer's Stripe customer portal directly from the customer page. You can quickly preview this and send to customers that want to manage their payment methods or see past invoices.
## Usage columns in your customer list
Preview a customer's current credit balances straight from the customer list. Now you can see who's worth peeking into!
## Autumn is live in us-east
Autumn is live on US-East! Previously all requests were hitting our us-west DB.
Now, we're reading and writing from multiple Redis caches, so both checking feature balances and tracking usage events are faster and more reliable.
More regions coming soon!
## Dark mode
Dark mode is here. No need to say more. We know you guys are all night owls.
We also shipped an entirely new design for the plan editor and customer pages, to make managing your plans and customers easier.
# Command reference
Source: https://docs.useautumn.com/cli/commands
All atmn CLI commands, flags and environment variables
Run `atmn --help` or `atmn --help` to see the latest options.
## Global flags
These work with every command.
| Flag | Description |
| ---------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------ |
| `-p, --prod` | Target production instead of sandbox |
| `--sandbox ` | Target a specific [sandbox](#sandboxes) |
| `-c, --config ` | Your `autumn.config.ts`, or the folder holding it. By default the CLI looks in the current folder, then at the path `atmn init` saved in your root `package.json`. |
| `--headless` | Never prompt. When a command needs an answer, it prints which flag to pass and stops. This is the default outside a terminal, eg in CI or when run by an agent. |
| `-l, --local` | Send requests to a local Autumn server on `localhost:8080` |
| `--port ` | Port of the local server. Implies `--local`. |
| `-b, --base-url ` | Send requests to this URL instead |
| `-v, -V, --version` | Print the CLI version |
## Environment variables
The CLI reads `.env.local` and then `.env` from your repo root, your config folder and the current folder. Anything already set in your shell wins over the files.
| Variable | Description |
| -------------------------------- | --------------------------------------------------------------------- |
| `AUTUMN_SECRET_KEY` | Your sandbox key. Written by `atmn login`. |
| `AUTUMN_PROD_SECRET_KEY` | Your production key, used with `-p`. Written by `atmn login`. |
| `AUTUMN_SANDBOX_ID` | Pins every command to a named sandbox. Written by `atmn sandbox use`. |
| `AUTUMN_SANDBOX__SECRET_KEY` | The key for one named sandbox. Written by `atmn sandbox create`. |
| `AUTUMN_BASE_URL` | Send requests to this URL instead of `https://api.useautumn.com`. |
In CI, set the key as a secret, install your dependencies, and push:
```yaml theme={null}
- name: Deploy pricing
run: npx atmn push --prod --yes
env:
AUTUMN_PROD_SECRET_KEY: ${{ secrets.AUTUMN_PROD_SECRET_KEY }}
```
## Setup
### `atmn init`
Set up your repo end to end: connect to Autumn, create the config folder, pull what's already in your organization, and install the agent skills. See [getting started](/cli/getting-started#set-up-a-project) for what it creates.
```bash theme={null}
atmn init
```
| Flag | Description |
| --------------- | ---------------------------------------------------------------------------- |
| `--login` | Connect by signing in on the web |
| `--keyless` | Connect by creating a sandbox with no account |
| `--path ` | Folder for the config. Default `autumn`, or `packages/autumn` in a monorepo. |
| `--name ` | Name of the config package (monorepos only) |
With no key on disk, `init` asks how you want to connect. In headless mode it prints the two flags and stops; run it again with one of them to continue. Running `init` again on a repo that's already set up is safe: it keeps your config and only fills in what's missing.
### `atmn login`
Connect to Autumn and write your organization's keys to `.env`. Opens your browser and lets you pick an organization. Outside a terminal it prints the URL for you to open.
```bash theme={null}
atmn login
```
| Flag | Description |
| ----------------- | ------------------------------------------------------------------------------------------------------- |
| `--keyless` | Create a sandbox with no account, and write its key to `.env` |
| `--claim ` | Link a keyless sandbox to an account. Prints and emails a sign-in link. The key you have keeps working. |
### `atmn env`
Show which organization, environment and key your commands will use:
```bash theme={null}
atmn env
```
```
Organization Acme (acme)
Environment Sandbox
User you@acme.com
Key AUTUMN_SECRET_KEY
```
| Flag | Description |
| -------- | --------------------------------------------------------------------- |
| `--json` | Print the same facts as JSON, with notes on anything that looks wrong |
## Config
### `atmn push`
Compare your config with what's in Autumn, and apply the difference.
```bash theme={null}
atmn push # preview
atmn push --yes # apply
```
| Flag | Description |
| --------------- | ----------------------------------- |
| `-y, --yes` | Apply the changes the preview shows |
| `-d, --dry-run` | Preview only, even with `--yes` |
A plain `push` is always a preview. It shows what would be created, updated or deleted, and nothing is sent until you add `--yes`. Deletions work the same way: a plan you remove from the config is removed from Autumn on the next `push --yes`.
If a change affects a plan version that has customers, Autumn drafts a migration and `push` prints the link to run it. After applying, the CLI writes the `internalId` of each new feature and plan back into your config files.
### `atmn pull`
Write what's in Autumn back into your config files.
```bash theme={null}
atmn pull
```
| Flag | Description |
| -------------------- | ------------------------------------------------------------------------------ |
| `--overwrite` | Rewrite the config from Autumn instead of updating it in place. Needs `--yes`. |
| `-y, --yes` | Confirm the overwrite |
| `--include-mappings` | Keep Stripe and RevenueCat mappings in the pulled config |
By default, `pull` updates in place: it adds new features and plans, updates existing ones, and removes deleted ones, keeping your formatting. If you have no config yet, it asks where to create one (pass `-c ` to skip the question).
`--overwrite --yes` rewrites `autumn.config.ts` and the `features.ts`, `plans.ts` and `rewards.ts` beside it from Autumn. Use it after switching organizations, or to move a 1.x config to the new format. Nothing is deleted, and files that don't import from `atmn` are left alone.
### `atmn reset`
Wipe a sandbox: every customer, plan, feature and migration draft. Keys and settings stay.
```bash theme={null}
atmn reset --yes
```
| Flag | Description |
| ----------- | ---------------------------------------------------------- |
| `-y, --yes` | Wipe it. Without this, `reset` only says what it would do. |
`reset` refuses to run against a production key. Run `atmn push --yes` afterwards to rebuild the sandbox from your config.
## API
### `atmn api`
Call any public API endpoint from the terminal. The command name matches the endpoint: `atmn api `.
```bash theme={null}
atmn api customers get_or_create customer_id=user_123 name="Ada Lovelace"
atmn api balances check customer_id=user_123 feature_id=messages
atmn api billing attach customer_id=user_123 plan_id=pro
atmn api plans list
```
| Flag | Description |
| ----------------------- | --------------------------------------------------------------- |
| `--body ` | The whole request body as JSON. Pass `-` to read it from stdin. |
| `-H, --header ` | An extra request header, as `"name: value"`. Repeatable. |
| `--curl` | Print the request as a `curl` command instead of sending it |
Body fields are passed as `key=value`. Numbers and booleans are converted for you, and fields that take an object or array are parsed as JSON:
```bash theme={null}
atmn api customers update customer_id=user_123 metadata='{"tier":"gold"}'
```
You can combine `--body` with `key=value` pairs; the pairs override fields in the body. Responses are printed as JSON. On an error, the status line goes to stderr, the response body goes to stdout, and the command exits with code 1.
`atmn api` uses the same key as every other command, so `-p` and `--sandbox` work with it. Run `atmn api --help` to list the groups, and `atmn api --help` to see an endpoint's fields.
Groups: `balances`, `billing`, `customers`, `entities`, `events`, `features`, `invoices`, `keys`, `licenses`, `plans`, `platform`, `referral_programs`, `referrals`, `rewards`, `sandboxes`.
## Sandboxes
Sandboxes are separate copies of your organization, each with its own plans, customers and API key. Use them to test changes without touching your main sandbox.
```bash theme={null}
atmn sandbox list # show your sandboxes
atmn sandbox create staging --use # create one and switch to it
atmn sandbox use staging # switch to one by name or id
atmn sandbox use --clear # go back to your main sandbox
atmn sandbox delete --yes # delete one, with its plans and customers
```
### `atmn sandbox list`
| Flag | Description |
| -------- | --------------------------------------- |
| `--json` | Print the response instead of the table |
### `atmn sandbox create `
Creates the sandbox and writes its key to `.env` as `AUTUMN_SANDBOX__SECRET_KEY`.
| Flag | Description |
| ----------------- | ----------------------------------------- |
| `--use` | Switch to it right away |
| `--color ` | Color the dashboard labels it with |
| `--icon ` | Icon the dashboard labels it with |
| `--json` | Print the response instead of the summary |
### `atmn sandbox use [name or id]`
Writes `AUTUMN_SANDBOX_ID` to your `.env`, so every later command targets that sandbox. With no name it asks which one. Add `-p` to any command to target production regardless of the pin.
| Flag | Description |
| --------- | ---------------------------------------------------------- |
| `--clear` | Remove the pin, so commands target your main sandbox again |
| `--json` | Print the result as JSON |
### `atmn sandbox delete `
| Flag | Description |
| ----------- | --------------------------------------- |
| `-y, --yes` | Delete it, plans and customers included |
`sandbox list`, `create` and `delete` always use your main key (`AUTUMN_SECRET_KEY`), even when a sandbox is pinned. If you want to target a sandbox for one command without pinning it, pass `--sandbox `.
## Skills
The CLI ships with skills that teach coding agents how to set up Autumn, model pricing, and integrate the API: `autumn-setup`, `autumn-catalog`, `autumn-integrate` and `autumn-concepts`.
### `atmn skills [name]`
List the bundled skills, or print one:
```bash theme={null}
atmn skills
atmn skills autumn-catalog
```
| Flag | Description |
| -------------- | ------------------------------------------------ |
| `--ref ` | Print one of the skill's reference files instead |
| `--json` | Print the skill as JSON |
### `atmn skills install`
Write the skills into a `skills/` folder next to your config, so your agent can use them. `atmn init` does this for you.
| Flag | Description |
| ------------- | ---------------------------------------------------------------------------- |
| `--dir ` | Write them somewhere else |
| `--link` | Run `npx skills add --all` afterwards to register them with your agent |
### `atmn skills update`
Bring installed skills up to the version bundled with this CLI. `push` and `pull` tell you when yours are out of date.
| Flag | Description |
| ------------- | ------------------------------------------------------------- |
| `--dir ` | The install to update. Default `skills/` next to your config. |
## Headless mode
Outside a terminal (CI, a pipe, an agent) the CLI never prompts. When a command needs an answer, it prints the flag to pass and stops, so you can run it again with that flag. Force this behavior with `--headless`.
### Exit codes
| Code | Meaning |
| ---- | ------------------------------------------------------- |
| `0` | Success, or the command stopped to ask for a flag |
| `1` | Error: network, auth, a config problem, or an API error |
# Configuration reference
Source: https://docs.useautumn.com/cli/config
Define features, plans, rewards and settings in autumn.config.ts
Your `autumn.config.ts` file is the source of truth for your pricing. It builds features, plans and rewards with helper functions from the `atmn` package, and hands them to `atmn()` as the default export.
```ts autumn.config.ts theme={null}
import { atmn, feature, plan } from "atmn";
export const messages = feature({ ... });
export const pro = plan({ ... });
export default atmn({ features: [messages], plans: [pro] });
```
Preview changes with `atmn push`, apply them with `atmn push --yes`, or pull what's in Autumn with `atmn pull`.
## File layout
`atmn init` and `atmn pull` create a folder with one file per kind of thing, and a root config that imports them:
```
autumn/
autumn.config.ts # export default atmn({ features, plans, rewards, referralPrograms, settings })
features.ts # export const features = [feature({ ... }), ...]
plans.ts # export const plans = [plan({ ... }), ...]
rewards.ts # export const rewards = [...]; export const referralPrograms = [...]
```
`atmn pull` writes into these files and keeps your formatting. A single `autumn.config.ts` with everything in it works too. Any file that imports from `atmn` is treated as part of your config.
## `atmn(config)`
The root of your config. Each list you include is the **complete** list: anything in Autumn that isn't in it gets deleted on push. Leave a list out to leave that part of Autumn alone.
Every feature, from `feature()`.
Every plan and every version of it, from `plan()`.
Coupons and feature grants, from `coupon()` and `featureGrant()`. See [rewards](#rewards).
Referral programs, from `referralProgram()`. See [referral programs](#referral-programs).
Organization settings. Only the flags you state are changed. See [settings](#settings).
The CLI checks the whole config before sending anything and reports every problem at once, with the file and line to fix.
## Features
Features define what can be gated, metered or billed in your app.
### `feature(config)`
Unique identifier used in API calls (`check`, `track`, etc).
Display name shown in the dashboard and billing UI.
`"boolean"` | `"metered"` | `"credit_system"` | `"ai_credit_system"`
**Required for `metered` features.**
* `true`: usage is used up and refilled (messages, API calls, credits)
* `false`: usage is ongoing (seats, storage, workspaces)
**Required for `credit_system` features.** The rate card: one entry per metered feature that draws from the credit balance.
Flat rate: `{ meteredFeatureId: string, creditCost: number, billingUnits?: number }`: `creditCost` credits per `billingUnits` units (default 1).
Graduated rate: `{ meteredFeatureId, billingUnits?, tierBehavior: "graduated", tiers: [{ to: number | "inf", creditCost: number }] }`: the credit cost steps as usage in the cycle grows. The last tier must be `"inf"`.
Each entry may also carry `dimensions` and `multipliers` to price by event properties. See [Rate cards and dimensions](/documentation/modelling-pricing/credit-systems#rate-cards-and-dimensions).
**For `ai_credit_system` features.** Percentage added on top of the model's cost, eg `30`. Use `-100` to make usage free.
**For `ai_credit_system` features.** Markup per provider, keyed by the first part of the model ID: `{ openrouter: { markup: 25 } }`.
**For `ai_credit_system` features.** Markup per model, keyed by model ID: `{ "openai/gpt-4o-mini": { markup: 20 } }`. For your own models, add `inputCost` and `outputCost` in dollars per million tokens. See [AI credit systems](/documentation/modelling-pricing/credit-systems#ai-credit-systems).
Archive the feature. Leave it out to keep it as is.
Written by the CLI after a push. Leave it there. Changing `featureId` next to it renames the feature.
Stripe mapping: `{ stripe: { productId, meterId } }`. Only pulled with `atmn pull --include-mappings`.
### Feature types
**Boolean**: simple on/off flag.
```ts theme={null}
export const sso = feature({
featureId: "sso",
name: "SSO Authentication",
type: "boolean",
});
```
**Metered, consumable**: used up and refilled (messages, API calls).
```ts theme={null}
export const messages = feature({
featureId: "messages",
name: "Messages",
type: "metered",
consumable: true,
});
```
**Metered, non-consumable**: ongoing usage (seats, storage).
```ts theme={null}
export const seats = feature({
featureId: "seats",
name: "Seats",
type: "metered",
consumable: false,
});
```
**Credit system**: maps several metered features to credit costs.
```ts theme={null}
export const basicModel = feature({
featureId: "basic_model",
name: "Basic Model",
type: "metered",
consumable: true,
});
export const premiumModel = feature({
featureId: "premium_model",
name: "Premium Model",
type: "metered",
consumable: true,
});
export const credits = feature({
featureId: "credits",
name: "AI Credits",
type: "credit_system",
creditSchema: [
{ meteredFeatureId: basicModel.featureId, creditCost: 1 },
{ meteredFeatureId: premiumModel.featureId, creditCost: 5 },
],
});
```
If you set the price per credit to 1 cent, credits become monetary credits (eg, 5 credits = \$0.05 per premium message).
**AI credit system**: bills LLM usage at the model's real cost plus a markup. Track usage with [`track_tokens`](/api-reference/balances/trackTokens).
```ts theme={null}
export const aiCredits = feature({
featureId: "ai_credits",
name: "AI Credits",
type: "ai_credit_system",
defaultMarkup: 30,
});
```
## Plans
Plans combine features with pricing to create your subscription tiers, add-ons and top-ups.
### `plan(config)`
Unique identifier used in checkout and subscription APIs.
Name of this version of the plan, eg `"v1"`. See [versions](#versions).
Whether this is the version new customers get. Exactly one version of each plan is active.
Display name shown in pricing tables and billing.
Optional description of the plan.
Base subscription price:
* `amount: number`: price amount (eg, `20` for \$20)
* `interval: string`: `"week"` | `"month"` | `"quarter"` | `"semi_annual"` | `"year"` | `"one_off"`
* `intervalCount?: number`: intervals per billing cycle, eg `3` with `"month"` for every 3 months. Defaults to `1`.
* `additionalCurrencies?: array`: amounts in [other currencies](/documentation/concepts/plans#multiple-currencies), eg `[{ currency: "eur", amount: 18 }]`
Array of plan items defining what's included. See [plan items](#plan-items).
Automatically assign this plan to new customers. Typically used for free plans.
Allow this plan to be bought alongside other plans (instead of replacing them).
Free trial before billing starts:
* `durationLength: number`: eg, `14`
* `durationType: string`: `"day"` | `"month"` | `"year"`
* `cardRequired: boolean`: whether a card is needed to start the trial
* `onEnd?: string`: `"bill"` (default) charges the customer when the trial ends. `"revert"` puts them back on their previous plan.
Group related plans together. Plans in the same group replace each other on upgrade/downgrade.
`variant()` entries for this plan, eg an annual version. See [plan variants](#plan-variants).
`license()` entries for plans this plan hands out per seat. See [licenses](#licenses).
Default [billing controls](/documentation/customers/billing-controls#plan-level-defaults) for every customer on this plan: `autoTopups`, `spendLimits`, `usageLimits`, `usageAlerts` and `overageAllowed`. Each is an array with one entry per feature, using the same fields as the API.
`{ ignorePastDue: true }` keeps this plan's balances resetting on schedule even when the customer is past due.
Any key-value data you want to keep on the plan. Shared by all versions.
Archive the plan. Leave it out to keep it as is.
Written by the CLI after a push. Leave it there. Changing `planId` next to it renames the plan.
Stripe and RevenueCat mappings: `{ stripe: { productId, additionalProductIds }, revenuecat: { products } }`. Only pulled with `atmn pull --include-mappings`.
### Versions
Each version of a plan is its own `plan()` entry with the same `planId` and a different `versionSlug`. One version is `active: true`; that's the one new customers get. Customers on an older version stay on it.
To change a plan's price for new customers only, add a new version and set the old one to `active: false`:
```ts theme={null}
export const proV2 = plan({
planId: "pro",
versionSlug: "v2",
active: true,
name: "Pro",
price: { amount: 25, interval: "month" },
items: [ ... ],
});
export const proV1 = plan({
planId: "pro",
versionSlug: "v1",
active: false,
name: "Pro",
price: { amount: 20, interval: "month" },
items: [ ... ],
});
```
To change a plan for everyone on it, edit its existing entry instead. If customers are on that version, Autumn drafts a migration and `atmn push` prints the link to run it.
After a push, the CLI adds an `internalId` to each plan and feature in your config. Leave it there. It's how the CLI knows to rename a plan instead of deleting and recreating it.
## Plan items
Plan items define what each plan includes: usage limits, pricing and billing behavior. They are plain objects in the plan's `items` array.
The `featureId` of the feature to include.
Amount included for free. Leave it out for boolean features.
Give unlimited usage of this feature.
How often the included amount refills:
* `interval: string`: `"minute"` | `"hour"` | `"day"` | `"week"` | `"month"` | `"quarter"` | `"semi_annual"` | `"year"` | `"one_off"`
* `intervalCount: number`: defaults to `1`
Pricing for usage beyond the included amount. See [pricing patterns](#pricing-patterns) below.
How to handle mid-cycle quantity changes on prepaid items:
* `onIncrease:` `"prorate_immediately"` | `"bill_immediately"` | `"prorate_next_cycle"` | `"bill_next_cycle"`
* `onDecrease:` `"prorate_immediately"` | `"prorate_next_cycle"` | `"no_prorations"`
Leave it out to prorate immediately on both. `pull` only writes it when a plan uses something else.
Carry unused balance forward:
* `max: number`: maximum rollover amount. Leave it out for no limit.
* `maxPercentage: number`: maximum as a percentage (0-100) of the included amount. Use this or `max`, not both.
* `expiryDurationType:` `"month"` | `"forever"`
* `expiryDurationLength: number`: ignored if type is `"forever"`
`{ threshold: number }`: bill this many units each time unpaid usage reaches it, instead of waiting for the end of the cycle. Flat usage-based prices only.
For [entity plans](/documentation/modelling-pricing/entity-plans): pool every entity's balance for this feature into one shared customer balance.
Override the feature's settings for customers on this plan. For credit systems, `{ creditSchema: [...] }` replaces the rate card. For AI credit systems, `{ markups: { defaultMarkup, providerMarkups, modelMarkups } }` replaces the markups.
### Pricing patterns
The `price` object on a plan item supports different billing models:
**Usage-based**: charge based on actual usage.
```ts theme={null}
{
featureId: messages.featureId,
included: 1000,
reset: { interval: "month" },
price: {
amount: 1,
billingUnits: 1000,
interval: "month",
billingMethod: "usage_based",
},
}
```
**Prepaid**: customer buys a fixed quantity upfront.
```ts theme={null}
{
featureId: credits.featureId,
price: {
amount: 5,
billingUnits: 100,
interval: "month",
billingMethod: "prepaid",
},
}
```
**Tiered**: price changes based on usage volume.
```ts theme={null}
{
featureId: apiCalls.featureId,
reset: { interval: "month" },
price: {
tiers: [
{ to: 1000, amount: 0.01 },
{ to: 10000, amount: 0.008 },
{ to: "inf", amount: 0.005 },
],
interval: "month",
billingMethod: "usage_based",
},
}
```
#### Price fields
Price per `billingUnits`. Use this or `tiers`, not both.
Tiered pricing. Each entry: `{ to: number | "inf", amount: number, flatAmount?: number }`. `flatAmount` adds a fixed charge for the tier. Use this or `amount`, not both.
`"graduated"`: each tier is priced at its own rate. `"volume"`: the tier the total lands in prices everything. See [volume-based tiers](/documentation/modelling-pricing/volume-based-tiers).
Amounts in [other currencies](/documentation/concepts/plans#multiple-currencies). For flat prices: `[{ currency: "eur", amount: 0.09 }]` at the price level. For tiered prices, set per tier: `{ to: 1000, amount: 0.01, additionalCurrencies: [{ currency: "eur", amount: 0.009 }] }`.
`"usage_based"` | `"prepaid"`
`"week"` | `"month"` | `"quarter"` | `"semi_annual"` | `"year"` | `"one_off"`. Use `"one_off"` for one-time charges.
Intervals per billing cycle, eg `3` with `"month"` to bill every 3 months.
Units per price. Eg, \$5 per 100 credits = `amount: 5, billingUnits: 100`.
Maximum quantity that can be bought.
## Plan variants
A variant is a plan that starts from another plan and changes a few things, eg an annual version of Pro. Each one is a `variant()` entry listed in the base plan's `variants`. See [plan variants](/documentation/modelling-pricing/plan-variants) for how they work.
### `variant(config)`
The variant's own plan ID, eg `"pro_annual"`.
Name of this version of the variant, eg `"v1"`.
Display name, eg `"Pro Annual"`.
What the variant changes from the base plan:
* `price`: a new base price, or `null` to remove it
* `items`: replaces the whole items list
* `addItems` / `removeItems`: add plan items, or remove the base plan's by `{ featureId, billingMethod?, interval? }`. Use these instead of `items` to change only some items.
* `freeTrial`: a different trial, or `null` for none
* `billingControls`: different default billing controls
* `upsertLicenses` / `removeLicenses`: change the base plan's [licenses](#licenses)
Archive the variant. Leave it out to keep it as is.
Written by the CLI after a push. Leave it there.
```ts theme={null}
export const proAnnual = variant({
variantPlanId: "pro_annual",
versionSlug: "v1",
name: "Pro Annual",
customize: {
price: { amount: 200, interval: "year" },
},
});
export const pro = plan({
planId: "pro",
versionSlug: "v1",
active: true,
name: "Pro",
price: { amount: 20, interval: "month" },
items: [ ... ],
variants: [proAnnual],
});
```
## Licenses
A license links a plan to another plan that each seat gets, eg a Team plan that hands out a Seat plan per member. Each one is a `license()` entry in the parent plan's `licenses`. See [entity plans](/documentation/modelling-pricing/entity-plans#licenses).
### `license(config)`
The `planId` of the plan each seat gets.
Which version of that plan, eg `"v1"`.
Number of seats included for free.
Cap seats at the included amount. Must be `true` for now.
Change what a seat gets on this parent plan: `price`, `addItems` and `removeItems`, with the same shapes as [variants](#plan-variants).
```ts theme={null}
export const team = plan({
planId: "team",
versionSlug: "v1",
active: true,
name: "Team",
licenses: [
license({
licensePlanId: seat.planId,
versionSlug: seat.versionSlug,
included: 1,
}),
],
});
```
## Rewards
Rewards are discounts and free usage that customers unlock with a promo code, or through a referral program. They go in the `rewards` list. See [rewards and referrals](/documentation/modelling-pricing/rewards).
### `coupon(config)`
A discount on invoices.
Unique identifier for the coupon.
Display name.
`"percentage_discount"` | `"fixed_discount"`
The percentage off (up to 100) or the fixed amount off.
How long it applies: `{ type: "one_off" | "months" | "forever", length: number | null }`. `length` is the number of months for `"months"`, and `null` otherwise.
Plans the coupon applies to, or `null` for all plans.
Codes customers can redeem: `[{ code: "SAVE20", globalMaxRedemption?: number | null, firstTimeTransaction?: boolean | null }]`.
### `featureGrant(config)`
Free usage of one or more features, unlocked with a promo code.
Unique identifier for the grant.
Display name.
What the customer gets: `[{ featureId, included: number | null, expiry: { type: "day" | "week" | "month" | "year", length: number } | null }]`. Use `included: null` for boolean features and `expiry: null` for a grant that never expires.
Codes customers can redeem: `[{ code: "WELCOME", maxUses: number | null }]`. `null` means unlimited uses.
```ts theme={null}
export const launchDiscount = coupon({
id: "launch20",
name: "Launch discount",
type: "percentage_discount",
value: 20,
duration: { type: "months", length: 3 },
planIds: null,
promoCodes: [{ code: "LAUNCH20" }],
});
export const welcomeCredits = featureGrant({
id: "welcome_credits",
name: "Welcome credits",
grants: [
{
featureId: credits.featureId,
included: 500,
expiry: { type: "month", length: 1 },
},
],
promoCodes: [{ code: "WELCOME", maxUses: null }],
});
```
## Referral programs
A referral program gives a reward to customers who bring in new customers. They go in the `referralPrograms` list.
### `referralProgram(config)`
Unique identifier, used when creating and redeeming referral codes.
The `id` of the coupon or feature grant to give, as a string. `coupon()` and `featureGrant()` return a wrapped entry, so you can't read `.id` off them.
When the reward is given: `"customer_creation"` (when the new customer signs up) or `"checkout"` (when they buy a plan).
Who gets the reward: `"referrer"` only, or `"all"` (both the referrer and the new customer).
How many times one referrer can be rewarded. `null` for no limit.
Plans that trigger the reward. Required when `redeemOn` is `"checkout"`.
Skip the reward when the new customer starts a trial.
```ts theme={null}
export const referrals = referralProgram({
id: "friend_referral",
rewardId: "launch20",
redeemOn: "customer_creation",
receivedBy: "all",
maxRedemptions: 10,
});
```
## Settings
The `settings` block manages organization-wide flags. Only the flags you state are changed. If you stop stating a flag, it keeps its current value; to turn one off, state it as `false`.
```ts theme={null}
export default atmn({
features: [...],
plans: [...],
settings: {
invoiceMemos: true,
blockOverdueEntitlements: true,
},
});
```
| Flag | What it does |
| -------------------------- | ----------------------------------------------------------- |
| `cancelOnPastDue` | Automatically cancel subscriptions when payment is past due |
| `blockOverdueEntitlements` | Block access to features while a plan is past due |
| `reverseDeductionOrder` | Deduct from the newest balance first instead of the oldest |
| `invoiceMemos` | Include line-item memos on Stripe invoices |
| `disableOverageBilling` | Stop posting usage overage line items to Stripe |
| `paydownOverages` | Let resets and top-ups pay down unbilled overages |
| `automaticTax` | Turn on Stripe Tax for automatic tax calculation |
| `multiCurrency` | Allow prices and billing in more than one currency |
All default to `false`.
## Full example
A complete config with a free plan, a paid plan with a trial, and a credits top-up add-on:
```ts autumn.config.ts theme={null}
import { atmn, feature, plan } from "atmn";
// Features
export const messages = feature({
featureId: "messages",
name: "Messages",
type: "metered",
consumable: true,
});
export const seats = feature({
featureId: "seats",
name: "Seats",
type: "metered",
consumable: false,
});
export const sso = feature({
featureId: "sso",
name: "SSO",
type: "boolean",
});
// Plans
export const free = plan({
planId: "free",
versionSlug: "v1",
active: true,
name: "Free",
autoEnable: true,
items: [
{
featureId: messages.featureId,
included: 100,
reset: { interval: "month" },
},
],
});
export const pro = plan({
planId: "pro",
versionSlug: "v1",
active: true,
name: "Pro",
price: { amount: 20, interval: "month" },
freeTrial: {
durationLength: 14,
durationType: "day",
cardRequired: true,
},
items: [
{
featureId: messages.featureId,
included: 10000,
reset: { interval: "month" },
price: {
amount: 1,
billingUnits: 1000,
interval: "month",
billingMethod: "usage_based",
},
},
{
featureId: seats.featureId,
included: 3,
price: {
amount: 10,
interval: "month",
billingMethod: "prepaid",
},
},
{ featureId: sso.featureId },
],
});
export const messageTopUp = plan({
planId: "message_top_up",
versionSlug: "v1",
active: true,
name: "Message Top-Up",
addOn: true,
items: [
{
featureId: messages.featureId,
price: {
amount: 5,
billingUnits: 1000,
interval: "one_off",
billingMethod: "prepaid",
},
},
],
});
export default atmn({
features: [messages, seats, sso],
plans: [free, pro, messageTopUp],
});
```
# Getting started
Source: https://docs.useautumn.com/cli/getting-started
Set up the CLI, connect to Autumn, and sync your pricing config
The `atmn` CLI keeps your pricing in code. You write your features and plans in an `autumn.config.ts` file, preview what would change, and push it to Autumn with one command.
This page covers `atmn` 2. If you have a config from `atmn` 1.x, see [upgrading from 1.x](#upgrading-from-1x).
## Set up a project
Run `atmn init` in the root folder of your project:
```bash bun theme={null}
bunx atmn init
```
```bash npm theme={null}
npx atmn init
```
```bash pnpm theme={null}
pnpm dlx atmn init
```
`init` does the whole setup in one go:
1. **Connects you to Autumn.** If you don't have a key yet, it asks how you want to connect: sign in (opens your browser), or go keyless (creates a sandbox for you right away, no account needed).
2. **Creates your config folder.** By default that's `autumn/`, holding `autumn.config.ts` next to `features.ts`, `plans.ts` and `rewards.ts`. In a monorepo it asks where the folder should go (default `packages/autumn`) and what to call the package.
3. **Adds `atmn` to your `package.json`** and installs it, because the config imports from it. It also adds an `atmn` script and a small `"atmn"` field to your root `package.json`, so every command can find the config from anywhere in your repo.
4. **Pulls what's already in Autumn** into the config files.
5. **Installs the Autumn skills** next to the config, so your coding agent knows how to work with the CLI.
Your keys end up in a `.env` file at the root of your repo:
```bash .env theme={null}
AUTUMN_SECRET_KEY=am_sk_test_...
AUTUMN_PROD_SECRET_KEY=am_sk_live_...
```
Went keyless? Your sandbox has no owner yet. Link it to an account within a few days with `bunx atmn login --claim you@example.com`. The key you already have keeps working.
You can check your setup at any time with `bunx atmn env`. It shows which organization, environment and key your commands will use.
## Log in on its own
You don't need `init` to connect. `atmn login` opens your browser, lets you pick an organization, and writes both keys to your `.env`:
```bash theme={null}
bunx atmn login
```
Add `--keyless` to create a sandbox without an account instead.
## Push and pull
Once you have a config, sync it with Autumn:
```bash theme={null}
# Preview what would change
bunx atmn push
# Apply the changes
bunx atmn push --yes
# Pull what's in Autumn into your local files
bunx atmn pull
```
`push` reads your config, compares it with what's in Autumn, and shows what would be created, updated or deleted. Nothing changes until you add `--yes`. If a change affects a plan that already has customers, Autumn drafts a migration for you and `push` prints the link to run it.
After a push, the CLI writes an `internalId` into each feature and plan in your config. Leave it there. It's how the CLI knows to rename something instead of deleting and recreating it.
`pull` fetches your features, plans and rewards from Autumn and writes them into `features.ts`, `plans.ts` and `rewards.ts`, keeping your formatting where it can. If you don't have a config yet, it asks where to create one.
Already made plans in the dashboard? Run `bunx atmn pull` to turn them into a config.
## Environments
All commands use your **sandbox** by default. Add `-p` to target production:
```bash theme={null}
# Push to production
bunx atmn push -p --yes
# Pull from production
bunx atmn pull -p
```
`push -p` only previews the changes. Add `--yes` to apply them to production.
You can also create extra sandboxes for testing, each with its own plans and customers:
```bash theme={null}
bunx atmn sandbox create staging --use # create one and switch to it
bunx atmn sandbox use --clear # switch back to your main sandbox
```
See the [command reference](/cli/commands#sandboxes) for the full list.
## Upgrading from 1.x
`atmn` 2 uses a new config format. If you run a 1.x config, the CLI stops and tells you so instead of guessing. To move over:
1. Note any changes you made to your config that aren't in Autumn yet.
2. Rebuild the config from your organization. This rewrites `autumn.config.ts` and the `features.ts`, `plans.ts` and `rewards.ts` beside it. Other files are left alone.
```bash theme={null}
bunx atmn pull --overwrite --yes
```
3. Re-apply your pending changes in the new format, then `bunx atmn push`.
What changed:
| 1.x | 2.x |
| -------------------------------------------------------------- | ---------------------------------------------------------------------------------------------------- |
| `feature({ id: "messages" })` | `feature({ featureId: "messages" })` |
| `plan({ id: "pro" })` | `plan({ planId: "pro", versionSlug: "v1", active: true })` |
| `item({ ... })` inside `items` | Plain objects inside `items`. There is no `item()` helper. |
| Named exports only | The file ends with `export default atmn({ features, plans })` |
| Plan versions handled by the CLI on push | Each version is its own `plan()` entry with the same `planId`. See [versions](/cli/config#versions). |
| `atmn push` applied straight away | `atmn push` only previews. `atmn push --yes` applies. |
| `atmn pull --force` | `atmn pull --overwrite --yes` |
| `atmn nuke` | `atmn reset --yes` |
| `atmn customers`, `atmn plans`, `atmn features`, `atmn events` | Removed. Use [`atmn api`](/cli/commands#api) to call any endpoint. |
| `atmn preview`, `atmn logout`, `atmn config` | Removed. |
**Next: Configuration reference**
Learn how to define features, plans and pricing in your `autumn.config.ts`.
Every builder and field available in autumn.config.ts
# Balances
Source: https://docs.useautumn.com/documentation/concepts/balances
Understanding how feature balances work in Autumn
Balances determine what features a customer can use, and track how much they have used.
Balances are created in two ways:
1. **Automatically from plans**: When a plan is attached to a customer, each feature in the plan becomes a balance for that customer.
2. **Standalone via API**: You can create balances directly using the API, independent of any plan. See [Managing Balances](/documentation/customers/managing-balances) for details.
```mermaid theme={null}
flowchart LR
F[Feature] -->|added to plan| PF[Plan Item]
PF -->|plan attached to customer| B[Customer Balance]
```
## Core Fields
Each balance has the following key fields:
| Field | Description |
| ---------------- | ------------------------------------------------------- |
| `included_usage` | The amount granted by the plan, or a purchased quantity |
| `balance` | The remaining amount available |
| `usage` | The amount that has been consumed |
When you retrieve a customer, their balances will be included in the response.
For the complete balance schema including reset configuration, overage settings, and breakdown details, see the [Get Customer API reference](/api-reference/customers/get-customer).
```json theme={null}
{
"balances": {
"messages": {
"granted_balance": 1000,
"current_balance": 750,
"usage": 250,
"unlimited": false,
"reset": {
"interval": "month",
"resets_at": 1745193600000
}
},
"premium-support": {
"unlimited": true
}
}
}
```
## Feature Types and Balances
When you create a feature, you define its type. This affects how balances behave.
### Consumable Features
Features that are used up and can be replenished. Examples: credits, API requests, AI tokens.
Consumable features support **reset intervals** - the balance resets to the granted amount on a regular schedule.
Available reset intervals:
* `hour`, `day`, `week`, `month`, `quarter`, `semi_annual`, `year`
* `one_off` - the balance never resets (useful for one-time grants or top-ups)
### Non-Consumable Features
Features with persistent, continuous usage. Examples: seats, workspaces, storage.
Non-consumable features don't reset. Instead, they support **proration** when quantities change mid-billing cycle.
### Credit Systems
A [credit system](/documentation/modelling-pricing/credit-systems) lets multiple features draw from a single shared balance.
When you check or track usage, you use the underlying feature ID (e.g., `premium_message`), but the balance is deducted from the credit system.
When you track usage for a feature in a credit system, Autumn:
1. Looks up the credit cost for that feature that you defined
2. Multiplies the usage value by the credit cost
3. Deducts from the credit system balance
For example, if you have a credit system with a credit cost of 2 credits per API request, and a customer uses 10 API requests, Autumn will deduct 20 credits from the balance.
## Positive and Negative Balances
A balance can be positive or negative:
* **Positive balance**: Customer has unused allowance remaining
* **Negative balance**: Customer has used more than their allowance (only possible if [overage](/documentation/concepts/plan-items#priced-features) is enabled)
Features can only have a negative balance if they have a usage-based price that allows overage. Otherwise, tracking stops when balance reaches 0.
## Balance Stacking
A single feature can have balances from multiple sources - different plans, add-ons, or standalone grants.
Autumn combines these into a single parent balance while tracking each source separately in a `breakdown` array, grouped by plan and interval.
> **Example**
> A customer has a feature, `messages`, with the following balances:
>
> * Pro plan: 500 messages per month
> * Top-up add-on: 200 lifetime messages
>
> Their total available balance is 700 `messages`.
### The Breakdown Array
Each balance source is tracked separately in the `breakdown` array. This lets you see exactly where the balance came from and how much remains from each source.
```json expandable theme={null}
{
"balances": {
"messages": {
"included_usage": 700,
"balance": 700,
"usage": 0,
"breakdown": [
{
"id": "ent_abc123",
"product_id": "pro",
"included_usage": 500,
"balance": 500,
"usage": 0,
"interval": "month",
"next_reset_at": 1745193600000
},
{
"id": "ent_def456",
"product_id": "top-up",
"included_usage": 200,
"balance": 200,
"usage": 0,
"interval": "one_off",
"next_reset_at": null
}
]
}
}
}
```
### Deduction Order
When usage is tracked, Autumn deducts from balances in a specific order based on their reset interval. **Shorter intervals are deducted first** by default.
The order is: `hour` (shortest) > `day` > `week` > `month` > `quarter` > `semi_annual` > `year` > `one_off` (lifetime - never resets).
Balances with the same interval are deducted by `expires_at`, soonest first. Balances without an expiry are deducted last.
This ensures that expiring balances are used before permanent ones.
If you need the deduction order reversed (longest interval first), please [contact us](https://discord.gg/STqxY92zuS).
> **Example**
> Suppose a customer has two balances for messages: 500 monthly and 200 lifetime. They have a total of 700 messages.
>
> * The customer uses 400 messages. The monthly balance (the shorter interval) is used up first, leaving 100 in monthly and 200 in lifetime (300 total).
> * The customer uses another 200 messages. The remaining 100 monthly is depleted, and the next 100 is deducted from the lifetime balance. Now, monthly is 0, lifetime is 100 (100 total).
> * On the next cycle, the monthly balance resets to 500, and the lifetime remains at 100, for a new total of 600.
# Features
Source: https://docs.useautumn.com/documentation/concepts/features
Learn about features in Autumn and how to create them
Features represent the parts of your product that you want to control access to, based on the pricing plan a customer is on. There are 2 key types of features you can create:
* **Metered features**: features that require you to keep track of a usage balance (eg, credits, API requests)
* **Boolean features**: features that can be either enabled or disabled (eg, access to a premium analytics dashboard).
When you create a feature, you can set a display name, and it's ID. This will be used to identify the feature when you make API calls to Autumn, to check or tracking usage of the feature.
## Metered features
Metered features can either be `consumable` or `non-consumable`.
* **Consumable**: features that can be used up and replenished, either by recurring resets or purchases. For example, credits, API requests.
* **Non-consumable**: features that are used persistently. For example, seats, storage, workspaces.
When adding features to a plan, you will be able to set reset cycles for `consumable` features, and proration behavior for `non-consumable` features.
Under the "advanced" section of the feature creation sheet, you can also define [event names](/documentation/customers/tracking-usage#using-event-names). This gives you more control over how events interact with customer balances in Autumn.
Metered features can each act as their own, standlone balance, or be added to a [credit system](/documentation/modelling-pricing/credit-systems). This lets you define credit costs per feature, and let many features draw from a common credit balance.
## Boolean features
Boolean features are for your features that can be either enabled or disabled. Think of them like feature flags to gate specific parts of your application based on what product a user has (eg, access to a premium analytics dashboard).
For these features, there is no configuration needed to be set. If you add them to a product, users on that product will be granted [access to the feature](/documentation/customers/check#checking-boolean-features).
# How It Works
Source: https://docs.useautumn.com/documentation/concepts/overview
How features, plans, subscriptions and balances fit together
Autumn's data model has a clear pipeline: you define **features**, bundle them into **plans** with pricing, and when a plan is attached to a customer, it creates a **subscription** and provisions **balances** that you can check and track in real-time.
```mermaid actions={false} theme={null}
%%{init: {'flowchart': {'padding': 6, 'nodeSpacing': 10, 'rankSpacing': 20, 'subGraphTitleMargin': {'top': 4, 'bottom': 12}}} }%%
flowchart LR
subgraph features["**Features**"]
F3["AI Credits"]:::credit
end
subgraph plan["**Plan**"]
direction TB
subgraph price["Price"]
P1["$200/year"]:::pricing
end
subgraph planItems["Plan items"]
PI1["200 AI credits/month"]:::credit
end
price ~~~ planItems
end
subgraph customer["**Customer**"]
direction TB
subgraph customerPlans["Subscription"]
C1["$200/year"]:::pricing
end
subgraph balances["Balances"]
B1["146/200 AI credits left"]:::credit
end
customerPlans ~~~ balances
end
features ~~~ plan ~~~ customer
classDef credit fill:#22c55e30,stroke:#22c55e
classDef pricing fill:#ec489930,stroke:#ec4899
style features fill:#eab30820,stroke:#eab308
style plan fill:#7c3aed10,stroke:#7c3aed
style customer fill:#0ea5e910,stroke:#0ea5e9
style price fill:none,stroke:none
style planItems fill:none,stroke:none
style customerPlans fill:none,stroke:none
style balances fill:none,stroke:none
```
## Features
Features represent the parts of your product you want to control access to. There are three types: **boolean** (on/off flags like premium analytics), **consumable** (usage that resets, like API requests or credits), and **non-consumable** (persistent quantities like seats or storage).
Features are the atomic building blocks — everything else is built on top of them.
Learn about feature types and how to create them
## Plans
Plans bundle features together with a base price. Each plan represents a distinct pricing tier or package you offer — free, pro, enterprise, or any add-on. You define which features are included, how they're priced, and any properties like trials or auto-enable.
Learn about plan pricing, properties and groups
## Plan Items
When you add a feature to a plan, it becomes a **plan item** with its own configuration. Included items grant a usage amount at no extra cost. Priced items add billing — either prepaid or usage-based — with options for billing units, tiers, and proration.
Plan items are where the "what" (features) meets the "how much" (pricing).
Configure grants, pricing and usage models
## Subscriptions
When you attach a plan to a customer, Autumn creates a Stripe subscription under the hood and provisions balances for each feature in the plan. Subscriptions track status (active, trialing, past\_due, etc.) and handle the payment lifecycle.
How Autumn manages Stripe subscriptions
## Balances
Balances are the customer-facing result of everything above. Each plan item becomes a balance that tracks what the customer has been granted, what they've used, and what remains. Balances from multiple sources (plans, add-ons, top-ups) stack together, with shorter-interval balances consumed first.
Your app interacts with Autumn primarily through balances — calling `/check` to gate access and `/track` to record usage.
Understand balance stacking, resets and deduction order
## Runtime
Once your features, plans and pricing are configured, your app interacts with Autumn through a few core endpoints.
Model your pricing plans in the Autumn UI, or through a config file. Define your free, paid and any add-on pricing tiers.
You can link features to these plans and define their usage limits: both recurring (monthly, yearly), one-time top ups, rollovers, etc.
The [attach](/api-reference/billing/attach) endpoint subscribes a customer to a plan or purchases a one-time product. It handles new subscriptions, upgrades, downgrades and add-ons — creating the Stripe subscription and provisioning balances automatically.
Once paid, Autumn grants access to the features on their plan.
When a customer tries to do something (eg, use a credit), [check](/api-reference/core/check) in real-time whether they're allowed to based on their active plans and remaining balance.
Set `send_event` to atomically deduct usage while checking.
If the customer is allowed access, let them use the feature. Afterwards, [track](/api-reference/core/track) the usage to update their balance, or bill them for any usage-pricing.
Autumn also provides endpoints to [get customer billing data](/api-reference/customers/getOrCreateCustomer) (subscriptions, balances, invoices, payment methods), open Stripe billing portal, display usage analytics, handle org billing, and more.
# Plan Items
Source: https://docs.useautumn.com/documentation/concepts/plan-items
Configure what customers get access to when they purchase a plan
When you add a feature to a plan, you define what customers on that plan can use, and how they should be charged for it.
There are 2 types of plan features:
* **Included Features**: features provided at no additional cost, either as a granted usage limit or a boolean flag
* **Priced Features**: features that are billed for, either as a prepaid quantity or a usage-based price. Priced features can also have an included amount.
When a customer purchases a plan, the items in the plan become [balances](/documentation/concepts/balances) under the customer.
## Included Features
#### Grant amount
For metered features, you can set a grant amount. This is how much of the feature can be used before the user hits their limit.
When the plan is enabled for a customer, their balance for this feature will be set to the grant amount. It can either be a fixed amount, or "unlimited".
Tracking usage will decrement the feature's balance, and once it's fully consumed, checking access will return `allowed: false`.
#### Reset interval
For metered features that are `consumable`, you can also set a reset interval. This is how often the feature's balance will be reset to the grant amount.
Reset intervals can be: `no reset`, `hour`, `day`, `week`, `month`, `quarter`, `semi_annual`, or `year`. You can also customize the `interval count` to be a custom number of intervals between resets (eg, 4 hours).
`no reset` can be used to grant one-time grants that never expire. This is commonly used for top-ups or one-time purchases.
You cannot set a reset interval for `non-consumable` features (eg, seats).
#### Advanced
You can additionally configure the following properties when adding a `consumable` included feature:
* **Reset existing usage when plan is enabled**: when the plan is enabled (eg on upgrade), their usage cycle will reset, and customer's balance will be reset to full grant amount. This is `true` by default.
**Example**
You have a free plan that allows users to send 10 messages per month. A user on this plan has used 3 messages so in the current month. Then, they upgrade to a pro plan that grants 100 messages per month.
If `Reset existing usage when plan is enabled` is set to `true`, their balance will be reset to 100 messages. If it's set to `false`, the 3 messages used will be carried over, and their new balance will be 97 messages.
* **Rollovers**: configure whether granted usage should rollover to the next cycle. You can configure rollover duration, and a maximum rollover cap. Rollover balances can be retrieved from the `balances` object.
* **Pooled**: on plans attached per entity (eg, per workspace), setting `pooled: true` makes each entity's grant join one shared customer-level balance instead of a per-entity one. A pooled item cannot carry a usage-based price — to charge overage on a pooled balance, add a separate usage-priced item (with no grant) alongside the pooled grant item.
Features that are `non-consumable` have no advanced configuration options.
## Priced Features
Priced features can be used to model usage-based pricing, where the price of the product is variable and tied to how much of a feature a user consumes. This combines the configuration options of a feature with a price.
#### Grant amount
Priced features can also have an optional grant amount. This is how much of the feature can be used before being billed.
Tracking usage for a feature will first decrement the grant amount. The price will then be applied to the remaining usage.
#### Price
A feature's price consists of:
* **Price**: the price of the feature per billing units of usage, or tiered by usage
* **Billing Units**: the packages of units that the price is defined for (eg, \$5 for 1000 credits)
* **Billing Interval**: how often the price is applied. This can be one-time, or recurring (eg, monthly, annually).
#### Usage model
When charging for a feature, you can choose between 2 methods:
* **Usage-based**: charge for how much of the feature is used end of billing period
* **Prepaid**: charge for a fixed quantity of the feature upfront, and draw from it as usage occurs.
#### Advanced
You can additionally configure the following properties when adding a priced feature:
* **Max purchase limit**: the maximum quantity of the feature that can be purchased. Once this limit is reached, checking access will return `allowed: false`. It includes the grant amount, if it exists.
* **Proration behavior**: for `non-consumable` features, you can choose whether to prorate the price when the quantity is increased or decreased. You can also choose whether to charge for that change immediately, or at the end of the billing period.
For priced `consumable` features, you can also set the `reset existing usage when plan is enabled` and `rollovers` properties, in the same way as included features.
# Plans
Source: https://docs.useautumn.com/documentation/concepts/plans
Learn about plans in Autumn and how to create them
Plans are the separate packages that define what your customers get and how much they should be billed for it. Each plan you create is a distinct combination of these features and prices.
For example, you can define a separate plan for all the pricing tiers (eg free plan, team plan, enterprise tier) you offer, or all your different price variations (annual billing, monthly billing, usage-based billing)
## Plan Price
When you create a plan, you can set its price:
* **Free** - no price, free to use
* **Paid, one-off** - a fixed amount a user will be charged. This is often used for one-time topups.
* **Paid, recurring** - a fixed amount a user will be charged per unit of time. This is often used for subscriptions.
* **Variable** - there is no fixed price for this plan. The plan is priced purely based on feature usage or quantity purchased.
## Multiple Currencies
Multi-currency pricing is currently in preview - contact us to enable it for your organization.
Plan prices are in your organization's default currency. To sell the same plan in other currencies, add `additional_currencies` wherever a price is defined - the base price, a priced feature, or each tier of a tiered price:
```json theme={null}
{
"plan_id": "pro",
"price": {
"amount": 20,
"interval": "month",
"additional_currencies": [
{ "currency": "eur", "amount": 18 },
{ "currency": "gbp", "amount": 16 }
]
}
}
```
Each amount is set explicitly per currency - Autumn does not apply exchange rates. Tier boundaries stay the same across currencies; only the amounts differ.
Each customer is billed in a single currency. You can set it when creating the customer, pass it on their first `attach`, or let it default to your organization's currency. Once a customer has paid in a currency, they're locked to it (Stripe requires this), and attaching a plan that doesn't offer a price in their currency fails with a `currency_mismatch` error.
Under the hood, Autumn creates a separate Stripe price per currency under the same Stripe product, on demand when a customer first attaches in that currency.
## Plan Features
Plans are made up of a list of [features](/documentation/concepts/features). These can be:
* **Included Features** - features that come with the plan for no additional cost. These can be boolean flags, or metered features with a limit.
* **Priced Features** - features that are billable based on usage of a feature. These can also have an included amount, and a prepaid or usage-based price.
When a plan is enabled for a customer, they will be granted access to the features defined in the plan.
## Plan Properties
**Auto-enable**
Set this is the plan should be automatically applied to a customer when they're created. This is typically for free plans that give customers access to a limited set of features without paying.
**Add ons**
Set this if the plan is an add on. This will mean it can be purchased together with other plans. If this flag is not set, then enabling a plan will replace the existing plan.
**Plan Groups**
If you have multiple groups of plans, and customers can have an active plan from each of these subscription groups at the same time, group the plans together. All plan tiers from the same group should have the same value.
**Example**
Let's say you have two different types of chatbots - one for customer support and one for sales. You want customers to be able to have both types of chatbots at the same time, but only one tier from each type.
You would create two plan groups:
1. "Customer Support Chatbots" (group: "support")
* Basic (\$49/month - 1,000 tickets)
* Advanced (\$149/month - 5,000 tickets)
* Enterprise (\$399/month - Unlimited tickets)
2. "Sales Chatbots" (group: "sales")
* Starter (\$79/month - 500 leads)
* Growth (\$199/month - 2,000 leads)
* Enterprise (\$499/month - Unlimited leads)
This way, a customer could have both the "Advanced Support" chatbot and the "Starter Sales" chatbot active at the same time, but they couldn't have both "Basic Support" and "Advanced Support" active together.
## Trials
Under plan settings, you can set a free trial for a plan. This will give customers a set amount of days to try the plan for free.
You can set whether a card is required for the free trial. If a card is not required, you can `attach` the plan to a customer without them having to go through a checkout flow or have a card on file. It will be automatically expired after the free trial period.
Each customer can only have access to a plan's trial **once**. If they try to attach the plan again, the trial will be ignored.
For a step-by-step guide on enabling, cancelling and ending trials, see our examples:
* [Trial - card required](/examples/trial-card-required)
* [Trial - card not required](/examples/trial-card-not-required)
When creating an Autumn customer, you can set the `customer.fingerprint` field (eg. device ID, browser fingerprint). This will limit the customer to one trial of the plan per fingerprint to prevent abuse.
## Plan Variants
Plan variants are named alternatives of a base plan. They inherit the base plan and store only the differences, such as a different billing interval, a different experiment package, or a different included usage ladder.
For example, an annual Pro plan can be modeled as a variant of monthly Pro:
```json theme={null}
{
"variant_plan_id": "pro_annual",
"name": "Pro Annual",
"customize": {
"price": { "amount": 200, "interval": "year" }
}
}
```
Variants are useful for monthly/annual pricing, A/B testing plan packages, and volume-based offers that share most of the same features.
# Stripe Sync
Source: https://docs.useautumn.com/documentation/concepts/stripe
How Autumn creates and manages Stripe objects under the hood
Autumn uses Stripe to create subscriptions and charge customers. You define plans, features and pricing in Autumn, and Stripe objects (customers, products, prices, subscriptions, invoices) are created automatically as they're needed.
You never need to manually create or interact with these objects in Stripe. Autumn handles the full lifecycle, and owns the customer state.
## Autumn and Stripe responsibilities
Autumn is the source of truth for a customer's state and what they can do. Stripe handles subscriptions and payments.
| Feature | Managed by | Details |
| -------------------------- | ---------- | ---------------------------------------------------------------------------- |
| Pricing and features | **Autumn** | Define and update in Autumn dashboard or API |
| Balances & credit ledgers | **Autumn** | Tracked in real-time via `/check` and `/track` |
| Usage metering | **Autumn** | Tracks usage internally, posts totals to Stripe at cycle end (if configured) |
| Feature gating | **Autumn** | `/check` evaluates access from Autumn's balances |
| Subscriptions and payments | **Stripe** | Autumn creates Stripe subscriptions and charges customers |
| Invoices & receipts | **Stripe** | Generated and delivered by Stripe |
| Checkout pages | **Stripe** | Keep Stripe Checkout pages for payment method collection |
| Refunds & disputes | **Stripe** | Issue refunds directly in Stripe dashboard |
Autumn syncs from Stripe automatically. If you update or cancel a subscription directly in the Stripe dashboard, Autumn will attempt to apply the same change to the corresponding customer state.
## Connecting Stripe
There are three ways to connect your Stripe account to Autumn:
| Method | When to use |
| ------------------- | ------------------------------------------------------------------------------------------- |
| **Default sandbox** | Automatic — every new Autumn org gets a Stripe Connect sandbox account with no setup needed |
| **OAuth** | Recommended for production. Connect via the deploy dialog in the Autumn dashboard |
| **Secret key** | Paste your Stripe secret key directly. Autumn creates a webhook endpoint automatically |
When disconnecting and reconnecting a different Stripe account, existing Stripe IDs on your plans become invalid. Autumn will recreate the products and prices in the new account when you `attach` it, but old customers and subscriptions will no longer be linked.
## Currency
Currency is set at the organization level and defaults to `usd`. You can change it when connecting Stripe or from the developer settings page.
All new Stripe prices are created in your configured currency. Changing the currency does not migrate existing subscriptions — those remain in the original currency. New prices and subscriptions going forward will use the updated currency.
## How customers map
When you create a customer in Autumn, you pass your own user ID (from your auth system, database, or any unique identifier) as the `customer_id`. This is the only ID you need — there's no separate "auth ID" concept.
```mermaid theme={null}
flowchart LR
A["Your app user_123"] -->|customers.getOrCreate| B["Autumn Customer user_123"]
B -->|on first billing call| C["Stripe Customer cus_abc123"]
```
By default, a Stripe customer is **not** created when you create an Autumn customer. The Stripe customer is created lazily — the first time a billing operation needs one (attaching a plan, opening the billing portal, setting up a payment method, etc.).
You can change this behavior:
* Pass `createInStripe: true` to create the Stripe customer immediately when the Autumn customer is created
* Pass `stripeId: "cus_abc123"` to link an existing Stripe customer instead of creating a new one
See [Creating Customers](/documentation/customers/creating-customers#stripe-integration) for details.
Once linked, the mapping is bidirectional:
* **Autumn → Stripe**: the Stripe customer ID is stored on the Autumn customer
* **Stripe → Autumn**: the Autumn customer ID is stored in the Stripe customer's `metadata`
## How products and prices map
The table below shows what maps to what:
| Autumn object | Stripe object |
| ----------------------------- | ------------------------------------ |
| Plan | Product |
| Fixed price (on a plan) | Price |
| Usage-based price (on a plan) | Separate Product + Price per feature |
| Customer | Customer |
| Subscription | Subscription |
In production, Stripe products and prices are lazily created — only on the first `attach` that uses them, not when you create or update a plan in Autumn. This means you can pre-map an Autumn plan to an existing Stripe product/price before the first attach, and Autumn will reuse it instead of creating a duplicate.
### Fixed prices
Each fixed price on a plan maps 1:1 to a Stripe price, attached to the plan's Stripe product.
### Usage-based prices
Usage-based prices are more complex. For each priced feature, Autumn creates a **separate Stripe product** (named `"Plan Name - Feature Name"`) with its own Stripe price. Depending on the billing model, Autumn may also create:
* An empty placeholder price to anchor the subscription
* A billing meter for in-arrear usage reporting
* A prepaid price for upfront usage billing
These are all managed automatically — you don't need to configure them.
### Renaming in Stripe
You can rename products and update their descriptions directly in the Stripe dashboard for display purposes (e.g., on invoices or the customer portal). Autumn won't overwrite these cosmetic changes.
Renaming in Stripe is purely cosmetic. The plan's ID and configuration are still managed in Autumn. For structural changes (prices, features, billing model), always use Autumn.
## Webhooks
Autumn automatically creates and manages webhook endpoints when you connect Stripe. You don't need to configure these manually.
Autumn listens for key Stripe events to keep state in sync:
| Event | What Autumn does |
| ------------------------------- | ----------------------------------------------------------------- |
| `checkout.session.completed` | Finalizes the plan attachment and provisions balances |
| `invoice.paid` | Records payment, triggers balance provisioning for deferred plans |
| `invoice.created` | Captures usage line items for arrear billing on renewal |
| `customer.subscription.updated` | Syncs subscription status (active, past\_due, canceled, etc.) |
| `customer.subscription.deleted` | Expires the plan and activates default plans if configured |
## Direct vs deferred execution
When you call `billing.attach`, Autumn takes one of two paths depending on whether the customer can be charged immediately:
**Direct (immediate):** The customer already has a payment method. Autumn creates the Stripe subscription, charges the customer, and provisions balances — all in a single API call.
**Deferred (checkout):** The customer doesn't have a payment method, or the payment requires additional action (like 3DS). Autumn creates a Stripe Checkout Session (or returns a `required_action`), stores the pending billing plan, and completes everything when the webhook confirms payment.
See [Payment Flow](/documentation/customers/payment-flow) for the full breakdown of redirect modes and checkout behavior.
## What to do in Stripe directly
While Autumn manages most of the Stripe lifecycle, there are a few things you should handle in Stripe:
| Task | Where |
| ---------------------------------------------------------- | ---------------- |
| Rename products for invoice display | Stripe dashboard |
| View payment logs and disputes | Stripe dashboard |
| Advanced subscription alterations (eg cycle anchors) | Stripe dashboard |
| Everything else (plans, pricing, subscriptions, customers) | **Autumn** |
# Subscriptions
Source: https://docs.useautumn.com/documentation/concepts/subscriptions
How Autumn manages customer subscriptions
Autumn uses Stripe subscriptions under the hood to handle recurring billing. When you attach a plan to a customer, Autumn creates the Stripe subscription and provisions feature balances automatically.
```mermaid theme={null}
flowchart LR
P[Plan] -->|attach| C[Customer]
C -->|creates| S[Stripe Subscription]
S -->|provisions| B[Balances]
```
When a subscription is created, Autumn provisions [balances](/documentation/concepts/balances) for each feature in the plan. Balances determine what the customer can access and track how much they've used. For example, a Pro plan might grant 1,000 API requests per month—this becomes a balance that decrements as the customer uses your product.
Balances can also be created for [credit systems](/documentation/modelling-pricing/credit-systems) (eg, \$10 credits per month) and boolean toggle features (eg, access to a premium analytics dashboard).
## Subscription statuses
| Status | Description |
| ----------- | ------------------------------------------------------ |
| `active` | Subscription is in good standing |
| `trialing` | Customer is in a free trial period |
| `past_due` | Payment failed, subscription needs attention |
| `scheduled` | Product will activate at end of current billing period |
| `expired` | Subscription has ended |
Learn about the checkout and payment flow
Handle upgrades, downgrades and cancellations
# Balance Locking
Source: https://docs.useautumn.com/documentation/customers/balance-locking
Reserve balance upfront with locks, then confirm or release when the operation completes
For operations where you don't know the final cost upfront — like AI completions, batch processing, or long-running jobs — you can **reserve** balance before the work starts, then **finalize** the reservation when it's done.
This is a three-step flow:
1. **Check with lock** — atomically check access and hold balance
2. **Do work** — run your operation
3. **Finalize** — confirm the deduction, adjust it, or release the hold
```mermaid theme={null}
sequenceDiagram
participant App
participant Autumn
App->>Autumn: check (lock: { enabled: true, lock_id })
Autumn-->>App: allowed: true (balance held)
App->>App: Do work (e.g. AI completion)
App->>Autumn: balances.finalize (lock_id, action)
Autumn-->>App: success: true
```
## Step 1: Check with lock
Pass the `lock` parameter to the check endpoint. This atomically checks if the customer has enough balance and reserves it in a single call.
```typescript TypeScript theme={null}
const response = await autumn.check({
customerId: "user_123",
featureId: "ai-tokens",
requiredBalance: 1000,
sendEvent: true,
lock: {
enabled: true,
lockId: "completion_abc123",
expiresAt: Date.now() + 5 * 60 * 1000, // 5 minutes
},
});
if (!response.allowed) {
// Customer doesn't have enough balance
}
// Balance is now held — proceed with the operation
```
```python Python theme={null}
response = await autumn.check(
customer_id="user_123",
feature_id="ai-tokens",
required_balance=1000,
send_event=True,
lock={
"enabled": True,
"lock_id": "completion_abc123",
"expires_at": int(time.time() * 1000) + 5 * 60 * 1000,
},
)
if not response.allowed:
# Customer doesn't have enough balance
pass
# Balance is now held — proceed with the operation
```
```bash cURL theme={null}
curl -X POST "https://api.useautumn.com/v1/check" \
-H "Authorization: Bearer am_sk_..." \
-H "Content-Type: application/json" \
-d '{
"customer_id": "user_123",
"feature_id": "ai-tokens",
"required_balance": 1000,
"send_event": true,
"lock": {
"enabled": true,
"lock_id": "completion_abc123",
"expires_at": 1735689600000
}
}'
```
### Lock parameters
| Parameter | Type | Description |
| ------------ | --------- | ------------------------------------------------------------------------------------------------------- |
| `enabled` | `boolean` | Must be `true` to enable locking |
| `lock_id` | `string` | A unique identifier for this lock. You'll use this to finalize later. If omitted, Autumn generates one. |
| `expires_at` | `number` | Unix timestamp (ms) when the lock auto-expires and releases the held balance. Max 24 hours from now. |
Always set an `expires_at` to prevent balance from being held indefinitely if your finalize call fails. If a lock expires, the held balance is automatically released back to the customer.
## Step 2: Do your work
Run whatever operation you reserved balance for. The held balance is guaranteed to be available — no other concurrent request can consume it.
## Step 3: Finalize the lock
When the operation completes, call `balances.finalize` to resolve the held balance.
### Confirm the full amount
If the operation used exactly the amount you reserved, confirm the lock:
```typescript TypeScript theme={null}
await autumn.balances.finalize({
lockId: "completion_abc123",
action: "confirm",
});
```
```python Python theme={null}
await autumn.balances.finalize(
lock_id="completion_abc123",
action="confirm",
)
```
```bash cURL theme={null}
curl -X POST "https://api.useautumn.com/v1/balances.finalize" \
-H "Authorization: Bearer am_sk_..." \
-H "Content-Type: application/json" \
-d '{
"lock_id": "completion_abc123",
"action": "confirm"
}'
```
### Release the hold
If the operation failed or was canceled, release the lock to return the held balance:
```typescript TypeScript theme={null}
await autumn.balances.finalize({
lockId: "completion_abc123",
action: "release",
});
```
```python Python theme={null}
await autumn.balances.finalize(
lock_id="completion_abc123",
action="release",
)
```
```bash cURL theme={null}
curl -X POST "https://api.useautumn.com/v1/balances.finalize" \
-H "Authorization: Bearer am_sk_..." \
-H "Content-Type: application/json" \
-d '{
"lock_id": "completion_abc123",
"action": "release"
}'
```
### Adjust the final amount
If the actual usage differs from the reserved amount (common with AI tokens), pass `overrideValue` to adjust:
```typescript TypeScript theme={null}
// Reserved 1000 tokens, but only used 743
await autumn.balances.finalize({
lockId: "completion_abc123",
action: "confirm",
overrideValue: 743,
});
```
```python Python theme={null}
# Reserved 1000 tokens, but only used 743
await autumn.balances.finalize(
lock_id="completion_abc123",
action="confirm",
override_value=743,
)
```
```bash cURL theme={null}
curl -X POST "https://api.useautumn.com/v1/balances.finalize" \
-H "Authorization: Bearer am_sk_..." \
-H "Content-Type: application/json" \
-d '{
"lock_id": "completion_abc123",
"action": "confirm",
"override_value": 743
}'
```
Autumn will reconcile the difference — returning the unused 257 tokens back to the customer's balance.
## Use cases
### AI completions
Reserve a token budget before starting generation, then finalize with the actual token count:
```typescript theme={null}
const lockId = `completion_${generateId()}`;
const { allowed } = await autumn.check({
customerId: "user_123",
featureId: "ai-tokens",
requiredBalance: 4000, // max_tokens
sendEvent: true,
lock: {
enabled: true,
lockId,
expiresAt: Date.now() + 60_000,
},
});
if (!allowed) return showUpgradePrompt();
const completion = await openai.chat.completions.create({
model: "gpt-4",
max_tokens: 4000,
messages: [{ role: "user", content: prompt }],
});
await autumn.balances.finalize({
lockId,
action: "confirm",
overrideValue: completion.usage.total_tokens,
});
```
### Long-running jobs
Reserve credits before queuing a job, release if the job fails:
```typescript theme={null}
const lockId = `job_${jobId}`;
const { allowed } = await autumn.check({
customerId: "user_123",
featureId: "compute-credits",
requiredBalance: 10,
sendEvent: true,
lock: {
enabled: true,
lockId,
expiresAt: Date.now() + 30 * 60_000, // 30 min timeout
},
});
if (!allowed) throw new Error("Insufficient credits");
try {
await runJob(jobId);
await autumn.balances.finalize({ lockId, action: "confirm" });
} catch (error) {
await autumn.balances.finalize({ lockId, action: "release" });
throw error;
}
```
## Compared to check + track
For simple operations where you know the cost upfront and the operation is fast, [check with `sendEvent`](/documentation/customers/check#checking-and-reserving-usage) is simpler — it deducts immediately in one call.
Use reservations when:
* The final usage amount is unknown at check time (e.g., AI token counts)
* The operation can fail after balance is deducted
* The operation takes significant time and you don't want another request to consume the same balance
# Billing Controls
Source: https://docs.useautumn.com/documentation/customers/billing-controls
Configure overage behavior, spend limits, usage alerts, and auto top-ups per customer or entity
Billing controls let you manage how individual customers (or [entities](/documentation/customers/feature-entities)) consume usage-based features. You can toggle whether overage is allowed, cap how much overage accumulates, hard-cap how much a feature can be used per time window, get notified when usage crosses a threshold, and automatically replenish prepaid balances — all configured per-customer via the API or viewed in the dashboard.
All billing controls are set through the `billingControls` field when [updating a customer](/api-reference/customers/updateCustomer) or [updating an entity](/api-reference/entities/updateEntity).
```typescript TypeScript theme={null}
await autumn.customers.update({
customerId: "user_123",
billingControls: {
overageAllowed: [{ featureId: "api_calls", enabled: true }],
spendLimits: [{ featureId: "api_calls", enabled: true, overageLimit: 5000 }],
usageLimits: [{ featureId: "api_calls", limit: 50, interval: "day" }],
usageAlerts: [{ featureId: "api_calls", threshold: 80, thresholdType: "usage_percentage", enabled: true }],
autoTopups: [{ featureId: "credits", enabled: true, threshold: 500, quantity: 1000 }],
},
});
```
```python Python theme={null}
await autumn.customers.update(
customer_id="user_123",
billing_controls={
"overage_allowed": [{"feature_id": "api_calls", "enabled": True}],
"spend_limits": [{"feature_id": "api_calls", "enabled": True, "overage_limit": 5000}],
"usage_limits": [{"feature_id": "api_calls", "limit": 50, "interval": "day"}],
"usage_alerts": [{"feature_id": "api_calls", "threshold": 80, "threshold_type": "usage_percentage", "enabled": True}],
"auto_topups": [{"feature_id": "credits", "enabled": True, "threshold": 500, "quantity": 1000}],
},
)
```
```bash cURL theme={null}
curl -X POST "https://api.useautumn.com/v1/customers/update" \
-H "Authorization: Bearer am_sk_..." \
-H "Content-Type: application/json" \
-d '{
"customer_id": "user_123",
"billing_controls": {
"overage_allowed": [{"feature_id": "api_calls", "enabled": true}],
"spend_limits": [{"feature_id": "api_calls", "enabled": true, "overage_limit": 5000}],
"usage_limits": [{"feature_id": "api_calls", "limit": 50, "interval": "day"}],
"usage_alerts": [{"feature_id": "api_calls", "threshold": 80, "threshold_type": "usage_percentage", "enabled": true}],
"auto_topups": [{"feature_id": "credits", "enabled": true, "threshold": 500, "quantity": 1000}]
}
}'
```
## Overage Allowed
By default, whether a customer can use a feature beyond their included balance depends on the plan's pricing model. Features with [usage-based pricing](/documentation/modelling-pricing/usage-based-pricing) (pay-per-use) automatically allow overage — the customer keeps using and gets billed for the extra. Features without usage-based pricing (like a flat included allowance) block usage once the balance hits zero.
The `overageAllowed` control lets you override this default per customer or entity.
#### Default behavior (no override)
| Plan item pricing | Overage? |
| ------------------------------------- | ---------------------------------------------------------- |
| Usage-based (pay-per-use) | Allowed — customer is billed for overage |
| Included / prepaid (no overage price) | Blocked — `check` returns `allowed: false` at zero balance |
#### With `overageAllowed` enabled
Setting `overageAllowed` to `true` on a feature lets a customer consume beyond their included balance **even when the plan doesn't have usage-based pricing** for that feature. The balance goes negative, meaning you can track how much overage occurred, though no automatic overage charge is created.
> **Example**
> A customer is on a free plan with 100 API calls included (no overage pricing). Normally they'd be blocked at 0 remaining. You set `overageAllowed: true` for `api_calls`. Now they can keep using beyond 100, and you can decide how to handle the overage in your application (prompt an upgrade, bill manually, etc.).
```typescript TypeScript theme={null}
await autumn.customers.update({
customerId: "user_123",
billingControls: {
overageAllowed: [{
featureId: "api_calls",
enabled: true,
}],
},
});
```
```python Python theme={null}
await autumn.customers.update(
customer_id="user_123",
billing_controls={
"overage_allowed": [{
"feature_id": "api_calls",
"enabled": True,
}],
},
)
```
```bash cURL theme={null}
curl -X POST "https://api.useautumn.com/v1/customers/update" \
-H "Authorization: Bearer am_sk_..." \
-H "Content-Type: application/json" \
-d '{
"customer_id": "user_123",
"billing_controls": {
"overage_allowed": [{
"feature_id": "api_calls",
"enabled": true
}]
}
}'
```
| Field | Type | Description |
| ------------ | ------- | -------------------------------------------- |
| `feature_id` | string | The feature to override overage behavior for |
| `enabled` | boolean | `true` to allow overage, `false` to block it |
#### Disabling overage on a pay-per-use feature
You can also use `overageAllowed` to **block** overage on a feature that would normally allow it. Setting `enabled: false` forces a hard cap at the included balance — even if the plan has usage-based pricing for that feature.
> **Example**
> A customer's plan includes 1,000 API calls with pay-per-use overage at \$1/1,000 calls. You set `overageAllowed: false` for `api_calls`. The customer is now blocked at 1,000 total calls — no overage charges will occur.
Setting `overageAllowed: false` is a hard override. It takes precedence over usage-based pricing on the plan. The customer will be blocked at zero remaining balance regardless of whether overage pricing exists.
#### How it interacts with spend limits
`overageAllowed` and [spend limits](#spend-limits) are complementary:
* **`overageAllowed`** answers: *can* usage go beyond the included balance?
* **Spend limits** answer: *how far* can overage go?
If both are set, `overageAllowed` is checked first. If overage is blocked (`enabled: false`), the spend limit is irrelevant. If overage is allowed, the spend limit caps how much overage can accumulate.
## Spend Limits
Spend limits cap how much overage a customer can accumulate on a usage-based feature. Once the cap is reached, `check` returns `allowed: false` and `track` stops deducting.
> **Example**
> A customer's plan includes 1,000 API calls with \$1 per 1,000 overage calls. You set a spend limit of 5,000 on `api_calls`. The customer can use up to 6,000 total calls (1,000 included + 5,000 overage), then they're blocked.
```typescript TypeScript theme={null}
await autumn.customers.update({
customerId: "user_123",
billingControls: {
spendLimits: [{
featureId: "api_calls",
enabled: true,
overageLimit: 5000,
}],
},
});
```
```python Python theme={null}
await autumn.customers.update(
customer_id="user_123",
billing_controls={
"spend_limits": [{
"feature_id": "api_calls",
"enabled": True,
"overage_limit": 5000,
}],
},
)
```
```bash cURL theme={null}
curl -X POST "https://api.useautumn.com/v1/customers/update" \
-H "Authorization: Bearer am_sk_..." \
-H "Content-Type: application/json" \
-d '{
"customer_id": "user_123",
"billing_controls": {
"spend_limits": [{
"feature_id": "api_calls",
"enabled": true,
"overage_limit": 5000
}]
}
}'
```
| Field | Type | Description |
| --------------- | ------- | ------------------------------------------------ |
| `feature_id` | string | The feature to cap |
| `enabled` | boolean | Whether the spend limit is active |
| `overage_limit` | number | Maximum overage units beyond the included amount |
The `overage_limit` is measured in feature units, not dollars. An `overage_limit` of 5,000 on "API calls" means 5,000 additional API calls beyond the included allowance.
When both a spend limit and a plan-level max purchase exist for the same feature, the **spend limit takes precedence**. This lets you use max purchase as a default for all customers, then selectively raise or lower the cap per-customer.
For a deeper dive, see [Spend Limits & Usage Alerts](/documentation/modelling-pricing/spend-limits).
## Usage Limits
A usage limit is a **windowed hard cap**: at most `limit` units of a feature per `interval` window (day, week, month, or year), regardless of how much balance the customer has left or how the plan is priced. It's a throttle, that you or your customer may set.
Once usage reaches the cap inside the active window, `check` returns `allowed: false` and `track` stops deducting.
Usage limits cap *total usage* of a feature within a period: a sub-limit within an existing balance. They sit on top of the plan's allowance and apply even when there's balance remaining and even when the feature has no overage pricing.
`set_usage` sets a feature's balance but never touches usage-window counters. A capped feature stays capped: after `set_usage`, a customer whose window is exhausted still gets `allowed: false` until the window resets. To count usage against a window (including limits with conditions, which match on event properties), record usage normally with `track`.
The consumed counter belongs to the window, not to the limit's configuration — editing the limit never resets what's already been counted. To unblock a capped customer mid-window: **disable** the limit (`enabled: false`) to stop it gating while keeping its configuration, **raise** the limit (headroom becomes the new limit minus usage already counted), or **delete** it.
> **Example**
> A customer's plan includes **300 credits per month**, but you want to stop any single day from burning through them. Set a usage limit of **50 on `credits` with a `day` interval**. The customer still gets their 300 monthly credits, but can never spend more than 50 in a day.
```typescript TypeScript theme={null}
await autumn.customers.update({
customerId: "user_123",
billingControls: {
usageLimits: [{
featureId: "credits",
limit: 50,
interval: "day",
}],
},
});
```
```python Python theme={null}
await autumn.customers.update(
customer_id="user_123",
billing_controls={
"usage_limits": [{
"feature_id": "credits",
"limit": 50,
"interval": "day",
}],
},
)
```
```bash cURL theme={null}
curl -X POST "https://api.useautumn.com/v1/customers/update" \
-H "Authorization: Bearer am_sk_..." \
-H "Content-Type: application/json" \
-d '{
"customer_id": "user_123",
"billing_controls": {
"usage_limits": [{
"feature_id": "credits",
"limit": 50,
"interval": "day"
}]
}
}'
```
| Field | Type | Description |
| ------------ | ------ | ------------------------------------------------------------------------------ |
| `feature_id` | string | The feature to cap |
| `limit` | number | Maximum units allowed per window |
| `interval` | string | Window length: `"day"`, `"week"`, `"month"`, or `"year"`. Cannot be `one_off`. |
Each customer/entity feature in a `get` response carries a `usage_limits` array where every entry also reports the `usage` consumed in the current window, so you can show "12 / 50 used today" without a separate call.
### Window reset and plan changes
Each window aligns to the **customer's billing cycle**, not the UTC calendar. A `day` cap rolls at the customer's billing time-of-day; a `month` cap rolls on their billing-cycle anchor. When there's no billing cycle to anchor to (e.g. a feature with no backing plan), the window falls back to UTC calendar alignment — daily windows roll at UTC midnight, monthly on the 1st.
Because the window is tied to the feature's reset cycle, **a plan change that restarts that cycle also restarts the window.** If a customer upgrades mid-month and their billing anchor moves, the usage limit's window re-anchors to the new cycle and the consumed counter starts fresh.
### Caps on credit systems
When a feature is part of a [credit system](/documentation/modelling-pricing/credit-systems), you can cap usage at either level:
* **Cap the credit balance** — e.g. limit total `credits` spend per window across every feature that draws from it.
* **Cap an individual feature** — e.g. give a credit system shared by features A, B, and C, but limit how many units of B specifically can be used per window. The per-feature cap is converted into credits using B's credit cost, so both caps are enforced together.
> **Example — per-feature cap inside a credit system**
> Your `credits` system is spent by `images`, `transcriptions`, and `exports`. Customers can spend credits freely across all three, but you cap `exports` at **10 per day** so one feature can't drain the whole balance. A check or track on `exports` is blocked at 10/day even if plenty of credits remain.
When more than one cap applies to a check (the cap on the evaluated feature and a cap on its parent credit system), Autumn enforces the **tightest** one — the remaining headroom is the minimum across all armed caps.
## Usage Alerts
Usage alerts fire a webhook when a customer's usage crosses a threshold. They don't block usage — they notify, so you can take action like sending a warning email or prompting an upgrade.
There are two threshold types:
* **`usage`** — fires when absolute usage reaches a specific count
* **`usage_percentage`** — fires when usage reaches a percentage of the included allowance
```typescript TypeScript theme={null}
await autumn.customers.update({
customerId: "user_123",
billingControls: {
usageAlerts: [
{
featureId: "api_calls",
threshold: 80,
thresholdType: "usage_percentage",
enabled: true,
name: "80% usage warning",
},
{
featureId: "api_calls",
threshold: 900,
thresholdType: "usage",
enabled: true,
name: "Approaching limit",
},
],
},
});
```
```python Python theme={null}
await autumn.customers.update(
customer_id="user_123",
billing_controls={
"usage_alerts": [
{
"feature_id": "api_calls",
"threshold": 80,
"threshold_type": "usage_percentage",
"enabled": True,
"name": "80% usage warning",
},
{
"feature_id": "api_calls",
"threshold": 900,
"threshold_type": "usage",
"enabled": True,
"name": "Approaching limit",
},
],
},
)
```
```bash cURL theme={null}
curl -X POST "https://api.useautumn.com/v1/customers/update" \
-H "Authorization: Bearer am_sk_..." \
-H "Content-Type: application/json" \
-d '{
"customer_id": "user_123",
"billing_controls": {
"usage_alerts": [
{
"feature_id": "api_calls",
"threshold": 80,
"threshold_type": "usage_percentage",
"enabled": true,
"name": "80% usage warning"
},
{
"feature_id": "api_calls",
"threshold": 900,
"threshold_type": "usage",
"enabled": true,
"name": "Approaching limit"
}
]
}
}'
```
| Field | Type | Description |
| ---------------- | ----------------- | --------------------------------------------------------------------------------------- |
| `feature_id` | string | The feature to monitor |
| `threshold` | number | Trigger value — absolute count or percentage (0–100) |
| `threshold_type` | string | `"usage"` for absolute count, `"usage_percentage"` for percentage of included allowance |
| `enabled` | boolean | Whether the alert is active (defaults to `true`) |
| `name` | string (optional) | A label to distinguish multiple alerts |
Each alert fires **once** per threshold crossing. It won't re-fire unless usage drops below the threshold and crosses it again.
When triggered, Autumn sends a `balances.usage_alert_triggered` [webhook](/documentation/webhooks). See the [webhook schema](/api-reference/webhooks/balancesUsageAlertTriggered) for the full payload.
For more details and examples, see [Spend Limits & Usage Alerts](/documentation/modelling-pricing/spend-limits#usage-alerts).
## Auto Top-Ups
Auto top-ups automatically replenish a customer's prepaid balance when it drops below a configured threshold. This prevents service interruptions for customers who don't want to manually manage their credits.
> **Example**
> A customer gets 5,000 credits per month. When their balance drops below 500, Autumn automatically purchases 1,000 more credits using the plan's one-off prepaid price.
Auto top-ups require a plan with a [one-off prepaid](/documentation/modelling-pricing/one-off-purchases) item for the feature, and the customer must have a payment method on file.
```typescript TypeScript theme={null}
await autumn.customers.update({
customerId: "user_123",
billingControls: {
autoTopups: [{
featureId: "credits",
enabled: true,
threshold: 500,
quantity: 1000,
}],
},
});
```
```python Python theme={null}
await autumn.customers.update(
customer_id="user_123",
billing_controls={
"auto_topups": [{
"feature_id": "credits",
"enabled": True,
"threshold": 500,
"quantity": 1000,
}],
},
)
```
```bash cURL theme={null}
curl -X POST "https://api.useautumn.com/v1/customers/update" \
-H "Authorization: Bearer am_sk_..." \
-H "Content-Type: application/json" \
-d '{
"customer_id": "user_123",
"billing_controls": {
"auto_topups": [{
"feature_id": "credits",
"enabled": true,
"threshold": 500,
"quantity": 1000
}]
}
}'
```
| Field | Type | Description |
| ---------------- | ----------------- | ----------------------------------------- |
| `feature_id` | string | The feature (credit balance) to monitor |
| `enabled` | boolean | Whether auto top-up is active |
| `threshold` | number | Balance level that triggers a top-up |
| `quantity` | number | Units to purchase each time |
| `purchase_limit` | object (optional) | Rate limit on how often top-ups can occur |
To prevent runaway spending, you can set a purchase limit:
```json theme={null}
{
"purchase_limit": {
"interval": "month",
"interval_count": 1,
"limit": 5
}
}
```
This limits the customer to 5 auto top-ups per month. Supported intervals: `hour`, `day`, `week`, `month`.
For setup instructions and how it works end-to-end, see [Auto Top-Ups](/documentation/modelling-pricing/auto-top-ups).
## Customer vs Entity Controls
Billing controls can be set at two levels:
| Control | Customer-level | Entity-level |
| ------------------- | -------------- | ------------ |
| **Overage allowed** | Yes | Yes |
| **Spend limits** | Yes | Yes |
| **Usage limits** | Yes | Yes |
| **Usage alerts** | Yes | Yes |
| **Auto top-ups** | Yes | No |
**Entity-level** controls are configured by updating the entity instead of the customer. Entity-level controls override customer-level controls for that entity — for example, an entity overage override takes precedence over the customer-level setting, and entity spend limits override the customer-level limit.
Overrides are resolved **per feature**: an entity's own entry for a feature wins, and the customer's entries fill in any features the entity doesn't set. For usage limits specifically, an inherited (customer-level) cap counts usage against the **shared customer window** — it's the same aggregate cap, not a separate per-entity copy. An entity-level usage limit, by contrast, gets its own per-entity window and counter.
> **Example — per-entity cap**
> An org (the customer) has 1,000 monthly API calls shared across its workspaces (entities). You set a customer-level usage limit of 1,000/month so the org can't exceed its plan, and an entity-level limit of 200/day on a noisy workspace so it can't starve the others. The workspace is blocked at 200/day; the org is blocked at 1,000/month.
```typescript TypeScript theme={null}
await autumn.entities.update({
customerId: "org_123",
entityId: "workspace_a",
billingControls: {
overageAllowed: [{
featureId: "api_calls",
enabled: true,
}],
spendLimits: [{
featureId: "api_calls",
enabled: true,
overageLimit: 2000,
}],
usageLimits: [{
featureId: "api_calls",
limit: 200,
interval: "day",
}],
usageAlerts: [{
featureId: "api_calls",
threshold: 90,
thresholdType: "usage_percentage",
enabled: true,
}],
},
});
```
```python Python theme={null}
await autumn.entities.update(
customer_id="org_123",
entity_id="workspace_a",
billing_controls={
"overage_allowed": [{
"feature_id": "api_calls",
"enabled": True,
}],
"spend_limits": [{
"feature_id": "api_calls",
"enabled": True,
"overage_limit": 2000,
}],
"usage_limits": [{
"feature_id": "api_calls",
"limit": 200,
"interval": "day",
}],
"usage_alerts": [{
"feature_id": "api_calls",
"threshold": 90,
"threshold_type": "usage_percentage",
"enabled": True,
}],
},
)
```
```bash cURL theme={null}
curl -X POST "https://api.useautumn.com/v1/entities/update" \
-H "Authorization: Bearer am_sk_..." \
-H "Content-Type: application/json" \
-d '{
"customer_id": "org_123",
"entity_id": "workspace_a",
"billing_controls": {
"overage_allowed": [{
"feature_id": "api_calls",
"enabled": true
}],
"spend_limits": [{
"feature_id": "api_calls",
"enabled": true,
"overage_limit": 2000
}],
"usage_limits": [{
"feature_id": "api_calls",
"limit": 200,
"interval": "day"
}],
"usage_alerts": [{
"feature_id": "api_calls",
"threshold": 90,
"threshold_type": "usage_percentage",
"enabled": true
}]
}
}'
```
Auto top-ups are customer-level only because they create invoices and charge a payment method, which is tied to the customer account — not individual entities.
## Plan-Level Defaults
Every billing control can also be defined on a **plan** (in the dashboard under plan settings → billing controls, via the `billingControls` field when creating or updating a plan, or in the [CLI config](/cli/config#plans) with the same field). Plan-level controls act as defaults for every customer on that plan — set a daily usage limit once on your free tier instead of on each customer.
```ts autumn.config.ts theme={null}
export const free = plan({
planId: "free",
versionSlug: "v1",
active: true,
name: "Free",
autoEnable: true,
items: [{ featureId: "emails", included: 200, reset: { interval: "month" } }],
billingControls: {
usageLimits: [{ featureId: "emails", limit: 200, interval: "day" }],
},
});
```
Resolution when a customer is on one or more plans:
* A **customer-level entry shadows the plan's entry** for the same feature (for usage limits, the same feature *and* conditions). Setting a control on the customer is how you override the plan default — and a disabled customer entry still shadows the plan's, it doesn't resurface it.
* With **multiple attached plans** defining the same control, the most restrictive wins (auto top-ups: the most recently attached plan's config).
### Reading effective controls
From API version `2.3.0`, [fetching a customer](/api-reference/customers/getCustomer) returns the **effective** controls: plan defaults are merged into `billing_controls`, and every entry carries a `source` field so you can tell overrides from inherited defaults. Inherited usage limits include the live window `usage`, so you can render "X of 200 used today" without extra calls.
```json theme={null}
"billing_controls": {
"usage_limits": [
{
"feature_id": "emails",
"enabled": true,
"limit": 200,
"interval": "day",
"usage": 37,
"source": "plan"
}
]
}
```
On earlier API versions, `billing_controls` contains only customer-level entries. Entity responses always show the entity's own controls.
## Related Webhooks
Billing controls tie into three webhook events that fire automatically based on usage:
| Event | When it fires |
| --------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| [`balances.limit_reached`](/api-reference/webhooks/balancesLimitReached) | Customer transitions from allowed to not allowed on a feature (included allowance exhausted, max purchase hit, spend limit reached, or usage limit hit). The payload's `limit_type` distinguishes `included`, `max_purchase`, `spend_limit`, and `usage_limit`. |
| [`balances.usage_alert_triggered`](/api-reference/webhooks/balancesUsageAlertTriggered) | Customer's usage crosses a configured alert threshold |
| [`customer.products.updated`](/documentation/webhooks#customerproductsupdated) | Customer's subscription changes (new, upgrade, downgrade, cancel, etc.) |
For webhook setup and security details, see [Webhooks](/documentation/webhooks).
# Checking access
Source: https://docs.useautumn.com/documentation/customers/check
Learn how to check feature access with the `check` endpoint
When you create a plan in Autumn, you define what features your customers on that plan get access to.
The `check` method returns the `allowed` field in real-time to check if a customer should have access to a feature. You can use this to block access and prompt an upsell.
## The `allowed` field
The `allowed` field will return `true` for a given feature if:
* The customer has an active plan with this feature
* The customer has an active plan with a `credit_system` that grants this feature
* The plan feature is included or prepaid, and the current balance is greater than the `required_balance` parameter
* The plan feature is usage-based, and the user has not exceeded their max spend limit
* The plan feature is unlimited or a boolean feature
Under these conditions, you should allow your customer to use the feature. You can then [record the usage event](/documentation/customers/tracking-usage/) so Autumn can update the `allowed` field as necessary.
The customer must already exist before calling `check`. If the `customer_id` doesn't match an existing customer, the API returns a `customer_not_found` error. Create customers using [`customers.getOrCreate`](/documentation/customers/creating-customers) during signup or login.
## Checking metered features
Before your customer uses a feature, you can check if the customer is allowed to use it and their current usage.
**Example**
Let's imagine you have a free plan for a chatbot that allows 5 messages per month. Before your customer sends an AI message, you can check if they have any left.
If they still have messages remaining, they'll be allowed to send an AI message.
```typescript TypeScript theme={null}
import { Autumn } from "autumn-js";
const autumn = new Autumn({ secretKey: "am_sk_test_1234" });
const response = await autumn.check({
customerId: "user_123",
featureId: "messages",
});
console.log(response.allowed);
```
```python Python theme={null}
from autumn_sdk import Autumn
autumn = Autumn("am_sk_test_1234")
response = await autumn.check(
customer_id="user_123",
feature_id="messages",
)
print(response.allowed)
```
```bash cURL theme={null}
curl -X POST "https://api.useautumn.com/v1/check" \
-H "Authorization: Bearer am_sk_test_1234" \
-H "Content-Type: application/json" \
-d '{
"customer_id": "user_123",
"feature_id": "messages"
}'
```
```json theme={null}
{
"allowed": true,
"customerId": "user_123",
"requiredBalance": 1,
"balance": {
"featureId": "messages",
"granted": 5,
"remaining": 5,
"usage": 0,
"unlimited": false,
"overageAllowed": false,
"nextResetAt": 1767610960519
}
}
```
Even if your product doesn't have usage limits (ie your feature is purely usage-based), you can still use the above method to prevent usage if a customer's payment fails.
## Checking for a required balance
If you know the balance a user will consume in advance, you can specify it with the `requiredBalance` parameter. This means you can prevent a user from starting a process that would consume more than their current balance.
By default, `requiredBalance` is 1, so not passing this parameter will return `allowed: true` as long as the customer has a feature balance of 1 or more.
```typescript TypeScript theme={null}
import { Autumn } from "autumn-js";
const autumn = new Autumn({ secretKey: "am_sk_test_1234" });
const response = await autumn.check({
customerId: "user_123",
featureId: "messages",
requiredBalance: 3,
});
console.log(response.allowed);
```
```python Python theme={null}
from autumn_sdk import Autumn
autumn = Autumn("am_sk_test_1234")
response = await autumn.check(
customer_id="user_123",
feature_id="messages",
required_balance=3,
)
print(response.allowed)
```
```bash cURL theme={null}
curl -X POST "https://api.useautumn.com/v1/check" \
-H "Authorization: Bearer am_sk_test_1234" \
-H "Content-Type: application/json" \
-d '{
"customer_id": "user_123",
"feature_id": "messages",
"required_balance": 3
}'
```
## Checking and reserving usage
When you don't know the final cost upfront — like AI completions or long-running jobs — reserve balance with a `lock` on the check call, then finalize it once the operation completes.
```typescript TypeScript theme={null}
import { Autumn } from "autumn-js";
const autumn = new Autumn({ secretKey: "am_sk_test_1234" });
const response = await autumn.check({
customerId: "user_123",
featureId: "api_calls",
requiredBalance: 3,
sendEvent: true,
lock: {
enabled: true,
lockId: "request_abc123",
expiresAt: Date.now() + 5 * 60 * 1000, // 5 minutes
},
});
console.log(response.allowed);
```
```python Python theme={null}
from autumn_sdk import Autumn
autumn = Autumn("am_sk_test_1234")
response = await autumn.check(
customer_id="user_123",
feature_id="api_calls",
required_balance=3,
send_event=True,
lock={
"enabled": True,
"lock_id": "request_abc123",
"expires_at": int(time.time() * 1000) + 5 * 60 * 1000,
},
)
print(response.allowed)
```
```bash cURL theme={null}
curl -X POST "https://api.useautumn.com/v1/check" \
-H "Authorization: Bearer am_sk_test_1234" \
-H "Content-Type: application/json" \
-d '{
"customer_id": "user_123",
"feature_id": "api_calls",
"required_balance": 3,
"send_event": true,
"lock": {
"enabled": true,
"lock_id": "request_abc123",
"expires_at": 1735689600000
}
}'
```
Once the operation completes, finalize the lock — `confirm` it to keep the deduction, or `release` it if the operation failed.
```typescript TypeScript theme={null}
await autumn.balances.finalize({
lockId: "request_abc123",
action: "confirm",
});
```
```python Python theme={null}
await autumn.balances.finalize(
lock_id="request_abc123",
action="confirm",
)
```
```bash cURL theme={null}
curl -X POST "https://api.useautumn.com/v1/balances.finalize" \
-H "Authorization: Bearer am_sk_test_1234" \
-H "Content-Type: application/json" \
-d '{
"lock_id": "request_abc123",
"action": "confirm"
}'
```
See [Balance Locking](/documentation/customers/balance-locking) for the full guide, including releasing a lock and adjusting the final amount when actual usage differs from what you reserved.
## Checking boolean features
For simple on/off features, use the check method to determine if a customer has access:
```typescript TypeScript theme={null}
import { Autumn } from "autumn-js";
const autumn = new Autumn({ secretKey: "am_sk_test_1234" });
const response = await autumn.check({
customerId: "user_123",
featureId: "premium-dashboard",
});
if (response.allowed) {
// Show premium dashboard
}
```
### Feature flags in customer responses
Boolean features are also returned as a `flags` object on customer and entity API responses. This lets you check on/off feature access directly from the customer object without calling the `check` endpoint separately.
```json theme={null}
{
"balances": {
"credits": { "featureId": "credits", "granted": 1000, "remaining": 800, "usage": 200 }
},
"flags": {
"premiumDashboard": {
"id": "cus_ent_abc123",
"planId": "pro_plan",
"expiresAt": null,
"featureId": "premiumDashboard"
}
}
}
```
* **Flags** are separate from **balances** — boolean features appear under `flags`, while metered and credit system features remain under `balances`
* Each flag shows which `planId` it originates from and when it expires
* Use `expand: ["flags.feature"]` to include the full feature object on each flag
```typescript TypeScript theme={null}
const customer = await autumn.customers.getOrCreate({
customerId: "user_123",
expand: ["flags.feature"],
});
if (customer.flags?.["premiumDashboard"]) {
// Customer has the premium dashboard feature
}
```
```python Python theme={null}
customer = await autumn.customers.get_or_create(
customer_id="user_123",
expand=["flags.feature"],
)
if customer.flags and "premium_dashboard" in customer.flags:
# Customer has the premium dashboard feature
pass
```
# Creating Customers
Source: https://docs.useautumn.com/documentation/customers/creating-customers
Create customers via API or dashboard, link to Stripe, and pre-create for enterprise deals
Customers represent the entities — usually users or organizations — of your application that can use and pay for your products.
For each customer, Autumn will:
* Keep record of the products they've purchased
* Track the features they've used and have access to
* Bill them through Stripe for the prices you've set
## Creating a customer via API
Use the `customers.getOrCreate` method to create a customer. This is idempotent — it creates the customer if they don't exist, or returns the existing one if they do.
```typescript TypeScript theme={null}
import { Autumn } from "autumn-js";
const autumn = new Autumn({ secretKey: "am_sk_test_1234" });
const customer = await autumn.customers.getOrCreate({
customerId: "user_123",
name: "John Doe",
email: "john@example.com",
});
```
```python Python theme={null}
from autumn_sdk import Autumn
autumn = Autumn("am_sk_test_1234")
customer = await autumn.customers.get_or_create(
customer_id="user_123",
name="John Doe",
email="john@example.com",
)
```
```bash cURL theme={null}
curl -X POST "https://api.useautumn.com/v1/customers" \
-H "Authorization: Bearer am_sk_test_1234" \
-H "Content-Type: application/json" \
-d '{
"customer_id": "user_123",
"name": "John Doe",
"email": "john@example.com"
}'
```
Only the `customerId` field is required — this should be your unique identifier for the customer that you'll use in all future API calls.
A common pattern is to call `customers.getOrCreate` on every login or signup in your application, so Autumn always has the latest customer information.
Customers must be created before calling the [`check`](/documentation/customers/check) or [`track`](/documentation/customers/tracking-usage) endpoints. If you call these endpoints with a `customer_id` that doesn't exist, the API will return a `customer_not_found` error. Make sure to call `customers.getOrCreate` during signup or login before checking access or tracking usage.
## Pre-creating customers via the dashboard
You can create a customer in the Autumn dashboard before they've ever interacted with your application. This is useful for enterprise or sales-led deals where you want to provision access before the customer signs up.
1. Navigate to the [Customers page](https://app.useautumn.com/customers)
2. Click "Create Customer"
3. Fill in the customer's details (name, email). **Leave the `id` field blank** — it will be assigned when the customer first logs in.
4. Click "Create Customer"
Once the customer is created, you can enable products and configure their features from the customer details page. When the customer eventually signs up in your application, Autumn will match them by email and link the pre-created customer record.
The email you provide must match the email the customer will use to sign up or log in. You can update the email from the customer details page if needed.
**Example: Enterprise onboarding**
You've closed an enterprise deal with Acme Corp. Before their team starts using your product:
1. Create a customer in the dashboard with the billing contact's email
2. Enable a custom Enterprise plan with negotiated pricing
3. When the Acme team signs up, Autumn matches the email and they immediately have their plan active — no checkout needed
## Customer properties
#### Customer ID
Your unique identifier for the customer. This is the only required field. It could be:
* Your database ID for the user
* Their email address
* Any other unique identifier in your system
#### Name and Email
Optional fields that help identify the customer in the Autumn dashboard and on Stripe invoices.
## Stripe integration
By default, Autumn does **not** create a Stripe customer when you create an Autumn customer. A Stripe customer is created lazily — only when the first billing operation needs one (like `billing.attach`, `billing.openCustomerPortal`, or `billing.setupPayment`).
```mermaid theme={null}
flowchart LR
A["Your app user_123"] -->|customers.getOrCreate| B["Autumn Customer user_123"]
B -->|on first billing call| C["Stripe Customer cus_abc123"]
```
You can change this behavior:
#### Create in Stripe immediately
Pass `createInStripe: true` to create the Stripe customer at the same time as the Autumn customer. This is useful if you need the Stripe customer ID upfront (e.g., for your own Stripe integration).
```typescript TypeScript theme={null}
await autumn.customers.getOrCreate({
customerId: "user_123",
name: "John Doe",
email: "john@example.com",
createInStripe: true,
});
```
```python Python theme={null}
await autumn.customers.get_or_create(
customer_id="user_123",
name="John Doe",
email="john@example.com",
create_in_stripe=True,
)
```
```bash cURL theme={null}
curl -X POST "https://api.useautumn.com/v1/customers" \
-H "Authorization: Bearer am_sk_test_1234" \
-H "Content-Type: application/json" \
-d '{
"customer_id": "user_123",
"name": "John Doe",
"email": "john@example.com",
"create_in_stripe": true
}'
```
#### Link to an existing Stripe customer
If you already have a Stripe customer (e.g., you're migrating to Autumn), pass `stripeId` to link it instead of creating a new one:
```typescript TypeScript theme={null}
await autumn.customers.getOrCreate({
customerId: "user_123",
stripeId: "cus_abc123",
});
```
```python Python theme={null}
await autumn.customers.get_or_create(
customer_id="user_123",
stripe_id="cus_abc123",
)
```
```bash cURL theme={null}
curl -X POST "https://api.useautumn.com/v1/customers" \
-H "Authorization: Bearer am_sk_test_1234" \
-H "Content-Type: application/json" \
-d '{
"customer_id": "user_123",
"stripe_id": "cus_abc123"
}'
```
Once linked, the mapping is bidirectional — the Stripe customer ID is stored on the Autumn customer, and the Autumn customer ID is stored in the Stripe customer's metadata.
For more details on how Autumn and Stripe work together, see [Stripe Sync](/documentation/concepts/stripe).
# Custom Plans
Source: https://docs.useautumn.com/documentation/customers/custom-plans
Create one-off plan variations for individual customers
Sometimes a customer needs a plan that doesn't match any of your standard offerings — extra credits, different pricing, or access to features not in their current tier. Custom plans let you create a one-off variation of any product for a specific customer, without changing the product for everyone else.
## When to use custom plans
Custom plans are useful when:
* An enterprise customer negotiates a different price or feature set
* You want to give a customer extra allowance as a one-time accommodation
* A customer needs access to a feature that isn't in their current plan
* You're closing a deal that doesn't fit neatly into your standard tiers
## Creating a custom plan via the dashboard
1. Navigate to the [Customer details page](https://app.useautumn.com/customers) for the customer
2. Click "Enable Product" (or click the existing product to modify it)
3. Make changes to the product items before enabling:
* Adjust feature allowances (e.g., increase included credits from 100 to 500)
* Add or remove features
* Change pricing (fixed or usage-based)
4. Click "Enable"
This creates a custom version of the product — only this customer will have it. The original product remains unchanged for all other customers.
## What happens when you enable a custom plan
The behavior depends on what you changed:
| Change type | Behavior |
| -------------------------------------------------------- | ------------------------------------------------------------------------------------------ |
| **Features only** (allowances, adding/removing features) | Takes effect immediately. New balances are provisioned while keeping existing reset dates. |
| **Pricing changes** (higher price) | Treated as an upgrade — prorated charges apply for the remainder of the billing cycle. |
| **Pricing changes** (lower price) | Treated as a downgrade — scheduled for end of current billing cycle. |
## Custom plans vs editing balances
If you just need a temporary adjustment (e.g., granting a customer extra credits this month), you can [edit their balance directly](/documentation/customers/managing-customers#editing-feature-balances) instead. Balance edits reset at the next billing cycle.
Custom plans are better when you want the change to persist across billing cycles.
**Example**
A customer on your Pro plan (100 credits/month, \$50/month) needs 250 credits/month at the same price. Create a custom plan with 250 included credits. They'll get 250 credits every month going forward, while all other Pro customers continue getting 100.
## Custom plans and versioning
Custom plans are tracked as separate versions of the product. When you [update the base product](/documentation/customers/versioning), customers on custom plans are not affected — they stay on their custom version.
If you want to migrate a customer off a custom plan and onto the latest standard version, you can do so from the [customer details page](https://app.useautumn.com/customers) by re-enabling the standard product.
# Billing Reliability
Source: https://docs.useautumn.com/documentation/customers/edge-cases
How Autumn handles 3DS, payment failures, and other uncommon states
In addition to the subscription lifecycle, Autumn automatically handles a number of edge cases to make sure your customers are always billed correctly.
## 3D Secure (3DS)
When a payment requires 3D Secure authentication, the `attach` response returns:
```json theme={null}
{
"required_action": {
"code": "3ds_required",
"reason": "Payment requires 3D Secure authentication"
},
"payment_url": "https://invoice.stripe.com/..."
}
```
As normal, redirect the customer to the `payment_url` to complete authentication. Once they authenticate, Autumn processes the payment and activates the plan automatically via the `invoice.paid` webhook.
The invoice URL expires after **10 minutes**. If the customer doesn't complete authentication in time, the invoice is automatically voided and the attach must be retried.
## Payment Failures
If the customer's payment method is declined during `attach`, the response returns:
```json theme={null}
{
"required_action": {
"code": "payment_failed",
"reason": "Card was declined"
},
"payment_url": "https://invoice.stripe.com/..."
}
```
The `payment_url` links to Stripe's hosted invoice page where the customer can update their payment method and retry. As with 3DS, the invoice is auto-voided after 10 minutes if left unresolved.
A third code, `payment_method_required`, is returned when no payment method is on file at all. In this case, redirect the customer to the `payment_url` which points to a Stripe Checkout session.
## Past Due Subscriptions
If a recurring payment fails (e.g. card expired between billing cycles), the subscription status becomes `past_due`. To resolve this:
1. Direct the customer to the [billing portal](/api-reference/billing/openCustomerPortal) to update their payment method
2. Once updated, Stripe automatically retries the failed invoice
```typescript Node.js theme={null}
const { data } = await autumn.billing.openCustomerPortal("user_123", {
returnUrl: "https://your-app.com/billing",
});
// Redirect to data.url
```
```python Python theme={null}
response = await autumn.billing.open_customer_portal(
"user_123",
return_url="https://your-app.com/billing",
)
# Redirect to response.url
```
If you'd like to block feature access when a subscription is `past_due`, please contact us. We can enable a configuration flag to do this for you.
## Subscription Expiry
When a subscription is deleted or expires, any open invoices associated with it are automatically voided. This prevents a scenario where a customer could pay a stale invoice for a subscription that no longer exists — the payment would go through but have no effect.
This also applies when a subscription transitions to `past_due` and is automatically canceled (if that behavior is enabled for your organization).
## Proration Failures
When an upgrade generates a proration invoice that fails to pay, Autumn automatically **rolls back the subscription update** to the customer's previous plan. The open invoice is then handled through the same 3DS / payment failure flow described above — the customer receives an invoice URL to resolve the payment.
## Concurrent Requests
Autumn uses distributed locking to prevent race conditions across billing operations. All mutating billing endpoints — `attach`, `multi_attach`, and `update_subscription` — share a per-customer lock. If two requests arrive simultaneously for the same customer, the second request receives a `429` response. This prevents duplicate subscriptions, double charges, or conflicting subscription updates.
The same lock is shared with auto top-ups, so a top-up triggered by usage can't race against a manual attach for the same customer.
## Duplicate Webhook Delivery
Stripe may deliver the same webhook event multiple times. Autumn deduplicates webhooks using a per-event idempotency key — if the same Stripe event ID is received more than once within a 5-minute window, the duplicate is acknowledged without reprocessing.
Additionally, when Autumn initiates a subscription change (e.g. a cancellation or upgrade), it sets a short-lived lock on the subscription. This prevents the resulting Stripe webhook from re-processing the change that Autumn already applied, avoiding double-counting or conflicting state updates.
## API Idempotency
All API requests support an `Idempotency-Key` header. If the same key is sent within 24 hours, the duplicate request is rejected with a `409` response. This is useful when retrying requests after network failures — you won't accidentally attach the same plan twice.
Event tracking (`track`) uses the same header. Pass it as a request option rather than a body field:
```typescript theme={null}
await autumn.track(
{ customerId: "cus_123", featureId: "api_calls", value: 1 },
{ headers: { "Idempotency-Key": "request_abc123" } }
);
```
# Entities
Source: https://docs.useautumn.com/documentation/customers/feature-entities
Learn how to use feature entities to track balances per separate entity, such as a user or a workspace
Entities are sub accounts of a customer. For example, you may have a product that allows 500 credits **per user** per month.
## Product setup
An entity can hold its own plan, with its own balances, while the parent customer pays. There are two ways to provision that, differing in where capacity comes from:
1. **Attach directly**: pass the [entity ID](/api-reference/billing/attach#body-entity-id) into an attach call. The entity gets its own subscription in Stripe, with billing cycles synced to the parent. Use this when entities appear and you bill for them as they do.
2. **Licenses**: the parent plan offers a pool of seats that the customer buys upfront, and you assign one to an entity to give it its plan. Use this when customers commit to a seat count before you know who fills it.
Both support different tiers per entity. See [entity plans](/documentation/modelling-pricing/entity-plans) for the full setup of either.
**Example**
Max has a team product where each seat gets 30 meeting note summaries per month, and teams buy their seat count upfront. He creates a Seat license plan holding the 30 summaries, offers it under his Team plan, and assigns a license each time someone joins.
Jamie also has a team product, but workspaces are created ad hoc and each can be on a Free or Pro tier. She creates the two tiers as normal and attaches them at the entity level as workspaces appear.
## Creating entities
You can manage feature entities via the `entities` route. This can be used to create, update and delete entities, such as when a seat or workspace is added or removed.
When you create an entity, a **usage event** will automatically be sent that increments the count of the number of entities (eg seats) being used.
This means if you create 2 entities for "seats", your usage of "seats" will be 2, allowing Autumn to bill accordingly if there's a price set.
This is how seats are counted when you attach plans directly. With [licenses](/documentation/modelling-pricing/entity-plans#licenses), seats are counted by the license pool instead, and the entity's feature only identifies its type.
```typescript TypeScript theme={null}
import { Autumn } from "autumn-js";
const autumn = new Autumn({ secretKey: "am_sk_test_1234" });
await autumn.entities.create({
customerId: "org_123",
entityId: "user_abc",
featureId: "seats",
name: "John Doe",
});
```
```python Python theme={null}
from autumn_sdk import Autumn
autumn = Autumn("am_sk_test_1234")
await autumn.entities.create(
customer_id="org_123",
entity_id="user_abc",
feature_id="seats",
name="John Doe",
)
```
```bash cURL theme={null}
curl -X POST "https://api.useautumn.com/v1/entities" \
-H "Authorization: Bearer am_sk_test_1234" \
-H "Content-Type: application/json" \
-d '{
"customer_id": "org_123",
"entity_id": "user_abc",
"feature_id": "seats",
"name": "John Doe"
}'
```
## Managing entity balances
Just like with normal features, you can check feature access and track usage events for each entity.
#### Check feature access
```typescript TypeScript theme={null}
import { Autumn } from "autumn-js";
const autumn = new Autumn({ secretKey: "am_sk_test_1234" });
const response = await autumn.check({
customerId: "org_123",
featureId: "ai-messages",
entityId: "user_abc",
});
console.log(response.allowed);
```
```python Python theme={null}
from autumn_sdk import Autumn
autumn = Autumn("am_sk_test_1234")
response = await autumn.check(
customer_id="org_123",
feature_id="ai-messages",
entity_id="user_abc",
)
print(response.allowed)
```
```bash cURL theme={null}
curl -X POST "https://api.useautumn.com/v1/check" \
-H "Authorization: Bearer am_sk_test_1234" \
-H "Content-Type: application/json" \
-d '{
"customer_id": "org_123",
"feature_id": "ai-messages",
"entity_id": "user_abc"
}'
```
#### Send usage event
```typescript TypeScript theme={null}
import { Autumn } from "autumn-js";
const autumn = new Autumn({ secretKey: "am_sk_test_1234" });
await autumn.track({
customerId: "org_123",
featureId: "ai-messages",
entityId: "user_abc",
value: 10,
});
```
```python Python theme={null}
from autumn_sdk import Autumn
autumn = Autumn("am_sk_test_1234")
await autumn.track(
customer_id="org_123",
feature_id="ai-messages",
entity_id="user_abc",
value=10,
)
```
```bash cURL theme={null}
curl -X POST "https://api.useautumn.com/v1/track" \
-H "Authorization: Bearer am_sk_test_1234" \
-H "Content-Type: application/json" \
-d '{
"customer_id": "org_123",
"feature_id": "ai-messages",
"entity_id": "user_abc",
"value": 10
}'
```
#### Customer-level vs entity-level balances
A customer-level balance is the total balance for the feature across all entities. Entity-level balances are the balance for a specific entity. You can check access and track usage events either at the customer-level or entity-level.
**Example**
You have a product that allows 500 credits per user per month. However, the credits are shared across all users in the account.
You can create a feature entity for "seats" and then check access and send usage events at the top-level.
To use top-level balances, just omit the `entityId` from your check request.
This will increment the usage counter for the top-level balance, and also
deduct from the first-created entity so that the sum of the the entity
balances is always the same as the top-level balance.
## Deleting Entities
Just as creating an entity sent a usage event for the associated feature,
deleting an entity will decrease the usage.
```typescript TypeScript theme={null}
import { Autumn } from "autumn-js";
const autumn = new Autumn({ secretKey: "am_sk_test_1234" });
await autumn.entities.delete({
customerId: "org_123",
entityId: "user_abc",
});
```
```python Python theme={null}
from autumn_sdk import Autumn
autumn = Autumn("am_sk_test_1234")
await autumn.entities.delete(
customer_id="org_123",
entity_id="user_abc",
)
```
```bash cURL theme={null}
curl -X DELETE "https://api.useautumn.com/v1/entities/user_abc" \
-H "Authorization: Bearer am_sk_test_1234" \
-H "Content-Type: application/json" \
-d '{ "customer_id": "org_123" }'
```
# Managing Balances
Source: https://docs.useautumn.com/documentation/customers/managing-balances
Create, update, and manage balances via the dashboard or API
You can manage customer balances through the Autumn dashboard or programmatically via the API.
## From the Dashboard
### Viewing Balances
1. Go to the [Customers page](https://app.useautumn.com/customers)
2. Click on a customer to view their details
3. Their balances are displayed in the **Balances** section, including breakdown by source
### Modifying a Balance
To set or add to a feature's balance:
1. Navigate to the customer's detail page
2. Under the balances section, click on the feature you want to modify. If there are [stacked balances](/documentation/concepts/balances#balance-stacking), choose the one you want to modify.
3. Choose whether to **set the balance** to a specific value or **add to the balance**
4. Enter the amount and save
## Creating Standalone Balances (API)
You can use the `/balances/create` endpoint to grant balances independent of any plan, for example to issue one-time promotional credits, referral rewards, or make manual customer adjustments.
You can also set expiration dates for promotional usage grants and configure reset intervals.
```typescript Node.js theme={null}
import { Autumn } from "autumn-js";
const autumn = new Autumn({ secretKey: "am_sk_..." });
await autumn.balances.create({
customer_id: "user_123",
feature_id: "credits",
granted_balance: 500,
reset: {
interval: "one_off"
}
});
```
```python Python theme={null}
from autumn import Autumn
autumn = Autumn(secret_key="am_sk_...")
autumn.balances.create(
customer_id="user_123",
feature_id="credits",
granted_balance=500,
reset={
"interval": "one_off"
}
)
```
```bash cURL theme={null}
curl -X POST https://api.useautumn.com/v1/balances/create \
-H "Authorization: Bearer am_sk_..." \
-H "Content-Type: application/json" \
-d '{
"customer_id": "user_123",
"feature_id": "credits",
"granted_balance": 500,
"reset": {
"interval": "one_off"
}
}'
```
See the [Create Balance API reference](/api-reference/balances/createBalance) for all available parameters.
## Updating Balances (API)
Use the `/customers/{customer_id}/balances` endpoint to set balances for a customer.
```typescript Node.js theme={null}
import { Autumn } from "autumn-js";
const autumn = new Autumn({ secretKey: "am_sk_..." });
await autumn.customers.updateBalances("user_123", {
balances: [{ feature_id: "credits", balance: 750 }]
});
```
```python Python theme={null}
from autumn import Autumn
autumn = Autumn(secret_key="am_sk_...")
autumn.customers.update_balances(
"user_123",
balances=[{"feature_id": "credits", "balance": 750}]
)
```
```bash cURL theme={null}
curl -X POST https://api.useautumn.com/v1/customers/user_123/balances \
-H "Authorization: Bearer am_sk_..." \
-H "Content-Type: application/json" \
-d '{
"balances": [{ "feature_id": "credits", "balance": 750 }]
}'
```
See the [Set Feature Balance API reference](/api-reference/balances/updateBalance) for all available parameters.
## Querying Balances
### Via Get Customer
Retrieve all balances for a customer:
```typescript Node.js theme={null}
const customer = await autumn.customers.get("user_123");
console.log(customer.balances);
```
```python Python theme={null}
customer = autumn.customers.get("user_123")
print(customer.balances)
```
```bash cURL theme={null}
curl https://api.useautumn.com/v1/customers/user_123 \
-H "Authorization: Bearer am_sk_..."
```
See the [Get Customer API reference](/api-reference/customers/get-customer) for the full response schema.
### Via Check Endpoint
Check access and get the current balance for a specific feature:
```typescript Node.js theme={null}
const result = await autumn.check({
customer_id: "user_123",
feature_id: "credits"
});
console.log(result.allowed);
console.log(result.balance);
```
```python Python theme={null}
result = autumn.check(
customer_id="user_123",
feature_id="credits"
)
print(result.allowed)
print(result.balance)
```
```bash cURL theme={null}
curl -X POST https://api.useautumn.com/v1/check \
-H "Authorization: Bearer am_sk_..." \
-H "Content-Type: application/json" \
-d '{
"customer_id": "user_123",
"feature_id": "credits"
}'
```
See the [Check API reference](/api-reference/core/check) for more details.
# Managing Customers
Source: https://docs.useautumn.com/documentation/customers/managing-customers
Learn how to view and manage customer information in Autumn
The customer details page provides a comprehensive view of a customer's information, subscriptions, and usage. You can access this by clicking on any customer from the [Customers page](https://app.useautumn.com/customers).
The customer details page shows:
* **Products**: View active subscriptions, status, billing dates, and feature limits
* **Features**: Track usage, limits, reset dates and history graphs
* **Invoices**: See billing history, payment status, amounts and hosted invoice pages
* **Events**: View feature usage events that have been tracked for the customer
## Editing Feature Balances
You can directly edit a customer's feature balances via the dashboard, to give them additional allowance or alter how much they'll be charged for their next invoice (typically in case of errors).
1. Navigate to the Customer details page
2. Under "Available Features", click on the feature you want to edit the balance for.
3. In the popup, enter the new balance value:
* If you're giving them more allowance (`granted`) of a feature, enter a **positive** number
* If you're changing how much usage they'll be charged for, enter a **negative** number
4. Optionally, set a new usage reset date for the feature
5. Click "Update"
Editing a balance will only last until the next reset date of the feature. If
you want to permanently set a new allowance, you should create a custom
product with the new allowance.
If you want to give a customer access to a feature that isn't present in the
product they're on, you can create a custom product with the new feature.
## Adding a Coupon
To apply a discount to a customer:
1. Go to the customer's details page
2. Under the "Rewards" section of the sidebar, click "Add Coupon"
3. Select a reward from the available options
4. Click "Add Reward"
The discount will show up when a Checkout URL is generated for the customer via `attach`, or from their next invoice.
## Updating Customer Properties
You can update a customer's basic information through either the dashboard or API:
#### Via Dashboard
1. Navigate to the customer's details page
2. On the right-hand side, you'll see a "Details" section in the sidebar. Click on any of the fields.
3. Update the desired fields (name, email, etc.)
4. Click "Update"
#### Via API
You can also update a customer's properties via the API, useful for when a customer changes their details in your application.
```typescript TypeScript theme={null}
import { Autumn } from "autumn-js";
const autumn = new Autumn({ secretKey: "am_sk_test_1234" });
await autumn.customers.update({
customerId: "user_123",
name: "Mr New Name",
email: "newemail@example.com",
});
```
```python Python theme={null}
from autumn_sdk import Autumn
autumn = Autumn("am_sk_test_1234")
await autumn.customers.update(
customer_id="user_123",
name="Mr New Name",
email="newemail@example.com",
)
```
```bash cURL theme={null}
curl -X POST "https://api.useautumn.com/v1/customers/update" \
-H "Authorization: Bearer am_sk_test_1234" \
-H "Content-Type: application/json" \
-d '{
"customer_id": "user_123",
"name": "Mr New Name",
"email": "newemail@example.com"
}'
```
#### Deleting a Customer
To delete a customer:
1. Go to the customer's details page
2. Click the "Settings" icon in the top right
3. Click "Delete"
Deleting a customer will not delete it in Stripe. If they have existing
subscriptions, you should cancel them from Stripe if needed.
# Payment Flow
Source: https://docs.useautumn.com/documentation/customers/payment-flow
Hosted checkout pages vs building your own payment flow
## Using hosted pages
Pass `redirectMode: "always"` and `billing.attach` will always return a `paymentUrl` — just redirect the customer and Autumn handles payment collection, confirmation, and activation.
```typescript TypeScript theme={null}
const response = await autumn.billing.attach({
customerId: "user_123",
planId: "pro",
redirectMode: "always",
});
redirect(response.paymentUrl);
```
```python Python theme={null}
response = await autumn.billing.attach(
customer_id="user_123",
plan_id="pro",
redirect_mode="always",
)
# Redirect to response.payment_url
```
```bash cURL theme={null}
curl -X POST 'https://api.useautumn.com/v1/billing.attach' \
-H 'Authorization: Bearer am_sk_...' \
-H 'Content-Type: application/json' \
-d '{
"customer_id": "user_123",
"plan_id": "pro",
"redirect_mode": "always"
}'
```
New customers without a payment method are sent to **Stripe Checkout**. Existing customers are sent to **Autumn Checkout** to review and confirm. After checkout, the customer is redirected to your `successUrl` (or the default URL in your Autumn dashboard).
## Building your own checkout
For full control over the checkout experience, use `redirectMode: "if_required"`. This charges the saved payment method directly instead of redirecting — the customer is only sent to Stripe Checkout if they don't have a payment method yet.
```mermaid actions={false} theme={null}
graph LR
A["previewAttach"] --> B["user confirms"] --> C["attach"] --> D{"Payment method?"}
D -->|Yes| E["Charged"]
D -->|No| F["Stripe Checkout"]
E --> G["Plan enabled"]
F --> G
style A fill:#f472b622,stroke:#f472b6
style C fill:#f472b622,stroke:#f472b6
```
### Step 1: Preview the charge
Call `billing.previewAttach` to get line items, totals, and proration details to display in your UI.
```typescript TypeScript theme={null}
const preview = await autumn.billing.previewAttach({
customerId: "user_123",
planId: "pro",
});
// preview.lineItems — array of charges and credits
// preview.total — net amount
// preview.currency — e.g. "usd"
```
```python Python theme={null}
preview = await autumn.billing.preview_attach(
customer_id="user_123",
plan_id="pro",
)
```
```bash cURL theme={null}
curl -X POST 'https://api.useautumn.com/v1/billing.preview_attach' \
-H 'Authorization: Bearer am_sk_...' \
-H 'Content-Type: application/json' \
-d '{
"customer_id": "user_123",
"plan_id": "pro"
}'
```
```json theme={null}
{
"customerId": "user_123",
"lineItems": [
{
"title": "Pro Plan",
"description": "Monthly subscription",
"amount": 20
},
{
"title": "Credit for Free Plan",
"description": "Unused time on current plan",
"amount": -5
}
],
"total": 15,
"currency": "usd",
"nextCycle": {
"startsAt": 1735689600000,
"total": 20
}
}
```
### Step 2: Confirm and charge
Once the customer confirms, call `billing.attach` with `redirectMode: "if_required"`.
```typescript TypeScript theme={null}
const response = await autumn.billing.attach({
customerId: "user_123",
planId: "pro",
redirectMode: "if_required",
});
if (response.paymentUrl) {
redirect(response.paymentUrl);
} else {
showSuccess();
}
```
```python Python theme={null}
response = await autumn.billing.attach(
customer_id="user_123",
plan_id="pro",
redirect_mode="if_required",
)
if response.payment_url:
redirect(response.payment_url)
else:
show_success()
```
```bash cURL theme={null}
curl -X POST 'https://api.useautumn.com/v1/billing.attach' \
-H 'Authorization: Bearer am_sk_...' \
-H 'Content-Type: application/json' \
-d '{
"customer_id": "user_123",
"plan_id": "pro",
"redirect_mode": "if_required"
}'
```
## Handling the response
The `billing.attach` response has two key fields:
**`payment_url`** — a URL the customer should be redirected to, or `null` if no redirect is needed.
**`required_action`** — present when payment couldn't be processed automatically. See [Edge Cases](/documentation/customers/edge-cases) for details on handling 3DS, payment failures, and retries.
# Subscription Lifecycle
Source: https://docs.useautumn.com/documentation/customers/subscription-lifecycle
Handle upgrades, downgrades, and cancellations
## Upgrades
Upgrades happen when you attach a plan with a higher price than the customer's current plan. Use `billing.attach` — Autumn handles the rest.
If a payment method exists, attaching the plan will immediately charge the customer. If upgrading from a free to a paid plan, a checkout URL is generated instead.
**Pricing behavior:**
* **Fixed prices** are prorated based on time remaining in the billing period
* **Usage-based prices** bill outstanding usage at the old rate immediately, then apply the new rate going forward
## Downgrades
Downgrades happen when you attach a plan with a lower price. Unlike upgrades, downgrades are **scheduled** to take effect at the end of the current billing period.
The new plan will have status `scheduled` until it activates. Customers can cancel a scheduled downgrade by re-attaching their current plan.
If you've set a [`group`](/documentation/concepts/plans#plan-properties) when creating plans, upgrades and downgrades only apply between plans in the same group. Attaching a plan from a different group adds it alongside the existing plan.
## Cancellations
Cancel a subscription using `billing.update` with the `cancelAction` parameter. By default, cancellations take effect at the end of the billing period.
### Cancel at end of billing period
```typescript TypeScript theme={null}
const response = await autumn.billing.update({
customerId: "user_123",
planId: "pro",
cancelAction: "cancel_end_of_cycle",
});
```
```python Python theme={null}
response = await autumn.billing.update(
customer_id="user_123",
plan_id="pro",
cancel_action="cancel_end_of_cycle",
)
```
```bash cURL theme={null}
curl -X POST 'https://api.useautumn.com/v1/billing.update' \
-H 'Authorization: Bearer am_sk_...' \
-H 'Content-Type: application/json' \
-d '{
"customer_id": "user_123",
"plan_id": "pro",
"cancel_action": "cancel_end_of_cycle"
}'
```
The subscription remains active until the end of the current billing period. If you have a default plan (with `is_default` set), it will be activated after the cancellation takes effect.
### Cancel immediately
To cancel a subscription right away with a prorated refund:
```typescript TypeScript theme={null}
const response = await autumn.billing.update({
customerId: "user_123",
planId: "pro",
cancelAction: "cancel_immediately",
});
```
```python Python theme={null}
response = await autumn.billing.update(
customer_id="user_123",
plan_id="pro",
cancel_action="cancel_immediately",
)
```
```bash cURL theme={null}
curl -X POST 'https://api.useautumn.com/v1/billing.update' \
-H 'Authorization: Bearer am_sk_...' \
-H 'Content-Type: application/json' \
-d '{
"customer_id": "user_123",
"plan_id": "pro",
"cancel_action": "cancel_immediately"
}'
```
This ends the subscription immediately and issues a prorated refund for the remaining time in the billing period.
## Uncanceling
If a subscription was scheduled for cancellation (via `cancel_end_of_cycle`), you can reverse it before the period ends using `uncancel`:
```typescript TypeScript theme={null}
const response = await autumn.billing.update({
customerId: "user_123",
planId: "pro",
cancelAction: "uncancel",
});
```
```python Python theme={null}
response = await autumn.billing.update(
customer_id="user_123",
plan_id="pro",
cancel_action="uncancel",
)
```
```bash cURL theme={null}
curl -X POST 'https://api.useautumn.com/v1/billing.update' \
-H 'Authorization: Bearer am_sk_...' \
-H 'Content-Type: application/json' \
-d '{
"customer_id": "user_123",
"plan_id": "pro",
"cancel_action": "uncancel"
}'
```
This clears the pending cancellation and the subscription continues as normal. Any default plan that was scheduled to activate after cancellation is also removed.
You cannot uncancel a subscription that was already canceled immediately — only pending cancellations (scheduled for end of cycle) can be reversed.
## Canceling a scheduled plan change
When a downgrade or other plan change is **scheduled** for the end of the billing period, canceling it works the same way as uncanceling. Call `billing.update` with `cancelAction: "uncancel"` on the customer's **active** plan:
```typescript TypeScript theme={null}
// Customer is on Pro with a scheduled downgrade to Basic.
// Cancel the scheduled change and keep Pro.
const response = await autumn.billing.update({
customerId: "user_123",
planId: "pro",
cancelAction: "uncancel",
});
```
```python Python theme={null}
# Customer is on Pro with a scheduled downgrade to Basic.
# Cancel the scheduled change and keep Pro.
response = await autumn.billing.update(
customer_id="user_123",
plan_id="pro",
cancel_action="uncancel",
)
```
```bash cURL theme={null}
# Customer is on Pro with a scheduled downgrade to Basic.
# Cancel the scheduled change and keep Pro.
curl -X POST 'https://api.useautumn.com/v1/billing.update' \
-H 'Authorization: Bearer am_sk_...' \
-H 'Content-Type: application/json' \
-d '{
"customer_id": "user_123",
"plan_id": "pro",
"cancel_action": "uncancel"
}'
```
This removes the scheduled replacement plan and keeps the customer on their current plan.
## `cancel_action` reference
| Value | Behavior |
| --------------------- | ------------------------------------------------------------------------------------------------------ |
| `cancel_end_of_cycle` | Schedules cancellation at the end of the current billing period. Subscription stays active until then. |
| `cancel_immediately` | Cancels immediately with a prorated refund for remaining time. |
| `uncancel` | Reverses a pending cancellation or removes a scheduled plan change. |
## Usage reset behavior
When a new plan is enabled, you can control what happens to existing feature usage with the `reset_usage_when_enabled` property on the plan item:
* `true`: Usage resets to 0 (typical for consumable features like credits)
* `false`: Usage carries over to the new plan (typical for continuous features like seats)
**Example:** A customer on Free has used 20 of their 100 credits. They upgrade to Pro which includes 500 credits.
* If `reset_usage_when_enabled = true`: They get 500 credits
* If `reset_usage_when_enabled = false`: They get 480 credits (500 - 20 used)
## Carry-over on plan upgrades
When a customer upgrades plans, you can preserve their unused balances or account for their existing usage. Two parameters on [`billing.attach`](/api-reference/billing/attach) give you fine-grained control over what happens to consumable features during an immediate upgrade.
Carry-over only works with **immediate** upgrades (`planSchedule: "immediate"` or default upgrade behavior). Scheduled plan changes and downgrades do not support carry-over.
### Carrying over unused balances
Use `carryOverBalances` to preserve a customer's remaining balance from the old plan. The unused credits are added as a one-off balance on the new plan, so the customer doesn't lose what they've already paid for.
```typescript TypeScript theme={null}
const response = await autumn.billing.attach({
customerId: "user_123",
planId: "enterprise",
carryOverBalances: {
enabled: true,
},
});
```
```python Python theme={null}
response = await autumn.billing.attach(
customer_id="user_123",
plan_id="enterprise",
carry_over_balances={
"enabled": True,
},
)
```
```bash cURL theme={null}
curl -X POST 'https://api.useautumn.com/v1/billing.attach' \
-H 'Authorization: Bearer am_sk_...' \
-H 'Content-Type: application/json' \
-d '{
"customer_id": "user_123",
"plan_id": "enterprise",
"carry_over_balances": {
"enabled": true
}
}'
```
**Example:** A customer on Pro has 300 of 1,000 credits remaining. They upgrade to Enterprise (2,000 credits/month). With `carryOverBalances` enabled, the 300 unused credits carry forward — giving them 2,300 credits on the new plan. The carried-over balance expires at the next reset or end of cycle.
### Carrying over prior usage
Use `carryOverUsages` to deduct prior usage from the new plan's allowance, preventing customers from getting a free reset on upgrade.
```typescript TypeScript theme={null}
const response = await autumn.billing.attach({
customerId: "user_123",
planId: "enterprise",
carryOverUsages: {
enabled: true,
},
});
```
```python Python theme={null}
response = await autumn.billing.attach(
customer_id="user_123",
plan_id="enterprise",
carry_over_usages={
"enabled": True,
},
)
```
```bash cURL theme={null}
curl -X POST 'https://api.useautumn.com/v1/billing.attach' \
-H 'Authorization: Bearer am_sk_...' \
-H 'Content-Type: application/json' \
-d '{
"customer_id": "user_123",
"plan_id": "enterprise",
"carry_over_usages": {
"enabled": true
}
}'
```
**Example:** A customer on Pro has used 700 of 1,000 credits this month. They upgrade to Enterprise (2,000 credits/month). With `carryOverUsages` enabled, 700 usage is deducted from the new allowance — giving them 1,300 remaining instead of a full 2,000.
### Scoping to specific features
Both parameters accept an optional `featureIds` array to limit carry-over to specific features:
```typescript TypeScript theme={null}
const response = await autumn.billing.attach({
customerId: "user_123",
planId: "enterprise",
carryOverBalances: {
enabled: true,
featureIds: ["credits", "api_calls"],
},
carryOverUsages: {
enabled: true,
featureIds: ["credits"],
},
});
```
Only consumable metered features support carry-over. Boolean features, unlimited features, and allocated (non-consumable) features are not eligible.
# Tracking usage
Source: https://docs.useautumn.com/documentation/customers/tracking-usage
Keep track of your customer's feature usage with the `track` route
When customers use features in your product, you'll need to record their usage so Autumn can track it against their limits or bill them for usage.
There are two ways to record usage: sending events or setting usage directly.
The customer must already exist before calling `track`. If the `customer_id` doesn't match an existing customer, the API returns a `customer_not_found` error. Create customers using [`customers.getOrCreate`](/documentation/customers/creating-customers) during signup or login.
## Sending Events
The track route is recommended for tracking consumable features, like AI messages, credits or API calls. Each time a customer uses a feature, send an event to count their usage.
Before recording usage, you may want to check if the customer is [allowed to
use the feature](/documentation/customers/check). This prevents them from exceeding usage
limits defined in the product.
```typescript TypeScript theme={null}
import { Autumn } from "autumn-js";
const autumn = new Autumn({ secretKey: "am_sk_test_1234" });
await autumn.track({
customerId: "user_123",
featureId: "ai-messages",
value: 1,
});
```
```python Python theme={null}
from autumn_sdk import Autumn
autumn = Autumn("am_sk_test_1234")
await autumn.track(
customer_id="user_123",
feature_id="ai-messages",
value=1,
)
```
```bash cURL theme={null}
curl -X POST "https://api.useautumn.com/v1/track" \
-H "Authorization: Bearer am_sk_test_1234" \
-H "Content-Type: application/json" \
-d '{
"customer_id": "user_123",
"feature_id": "ai-messages",
"value": 1
}'
```
```json theme={null}
{
"customerId": "user_123",
"value": 1,
"balance": {
"featureId": "ai-messages",
"granted": 100,
"remaining": 99,
"usage": 1,
"unlimited": false,
"overageAllowed": false,
"nextResetAt": 1767610960519
}
}
```
You can also send a negative `value` to increase the balance counter, which is
useful for increasing a feature limit (eg, if a customer removes a seat).
## Setting Usage Directly
For non-consumable features (such as seats or workspaces), you may prefer to set usage directly, rather than incrementing Autumn's feature balance. This enables you to sync a source of truth up on your side with Autumn, preventing any discrepancies.
```typescript TypeScript theme={null}
import { Autumn } from "autumn-js";
const autumn = new Autumn({ secretKey: "am_sk_test_1234" });
await autumn.balances.update({
customerId: "user_123",
featureId: "seats",
usage: 3,
});
```
```python Python theme={null}
from autumn_sdk import Autumn
autumn = Autumn("am_sk_test_1234")
await autumn.balances.update(
customer_id="user_123",
feature_id="seats",
usage=3,
)
```
```bash cURL theme={null}
curl -X POST "https://api.useautumn.com/v1/balances/update" \
-H "Authorization: Bearer am_sk_test_1234" \
-H "Content-Type: application/json" \
-d '{
"customer_id": "user_123",
"feature_id": "seats",
"usage": 3
}'
```
The usage route overwrites the current usage value. Use this carefully, as it
can reset or override incremental usage recorded through events.
## Tracking AI Token Usage
If you're using an [AI credit system](/examples/monetary-credits), you can track token usage directly with `trackTokens`. This automatically converts token counts to a dollar cost using [Models.dev](https://models.dev) pricing and your configured markup, then deducts from the customer's credit balance.
The `modelId` must be in `provider/model` format, matching the provider and model keys from [Models.dev](https://models.dev). For example:
* `anthropic/claude-sonnet-4-5-20250514`
* `openai/gpt-4o`
* `google/gemini-2.5-pro`
For providers with nested model paths (like OpenRouter), include the full path after the provider: `openrouter/anthropic/claude-opus-4.6`.
Token counts are **exclusive pools**: `inputTokens` should exclude cached tokens (pass those as `cacheReadTokens` / `cacheWriteTokens`) and `outputTokens` should exclude reasoning tokens (pass those as `reasoningTokens`). Audio tokens go in `audioInputTokens` / `audioOutputTokens`. See the [API reference](/api-reference/balances/trackTokens) for the full parameter list.
`autumn.balances.trackTokens` requires an autumn-js release that includes
the method. On older versions, call the REST endpoint directly — see the
cURL tab below.
```typescript TypeScript theme={null}
import { Autumn } from "autumn-js";
const autumn = new Autumn({ secretKey: "am_sk_test_1234" });
await autumn.balances.trackTokens({
customerId: "user_123",
modelId: "anthropic/claude-opus-4-6",
inputTokens: 1000,
outputTokens: 500,
});
```
```python Python theme={null}
from autumn_sdk import Autumn
autumn = Autumn("am_sk_test_1234")
await autumn.balances.track_tokens(
customer_id="user_123",
model_id="anthropic/claude-opus-4-6",
input_tokens=1000,
output_tokens=500,
)
```
```bash cURL theme={null}
curl -X POST "https://api.useautumn.com/v1/balances.track_tokens" \
-H "Authorization: Bearer am_sk_test_1234" \
-H "Content-Type: application/json" \
-d '{
"customer_id": "user_123",
"model_id": "anthropic/claude-opus-4-6",
"input_tokens": 1000,
"output_tokens": 500
}'
```
If the customer has exactly one AI credit system feature, you can omit the
`featureId` parameter — it will be auto-detected. The request fails with an
error if the customer has no AI credit system, or has more than one and no
`featureId` is provided.
### Vercel AI SDK integration
If you're using the [Vercel AI SDK](https://sdk.vercel.ai), the `@useautumn/gateway` package can automatically track token usage for every `generateText` or `streamText` call — no manual `trackTokens` calls needed.
## Using Event Names
In the above examples, we used the `featureId` to identify the feature. You can instead use the `eventName` parameter to link balances to different events in your application. This can be useful when:
* Multiple balances are affected by the same user action
* Different user actions should be tracked against the same balance
**Example Use Case:**
Your AI chatbot has a daily limit of 10 messages, with a maximum monthly limit of 100 messages. Recording a message in Autumn should decrease both balances simultaneously.
In Autumn, you can create two features: `daily-messages` and `monthly-messages`. You can add the same event name to both features: `message-sent`. Then, assign both features to a plan with the correct included amounts.
Every time that event name is recorded, both the daily-messages and monthly-messages balances will be decremented.
If you were to use the same feature for both in this case, the daily and monthly balances would sum, allowing the user to send 10 messages a day, with an "overage" balance of 100 messages per month if they go over the daily limit.
You can define event names in the Autumn dashboard:
1. Go to the [Features Page](https://app.useautumn.com/sandbox/products?tab=features).
2. Click on the feature you want to add an event to.
3. In the sheet, under the "advanced" section, add your event names.
4. Save the feature.
You can then record usage for these events from your application:
```typescript TypeScript theme={null}
import { Autumn } from "autumn-js";
const autumn = new Autumn({ secretKey: "am_sk_test_1234" });
await autumn.track({
customerId: "user_123",
eventName: "blog_post_generation",
value: 1,
});
```
```python Python theme={null}
from autumn_sdk import Autumn
autumn = Autumn("am_sk_test_1234")
await autumn.track(
customer_id="user_123",
event_name="blog_post_generation",
value=1,
)
```
```bash cURL theme={null}
curl -X POST "https://api.useautumn.com/v1/track" \
-H "Authorization: Bearer am_sk_test_1234" \
-H "Content-Type: application/json" \
-d '{
"customer_id": "user_123",
"event_name": "blog_post_generation",
"value": 1
}'
```
You can only use one of `eventName` or `featureId` when recording usage.
Check that you're sending the correct one in the request, especially if you're
using a mix of `snake_case` and `kebab-case`.
# Updating Subscriptions
Source: https://docs.useautumn.com/documentation/customers/updating-subscriptions
Modify existing subscriptions - update quantities, cancel, or customize
Use `billing.update` to modify an existing subscription. This is different from `billing.attach` which is for attaching new plans or changing between plans.
**When to use `billing.update`:**
* **Update feature quantities** — if your plan contains prepaid features (like seats)
* **Cancel or uncancel** — cancel a subscription immediately or at end of cycle
* **Customize the plan** — modify pricing or feature configuration (advanced)
## Updating prepaid feature quantities
Prepaid features are features where customers pay upfront for a quantity (e.g., seats, team members). Here's an example plan with a prepaid `seats` feature:
```typescript autumn.config.ts theme={null}
import { atmn, feature, plan } from "atmn";
export const seats = feature({
featureId: "seats",
name: "Seats",
type: "metered",
consumable: false, // Non-consumable = doesn't reset
});
export const team = plan({
planId: "team",
versionSlug: "v1",
active: true,
name: "Team Plan",
price: {
amount: 49,
interval: "month",
},
items: [
{
featureId: seats.featureId,
included: 5, // 5 seats included
price: {
amount: 10, // $10 per additional seat
interval: "month",
billingMethod: "prepaid",
},
},
],
});
export default atmn({ features: [seats], plans: [team] });
```
To update the quantity of seats for a customer:
```typescript TypeScript theme={null}
const response = await autumn.billing.update({
customerId: "user_123",
planId: "team",
featureQuantities: [
{ featureId: "seats", quantity: 10 }
],
});
```
```python Python theme={null}
response = await autumn.billing.update(
customer_id="user_123",
plan_id="team",
feature_quantities=[
{ "feature_id": "seats", "quantity": 10 }
],
)
```
```bash cURL theme={null}
curl -X POST 'https://api.useautumn.com/v1/billing/update' \
-H 'Authorization: Bearer am_sk_...' \
-H 'Content-Type: application/json' \
-d '{
"customer_id": "user_123",
"plan_id": "team",
"feature_quantities": [
{ "feature_id": "seats", "quantity": 10 }
]
}'
```
## Canceling a subscription
Use `cancelAction` to cancel or uncancel a subscription:
| Action | Description |
| --------------------- | ------------------------------------------------------------------------------------ |
| `cancel_end_of_cycle` | Cancel at the end of the current billing period. Customer retains access until then. |
| `cancel_immediately` | Cancel immediately with a prorated refund. |
| `uncancel` | Reverse a pending cancellation (only works if not yet expired). |
```typescript TypeScript theme={null}
// Cancel at end of billing cycle
await autumn.billing.update({
customerId: "user_123",
planId: "pro",
cancelAction: "cancel_end_of_cycle",
});
// Uncancel a pending cancellation
await autumn.billing.update({
customerId: "user_123",
planId: "pro",
cancelAction: "uncancel",
});
```
```python Python theme={null}
# Cancel at end of billing cycle
await autumn.billing.update(
customer_id="user_123",
plan_id="pro",
cancel_action="cancel_end_of_cycle",
)
```
```bash cURL theme={null}
curl -X POST 'https://api.useautumn.com/v1/billing/update' \
-H 'Authorization: Bearer am_sk_...' \
-H 'Content-Type: application/json' \
-d '{
"customer_id": "user_123",
"plan_id": "pro",
"cancel_action": "cancel_end_of_cycle"
}'
```
## How billing works
By default, updating a subscription with billing changes will generate an invoice:
* **Increasing quantity** (e.g., adding seats) charges a prorated amount for the remainder of the billing cycle
* **Decreasing quantity** (e.g., removing seats) generates a credit applied to the next invoice
* **Canceling immediately** generates a negative invoice granting credits to the customer
### Previewing changes before executing
Similar to [`billing.previewAttach`](/documentation/customers/payment-flow#step-1-preview-the-charge), you can use `billing.previewUpdate` to see exactly what will be charged before making changes. This returns line items and totals that you can display in a confirmation UI.
```typescript TypeScript theme={null}
const preview = await autumn.billing.previewUpdate({
customerId: "user_123",
planId: "team",
featureQuantities: [
{ featureId: "seats", quantity: 10 }
],
});
// Display preview.lineItems, preview.total, preview.currency
// Then call billing.update to execute
```
```python Python theme={null}
preview = await autumn.billing.preview_update(
customer_id="user_123",
plan_id="team",
feature_quantities=[
{ "feature_id": "seats", "quantity": 10 }
],
)
# Display preview.line_items, preview.total
```
```bash cURL theme={null}
curl -X POST 'https://api.useautumn.com/v1/billing/preview-update' \
-H 'Authorization: Bearer am_sk_...' \
-H 'Content-Type: application/json' \
-d '{
"customer_id": "user_123",
"plan_id": "team",
"feature_quantities": [
{ "feature_id": "seats", "quantity": 10 }
]
}'
```
### Skipping charges
If you want to update a subscription without creating any charges or credits, pass `prorationBehavior: "none"`:
```typescript theme={null}
await autumn.billing.update({
customerId: "user_123",
planId: "team",
featureQuantities: [
{ featureId: "seats", quantity: 10 }
],
prorationBehavior: "none", // No charges or credits created
});
```
This is useful for administrative adjustments or when you want to handle billing separately.
# Versioning Plans
Source: https://docs.useautumn.com/documentation/customers/versioning
How to update and migrate customers between product versions
## Updating Products
You can update products through the Autumn UI:
1. Navigate to the [products page](https://app.useautumn.com/products)
2. Select the product you want to modify
3. Make your changes to the product items or properties
4. Click "Update Product "
When you update a product, Autumn will create a new version of the product, and immediately apply this version to any new customers who purchase the product.
A new version will only be created if there are customers on the current
version.
Existing customers will remain on the previous version (known as "grandfathering"). You'll be able to see which customers are on which version in your [customer page](https://app.useautumn.com/customers).
## Migrating customers between product versions
When you're ready, you can migrate customers to the latest verion of a product.
1. Go to the [product details page](https://app.useautumn.com/products) of the product you want to migrate customers from
2. On the right-hand side, you'll see a "Versions" section in the sidebar. Use the version history selector to find the version you want to migrate customers from
3. Navigate to the old version, and click the "Migrate Customers" button
When migrating customers to a new product version:
* Feature balances are updated immediately. Customer's existing usage will carry over (not reset) to the new product.
* Outstanding billable usage will be added as a line item to the customer's next invoice. Any further usage will be billed at the new price.
* Fixed pricing changes will only take effect from the customer's next billing cycle, as no proration is applied to price differences between versions.
**Example**
Our existing product gives customers 10 credits per month, 1 USD per additional credit, and a 10 USD per month price.
We're updating the product to give customers 20 credits per month, 2 USD per additional credit, and a 200 USD per month price.
We have a customer, Mark, who has used 5 credits in the current month. We also have Helly who has used 20 credits.
Here's what will happen to Mark:
* Mark will be immediately have 15 credits available (20 in the new product minus 5 used)
* Mark was 5 credits under the limit in the old product, so has no line items added to his next invoice.
* Mark will be charged 20 USD from his next billing cycle.
Here's what will happen to Helly:
* Helly will be immediately have 0 credits remaining (20 in the new product minus 20 used)
* Helly was 10 credits over the limit in the old product, so she'll have a 10 USD line item (10 credits \* 1 USD) added to her next invoice.
* Any further credit usage will be charged at the new rate of 2 USD per credit.
* Helly will be charged 20 USD from her next billing cycle.
# Vercel AI SDK
Source: https://docs.useautumn.com/documentation/external-providers/ai-sdk
Automatically track AI token usage with the Vercel AI SDK
The `@useautumn/gateway` package integrates Autumn with the [Vercel AI SDK](https://sdk.vercel.ai), automatically tracking token usage for every `generateText` or `streamText` call. No manual `trackTokens` calls needed.
## Setup
#### 1. Install the package
```bash npm theme={null}
npm install @useautumn/gateway
```
```bash pnpm theme={null}
pnpm add @useautumn/gateway
```
```bash yarn theme={null}
yarn add @useautumn/gateway
```
```bash bun theme={null}
bun add @useautumn/gateway
```
Requires `autumn-js` and `ai` (v6+) as peer dependencies.
#### 2. Wrap your model
Use `withAutumn` to wrap any AI SDK language model. It intercepts generate and stream calls, reads the token usage from the response, and reports it to Autumn automatically.
```typescript theme={null}
import { Autumn } from "autumn-js";
import { anthropic } from "@ai-sdk/anthropic";
import { withAutumn } from "@useautumn/gateway/ai-sdk";
const autumn = new Autumn({ secretKey: "am_sk_test_1234" });
const model = withAutumn({
autumn,
model: anthropic("claude-sonnet-4-5-20250514"),
customerId: "user_123",
});
```
#### 3. Use as normal
The wrapped model works exactly like a regular AI SDK model. Token usage is tracked in the background after each call.
```typescript theme={null}
import { generateText, streamText } from "ai";
// Generate — usage tracked automatically
const { text } = await generateText({
model,
prompt: "Explain quantum computing in one paragraph",
});
// Stream — usage tracked when the stream finishes
const result = streamText({
model,
prompt: "Write a short poem about recursion",
});
for await (const chunk of result.textStream) {
process.stdout.write(chunk);
}
```
## Token pools
The wrapper normalizes the AI SDK's usage object into the exclusive token pools that [trackTokens](/api-reference/balances/trackTokens) expects: text input (excluding cached tokens), text output (excluding reasoning tokens), cache reads, cache writes, and reasoning tokens. Each pool is billed at the model's published rate, so cached and reasoning-heavy requests are priced correctly without any extra work.
## Model ID format
The wrapped model constructs the `modelId` sent to Autumn using `provider/model` format, derived from the AI SDK model's `provider` and `modelId` fields. This must match a valid provider and model key from [Models.dev](https://models.dev).
For example:
* `@ai-sdk/anthropic` → `anthropic/claude-sonnet-4-5-20250514`
* `@ai-sdk/openai` → `openai/gpt-4o`
* `@ai-sdk/google` → `google/gemini-2.5-pro`
If the AI SDK provider name doesn't match the Models.dev provider key, use the `providerId` option to override it:
```typescript theme={null}
import { createOpenRouter } from "@openrouter/ai-sdk-provider";
const openrouter = createOpenRouter();
const model = withAutumn({
autumn,
model: openrouter("anthropic/claude-opus-4.6"),
customerId: "user_123",
providerId: "openrouter", // Override provider prefix
});
// Sends modelId as "openrouter/anthropic/claude-opus-4.6"
```
## Options
| Parameter | Type | Required | Description |
| ------------ | ------------------------- | -------- | --------------------------------------------------------------------------------------------------------- |
| `autumn` | `Autumn` | Yes | Your Autumn SDK client instance |
| `model` | `LanguageModelV3` | Yes | The AI SDK language model to wrap |
| `customerId` | `string` | Yes | The Autumn customer ID to attribute usage to |
| `providerId` | `string` | No | Override the provider prefix in the model name sent to Autumn. Falls back to the model's `provider` field |
| `featureId` | `string` | No | Target a specific AI credit system feature. Auto-detected if you only have one |
| `entityId` | `string` | No | Entity ID for entity-scoped balance tracking |
| `properties` | `Record` | No | Additional properties to attach to each usage event |
## Full example
```typescript theme={null}
import { Autumn } from "autumn-js";
import { openai } from "@ai-sdk/openai";
import { generateText } from "ai";
import { withAutumn } from "@useautumn/gateway/ai-sdk";
const autumn = new Autumn({ secretKey: process.env.AUTUMN_SECRET_KEY! });
async function chat(customerId: string, message: string) {
const model = withAutumn({
autumn,
model: openai("gpt-4o"),
customerId,
});
const { text } = await generateText({
model,
prompt: message,
});
return text;
}
```
Tracking failures are caught and logged to the console — they won't break your AI features. Check your server logs if usage isn't appearing in Autumn.
# OpenRouter
Source: https://docs.useautumn.com/documentation/external-providers/openrouter
Automatically track AI token usage with the OpenRouter SDK
The `@useautumn/gateway` package integrates Autumn with the [OpenRouter SDK](https://openrouter.ai/docs), automatically tracking token usage for every `chat.send` call. No manual `trackTokens` calls needed.
Using OpenRouter through the Vercel AI SDK (`@openrouter/ai-sdk-provider`)? Use the [AI SDK wrapper](/documentation/external-providers/ai-sdk) with `providerId: "openrouter"` instead.
## Setup
#### 1. Install the package
```bash npm theme={null}
npm install @useautumn/gateway
```
```bash pnpm theme={null}
pnpm add @useautumn/gateway
```
```bash yarn theme={null}
yarn add @useautumn/gateway
```
```bash bun theme={null}
bun add @useautumn/gateway
```
Requires `autumn-js` and `@openrouter/sdk` as peer dependencies.
#### 2. Wrap your client
Use `withAutumn` to wrap your OpenRouter client. It intercepts `chat.send` calls, enables OpenRouter's [usage accounting](https://openrouter.ai/docs/use-cases/usage-accounting) on every request, reads the token usage from the response, and reports it to Autumn automatically.
```typescript theme={null}
import { Autumn } from "autumn-js";
import { OpenRouter } from "@openrouter/sdk";
import { withAutumn } from "@useautumn/gateway/openrouter";
const autumn = new Autumn({ secretKey: "am_sk_test_1234" });
const openRouter = new OpenRouter({ apiKey: process.env.OPENROUTER_API_KEY });
const client = withAutumn({
autumn,
openRouter,
customerId: "user_123",
});
```
#### 3. Use as normal
The wrapped client works exactly like a regular OpenRouter client — streaming and non-streaming. Token usage is tracked in the background after each call.
```typescript theme={null}
// Non-streaming — usage tracked automatically
const result = await client.chat.send({
model: "openai/gpt-4o",
messages: [{ role: "user", content: "Explain quantum computing" }],
});
// Streaming — usage tracked when the stream finishes
const stream = await client.chat.send({
model: "anthropic/claude-sonnet-4-5",
messages: [{ role: "user", content: "Write a short poem" }],
stream: true,
});
for await (const chunk of stream) {
process.stdout.write(chunk.choices[0]?.delta?.content ?? "");
}
```
## Token pools
The wrapper normalizes OpenRouter's usage accounting into the exclusive token pools that [trackTokens](/api-reference/balances/trackTokens) expects: text input (excluding cached and audio tokens), text output (excluding reasoning tokens), cache reads, cache writes, audio input, and reasoning tokens. Each pool is billed at the model's published rate.
The model is reported to Autumn as `openrouter/` (e.g. `openrouter/openai/gpt-4o`), using the resolved model from the response — so router aliases like `openrouter/auto` bill against the model that actually served the request. Autumn prices usage with OpenRouter's rates from [Models.dev](https://models.dev), and OpenRouter's own reported cost is attached to each event as the `openrouter_cost` property for reconciliation.
## Options
| Parameter | Type | Required | Description |
| ------------ | ------------------------- | -------- | ------------------------------------------------------------------------------ |
| `autumn` | `Autumn` | Yes | Your Autumn SDK client instance |
| `openRouter` | `OpenRouter` | Yes | The OpenRouter SDK client to wrap |
| `customerId` | `string` | Yes | The Autumn customer ID to attribute usage to |
| `featureId` | `string` | No | Target a specific AI credit system feature. Auto-detected if you only have one |
| `entityId` | `string` | No | Entity ID for entity-scoped balance tracking |
| `properties` | `Record` | No | Additional properties to attach to each usage event |
## Manual tracking
If you consume OpenRouter through a path the wrapper doesn't cover (e.g. `callModel`, or raw `fetch` against the REST API), use `trackOpenRouterUsage` directly with the response's usage object — it accepts both the SDK's camelCase models and the raw snake\_case API shape:
```typescript theme={null}
import { trackOpenRouterUsage } from "@useautumn/gateway/openrouter";
await trackOpenRouterUsage({
autumn,
customerId: "user_123",
model: response.model, // e.g. "openai/gpt-4o"
usage: response.usage,
});
```
Tracking failures are caught and logged to the console — they won't break your AI features. Check your server logs if usage isn't appearing in Autumn.
# RevenueCat
Source: https://docs.useautumn.com/documentation/external-providers/revenuecat
Integrate Autumn with RevenueCat for mobile app billing
RevenueCat integration allows you to use Autumn alongside RevenueCat for managing mobile app subscriptions and billing. This is a *read-only* integration, which means that you will handle billing through RevenueCat.
Autumn will receive webhook updates from RevenueCat to update the customer's plan and features. You keep the benefits of RevenueCat's paywalls, AB testing and SDK.
This is currently in beta, please reach out to us on [Discord](https://discord.gg/STqxY92zuS) or email us at [support@useautumn.com](mailto:support@useautumn.com) to get access.
## Setup Guide
#### Connect RevenueCat to Autumn
To connect RevenueCat to Autumn, you'll need:
* A RevenueCat project ID
* A RevenueCat API key
To get your RevenueCat project ID, visit your RevenueCat dashboard and copy the project ID from the URL. e.g. `https://app.revenuecat.com/projects/1234567890/overview` will have a project ID of `1234567890`.
To get your RevenueCat API key, visit the API keys section on your dashboard, select "New secret API key", and select the following configuration:
* API Version: V2
* Charts metrics permissions: No access
* Customer information permissions: Read only
* Project configuration permissions: Read only
Then, visit your Autumn dashboard, and in the "Developer > RevenueCat" section,
set up your RevenueCat project ID and API key.
#### Map your RevenueCat products to Autumn products
When a RevenueCat product is purchased, define which Autumn product should be enabled for the customer.
RevenueCat is managing billing, so any plan prices in Autumn will be ignored.
Since RevenueCat does not support usage-based or quantity-based pricing, any Autumn plans with these price types will not display in the mapping screen for safety.
RevenueCat products are mapped at the store-level into Autumn. This means instead of mapping a Package or an Offering, you will be mapping Products from Google Play, Apple Store, Roku or etc... instead.
You can still use this in conjunction with RevenueCat's paywalls, packages and offerings however you wish.
#### Set up the webhook integration
For Autumn to recieve updates from RevenueCat, you'll need to set up a webhook integration.
In RevenueCat, visit "Integrations > Webhooks", and click "Add new configuration". Use the following configuration:
* Webhook URL: paste this from the Autumn dashboard
* Authorization header value: paste this from the Autumn dashboard
* Environments: Depending on your Autumn environment, you are given two different URLs. This means you should also separate your RevenueCat webhooks for test and live environments.
* Events filter: All apps, all events.
#### Integration
**You should not call Autumn's `attach()` or `checkout()` functions. Instead you should either use RevenueCat's SDK or RevenueCat's paywalls.**
When the user pays via mobile, the plan will automatically sync into Autumn. Once you have purchased a product or an add-on, you may then continue using `check()` or `track()` to manage your features.
Any existing Autumn customers (that have purchased a plan via Stripe / Web) can still access their balances and features as normal on mobile. They will have an active plan in their `customer` object.
You should handle blocking existing Autumn customers from initiating subscriptions with RevenueCat on mobile, by checking for an active plan in their `customer` object.
When integrating RevenueCat and initiating your `Purchases` instance, you must use the `appUserID` parameter to pass in the customer ID from your auth system.
This will allow you to sync the customer ID into Autumn, whether its a new user or an existing user from Stripe.
```typescript RevenueCatProvider.tsx theme={null}
import { useEffect } from "react";
import Purchases, { LOG_LEVEL } from "react-native-purchases";
export default function RevenueCatProvider({ userID }: { userID: string }) {
useEffect(() => {
Purchases.setLogLevel(LOG_LEVEL.VERBOSE);
Purchases.configure({
apiKey:
process.env.EXPO_PUBLIC_REVENUE_CAT_API_KEY || "",
appUserID: userID,
});
}, [userID]);
return null;
}
```
```typescript app/api/autumn/[...all]+api.ts theme={null}
// Expo also supports better-auth :)
import { auth } from "@/lib/auth";
import { autumnHandler } from "autumn-js/backend";
export async function GET(request: Request, { all }: { all: string }) {
// Get the session from Better Auth
const session = await auth.api.getSession({ headers: request.headers });
if (!session?.user?.id) {
return Response.json(
{ error: "Unauthorized - Please sign in" },
{ status: 401 },
);
}
// Extract user data from session
const customerId = session.user.id;
const customerData = {
name: session.user.name || "Unknown User",
email: session.user.email || "",
};
const autumnResponse = await autumnHandler({
request,
customerId,
customerData
});
return Response.json(autumnResponse.response, { status: autumnResponse.statusCode });
}
export const POST = GET;
export const PUT = GET;
export const DELETE = GET;
export const PATCH = GET;
export const OPTIONS = GET;
```
Then to initiate a purchase, you can use the `purchasePackage` function from the `Purchases` SDK, or open a paywall.
```typescript PurchaseProduct.tsx theme={null}
```
```typescript RCPaywall.tsx theme={null}
import { useRouter } from "expo-router";
import { View } from "react-native";
import RevenueCatUI from "react-native-purchases-ui";
export default function RCPaywall() {
const router = useRouter();
return (
{
router.back();
}}
/>
);
}
```
#### Congratulations!
You have now successfully integrated Autumn with RevenueCat.
You can now use the `check()` and `track()` functions to manage your features as usual.
```typescript check.ts theme={null}
const { data } = await autumn.check({
customer_id: "user_or_org_id_from_auth",
feature_id: "pro",
});
if (data.allowed) {
// User has access to the feature
} else {
// User does not have access to the feature
}
```
```typescript track.ts theme={null}
const { data } = await autumn.track({
customer_id: "john_doe",
feature_id: "messages",
value: 1,
});
// This will decrement the messages balance by 1
```
## Versioning Plans
Autumn's [plan versioning](/documentation/concepts/versioning) feature allows you to update your pricing and migrate customers between versions. However, since mobile billing has specific limitations and is handled by RevenueCat, you should keep the following in mind:
* Whenever a RevenueCat product is purchased, the latest version of the Autumn plan will be enabled for the customer.
* Any price set in Autumn is ignored: only the price set in RevenueCat will be used
* If you migrate a customer from one plan version to another, the plan features will be immediately updated -- just as with the standard migration process. Prices will **not** be updated. You should handle this in [RevenueCat](https://www.revenuecat.com/docs/subscription-guidance/price-changes) (your customers may need to opt-in to the new pricing).
# Vercel Marketplace
Source: https://docs.useautumn.com/documentation/external-providers/vercel-marketplace
Set up the Vercel Marketplace integration in Autumn
Autumn lets you add your product to [Vercel's Marketplace](https://vercel.com/marketplace) without any additional code. This guide walks through connecting the Autumn partner API and webhooks to Vercel, and setting up Stripe's custom payment method for accurate billing.
This is currently in beta. Reach out on [Discord](https://discord.gg/STqxY92zuS) or email [hey@useautumn.com](mailto:hey@useautumn.com) to get access.
## Prerequisites
* An Autumn account with a connected Stripe account
* A Vercel integration entry in the [Vercel Integration Console](https://vercel.com/dashboard/integrations)
## Setup
### Open the Integration Console
Navigate to the Vercel dashboard, then go to **Integrations → Browse Marketplace → Integration Console**.
### Copy your Vercel credentials
Scroll to the bottom of the Integration Console page to find your **Client (Integration) ID** and **Client (Integration) Secret**. You'll need both of these for the Autumn dashboard.
### Copy the Base URL from Autumn
In the Autumn dashboard, open **Developer → Vercel**. Enter the Client ID and Client Secret from the previous step, then copy the **Base URL** that Autumn generates for you.
### Set the Webhook URL in Vercel
Back in the Vercel Integration Console, paste the Autumn Base URL into the **External Integration Settings → Webhook URL** field.
### Set the Marketplace Base URL in Vercel
Paste the same Autumn Base URL into **Marketplace Integration Settings → Base URL**.
### Create a Stripe custom payment method
Autumn uses Stripe's billing clock for accurate billing cycles and invoice reporting via the **Custom Payment Methods** system. In the Stripe dashboard, go to **Settings → Payments → Custom payment methods**, then click **Create a custom payment method**.
### Provide a custom name and icon
Select **Provide a custom name and icon** at the bottom of the payment method selection dialog.
### Name the payment method
Enter **Vercel Marketplace** as the display name and upload the Vercel logo.
### Copy the custom payment method ID
After creating the payment method, Stripe will display a `custom.type ID` (starting with `cpmt_`). Copy this ID and paste it into the **Custom Payment Method ID** field in the Autumn dashboard.
### Configure webhook events
Finally, set up the webhook endpoint for events that Autumn sends to your application. In the Autumn dashboard under **Developer → Vercel**, use the Svix webhook iframe to create a new endpoint. Set your endpoint URL and subscribe to all **Vercel** events. You can ignore the standalone "Webhook URL" setting and leave it empty — the Svix iframe handles this instead.
## Validation
Once everything is configured, trigger a test event flow in Vercel to confirm end-to-end delivery. Verify that:
* Vercel receives callback requests for key lifecycle events
* Autumn logs the incoming payload and processes it correctly
* Your application receives the forwarded webhook events
If events aren't being delivered, double-check that the Base URL is identical in both the Webhook URL and Marketplace Base URL fields in Vercel.
# Fail-Open Defaults
Source: https://docs.useautumn.com/documentation/fail-open
Keep your app running even when Autumn is unreachable
Autumn's SDKs include a **fail-open** mechanism that prevents your application from going down if Autumn is temporarily unreachable. When enabled, critical SDK methods return safe default responses instead of throwing errors.
## Why fail-open?
As a billing engine, Autumn sits in the critical path of your application. If your app calls `check()` to gate access to a feature, and Autumn is unreachable, that call would throw an error -- effectively blocking your users from accessing your product.
Fail-open ensures your users are never blocked by an Autumn outage. Usage events may be lost during the outage, but your customers stay unaffected.
## Behavior
Fail-open is **enabled by default**. When Autumn is unreachable (network errors, timeouts, or server errors returning 5XX status codes), the SDK returns safe defaults:
| Method | Default response | Effect |
| ------------------------- | --------------------------------- | ----------------------------------------- |
| `check()` | `{ allowed: true }` | Users retain access to features |
| `track()` | `{ value: 0, balance: null }` | Usage event is silently dropped |
| `customers.getOrCreate()` | Sentinel customer with `id: null` | Returns a valid but empty customer object |
When fail-open triggers, the SDK logs a prominent error to your console so you're immediately aware of the issue.
## When fail-open triggers
Fail-open activates when the SDK encounters:
* **Server errors** -- Autumn returns a 5XX status code (500, 502, 503, etc.)
* **Network failures** -- DNS resolution failure, connection refused, connection reset
* **Timeouts** -- The request to Autumn times out
Fail-open does **not** activate for client errors (4XX). If you receive a 400 (bad request), 401 (unauthorized), or 404 (not found), those errors propagate normally since they indicate a problem with your integration, not an Autumn outage.
## Configuration
### Disabling fail-open
If you prefer strict error handling and want all Autumn errors to propagate:
```typescript TypeScript theme={null}
import { Autumn } from "@useautumn/sdk";
const autumn = new Autumn({
secretKey: "sk_...",
failOpen: false,
});
```
```python Python theme={null}
# Coming soon
```
### Detecting fail-open responses
When `check()` fails open, the response will have `allowed: true` with empty values:
```typescript theme={null}
const result = await autumn.check({
customerId: "cus_123",
featureId: "messages",
});
// Normal response: allowed is based on actual balance
// Fail-open response: allowed is always true, customerId is ""
```
When `customers.getOrCreate()` fails open, the returned customer will have `id: null`:
```typescript theme={null}
const customer = await autumn.customers.getOrCreate({
customerId: "cus_123",
});
if (customer.id === null) {
// Autumn was unreachable, handle gracefully
}
```
## Console output
When fail-open triggers, you'll see this in your server logs:
```
FATAL AUTUMN ERROR DETECTED; FAILING OPEN; LEARN MORE: https://docs.useautumn.com/docs/fail-open; STATUS PAGE: status.useautumn.com
Operation: check | Status: 503 | Error: Server error
```
Monitor your logs for this message. If you see it, check [status.useautumn.com](https://status.useautumn.com) for ongoing incidents.
## SDK support
| SDK | Fail-open support |
| ----------------------------- | ----------------- |
| `@useautumn/sdk` (TypeScript) | Supported |
| `autumn-python` (Python) | Coming soon |
| `autumn-js` (framework SDK) | Coming soon |
# Deploy to production
Source: https://docs.useautumn.com/documentation/getting-started/deploy
A checklist to go live with confidence
Once you've tested your integration in sandbox, follow this checklist to go live with real payments.
### Connect your live Stripe account
In the Autumn dashboard, open the **Deploy to Production** dialog from the sidebar.
Connect your live Stripe account via OAuth — this links Autumn to your real Stripe environment.
Your sandbox uses a shared Stripe test account by default. Production requires your own Stripe account.
### Push your plans to production
If you're using the [CLI](/cli/getting-started), add `-p` to target production. It uses `AUTUMN_PROD_SECRET_KEY`. `push -p` only previews the change. Add `--yes` to apply it:
```bash theme={null}
bunx atmn push -p
bunx atmn push -p --yes
```
`atmn login` writes `AUTUMN_PROD_SECRET_KEY` next to your sandbox key, so you can use both.
Alternatively, the Deploy dialog in the dashboard can copy your sandbox plans to production for you.
### Swap your API key
Point your server-side code at a live secret key. Create a production key from [Developer Settings](https://app.useautumn.com/production/dev?tab=api_keys), and set it in your production environment:
```bash .env theme={null}
AUTUMN_SECRET_KEY=am_sk_live_...
```
Only set the live key in your production environment. Keep your local `AUTUMN_SECRET_KEY` as the sandbox key. CLI commands with `-p` read `AUTUMN_PROD_SECRET_KEY`, so you never need to overwrite it.
Double check that:
* Your **server-side** code uses the live secret key (`am_sk_live_*`)
* If you're using a publishable key client-side, it's the live one (`am_pk_live_*`)
The key prefix determines the environment automatically — `_test_` routes to sandbox, `_live_` routes to production. There's no separate "environment" config to flip.
### Verify fail-open behavior
Autumn's SDK is **fail-open by default** — if Autumn is unreachable, `check`, `track`, and customer fetches return safe dummy responses instead of throwing errors. This means Autumn can never take your app down.
You should verify this before going live. The easiest way is to point the SDK at a non-existent URL and exercise your app's core flows:
```typescript TypeScript theme={null}
const autumn = new Autumn({
secretKey: process.env.AUTUMN_SECRET_KEY,
serverURL: "https://localhost:9999", // simulate outage
});
```
```python Python theme={null}
autumn = Autumn(
secret_key=os.environ["AUTUMN_SECRET_KEY"],
server_url="https://localhost:9999", # simulate outage
)
```
With this in place:
1. Trigger actions that call `check` — they should return `allowed: true`
2. Trigger actions that call `track` — they should not crash
3. Confirm your core user flows work as normal
4. Remove the `serverURL` override when done
While the SDK gracefully handles outages for read-path calls, write operations like `attach` (which initiate checkout or subscription changes) will still fail when Autumn is unreachable.
### Set up webhooks (if applicable)
If you're listening for Autumn [webhook events](/documentation/webhooks) (e.g. `customer.products.updated`), make sure your production webhook endpoint is configured in the dashboard. Verify you can receive a test event.
### Monitor your first users
After deploying, keep an eye on the [Customers](https://app.useautumn.com/production/customers) page in the Autumn dashboard. Verify that:
* New customers are created correctly
* Subscriptions are attached as expected
* Usage is being tracked
* Invoices are generated in Stripe
***
Once you've completed this checklist, you're live. Your sandbox environment remains available for testing new plans and pricing changes before pushing them to production.
# Build your billing page
Source: https://docs.useautumn.com/documentation/getting-started/display-billing
Display usage and billing data in your app for your users
Software applications typically ship with a billing page. This allows customers to change plan, cancel subscription and view their usage.
The customer endpoint returns the current state of the customer, including their active subscriptions, one-time purchases, and feature balances.
## Pricing table
When building a pricing table, you need to know what each plan means for the current customer — is it an upgrade, a downgrade, or their current plan? Is a free trial available?
Pass a `customerId` when listing plans and each plan will include a `customerEligibility` object:
| Field | Type | Description |
| ---------------- | ------------------------------------------------------------------------ | ---------------------------------------------------------- |
| `attachAction` | `"activate"` \| `"upgrade"` \| `"downgrade"` \| `"purchase"` \| `"none"` | What happens when this plan is attached |
| `status` | `"active"` \| `"scheduled"` \| undefined | The customer's current relationship to this plan |
| `trialAvailable` | boolean | Whether the customer is eligible for the plan's free trial |
```typescript TypeScript theme={null}
import { Autumn } from "autumn-js";
const autumn = new Autumn({ secretKey: "am_sk_test_1234" });
const { list: plans } = await autumn.plans.list({
customerId: "user_123",
});
for (const plan of plans) {
console.log(plan.name, plan.customerEligibility?.attachAction);
// e.g. "Free" "downgrade", "Pro" "none", "Enterprise" "upgrade"
}
```
```python Python theme={null}
from autumn_sdk import Autumn
autumn = Autumn("am_sk_test_1234")
plans = await autumn.plans.list(customer_id="user_123")
for plan in plans.list:
print(plan.name, plan.customer_eligibility.attach_action)
```
```bash cURL theme={null}
curl -X POST 'https://api.useautumn.com/v1/plans.list' \
-H 'Authorization: Bearer am_sk_test_1234' \
-H 'Content-Type: application/json' \
-d '{ "customer_id": "user_123" }'
# Each plan in the response includes customer_eligibility
```
## Switching plans
Switching plans uses `billing.attach`. See [Attaching Plans](/documentation/customers/payment-flow) for the full guide.
```typescript TypeScript theme={null}
import { Autumn } from "autumn-js";
const autumn = new Autumn({ secretKey: "am_sk_test_1234" });
const response = await autumn.billing.attach({
customerId: "user_123",
planId: "pro",
});
// Redirect to complete payment or confirm plan change
redirect(response.paymentUrl);
```
```python Python theme={null}
from autumn_sdk import Autumn
autumn = Autumn("am_sk_test_1234")
response = await autumn.billing.attach(
customer_id="user_123",
plan_id="pro",
)
# Redirect to response.payment_url
```
```bash cURL theme={null}
curl -X POST 'https://api.useautumn.com/v1/attach' \
-H 'Authorization: Bearer am_sk_test_1234' \
-H 'Content-Type: application/json' \
-d '{
"customer_id": "user_123",
"plan_id": "pro"
}'
```
## Cancelling a plan
Cancel a subscription using `billing.update` with a `cancelAction`. See [Subscription Lifecycle](/documentation/customers/subscription-lifecycle#cancellations) for the full guide on immediate vs end-of-cycle cancellations.
```typescript TypeScript theme={null}
import { Autumn } from "autumn-js";
const autumn = new Autumn({ secretKey: "am_sk_test_1234" });
// Cancel at end of billing cycle
await autumn.billing.update({
customerId: "user_123",
planId: "pro",
cancelAction: "cancel_end_of_cycle",
});
```
```python Python theme={null}
from autumn_sdk import Autumn
autumn = Autumn("am_sk_test_1234")
# Cancel at end of billing cycle
await autumn.billing.update(
customer_id="user_123",
plan_id="pro",
cancel_action="cancel_end_of_cycle",
)
```
```bash cURL theme={null}
curl -X POST 'https://api.useautumn.com/v1/billing/update' \
-H 'Authorization: Bearer am_sk_test_1234' \
-H 'Content-Type: application/json' \
-d '{
"customer_id": "user_123",
"plan_id": "pro",
"cancel_action": "cancel_end_of_cycle"
}'
```
## Uncancelling a plan
If a subscription has a pending cancellation, a scheduled downgrade, or a scheduled plan switch, you can reverse it with `cancelAction: "uncancel"`.
A subscription is pending cancellation when `canceledAt` is not null while the subscription is still `active`.
```typescript TypeScript theme={null}
import { Autumn } from "autumn-js";
const autumn = new Autumn({ secretKey: "am_sk_test_1234" });
const customer = await autumn.customers.getOrCreate({
customerId: "user_123",
});
const cancellingSub = customer.subscriptions?.find(
(sub) => sub.status === "active" && sub.canceledAt !== null
);
if (cancellingSub) {
await autumn.billing.update({
customerId: "user_123",
planId: cancellingSub.planId,
cancelAction: "uncancel",
});
}
```
```python Python theme={null}
from autumn_sdk import Autumn
autumn = Autumn("am_sk_test_1234")
customer = await autumn.customers.get_or_create(
customer_id="user_123"
)
cancelling_sub = next(
(s for s in customer.subscriptions
if s.status == "active" and s.canceled_at is not None),
None,
)
if cancelling_sub:
await autumn.billing.update(
customer_id="user_123",
plan_id=cancelling_sub.plan_id,
cancel_action="uncancel",
)
```
```bash cURL theme={null}
curl -X POST 'https://api.useautumn.com/v1/billing/update' \
-H 'Authorization: Bearer am_sk_test_1234' \
-H 'Content-Type: application/json' \
-d '{
"customer_id": "user_123",
"plan_id": "pro",
"cancel_action": "uncancel"
}'
```
## Active plans
Display the plan the user is currently on. Users can have multiple active subscriptions and purchases (e.g., main plan and add-ons).
* **`subscriptions`** - Free and paid recurring plans
* **`purchases`** - One-off plans (e.g., credit top-ups)
```typescript TypeScript theme={null}
import { Autumn } from "autumn-js";
const autumn = new Autumn({ secretKey: "am_sk_test_1234" });
const customer = await autumn.customers.getOrCreate({
customerId: "user_123",
});
const active = customer.subscriptions?.filter(
(sub) => sub.status === "active"
);
console.log(active?.map((sub) => sub.planId).join(", "));
```
```python Python theme={null}
from autumn_sdk import Autumn
autumn = Autumn("am_sk_test_1234")
customer = await autumn.customers.get_or_create(
customer_id="user_123"
)
active = [s for s in customer.subscriptions if s.status == "active"]
print([s.plan_id for s in active])
```
```bash cURL theme={null}
curl -X POST 'https://api.useautumn.com/v1/customers' \
-H 'Authorization: Bearer am_sk_test_1234' \
-H 'Content-Type: application/json' \
-d '{ "customer_id": "user_123" }'
# Response includes subscriptions array
```
## Usage balances
Metered features have `granted`, `usage`, and `remaining` fields. Use these to display current usage and remaining balance.
```typescript TypeScript theme={null}
import { Autumn } from "autumn-js";
const autumn = new Autumn({ secretKey: "am_sk_test_1234" });
const customer = await autumn.customers.getOrCreate({
customerId: "user_123",
});
const messages = customer.balances?.messages;
console.log(`${messages?.remaining} / ${messages?.granted}`);
```
```python Python theme={null}
from autumn_sdk import Autumn
autumn = Autumn("am_sk_test_1234")
customer = await autumn.customers.get_or_create(
customer_id="user_123"
)
messages = customer.balances.get("messages")
print(f"{messages.remaining} / {messages.granted}")
```
```bash cURL theme={null}
curl -X POST 'https://api.useautumn.com/v1/customers' \
-H 'Authorization: Bearer am_sk_test_1234' \
-H 'Content-Type: application/json' \
-d '{ "customer_id": "user_123" }'
# Response includes balances.[feature_id]
```
## Stripe billing portal
The Stripe billing portal lets users manage their payment method, view past invoices, and cancel their plan.
Enable the billing portal in your [Stripe settings](https://dashboard.stripe.com/settings/billing/portal).
```typescript TypeScript theme={null}
import { Autumn } from "autumn-js";
const autumn = new Autumn({ secretKey: "am_sk_test_1234" });
const { url } = await autumn.billing.openCustomerPortal({
customerId: "user_123",
returnUrl: "https://your-app.com/billing",
});
redirect(url);
```
```python Python theme={null}
from autumn_sdk import Autumn
autumn = Autumn("am_sk_test_1234")
response = await autumn.billing.open_customer_portal(
customer_id="user_123",
return_url="https://your-app.com/billing",
)
# Redirect to response.url
```
```bash cURL theme={null}
curl -X POST 'https://api.useautumn.com/v1/billing.open_customer_portal' \
-H 'Authorization: Bearer am_sk_test_1234' \
-H 'Content-Type: application/json' \
-d '{
"customer_id": "user_123",
"return_url": "https://your-app.com/billing"
}'
```
## Usage timeseries chart
Autumn provides aggregate time series queries for usage data. Pass the response to a charting library like Recharts.
```typescript TypeScript theme={null}
import { Autumn } from "autumn-js";
const autumn = new Autumn({ secretKey: "am_sk_test_1234" });
const { list, total } = await autumn.events.aggregate({
customerId: "user_123",
featureId: "messages",
range: "30d",
});
```
```python Python theme={null}
from autumn_sdk import Autumn
autumn = Autumn("am_sk_test_1234")
response = await autumn.events.aggregate(
customer_id="user_123",
feature_id="messages",
range="30d",
)
# response.list, response.total
```
```bash cURL theme={null}
curl -X POST 'https://api.useautumn.com/v1/events.aggregate' \
-H 'Authorization: Bearer am_sk_test_1234' \
-H 'Content-Type: application/json' \
-d '{
"customer_id": "user_123",
"feature_id": "messages",
"range": "30d"
}'
```
You can also use the [`events.list`](/api-reference/events/listEvents) method to get the raw event data and display it in a table.
***
**Next: Deploy to production**
Once your billing page is in place, go through the production checklist to launch with real payments.
A checklist to go live with confidence
# Checking and tracking
Source: https://docs.useautumn.com/documentation/getting-started/gating
Give customers access to the right features and limits based on their plan
Typically, your users should get access to different features and usage limits, depending on their plan.
Autumn handles your customer's payments and grants them the features defined in your plan configuration. There are 2 functions you need to enforce limits and gating:
* `check` for feature access, before allowing a user to do something
* `track` the usage in Autumn afterwards (if needed)
This example will continue from before: a 2-tier pricing model for a chatbot.
This guide shows an asynchronous approach to checking and tracking. You can also [check and reserve](/documentation/customers/check#checking-and-reserving-usage) balance in a single, atomic API call for concurrent events.
### Checking feature access
Check if a user has enough remaining balance of messages, before executing the action. The `feature_id` used here is defined by you when you create the feature in Autumn.
```typescript TypeScript theme={null}
import { Autumn } from "autumn-js";
const autumn = new Autumn({
secretKey: 'am_sk_42424242',
});
// Check if user can send 1 message
const { allowed } = await autumn.check({
customerId: "user_or_org_id_from_auth",
featureId: "messages",
requiredBalance: 1,
});
if (!allowed) {
console.log("User has run out of messages");
return;
}
```
```python Python theme={null}
import asyncio
from autumn_sdk import Autumn
autumn = Autumn('am_sk_42424242')
async def main():
# Check feature access
response = await autumn.check(
customer_id='user_or_org_id_from_auth',
feature_id='messages',
required_balance=1,
)
asyncio.run(main())
```
```bash cURL theme={null}
# Check feature access
curl -X POST 'https://api.useautumn.com/v1/check' \
-H 'Authorization: Bearer am_sk_42424242' \
-H 'Content-Type: application/json' \
-d '{
"customer_id": "user_123",
"feature_id": "messages",
"required_balance": 1
}'
```
You can also use `check` to [gate boolean features](/documentation/customers/check#checking-boolean-features) (non-metered features), such as access to "premium AI models".
### Tracking usage
After the user has successfully used a chatbot message, you can record the usage in Autumn. This will decrement the user's message balance.
```typescript TypeScript theme={null}
// Your own function to send the chat message
// Then record 1 message used
await autumn.track({
customerId: "user_or_org_id_from_auth",
featureId: "messages",
value: 1,
});
```
```python Python theme={null}
import asyncio
from autumn_sdk import Autumn
autumn = Autumn('am_sk_42424242')
# Your own function to send the chat message
# Then record 1 message used
async def main():
await autumn.track(
customer_id='user_or_org_id_from_auth',
feature_id='messages',
value=1,
)
asyncio.run(main())
```
```bash cURL theme={null}
# Your own function to send the chat message
# Then record 1 message used
curl -X POST 'https://api.useautumn.com/v1/track' \
-H 'Authorization: Bearer am_sk_42424242' \
-H 'Content-Type: application/json' \
-d '{
"customer_id": "user_or_org_id_from_auth",
"feature_id": "messages",
"value": 1
}'
```
Once you send usage events, you can verify their receipt in the Autumn dashboard, on the [customer](https://app.useautumn.com/customers) detail page.
You should always handle access checks and usage tracking server-side for security. Users can manipulate client-side code using devtools.
***
**Next: Build your billing page**
Now, whenever your customers change their plan, they will automatically have the correct access and limits. Next, build a billing page for your customers.
Display plan, balance and usage information to your customers using Autumn's `customer` state
# Migrating to Autumn
Source: https://docs.useautumn.com/documentation/getting-started/migration
How to migrate your existing Stripe customers to Autumn
It's easy to move your existing customers to Autumn. The Autumn team will help you move your subscriptions and purchases over without any disruption. The main reasons teams migrate are:
* **Speed** - Team-based billing, multi-interval usage limits, auto-topups, timeseries charts: all handled by Autumn out of the box.
* **Flexibility** — Plan versioning, custom deals, and pricing changes without code deploys
* **Reliability** — No webhook edge cases, race conditions, or state sync issues to debug
Planning a complex migration? [Reach out to us](https://cal.com/ayrod) — we can help you plan and execute it.
## Migration Steps
Start by integrating Autumn in your development environment. Replace your existing Stripe billing logic with Autumn's SDK:
* Set up your pricing plans in the [Autumn dashboard](https://app.useautumn.com)
* Install the Autumn SDK and configure your API keys
* Replace Stripe checkout, subscription management, and usage tracking with Autumn equivalents
See our [setup guide](/documentation/getting-started/setup) for detailed integration instructions.
Connect your existing Stripe account to Autumn in your production environment. This gives us access to your active subscriptions so we can link them during migration.
Before importing any customers, make sure every plan your Stripe customers are currently on has a matching plan set up in your Autumn production environment. Each customer you import will reference one of these plans by its `plan_id`, so this mapping needs to be in place first.
For each customer, call [`billing.import`](/api-reference/billing/import) with their existing Stripe customer ID, their current subscription, and the Autumn plan it maps to. This links their live Stripe subscription so Autumn can manage it going forward — **there will be no change or disruption to your customers' billing**.
```typescript theme={null}
const autumn = new Autumn({ secretKey: "am_sk_..." });
await autumn.billing.import({
customerId: "user_123",
processors: [{ type: "stripe", id: "cus_ABC123" }],
billables: [
{
processor: "stripe",
link: { subscriptionId: "sub_XYZ789" },
plan: { planId: "pro" },
},
],
});
```
If you need to preserve a customer's exact usage counts rather than have their balances reset on import, follow up with [`balances.update`](/api-reference/balances/updateBalance) to set the correct remaining balance for each feature:
```typescript theme={null}
await autumn.balances.update({
customerId: "user_123",
featureId: "messages",
remaining: 42,
});
```
Once your customers are imported, you can deploy your Autumn integration to production. Your existing customers will be seamlessly linked to their Stripe subscriptions through Autumn.
# Setup and payments
Source: https://docs.useautumn.com/documentation/getting-started/setup
Implement your app's payments and pricing model
In this example we'll create the pricing for a premium AI chatbot. We're going to have:
* A Free plan that gives users 5 chat messages per month for free
* A Pro plan that gives users 100 chat messages per month for \$20 per month.
Create a plan for each pricing tier that your app offers. In our example we'll create a "Free" and "Pro" plan, and assign them features.
Browse our [Examples](/examples) for guides on setting up credit systems, top ups and other common pricing models.
Run the following command in your root directory:
```bash bun theme={null}
bunx atmn init
```
```bash npm theme={null}
npx atmn init
```
```bash pnpm theme={null}
pnpm dlx atmn init
```
This asks how you want to connect (sign in, or create a sandbox with no account), then creates an `autumn/` folder with an `autumn.config.ts` inside. Replace the contents of that file with the code below, or view our [config reference](/cli/config) to build your own.
```typescript autumn.config.ts [expandable] theme={null}
import { atmn, feature, plan } from "atmn";
// Features
export const messages = feature({
featureId: "messages",
name: "Messages",
type: "metered",
consumable: true,
});
// Plans
export const free = plan({
planId: "free",
versionSlug: "v1",
active: true,
name: "Free",
autoEnable: true,
items: [
// 5 messages per month
{
featureId: messages.featureId,
included: 5,
reset: { interval: "month" },
},
],
});
export const pro = plan({
planId: "pro",
versionSlug: "v1",
active: true,
name: "Pro",
price: {
amount: 20,
interval: "month",
},
items: [
// 100 messages per month
{
featureId: messages.featureId,
included: 100,
reset: { interval: "month" },
},
],
});
export default atmn({ features: [messages], plans: [free, pro] });
```
Then, preview your changes against Autumn's sandbox environment.
```bash bun theme={null}
bunx atmn push
```
```bash npm theme={null}
npx atmn push
```
```bash pnpm theme={null}
pnpm dlx atmn push
```
Once the preview looks right, apply it:
```bash bun theme={null}
bunx atmn push --yes
```
```bash npm theme={null}
npx atmn push --yes
```
```bash pnpm theme={null}
pnpm dlx atmn push --yes
```
If you already have plans created in the dashboard, `atmn init` pulls them
into your config for you. Run `atmn pull` at any time to do it again.
Create your [Autumn account](https://app.useautumn.com/), and the Free and Pro plans in the [Plans](https://app.useautumn.com/products) tab.
* On the [Plans](https://app.useautumn.com/products) page, click **Create Plan**.
* Name the plan (eg, "Free") and select plan type `Free`
* Toggle the `auto-enable` flag, so that the plan is assigned whenever customers are created
* In the plan editor, click **Add Feature to Plan**, and create a `Metered`, `Consumable` feature for "messages"
* Configure the plan to grant `5` messages, and set the interval to `per month`
* Click **Save**
* On the [Plans](https://app.useautumn.com/products) page, click **Create Plan**.
* Name the plan (eg, "Pro") and select plan type `Paid`, `Recurring`, and set the price to `$20` per month
* In the plan editor, click **Add Feature to Plan**, and add the `messages` feature that you created in the Free plan
* Configure the plan to grant `100` messages, and set the interval to `per month`
* Click **Save**
[Create an Autumn Secret key](https://app.useautumn.com/sandbox/dev?tab=api_keys), and paste it in your `.env` variables. Then, install the Autumn SDK. If you're using the CLI, this will be done for you.
```bash .env theme={null}
AUTUMN_SECRET_KEY=am_sk_test_42424242...
```
```bash bun theme={null}
bun add autumn-js
```
```bash npm theme={null}
npm install autumn-js
```
```bash pnpm theme={null}
pnpm add autumn-js
```
```bash yarn theme={null}
yarn add autumn-js
```
```bash pip theme={null}
pip install autumn-sdk
```
When the customer signs up, create an Autumn customer for them. Autumn will automatically enable the Free plan, since you marked it with the `auto-enable` flag.
```typescript TypeScript theme={null}
import { Autumn } from "autumn-js";
const autumn = new Autumn({
secretKey: "am_sk_42424242",
});
const customer = await autumn.customers.getOrCreate({
customerId: "user_or_org_id_from_auth",
name: "John Doe",
email: "john@example.com",
});
```
```python Python theme={null}
import asyncio
from autumn_sdk import Autumn
autumn = Autumn('am_sk_42424242')
async def main():
customer = await autumn.customers.get_or_create(
customer_id="user_or_org_id_from_auth",
name="John Doe",
email="john@example.com",
)
asyncio.run(main())
```
```bash cURL theme={null}
curl --request POST \
--url https://api.useautumn.com/v1/customers \
--header 'Authorization: Bearer am_sk_42424242' \
--header 'Content-Type: application/json' \
--data '{
"customer_id": "user_or_org_id_from_auth",
"name": "John Doe",
"email": "john@example.com"
}'
```
Autumn's customer ID is the same as your internal user or org ID generated
from your auth provider. No need to store any extra IDs.
In the Autumn dashboard, you will see your user under the [customers](https://app.useautumn.com/customers) page.
Call `attach` when the customer wants to purchase the Pro plan. This will return a Stripe payment URL. Once they've paid, Autumn will grant access to "100 messages per month" defined in Step 1.
```typescript TypeScript theme={null}
import { Autumn } from "autumn-js";
const autumn = new Autumn({
secretKey: "am_sk_42424242",
});
const response = await autumn.billing.attach({
customerId: "user_or_org_id_from_auth",
planId: "pro",
redirectMode: "always",
});
// Redirect customer to complete payment or confirm plan change
redirect(response.paymentUrl);
```
```python Python theme={null}
import asyncio
from autumn_sdk import Autumn
autumn = Autumn('am_sk_42424242')
async def main():
response = await autumn.billing.attach(
customer_id='user_or_org_id_from_auth',
plan_id='pro',
redirect_mode='always',
)
asyncio.run(main())
```
```bash cURL theme={null}
curl -X POST 'https://api.useautumn.com/v1/attach' \
-H 'Authorization: Bearer am_sk_42424242' \
-H 'Content-Type: application/json' \
-d '{
"customer_id": "user_or_org_id_from_auth",
"plan_id": "pro",
"redirect_mode": "always"
}'
```
Use Stripe's test card `4242 4242 4242 4242` to make a purchase in sandbox.
You can enter any Expiry and CVV.
This can be used for any plan changes scenario (upgrades, downgrades, one-time topups, renewals, etc).
Upgrades will happen immediately, and downgrades will be scheduled for the next billing cycle.
The **`redirectMode: "always"`** flag will always return a payment URL.
New purchases redirect to Stripe Checkout to enter payment details, and subsequent charges redirect to an Autumn hosted, one-click confirmation page.
You can build your own billing confirmation flows by using the [previewAttach](/api-reference/billing/previewAttach) function.
**Next: Track and limit usage**
Now that the plan is enabled and you've handled payments, you can now make sure that customers have the access to the right features and limits based on their plan.
Enforce usage limits and feature permissions using Autumn's `check` and
`track` functions
# Working with balances
Source: https://docs.useautumn.com/documentation/lakehouse/balance-semantics
What v2_3_balances, v2_3_breakdowns, and v2_3_rollovers actually mean — and how to reconstruct the figures the API and dashboard show.
**Available on request** — The Autumn Lakehouse is provisioned per customer. Contact us at [hey@useautumn.com](mailto:hey@useautumn.com) to get access.
`v2_3_balances` and `v2_3_breakdowns` look like a tidy relational schema, but they aren't one. They are **denormalized snapshots of Autumn's read-time balance computation** — the same computation behind `GET /customers/:id` and the dashboard. Read them as columns named after their source values rather than as a schema you can do naive arithmetic on, and the surprises below disappear.
If you only take one thing from this page: **the warehouse keeps every entitlement row, the API does not.** To reproduce an API or dashboard figure you must re-apply the filter the API applies — active products, non-expired entitlements, current cycle. And **add the rollovers back in**, because they live in their own table now.
## The model in one paragraph
For each feature, the API gathers a customer's **active** `customer_entitlement` rows, computes a small set of values per row (`included_grant`, `prepaid_grant`, `remaining`, `usage`, `overage`), and sums them into one balance. The ETL materializes exactly this: `v2_3_breakdowns` is one row **per entitlement** (the per-row values), and `v2_3_balances` is the `GROUP BY customer × feature × scope` sum over it. Two differences matter: the ETL aggregates over **all** entitlement rows in your database while the API first filters to the active, current set, and the ETL leaves rollover balances out of both tables entirely.
## Why your numbers look inflated
`v2_3_breakdowns` is built from a plain join over `customer_entitlements` with **no status, expiry, or cycle filter**. Every entitlement row your account has ever held is in there:
* superseded / cancelled product **versions**,
* past reset **cycles** that already rolled over,
* pre-seeded **future** cycles.
The API, by contrast, keeps only entitlements whose product is **active** (status `active`, or `past_due` if your org enables `include_past_due`) and whose `expires_at` is in the future, then dedups and sums.
So a single `v2_3_balances` row can sum *many lifetimes* of `usage` for one customer × feature. This is **not** because `usage` is a lifetime accumulator — each entitlement's `usage` is its own current value. It's because the row aggregates over entitlements the API would have thrown away. A pooled balance that reads `granted = 53,000`, `usage = 3,408,161`, `remaining = +10,312` is not a corrupted row — it is dozens of historical entitlements summed together. Filter to the active, current-cycle set and it reconciles.
## Per-column meaning
These are the values the ETL writes, verbatim from the read-time math.
| Column (both tables unless noted) | Definition |
| --------------------------------- | -------------------------------------------------------------------------------- |
| `included_grant` *(breakdowns)* | `allowance × plan quantity + adjustment` |
| `prepaid_grant` *(breakdowns)* | prepaid quantity × billing units (0 unless a prepaid price is linked) |
| `granted` *(balances)* | `Σ(included_grant + prepaid_grant)` |
| `usage` | `included_grant + prepaid_grant - balance` per row (signed balance), then summed |
| `remaining` | `max(0, balance)` per row — **floored at 0** — then summed |
| `overage` | **not stored** — see below |
| rollover balance | **not on either table** — join `v2_3_rollovers`, see below |
Two consequences fall straight out of these definitions:
1. **`remaining` is floored.** Each entitlement contributes `max(0, balance)`, never a negative. You cannot recover how far a balance went negative from `remaining` — that information lives only in `usage`.
2. **`usage` carries the sign.** Because `usage = granted - balance` (per row), `usage - granted = -balance`. When a balance goes negative (overage), `usage` exceeds `granted` by exactly that amount. This is the hook used to reconstruct overage.
### `granted`, `remaining`, `usage` are not a closed triple
`remaining ≠ granted - usage`. They diverge for two independent reasons, both by design:
* **Manual "Set Balance"** writes `balance` directly, decoupling it from `granted`. Set a balance below zero and `usage` (= `granted - balance`) inflates past `granted` with no real consumption behind it — the "spurious negative balance / huge usage" artifact.
* **The flooring** of `remaining` (above) breaks the identity whenever any entitlement is in overage.
Treat each column as the named sum it is, not as a term in an equation. Rollovers used to be a third reason — they were layered into all three columns as separate `rollover_*` terms that didn't cancel. They no longer appear here at all, which makes the columns cleaner but means you have to add them yourself.
## Rollovers live in their own table
Rollover **config** (`rollover_max`, `rollover_max_percentage`, and the two expiry fields) has always been visible, on `v2_3_plan_items`. Rollover **balances** were not in the lakehouse at all — so `balances.remaining` and `balances.usage` understated the real figures for every customer holding a rollover, silently. `v2_3_rollovers` fixes that. It is a correctness fix, not a convenience table: if you built a report on rollover-enabled features before it existed, that report was wrong and should be re-run.
One row per rollover grant. Join `internal_breakdown_id` → `v2_3_breakdowns.internal_id` to attach a rollover to the entitlement it carried over from; `internal_plan_item_id` gets you the config that produced it.
It is a separate table rather than extra columns on `v2_3_breakdowns` because rollovers are **sparse** — only about 6.8% of customer entitlements carry one — so folding them in would hang mostly-null columns off every breakdown row to serve a small minority of them. One entitlement can also hold several grants with different expiry dates, which no fixed set of columns represents.
**Rollovers expire, and the table keeps the expired ones.** `expires_at` null means *never expires*; a past `expires_at` means the grant is dead but still present. Sum `balance` without a filter and you overstate what the customer holds — always guard with `(expires_at IS NULL OR expires_at > now)`, spelled `(coalesce(expires_at, 0) = 0 OR expires_at > toUnixTimestamp(now()) * 1000)` in ClickHouse.
Aggregate rollovers in a subquery **before** joining them to breakdowns — one entitlement can hold several grants, and a direct join fans the breakdown row out so its `remaining` gets counted once per rollover. There is a ready-to-run query in [Querying → Balance including rollovers](/documentation/lakehouse/querying#balance-including-rollovers).
Rollover balance also feeds back into overage: unspent rollover is available allowance, so a customer who looks over their grant on `v2_3_breakdowns` alone may not be in overage once rollovers are counted. The leaderboard query below omits them — fold them in if your features roll over.
## Overage is derived, not stored — and there are two of them
There is **no overage column** on `v2_3_balances` or `v2_3_breakdowns`. Overage is computed at read time, and there are **two distinct figures** that are easy to conflate. They use the same per-row quantity (`usage - granted = -balance`) but floor at different points, so they give different answers.
**Billable overage** — what Autumn invoices. Per entitlement, `max(0, -balance)`, **floored per row, then summed**. Equivalently `Σ max(0, usage - included_grant - prepaid_grant)`. An undrawn grant on one entitlement never reduces the bill on another.
```text theme={null}
billable_overage = Σ max(0, usage - included_grant - prepaid_grant) -- floor each row, then sum
```
**Displayed overage** — what the balance header and dashboard show. The **feature-level net**, summed first and floored once: `max(0, Σusage - Σgranted)`. Because `balances.usage` and `balances.granted` already net per-entitlement surpluses against deficits, an undrawn grant on one entitlement **does** offset an overage on another.
```text theme={null}
displayed_overage = max(0, Σusage - Σgranted) -- sum first, then floor once
```
**These two diverge by exactly the undrawn grants** (`Σ max(0, granted - usage)`), and the difference can be large. For one real customer, billable overage was ≈ `824k` while displayed (dashboard) overage was ≈ `715k` — a ≈ `110k` gap of unused allowance and lifetime grants that offset the deficit in the net but not in the per-row floor. The absolute figures drift each cycle; the gap structure does not. The dashboard balance header shows **displayed** — decide which one you mean before you report it, and label it.
Either way, overage is only meaningful where a usage-based / overage-allowed price exists — a capped feature never goes negative.
The leaderboard query in [Querying → Current-period overage](/documentation/lakehouse/querying#current-period-overage) computes the **displayed** net (to match the dashboard) and shows the billable variant alongside.
## The active + current-cycle filter
This is the filter the API applies and the warehouse does not. Re-apply it before any balance, usage, or overage query.
1. **Active plan only.** Keep breakdown rows whose `internal_customer_product_id` matches an active subscription — it **is** `v2_3_subscriptions.internal_id`, so this is one direct equality against the customer's own subscription row, and its `status` is right there. (Don't match on `internal_product_id` instead — it identifies the shared *plan version* rather than the customer's copy of it, so you'd have to match on customer **and** plan and hope the customer had held that plan only once.) If your org enables `include_past_due`, also keep `past_due`. One-off entitlements (`reset_interval = 'one_off'`) are always live. A row whose `internal_customer_product_id` matches a `v2_3_purchases` row instead is a one-off purchase, not a subscription.
2. **Current cycle only.** An entitlement carries one row per reset cycle it has lived through. The current cycle is the one whose reset is the **earliest still in the future**: per `(internal_customer_id, internal_customer_product_id)`, `min(reset_resets_at)` where `reset_resets_at > now`. `one_off` rows have no cycle and are always kept.
3. **Scope.** Keep `coalesce(entity_id, '') = ''` for customer-scoped totals — but note this now *excludes* entity-scoped entitlements rather than deduping, because each entitlement produces exactly one row. Customers with `config.disable_pooled_balance` set track per-entity instead; for those, sum the per-entity rows. See [Querying → Pooled vs per-entity](/documentation/lakehouse/querying#pooled-vs-per-entity-rows).
4. **Not expired.** Drop rows whose `expires_at` is in the past.
5. **Add rollovers.** Sum the unexpired `v2_3_rollovers.balance` for the surviving breakdown rows — the API includes them and these tables don't.
A ready-to-run query that applies all of this and reproduces the dashboard's overage leaderboard is in [Querying → Current-period overage](/documentation/lakehouse/querying#current-period-overage).
## Deduction order (why monthly drains before lifetime)
When usage is recorded, Autumn deducts from entitlements **shortest-reset-interval-first** (a daily grant drains before a monthly, which drains before a lifetime/`one_off`), after a few higher-priority rules — entity-scoped before pooled when tracking an entity, unlimited first, prepaid before pay-per-use. This is why, when a customer has both a monthly grant and a lifetime grant for the same feature, the monthly empties first and overage lands on whichever pool is drained last. It matters for analytics because it determines **which** breakdown row shows the overage, not just the total.
## Footgun: `IS NULL` throws on these tables
In **ClickHouse**, on the Iceberg balances/breakdowns/rollovers/flags tables, `WHERE entity_id IS NULL` raises `NOT_FOUND_COLUMN_IN_BLOCK` (it reaches for an unmaterialized `entity_id.null` subcolumn). Use `coalesce(entity_id, '') = ''` instead, everywhere you'd reach for `IS NULL` — including `v2_3_rollovers.expires_at`, where null carries real meaning ("never expires") and the numeric form is `coalesce(expires_at, 0) = 0`. BigQuery is unaffected; plain `IS NULL` works there. See [Querying → Pooled vs per-entity](/documentation/lakehouse/querying#pooled-vs-per-entity-rows).
# Connecting
Source: https://docs.useautumn.com/documentation/lakehouse/connecting
Attach ClickHouse or BigQuery to your Autumn Lakehouse catalog.
**Available on request** — The Autumn Lakehouse is provisioned per customer. Contact us at [hey@useautumn.com](mailto:hey@useautumn.com) to get access.
When your Lakehouse is provisioned, Autumn privately sends you:
* Your **catalog** and **namespace** names (the namespace is where your `v2_3_*` tables live).
* A **scoped access key and secret** for the underlying object storage.
* The **region**: `us-east-2`.
Keep these credentials private. If you're connecting **BigQuery**, you get a **project** and **dataset** instead of a catalog, namespace, and storage key — Autumn owns the external connection, so there are no object-storage credentials for you to hold. Then connect your engine below.
#### Add a Data Lake Catalog
In ClickHouse Cloud, go to **Data Sources → Add → Data Lake Catalog → AWS Glue**.
#### Configure the catalog
Set the **region** to `us-east-2`, then paste the **access key** and **secret** Autumn sent you.
#### Save and browse
Save the connection. The catalog mounts as a database, and your tables appear as `` ``.`.v2_3_
#### Access the dataset
Autumn provisions your Iceberg tables as BigLake external tables in a BigQuery dataset you're granted access to. We share the **project** and **dataset** names with you during onboarding — you don't create the external connection yourself.
#### Verify access
List the dataset to confirm the tables are visible. They appear as `` `..v2_3_` ``, plus the unversioned `events` table.
```sql theme={null}
SELECT table_name
FROM `..INFORMATION_SCHEMA.TABLES`
ORDER BY table_name;
```
Unlike ClickHouse, BigQuery addressing is ordinary three-part `project.dataset.table` — there is no literal dot inside the table name. See [Querying](/documentation/lakehouse/querying#identifier-syntax).
## Test the connection
Run a quick count against any table to confirm everything is wired up:
```sql theme={null}
SELECT count() FROM ; -- BigQuery: COUNT(*)
```
Once that returns, head to the [Schema Reference](/documentation/lakehouse/schema) to see what's available, then [Querying](/documentation/lakehouse/querying) for examples.
If you notice the number seems lower than expected, it's because it may take a few minutes to a few hours for your data warehouse to catch up.
# Lakehouse Overview
Source: https://docs.useautumn.com/documentation/lakehouse/overview
Query your full Autumn dataset directly from your own data warehouse.
**Available on request** — The Autumn Lakehouse is provisioned per customer. Contact us at [hey@useautumn.com](mailto:hey@useautumn.com) to get access.
The Autumn Lakehouse mirrors your entire Autumn dataset — customers, plans, subscriptions, invoices, balances, events, and more — into your own data warehouse as [Apache Iceberg](https://iceberg.apache.org/) tables. You read it directly with **ClickHouse** or **BigQuery**, no API pagination required.
It's built for analytics: BI dashboards, revenue and usage reporting, cohort analysis, and joining Autumn's billing data against your own product data — all in SQL, against the full history.
Every object is delivered as a table named `v2_3_` (for example `v2_3_customers`, `v2_3_subscriptions`) inside a namespace Autumn assigns you. The usage event log is the one exception — it's immutable and unversioned, delivered as `events` (not `v2_3_events`).
## How it works
Autumn's pipeline continuously reshapes the live billing database into these analytics-friendly tables and syncs them to Iceberg in object storage. You attach your query engine to the catalog once — after that, data keeps flowing in and new columns appear automatically.
```mermaid theme={null}
flowchart LR
subgraph autumn["Autumn"]
DB["Billing data"]
EV["Usage events"]
end
RW["Autumn ETL reshape and sync"]
subgraph lake["Your lakehouse (object storage)"]
ICE[("Iceberg tables v2_3_*")]
EVT[("Events")]
end
CH["ClickHouse"]
BQ["BigQuery"]
DB -->|change data capture| RW
EV --> RW
RW -->|state lane| ICE
RW -->|events lane| EVT
ICE -->|AWS Glue catalog| CH
EVT -->|AWS Glue catalog| CH
ICE -->|BigLake REST catalog| BQ
EVT -->|BigLake REST catalog| BQ
```
## Data freshness
**State tables** (everything except events) sync under normal load within **\~5 minutes** of a change in Autumn.
**Events** have a variable lead time. On **initial connection**, historical events backfill and can take a while to fully populate — counts will climb until the backfill catches up, then track in near real-time.
## Schema versioning
The `v2_3` in every table name is the **schema version**. The Lakehouse schema changes far less often than Autumn's main API, and **all schema updates are applied automatically** — you never run a migration.
There are two kinds of change:
* **In-version (additive)** — a new column added to an existing `v2_3_*` table. Your existing saved queries keep working unchanged; the new column simply becomes available.
* **New version** — a future `v2_4_*`. This arrives as a **new table** and is **opt-in**. Your existing `v2_3_*` queries keep working untouched, and you adopt the new shape only when you choose to.
When we foresee a new version, we contact tenants beforehand. You **never need to reconnect** to receive updates — new columns and tables appear in your existing catalog automatically.
## Next steps
Attach ClickHouse or BigQuery to your catalog.
Every table and column, with the keys to join on.
Examples, cross-database joins, and footguns to avoid.
# Querying
Source: https://docs.useautumn.com/documentation/lakehouse/querying
How to address tables, convert types, join, and avoid footguns.
**Available on request** — The Autumn Lakehouse is provisioned per customer. Contact us at [hey@useautumn.com](mailto:hey@useautumn.com) to get access.
Throughout this page, replace `` and `` with the names Autumn assigned you.
## Find your catalog and namespace
Autumn sends you both names when your Lakehouse is provisioned (see [Connecting](/documentation/lakehouse/connecting)). If you need to rediscover them in ClickHouse Cloud, the catalog mounts as a database — list databases to find it:
```sql theme={null}
SHOW DATABASES;
```
The catalog appears as one of the listed databases. Your tables then live under `` ``.`.v2_3_` `` (the `.v2_3_` part is a single literal table name — see below).
BigQuery has no catalog to mount — Autumn grants you a **project** and **dataset**. List it to see what's there:
```sql theme={null}
SELECT table_name
FROM `..INFORMATION_SCHEMA.TABLES`
ORDER BY table_name;
```
## Identifier syntax
The Glue catalog mounts as a database. The whole `.v2_3_` is the **table name** — the dot is literal, so backtick **both** parts:
```sql theme={null}
SELECT * FROM ``.`.v2_3_features` LIMIT 10;
```
A common mistake is `` `.`.`v2_3_features` `` — that won't resolve, because `.v2_3_features` is a single identifier, not `database.table`. The single-quoted `'.v2_3_features'` form does not resolve in ClickHouse Cloud either — use backticks on both parts.
Iceberg tables are addressed as standard fully-qualified BigQuery tables — ordinary `project.dataset.table`, with no literal dot inside the table name:
```sql theme={null}
SELECT * FROM `..v2_3_features` LIMIT 10;
```
## Timestamps
All `number (epoch ms)` columns (`created_at`, `started_at`, `expires_at`, `current_period_*`, `*_resets_at`, …) are epoch-milliseconds. Convert before use. The only native timestamp is `events.timestamp` (the unversioned `events` table — see [Schema → Events](/documentation/lakehouse/schema#events)).
```sql theme={null}
SELECT
customer_id,
toDateTime(toInt64(created_at) / 1000) AS created
FROM ``.`.v2_3_customers`;
```
`fromUnixTimestamp64Milli(toInt64(created_at))` also works and preserves millisecond precision. `events.timestamp` is already a `DateTime` — use it directly.
```sql theme={null}
SELECT
customer_id,
TIMESTAMP_MILLIS(created_at) AS created
FROM `..v2_3_customers`;
```
## JSON columns
`metadata`, `config`, `processors`, `properties`, `deductions`, `display`, `v2_3_rollovers.entities`, and the `discounts` arrays are stored as JSON strings.
```sql theme={null}
SELECT JSONExtractString(properties, 'subtype') AS subtype
FROM ``.`.events`;
```
```sql theme={null}
SELECT JSON_VALUE(properties, '$.subtype') AS subtype
FROM `..events`;
```
## Nullable columns: don't use `IS NULL`
**ClickHouse only.** On the Iceberg tables, `WHERE col IS NULL` raises `NOT_FOUND_COLUMN_IN_BLOCK` — the engine reaches for an unmaterialized `col.null` subcolumn that doesn't exist. This bites hardest on `entity_id` (the customer-vs-entity scope discriminator) and on `v2_3_rollovers.expires_at` (where null means "never expires", so you *have* to test for it). Use **`coalesce(col, '') = ''`** for "is null" and **`coalesce(col, '') != ''`** for "is not null"; for numeric columns, `coalesce(col, 0) = 0`. BigQuery has no such restriction — plain `IS NULL` works there.
```sql theme={null}
-- ✗ throws NOT_FOUND_COLUMN_IN_BLOCK (ClickHouse)
WHERE entity_id IS NULL
-- ✓ customer-scoped (pooled) rows
WHERE coalesce(entity_id, '') = ''
-- ✓ unexpired rollovers
WHERE coalesce(expires_at, 0) = 0 OR expires_at > toUnixTimestamp(now()) * 1000
```
## Examples
### Fetch one customer
```sql theme={null}
SELECT internal_id, customer_id, name, email
FROM ``.`.v2_3_customers`
WHERE customer_id = 'cus_123';
```
```sql theme={null}
SELECT internal_id, customer_id, name, email
FROM `..v2_3_customers`
WHERE customer_id = 'cus_123';
```
### Active subscriptions joined to their plan
Join on the **internal** ids, not the external ones (see [below](#use-internal-ids-not-external-ids)).
```sql theme={null}
SELECT
s.customer_id,
p.name AS plan_name,
p.price_amount,
toDateTime(toInt64(s.current_period_end) / 1000) AS renews_at
FROM ``.`.v2_3_subscriptions` AS s
INNER JOIN ``.`.v2_3_plans` AS p
ON p.internal_id = s.internal_product_id
WHERE s.status = 'active';
```
```sql theme={null}
SELECT
s.customer_id,
p.name AS plan_name,
p.price_amount,
TIMESTAMP_MILLIS(s.current_period_end) AS renews_at
FROM `..v2_3_subscriptions` AS s
INNER JOIN `..v2_3_plans` AS p
ON p.internal_id = s.internal_product_id
WHERE s.status = 'active';
```
### A customer's balances for a feature
Use the customer-scoped (pooled) rows where `coalesce(entity_id, '') = ''`.
This returns the **raw** aggregated row, which sums over *every* entitlement — including superseded versions and past cycles — so `granted`/`remaining`/`usage` will not match the API for customers with history. It also **excludes rollover balances**, which live in `v2_3_rollovers` — see [Balance including rollovers](#balance-including-rollovers). To reproduce the API/dashboard figure, apply the active + current-cycle filter from [Working with balances](/documentation/lakehouse/balance-semantics). For overage specifically, use [the reference query below](#current-period-overage).
```sql theme={null}
SELECT feature_id, granted, remaining, usage
FROM ``.`.v2_3_balances`
WHERE customer_id = 'cus_123'
AND feature_id = 'AI_CREDITS'
AND coalesce(entity_id, '') = '';
```
```sql theme={null}
SELECT feature_id, granted, remaining, usage
FROM `..v2_3_balances`
WHERE customer_id = 'cus_123'
AND feature_id = 'AI_CREDITS'
AND entity_id IS NULL;
```
### Balance including rollovers
`v2_3_balances.remaining` and `v2_3_breakdowns.remaining` **do not include rollover balances** — rollovers are their own table, so any customer carrying unused allowance forward reads low until you add them in. This is the single most common way to undercount.
Join `v2_3_rollovers.internal_breakdown_id` to `v2_3_breakdowns.internal_id` and sum the **unexpired** rows. A rollover with `expires_at` null never expires; one with `expires_at` in the past is dead weight the table still keeps, so an unfiltered `sum(balance)` overstates.
```sql theme={null}
SELECT
b.customer_id,
b.feature_id,
sum(b.remaining) AS remaining_excl_rollover,
sum(coalesce(r.rollover_balance, 0)) AS rollover_balance,
sum(b.remaining) + sum(coalesce(r.rollover_balance, 0)) AS remaining_incl_rollover
FROM ``.`.v2_3_breakdowns` AS b
LEFT JOIN (
SELECT internal_breakdown_id AS bid, sum(balance) AS rollover_balance
FROM ``.`.v2_3_rollovers`
WHERE env = 'live'
AND (coalesce(expires_at, 0) = 0 OR expires_at > toUnixTimestamp(now()) * 1000)
GROUP BY bid
) AS r ON r.bid = b.internal_id
WHERE b.env = 'live'
AND b.customer_id = 'cus_123'
AND b.feature_id = 'AI_CREDITS'
AND coalesce(b.entity_id, '') = ''
GROUP BY b.customer_id, b.feature_id;
```
```sql theme={null}
SELECT
b.customer_id,
b.feature_id,
SUM(b.remaining) AS remaining_excl_rollover,
SUM(COALESCE(r.rollover_balance, 0)) AS rollover_balance,
SUM(b.remaining) + SUM(COALESCE(r.rollover_balance, 0)) AS remaining_incl_rollover
FROM `..v2_3_breakdowns` AS b
LEFT JOIN (
SELECT internal_breakdown_id AS bid, SUM(balance) AS rollover_balance
FROM `..v2_3_rollovers`
WHERE env = 'live'
AND (expires_at IS NULL OR expires_at > UNIX_MILLIS(CURRENT_TIMESTAMP()))
GROUP BY bid
) AS r ON r.bid = b.internal_id
WHERE b.env = 'live'
AND b.customer_id = 'cus_123'
AND b.feature_id = 'AI_CREDITS'
AND b.entity_id IS NULL
GROUP BY b.customer_id, b.feature_id;
```
Aggregate the rollovers in a **subquery before joining**, as above. Joining the rollover rows in directly fans out `v2_3_breakdowns` — one entitlement can hold several rollover grants — and then `sum(b.remaining)` counts the same breakdown row once per rollover. This query also has the same caveat as every other raw balances query: it sums over all entitlement rows, so apply the [active + current-cycle filter](/documentation/lakehouse/balance-semantics#the-active-current-cycle-filter) if you want the figure the API would return.
### Current-period overage
Overage is **derived, not stored**, and there are **two figures** — pick deliberately (see [Working with balances → Overage](/documentation/lakehouse/balance-semantics#overage-is-derived-not-stored-and-there-are-two-of-them)):
* **Displayed** (`max(0, Σusage − Σgranted)` — sum first, floor once): what the **balance header / dashboard** shows. This query computes this one, so it reproduces the dashboard to within sync-lag drift.
* **Billable** (`Σ max(0, usage − granted)` — floor per row, then sum): what Autumn **invoices**. To get it, swap the `overage` expression as noted in the query.
Both reconstruct from `v2_3_breakdowns` over the same row set: rows whose customer plan is an **active** subscription (plus always-live `one_off` rows), restricted to each entitlement's **current cycle** (earliest upcoming reset).
Swap in your `` / `` and the feature id. Known simplifications: it omits rollover balances (join `v2_3_rollovers` as in [Balance including rollovers](#balance-including-rollovers) if your features roll over — unspent rollover reduces overage) and it is customer-scope-only (`coalesce(entity_id,'') = ''`), so entity-scoped overage under `config.disable_pooled_balance` is not counted. For those customers, sum the per-entity rows instead.
```sql theme={null}
WITH
-- `internal_customer_product_id` on breakdowns IS the subscription's `internal_id`,
-- so active-ness is one direct equality — no customer + plan-version detour.
active_plan AS (
SELECT internal_id
FROM ``.`.v2_3_subscriptions`
WHERE env = 'live' AND status = 'active'
),
bd AS (
SELECT
b.internal_customer_id AS icid,
b.internal_customer_product_id AS icpid,
b.reset_interval AS ri,
toInt64(b.reset_resets_at) AS rra,
(b.included_grant + b.prepaid_grant) AS granted,
b.usage AS usage
FROM ``.`.v2_3_breakdowns` AS b
WHERE b.env = 'live'
AND b.feature_id = 'AI_CREDITS'
AND coalesce(b.entity_id, '') = ''
AND (
b.reset_interval = 'one_off'
OR b.internal_customer_product_id IN (SELECT internal_id FROM active_plan)
)
),
cur_cycle AS (
SELECT icid, icpid, min(rra) AS cur_reset
FROM bd
WHERE ri != 'one_off' AND rra > toUnixTimestamp(now()) * 1000
GROUP BY icid, icpid
),
per_customer AS (
SELECT
bd.icid AS icid,
sum(bd.granted) AS granted,
sum(bd.usage) AS usage,
-- DISPLAYED overage (matches the dashboard): sum first, floor once.
greatest(0, sum(bd.usage) - sum(bd.granted)) AS overage
-- For BILLABLE overage (what Autumn invoices) instead, floor per row, then sum:
-- sum(greatest(0, bd.usage - bd.granted)) AS overage
FROM bd
LEFT JOIN cur_cycle AS cc ON cc.icid = bd.icid AND cc.icpid = bd.icpid
WHERE bd.ri = 'one_off' OR bd.rra = cc.cur_reset
GROUP BY bd.icid
HAVING overage > 0
ORDER BY overage DESC
LIMIT 10
),
active_subs AS (
SELECT s.internal_customer_id AS icid, groupArray(coalesce(p.name, s.plan_id)) AS subscriptions
FROM ``.`.v2_3_subscriptions` AS s
LEFT JOIN ``.`.v2_3_plans` AS p ON p.internal_id = s.internal_product_id
WHERE s.env = 'live' AND s.status = 'active'
GROUP BY s.internal_customer_id
)
SELECT
c.customer_id AS customer_id,
nullIf(c.name, '') AS name,
nullIf(c.email, '') AS email,
pc.granted AS granted,
pc.usage AS usage,
pc.overage AS overage,
s.subscriptions AS subscriptions
FROM per_customer AS pc
INNER JOIN ``.`.v2_3_customers` AS c ON c.internal_id = pc.icid
LEFT JOIN active_subs AS s ON s.icid = pc.icid
ORDER BY pc.overage DESC;
```
```sql theme={null}
WITH
-- `internal_customer_product_id` on breakdowns IS the subscription's `internal_id`,
-- so active-ness is one direct equality — no customer + plan-version detour.
active_plan AS (
SELECT internal_id
FROM `..v2_3_subscriptions`
WHERE env = 'live' AND status = 'active'
),
bd AS (
SELECT
b.internal_customer_id AS icid,
b.internal_customer_product_id AS icpid,
b.reset_interval AS ri,
b.reset_resets_at AS rra,
(b.included_grant + b.prepaid_grant) AS granted,
b.usage AS usage
FROM `..v2_3_breakdowns` AS b
WHERE b.env = 'live'
AND b.feature_id = 'AI_CREDITS'
AND b.entity_id IS NULL
AND (
b.reset_interval = 'one_off'
OR b.internal_customer_product_id IN (SELECT internal_id FROM active_plan)
)
),
cur_cycle AS (
SELECT icid, icpid, MIN(rra) AS cur_reset
FROM bd
WHERE ri != 'one_off' AND rra > UNIX_MILLIS(CURRENT_TIMESTAMP())
GROUP BY icid, icpid
),
per_customer AS (
SELECT
bd.icid AS icid,
SUM(bd.granted) AS granted,
SUM(bd.usage) AS usage,
-- DISPLAYED overage (matches the dashboard): sum first, floor once.
GREATEST(0, SUM(bd.usage) - SUM(bd.granted)) AS overage
-- For BILLABLE overage (what Autumn invoices) instead, floor per row, then sum:
-- SUM(GREATEST(0, bd.usage - bd.granted)) AS overage
FROM bd
LEFT JOIN cur_cycle AS cc ON cc.icid = bd.icid AND cc.icpid = bd.icpid
WHERE bd.ri = 'one_off' OR bd.rra = cc.cur_reset
GROUP BY bd.icid
HAVING overage > 0
ORDER BY overage DESC
LIMIT 10
),
active_subs AS (
SELECT s.internal_customer_id AS icid,
ARRAY_AGG(COALESCE(p.name, s.plan_id) IGNORE NULLS) AS subscriptions
FROM `..v2_3_subscriptions` AS s
LEFT JOIN `..v2_3_plans` AS p ON p.internal_id = s.internal_product_id
WHERE s.env = 'live' AND s.status = 'active'
GROUP BY s.internal_customer_id
)
SELECT
c.customer_id AS customer_id,
NULLIF(c.name, '') AS name,
NULLIF(c.email, '') AS email,
pc.granted AS granted,
pc.usage AS usage,
pc.overage AS overage,
s.subscriptions AS subscriptions
FROM per_customer AS pc
INNER JOIN `..v2_3_customers` AS c ON c.internal_id = pc.icid
LEFT JOIN active_subs AS s ON s.icid = pc.icid
ORDER BY pc.overage DESC;
```
### Invoice totals by status
```sql theme={null}
SELECT status, count() AS invoices, sum(total) AS total
FROM ``.`.v2_3_invoices`
GROUP BY status
ORDER BY total DESC;
```
To break down by plan, expand the `plan_ids` array with `ARRAY JOIN`:
```sql theme={null}
SELECT plan_id, count() AS invoices
FROM ``.`.v2_3_invoices`
ARRAY JOIN plan_ids AS plan_id
GROUP BY plan_id;
```
```sql theme={null}
SELECT status, COUNT(*) AS invoices, SUM(total) AS total
FROM `..v2_3_invoices`
GROUP BY status
ORDER BY total DESC;
```
To break down by plan, expand the `plan_ids` array with `UNNEST`:
```sql theme={null}
SELECT plan_id, COUNT(*) AS invoices
FROM `..v2_3_invoices`, UNNEST(plan_ids) AS plan_id
GROUP BY plan_id;
```
### Event volume per day by subtype
```sql theme={null}
SELECT
toStartOfDay(timestamp) AS day,
JSONExtractString(properties, 'subtype') AS subtype,
count() AS events
FROM ``.`.events`
WHERE timestamp > now() - INTERVAL 30 DAY
GROUP BY day, subtype
ORDER BY day;
```
```sql theme={null}
SELECT
TIMESTAMP_TRUNC(timestamp, DAY) AS day,
JSON_VALUE(properties, '$.subtype') AS subtype,
COUNT(*) AS events
FROM `..events`
WHERE timestamp > TIMESTAMP_SUB(CURRENT_TIMESTAMP(), INTERVAL 30 DAY)
GROUP BY day, subtype
ORDER BY day;
```
### Reconstruct a full customer (API shape)
This rebuilds the **entire** `GET /customers/:id` response — scalars, subscriptions, purchases, balances (with per-plan breakdowns), flags, and invoices — from the warehouse in a single query, returned as one JSON object. It's the most useful query if you want the API's customer view without calling the API.
ClickHouse-specific (uses `groupArray`, `Tuple`/`Map` casts, and the `JSON` type — ClickHouse 24.8+). Customer-level (pooled) balances and flags use `entity_id = ''`; per-entity rows are excluded from the customer envelope. `FORMAT PrettyJSONEachRow` emits one pretty-printed JSON object.
This mirrors the **shape** of the API response, but the `balances` / `breakdown` values are the raw aggregated rows — they sum over superseded versions and past cycles, and they **exclude rollover balances** — so they will not match `GET /customers/:id` for customers with billing history or rollovers. To match the API, restrict the balances/breakdowns subqueries to active, current-cycle rows per [Working with balances → The active + current-cycle filter](/documentation/lakehouse/balance-semantics#the-active-current-cycle-filter), and fold in `v2_3_rollovers` as in [Balance including rollovers](#balance-including-rollovers).
```sql theme={null}
SELECT
-- customer scalars — from v2_3_customers
c.customer_id AS id,
nullIf(c.name, '') AS name,
nullIf(c.email, '') AS email,
c.created_at AS created_at,
nullIf(c.fingerprint, '') AS fingerprint,
nullIf(c.stripe_id, '') AS stripe_id,
c.env AS env,
c.internal_id AS autumn_id,
c.send_email_receipts AS send_email_receipts,
CAST(if(empty(c.metadata), '{}', c.metadata) AS JSON) AS metadata,
CAST(if(empty(c.billing_controls), '{}', c.billing_controls) AS JSON) AS billing_controls,
CAST(if(empty(c.config), '{}', c.config) AS JSON) AS config,
CAST(if(empty(c.processors), '{}', c.processors) AS JSON) AS processors,
-- subscriptions[] — recurring customer products, from v2_3_subscriptions
(
SELECT groupArray(CAST((
s.id, s.plan_id, s.auto_enable, s.add_on, s.status, s.past_due,
nullIf(s.canceled_at, 0), nullIf(s.expires_at, 0), nullIf(s.trial_ends_at, 0),
s.started_at, s.quantity,
nullIf(s.current_period_start, 0), nullIf(s.current_period_end, 0),
if(coalesce(s.entity_id, '') = '', 'customer', 'entity'),
nullIf(s.entity_id, ''), nullIf(s.internal_entity_id, '')
) AS Tuple(
id String, plan_id String, auto_enable Bool, add_on Bool, status String, past_due Bool,
canceled_at Nullable(Int64), expires_at Nullable(Int64), trial_ends_at Nullable(Int64),
started_at Int64, quantity Float64,
current_period_start Nullable(Int64), current_period_end Nullable(Int64),
scope String, entity_id Nullable(String), internal_entity_id Nullable(String))))
FROM ``.`.v2_3_subscriptions` s
WHERE s.customer_id = 'cus_123'
) AS subscriptions,
-- purchases[] — one-off customer products, from v2_3_purchases
(
SELECT groupArray(CAST((
p.plan_id, nullIf(p.expires_at, 0), p.started_at, p.quantity,
if(coalesce(p.entity_id, '') = '', 'customer', 'entity'),
nullIf(p.entity_id, ''), nullIf(p.internal_entity_id, '')
) AS Tuple(plan_id String, expires_at Nullable(Int64), started_at Int64, quantity Float64,
scope String, entity_id Nullable(String), internal_entity_id Nullable(String))))
FROM ``.`.v2_3_purchases` p
WHERE p.customer_id = 'cus_123'
) AS purchases,
-- balances{} — keyed by feature_id, with nested breakdown[], from v2_3_balances + v2_3_breakdowns.
-- The breakdown's plan_id and price_* fields no longer live on v2_3_breakdowns — they are
-- joined back in from v2_3_plans and v2_3_plan_items via the internal_*_id keys.
(
SELECT CAST(groupArray((b.feature_id, CAST((
'balance', b.feature_id, b.granted, b.remaining, b.usage, b.unlimited,
nullIf(b.next_reset_at, 0),
bd.breakdown
) AS Tuple(
object String, feature_id String, granted Float64, remaining Float64, usage Float64,
unlimited Bool, next_reset_at Nullable(Int64),
breakdown Array(Tuple(
object String, id String, plan_id Nullable(String), included_grant Float64, prepaid_grant Float64,
remaining Float64, usage Float64, unlimited Bool, expires_at Nullable(Int64),
reset_interval Nullable(String), reset_interval_count Nullable(Float64), reset_resets_at Nullable(Int64),
price_amount Nullable(Float64), price_billing_method Nullable(String), price_billing_units Nullable(Float64),
price_tier_behavior Nullable(String), price_max_purchase Nullable(Float64))))))
) AS Map(String, Tuple(
object String, feature_id String, granted Float64, remaining Float64, usage Float64,
unlimited Bool, next_reset_at Nullable(Int64),
breakdown Array(Tuple(
object String, id String, plan_id Nullable(String), included_grant Float64, prepaid_grant Float64,
remaining Float64, usage Float64, unlimited Bool, expires_at Nullable(Int64),
reset_interval Nullable(String), reset_interval_count Nullable(Float64), reset_resets_at Nullable(Int64),
price_amount Nullable(Float64), price_billing_method Nullable(String), price_billing_units Nullable(Float64),
price_tier_behavior Nullable(String), price_max_purchase Nullable(Float64))))))
FROM ``.`.v2_3_balances` b
LEFT JOIN (
SELECT d.feature_id AS feature_id, groupArray(CAST((
'balance_breakdown', d.id, nullIf(pl.plan_id, ''), d.included_grant, d.prepaid_grant, d.remaining, d.usage, d.unlimited,
nullIf(d.expires_at, 0), nullIf(d.reset_interval, ''), d.reset_interval_count, nullIf(d.reset_resets_at, 0),
pi.price_amount, nullIf(pi.price_billing_method, ''), pi.price_billing_units, nullIf(pi.price_tier_behavior, ''), pi.price_max_purchase
) AS Tuple(
object String, id String, plan_id Nullable(String), included_grant Float64, prepaid_grant Float64,
remaining Float64, usage Float64, unlimited Bool, expires_at Nullable(Int64),
reset_interval Nullable(String), reset_interval_count Nullable(Float64), reset_resets_at Nullable(Int64),
price_amount Nullable(Float64), price_billing_method Nullable(String), price_billing_units Nullable(Float64),
price_tier_behavior Nullable(String), price_max_purchase Nullable(Float64)))) AS breakdown
FROM ``.`.v2_3_breakdowns` d
LEFT JOIN ``.`.v2_3_plans` pl ON pl.internal_id = d.internal_product_id
LEFT JOIN ``.`.v2_3_plan_items` pi ON pi.internal_id = d.internal_plan_item_id
WHERE d.customer_id = 'cus_123' AND coalesce(d.entity_id, '') = ''
GROUP BY d.feature_id
) bd ON bd.feature_id = b.feature_id
WHERE b.customer_id = 'cus_123' AND coalesce(b.entity_id, '') = ''
) AS balances,
-- flags{} — keyed by feature_id, boolean features, from v2_3_flags.
-- plan_id no longer lives on v2_3_flags — it is joined back in from v2_3_plans
-- via internal_product_id, the same way the breakdowns above resolve theirs.
(
SELECT CAST(groupArray((f.feature_id, CAST((
'flag', f.id, nullIf(fp.plan_id, ''), nullIf(f.expires_at, 0), f.feature_id
) AS Tuple(object String, id String, plan_id Nullable(String), expires_at Nullable(Int64), feature_id String))))
AS Map(String, Tuple(object String, id String, plan_id Nullable(String), expires_at Nullable(Int64), feature_id String)))
FROM ``.`.v2_3_flags` f
LEFT JOIN ``.`.v2_3_plans` fp ON fp.internal_id = f.internal_product_id
WHERE f.customer_id = 'cus_123' AND coalesce(f.entity_id, '') = ''
) AS flags,
-- invoices[] — from v2_3_invoices
(
SELECT groupArray(CAST((
i.plan_ids, i.stripe_id, coalesce(nullIf(i.processor_type, ''), 'stripe'),
coalesce(i.status, ''), i.total, i.currency, i.created_at, nullIf(i.hosted_invoice_url, '')
) AS Tuple(
plan_ids Array(String), stripe_id String, processor_type String, status String,
total Float64, currency String, created_at Int64, hosted_invoice_url Nullable(String))))
FROM ``.`.v2_3_invoices` i
WHERE i.customer_id = 'cus_123'
) AS invoices
FROM ``.`.v2_3_customers` c
WHERE c.customer_id = 'cus_123'
FORMAT PrettyJSONEachRow;
```
Timestamps in the output are epoch-milliseconds (the API's convention); `0` is normalized to `null` via `nullIf(x, 0)`. `metadata` / `billing_controls` / `config` / `processors` are stored as JSON strings and re-parsed with `CAST(... AS JSON)` — on ClickHouse older than 24.8, drop the `CAST` to emit the raw JSON string.
## Recipes
Short, runnable answers to the questions people ask most often once they start joining the balances lane to everything else. They're written for **BigQuery**; to run them on ClickHouse, swap the addressing form to `` ``.`.
` ``, replace `TIMESTAMP_MILLIS(x)` with `fromUnixTimestamp64Milli(toInt64(x))`, `UNIX_MILLIS(CURRENT_TIMESTAMP())` with `toUnixTimestamp(now()) * 1000`, and every `IS NULL` / `IS NOT NULL` with the `coalesce` form ([why](#nullable-columns-dont-use-is-null)).
All of these read raw breakdown rows, which span superseded plan versions and past cycles and exclude rollovers, so apply the [active + current-cycle filter](/documentation/lakehouse/balance-semantics#the-active-current-cycle-filter) before quoting any of these numbers as the customer's real position.
### Join a breakdown to its subscription
`internal_customer_product_id` **is** the subscription's `internal_id`, so this is one equality — no detour through customer + plan version.
```sql theme={null}
SELECT
b.customer_id,
b.feature_id,
b.remaining,
s.id AS subscription_id,
s.status,
s.past_due,
TIMESTAMP_MILLIS(s.current_period_end) AS period_end
FROM `..v2_3_breakdowns` AS b
INNER JOIN `..v2_3_subscriptions` AS s
ON s.internal_id = b.internal_customer_product_id
WHERE b.env = 'live'
AND b.customer_id = 'cus_123';
```
### Join a breakdown to its purchase
Identical shape against `v2_3_purchases` — one-off purchases have no `status`, so their liveness is `expires_at`.
```sql theme={null}
SELECT
b.customer_id,
b.feature_id,
b.remaining,
p.id AS purchase_id,
TIMESTAMP_MILLIS(p.started_at) AS started_at,
TIMESTAMP_MILLIS(p.expires_at) AS expires_at
FROM `..v2_3_breakdowns` AS b
INNER JOIN `..v2_3_purchases` AS p
ON p.internal_id = b.internal_customer_product_id
WHERE b.env = 'live'
AND b.customer_id = 'cus_123';
```
### The status of the plan a breakdown belongs to
`v2_3_breakdowns` has **no `status` column** — status is a property of the customer's plan, so you fetch it through `internal_customer_product_id`. Because that key resolves to a subscription *or* a purchase, join both sides and coalesce. This also shows how to recover the external `plan_id`, which no longer lives on breakdowns: join `internal_product_id` → `v2_3_plans`.
```sql theme={null}
SELECT
b.internal_id AS breakdown_id,
b.feature_id,
pl.plan_id, -- external plan id, resolved via internal_product_id
pl.name AS plan_name,
CASE
WHEN s.internal_id IS NOT NULL THEN s.status -- 'active' / 'scheduled'
WHEN pu.internal_id IS NOT NULL THEN 'purchase'
ELSE 'unattached' -- no customer plan (rare)
END AS plan_status,
TIMESTAMP_MILLIS(COALESCE(s.expires_at, pu.expires_at)) AS plan_expires_at
FROM `..v2_3_breakdowns` AS b
LEFT JOIN `..v2_3_subscriptions` AS s
ON s.internal_id = b.internal_customer_product_id
LEFT JOIN `..v2_3_purchases` AS pu
ON pu.internal_id = b.internal_customer_product_id
LEFT JOIN `..v2_3_plans` AS pl
ON pl.internal_id = b.internal_product_id
WHERE b.env = 'live'
AND b.customer_id = 'cus_123';
```
### The status of the plan behind a flag
`v2_3_flags` works the same way, and for the same reason: it carries keys, not copies. It has **no `customer_plan_status`, `customer_plan_starts_at`, or `customer_plan_ended_at`** — those were removed along with `plan_id` — so a flag's plan status comes from the same double join on `internal_customer_product_id`.
```sql theme={null}
SELECT
fl.customer_id,
fl.feature_id,
pl.plan_id, -- external plan id, resolved via internal_product_id
COALESCE(
s.status, -- 'active' / 'scheduled' for a subscription
IF(pu.internal_id IS NOT NULL, 'purchase', NULL)
) AS plan_status,
TIMESTAMP_MILLIS(COALESCE(s.started_at, pu.started_at)) AS plan_started_at,
TIMESTAMP_MILLIS(COALESCE(s.expires_at, pu.expires_at)) AS plan_ends_at
FROM `..v2_3_flags` AS fl
LEFT JOIN `..v2_3_subscriptions` AS s
ON s.internal_id = fl.internal_customer_product_id
LEFT JOIN `..v2_3_purchases` AS pu
ON pu.internal_id = fl.internal_customer_product_id
LEFT JOIN `..v2_3_plans` AS pl
ON pl.internal_id = fl.internal_product_id
WHERE fl.env = 'live'
AND fl.customer_id = 'cus_123'
AND fl.entity_id IS NULL; -- pooled rows only; see Pooled vs per-entity
```
Only `v2_3_subscriptions` has a `status` column — a one-off purchase has no lifecycle states, so its liveness is `expires_at`. That's why the `COALESCE` falls back to a literal rather than to `pu.status`. To keep only flags granted by a live plan, filter `s.status = 'active'` **or** an unexpired purchase, rather than reaching for a single status column.
### Use `internal_customer_product_id` as the join key
A **customer plan** is a customer's own instance of a plan, and it is either a recurring subscription or a one-off purchase — never both, never neither-but-something-else. So `internal_customer_product_id` on `v2_3_breakdowns`, `v2_3_rollovers`, and `v2_3_flags` points at `v2_3_subscriptions.internal_id` **or** `v2_3_purchases.internal_id`, and exactly one of the two joins matches. Left-join both and let the null tell you which kind it is:
```sql theme={null}
SELECT
CASE
WHEN s.internal_id IS NOT NULL THEN 'subscription'
WHEN pu.internal_id IS NOT NULL THEN 'purchase'
ELSE 'unattached'
END AS plan_kind,
COUNT(*) AS breakdown_rows
FROM `..v2_3_breakdowns` AS b
LEFT JOIN `..v2_3_subscriptions` AS s
ON s.internal_id = b.internal_customer_product_id
LEFT JOIN `..v2_3_purchases` AS pu
ON pu.internal_id = b.internal_customer_product_id
WHERE b.env = 'live'
GROUP BY plan_kind;
```
Don't reach for `internal_product_id` to do this job. It identifies the shared **plan version**, so matching on it gives you every customer who ever held that plan; you'd have to add the customer id and still couldn't tell two spells of the same plan apart. `internal_customer_product_id` is the customer's own row, and it is unique.
### What balances did this customer have on their last plan
"Last plan" is the most recently started customer plan. Take it from `v2_3_subscriptions` by `started_at`, then pull every breakdown that hangs off it.
```sql theme={null}
WITH last_plan AS (
SELECT internal_id, plan_id, internal_product_id, started_at
FROM `..v2_3_subscriptions`
WHERE env = 'live' AND customer_id = 'cus_123'
ORDER BY started_at DESC
LIMIT 1
)
SELECT
lp.plan_id,
b.feature_id,
SUM(b.included_grant + b.prepaid_grant) AS granted,
SUM(b.remaining) AS remaining,
SUM(b.usage) AS usage
FROM `..v2_3_breakdowns` AS b
INNER JOIN last_plan AS lp
ON lp.internal_id = b.internal_customer_product_id
GROUP BY lp.plan_id, b.feature_id
ORDER BY b.feature_id;
```
Two adjustments depending on what you mean. If the customer's most recent plan might be a one-off, build `last_plan` as a `UNION ALL` over `v2_3_subscriptions` and `v2_3_purchases` before the `ORDER BY started_at DESC LIMIT 1`. And this still sums **every reset cycle** that plan lived through — add `AND b.reset_resets_at = (the current cycle)` per the [active + current-cycle filter](/documentation/lakehouse/balance-semantics#the-active-current-cycle-filter), and fold in [rollovers](#balance-including-rollovers), if you want the position as of now rather than the plan's whole history.
### Rows whose next reset is in the past
Useful as a health check. On `v2_3_balances`, `next_reset_at` is the **earliest** reset across every entitlement in the group, so a past value usually means the group still contains stale entitlement rows from cycles that have already rolled — not that a reset is overdue.
```sql theme={null}
SELECT
customer_id,
feature_id,
entity_id,
remaining,
TIMESTAMP_MILLIS(next_reset_at) AS next_reset
FROM `..v2_3_balances`
WHERE env = 'live'
AND next_reset_at IS NOT NULL
AND next_reset_at < UNIX_MILLIS(CURRENT_TIMESTAMP())
ORDER BY next_reset_at;
```
To find the individual entitlements behind it, run the same predicate on `v2_3_breakdowns.reset_resets_at` — that column is per-entitlement, so a past value there identifies exactly which rows the current-cycle filter would drop.
```sql theme={null}
SELECT internal_id, customer_id, feature_id, internal_customer_product_id,
TIMESTAMP_MILLIS(reset_resets_at) AS resets_at
FROM `..v2_3_breakdowns`
WHERE env = 'live'
AND reset_resets_at IS NOT NULL
AND reset_resets_at < UNIX_MILLIS(CURRENT_TIMESTAMP())
ORDER BY reset_resets_at;
```
## Cross-database joins
You can join your Lakehouse tables against your own data living elsewhere in the same engine.
Qualify each side fully — the Iceberg catalog table and your own ClickHouse table:
```sql theme={null}
SELECT c.customer_id, c.email, u.signup_source
FROM ``.`.v2_3_customers` AS c
INNER JOIN my_db.users AS u
ON u.autumn_customer_id = c.customer_id;
```
The catalog connection is best for **ad-hoc and bounded** queries. For very large scans, filter early (by `env`, time range, or id) or materialize a subset into a native table first.
Cross-dataset joins are native — fully-qualify `project.dataset.table` on both sides:
```sql theme={null}
SELECT i.id, i.total, a.region
FROM `..v2_3_invoices` AS i
INNER JOIN `.analytics.accounts` AS a
ON a.autumn_customer_id = i.customer_id;
```
## Important notes
### Use internal ids, not external ids
This is the single most important rule for reliable queries.
* Each **plan version is its own row** in `v2_3_plans`, with its own `internal_id`. The only identifier shared *across versions* is the external `plan_id`.
* External ids (`plan_id`, `customer_id`, `feature_id`, `entity_id`, …) are **mutable** — you can rename them in Autumn at any time — and a single external id can map to multiple versioned rows.
So:
* **Join and filter on `internal_id`** and the `internal_*` foreign keys (`internal_customer_id`, `internal_feature_id`, `internal_product_id`, `internal_entity_id`). These are immutable and globally unique.
* The balances lane (`v2_3_breakdowns`, `v2_3_balances`, `v2_3_rollovers`, `v2_3_flags`) uses the same keys as every other table: `internal_product_id` (→ `v2_3_plans`), `internal_plan_item_id` (→ `v2_3_plan_items`), and `internal_customer_product_id` (→ `v2_3_subscriptions` or `v2_3_purchases`). Reach for `internal_customer_product_id` whenever you need the customer's *own* plan row — status, period, cancellation — rather than the shared plan version.
* Treat external ids as **display-only** — great for human-readable output, unreliable as join or lookup keys.
Filtering by an external `plan_id` can silently match **multiple plan versions** (and breaks entirely if the id was renamed). Reach for `internal_id` whenever you need a stable, exact reference.
### Pooled vs per-entity rows
`v2_3_balances`, `v2_3_breakdowns`, and `v2_3_flags` contain two kinds of row:
* **Pooled** (customer-scoped) — `entity_id` is null.
* **Per-entity** — `entity_id` is set.
In `v2_3_balances` and `v2_3_breakdowns` the two are **disjoint**: an entitlement produces exactly one row, under whichever scope it holds. So `coalesce(entity_id, '') = ''` gives you the customer-scoped rows and *excludes* entity-scoped ones — it isn't a dedup. If you want a customer's true total across both, sum them all and don't filter on scope at all. To analyze one entity, filter on its `entity_id` (or `internal_entity_id`).
`v2_3_flags` is different: an entity-scoped flag is written **twice**, once at its own entity scope and once into the customer pool, so there `coalesce(entity_id, '') = ''` genuinely is the dedup.
Write `coalesce(entity_id, '') = ''`, **not** `entity_id IS NULL` — `IS NULL` throws on these Iceberg columns (see [Nullable columns](#nullable-columns-dont-use-is-null)).
Customers with `config.disable_pooled_balance` track per-entity rather than pooled — for them, sum the per-entity rows instead of reading the pooled row. See [Working with balances](/documentation/lakehouse/balance-semantics) for what the aggregated values mean and the active + current-cycle filter you need before trusting them.
### Freshness
State tables sync within **\~5 minutes** under normal load; events have a variable lead time and backfill on first connection. See [Overview → Data freshness](/documentation/lakehouse/overview#data-freshness).
# Schema Reference
Source: https://docs.useautumn.com/documentation/lakehouse/schema
Every Lakehouse table and column, with the keys to join on.
**Available on request** — The Autumn Lakehouse is provisioned per customer. Contact us at [hey@useautumn.com](mailto:hey@useautumn.com) to get access.
Every object is delivered as a table named `v2_3_`, grouped below by lane. The **one exception is events**: the event log is immutable and unversioned, delivered as `events` (not `v2_3_events`) — see [Events](#events).
## Type legend
Types below are **engine-neutral**. How each engine surfaces them:
| Logical type | ClickHouse | BigQuery |
| ------------------- | -------------------------- | ------------------- |
| `string` | `Nullable(String)` | `STRING` |
| `number` | `Nullable(Decimal(38, …))` | `INT64` / `NUMERIC` |
| `number (epoch ms)` | `Nullable(Decimal(38, …))` | `INT64` |
| `boolean` | `Nullable(Bool)` | `BOOL` |
| `json (string)` | `Nullable(String)` | `STRING` |
| `json[] (string)` | `Array(Nullable(String))` | `ARRAY` |
| `string[]` | `Array(Nullable(String))` | `ARRAY` |
| `timestamp` | `Nullable(DateTime64)` | `TIMESTAMP` |
* **Timestamps are epoch-milliseconds** (`number (epoch ms)`), not native datetimes — convert before use. See [Querying → Timestamps](/documentation/lakehouse/querying#timestamps). The one exception is `events.timestamp`, which is a real `timestamp`.
* **JSON columns are stored as strings** — parse them with `JSONExtract*` (ClickHouse) or `JSON_VALUE` (BigQuery).
## Keys
* ⭐ marks the **stable, immutable key** for a table — join and filter on this.
* 🔗 marks a **stable foreign key** (`internal_customer_id`, `internal_feature_id`, `internal_product_id`, `internal_entity_id`, `internal_reward_id`) — join to the matching `internal_id`.
* External ids (`customer_id`, `plan_id`, `feature_id`, `entity_id`, `id`, …) are **mutable** — convenient for display, but don't rely on them as stable keys. See [Querying → Use internal ids](/documentation/lakehouse/querying#use-internal-ids-not-external-ids).
* `org_id` is your tenant id (constant across your tables); `env` is `sandbox` or `live` (**not** `production` — filtering `env = 'production'` silently returns zero rows).
***
## Catalog
Your pricing model: features, plans, plan items, rewards, and referral programs.
| Column | Type | Notes |
| ------------- | ------------- | ---------------------------------------- |
| `internal_id` | string | ⭐ stable key |
| `feature_id` | string | external id (e.g. `AI_CREDITS`), mutable |
| `org_id` | string | your tenant id |
| `env` | string | `sandbox` / `live` |
| `name` | string | |
| `type` | string | feature type |
| `display` | json (string) | display config |
| `config` | json (string) | metered / credit-system config |
| Column | Type | Notes |
| ----------------------- | ----------------- | -------------------------------------------- |
| `internal_id` | string | ⭐ stable key — one row **per plan version** |
| `plan_id` | string | external id, mutable, shared across versions |
| `org_id` | string | your tenant id |
| `env` | string | `sandbox` / `live` |
| `name` | string | |
| `description` | string | |
| `group` | string | |
| `version` | number | plan version number |
| `add_on` | boolean | |
| `auto_enable` | boolean | |
| `archived` | boolean | |
| `base_variant_id` | string | |
| `created_at` | number (epoch ms) | |
| `config` | json (string) | |
| `price_amount` | number | base recurring price |
| `price_interval` | string | billing interval |
| `price_interval_count` | number | |
| `trial_duration_length` | number | |
| `trial_duration_type` | string | |
| `trial_card_required` | boolean | |
| `trial_on_end` | string | |
| Column | Type | Notes |
| --------------------------------- | ------------- | --------------------------------------- |
| `internal_id` | string | ⭐ stable key |
| `plan_id` | string | external plan id |
| `internal_product_id` | string | 🔗 → `v2_3_plans.internal_id` |
| `org_id` | string | your tenant id |
| `env` | string | `sandbox` / `live` |
| `feature_id` | string | external feature id |
| `internal_feature_id` | string | 🔗 → `v2_3_features.internal_id` |
| `included` | number | allowance (`0` if unlimited) |
| `unlimited` | boolean | |
| `reset_interval` | string | null for boolean / continuous-use |
| `reset_interval_count` | number | null if count is 1 |
| `has_price` | boolean | |
| `price_amount` | number | single-tier only |
| `price_tiers` | json (string) | multi-tier array (null if single/fixed) |
| `price_tier_behavior` | string | graduated / stairstep |
| `price_interval` | string | |
| `price_interval_count` | number | |
| `price_billing_units` | number | |
| `price_billing_method` | string | prepaid / usage\_based |
| `price_max_purchase` | number | usage\_limit − included |
| `rollover_max` | number | |
| `rollover_max_percentage` | number | |
| `rollover_expiry_duration_type` | string | |
| `rollover_expiry_duration_length` | number | |
| Column | Type | Notes |
| ----------------------------- | ----------------- | ------------------------------------------------------ |
| `internal_id` | string | ⭐ stable key |
| `id` | string | external id, mutable |
| `org_id` | string | your tenant id |
| `env` | string | `sandbox` / `live` |
| `name` | string | |
| `type` | string | percentage\_discount / fixed\_discount / free\_product |
| `created_at` | number (epoch ms) | |
| `discount_value` | number | |
| `discount_duration_type` | string | |
| `discount_duration_value` | number | |
| `discount_apply_to_all` | boolean | |
| `discount_price_ids` | json (string) | string array (null for free-product) |
| `free_product_id` | string | plan id (null for discount) |
| `free_product_duration_type` | string | |
| `free_product_duration_value` | number | |
| `promo_codes` | json (string) | array of `{code, global_max_redemption}` |
| Column | Type | Notes |
| ----------------------- | ----------------- | ------------------------------- |
| `internal_id` | string | ⭐ stable key |
| `id` | string | external id, mutable |
| `org_id` | string | your tenant id |
| `env` | string | `sandbox` / `live` |
| `created_at` | number (epoch ms) | |
| `reward_id` | string | external reward id |
| `internal_reward_id` | string | 🔗 → `v2_3_rewards.internal_id` |
| `trigger_event` | string | customer\_creation / checkout |
| `received_by` | string | referrer / all |
| `product_ids` | string\[] | external plan ids |
| `exclude_trial` | boolean | |
| `unlimited_redemptions` | boolean | |
| `max_redemptions` | number | |
***
## Subjects
Who your plans apply to: customers and entities (sub-customers).
| Column | Type | Notes |
| --------------------- | ----------------- | ------------------------------------------------------------ |
| `internal_id` | string | ⭐ stable key |
| `customer_id` | string | external id, mutable (may be null) |
| `org_id` | string | your tenant id |
| `env` | string | `sandbox` / `live` |
| `name` | string | |
| `email` | string | |
| `created_at` | number (epoch ms) | |
| `fingerprint` | string | |
| `stripe_id` | string | Stripe customer id |
| `metadata` | json (string) | |
| `send_email_receipts` | boolean | |
| `billing_controls` | json (string) | auto\_topups, spend\_limits, usage\_alerts, overage\_allowed |
| `config` | json (string) | |
| `processors` | json (string) | stripe / vercel / revenuecat links |
| Column | Type | Notes |
| ---------------------- | ----------------- | ---------------------------------------------- |
| `internal_id` | string | ⭐ stable key |
| `id` | string | external id, mutable |
| `org_id` | string | your tenant id |
| `env` | string | `sandbox` / `live` |
| `customer_id` | string | parent customer external id |
| `internal_customer_id` | string | 🔗 → `v2_3_customers.internal_id` |
| `feature_id` | string | entity feature scope (external) |
| `name` | string | |
| `created_at` | number (epoch ms) | |
| `deleted` | boolean | |
| `billing_controls` | json (string) | spend\_limits, usage\_alerts, overage\_allowed |
***
## States
Active customer–product relationships: recurring subscriptions and one-off purchases.
| Column | Type | Notes |
| ---------------------- | ----------------- | --------------------------------------------------------- |
| `internal_id` | string | ⭐ stable key |
| `id` | string | external id, mutable |
| `customer_id` | string | external customer id |
| `internal_customer_id` | string | 🔗 → `v2_3_customers.internal_id` |
| `org_id` | string | your tenant id |
| `env` | string | `sandbox` / `live` |
| `plan_id` | string | external plan id |
| `internal_product_id` | string | 🔗 → `v2_3_plans.internal_id` |
| `add_on` | boolean | |
| `auto_enable` | boolean | |
| `status` | string | active / scheduled |
| `past_due` | boolean | |
| `canceled_at` | number (epoch ms) | null if not canceled |
| `expires_at` | number (epoch ms) | null if no expiry |
| `trial_ends_at` | number (epoch ms) | null if no trial |
| `started_at` | number (epoch ms) | |
| `quantity` | number | |
| `current_period_start` | number (epoch ms) | null if none |
| `current_period_end` | number (epoch ms) | null if none |
| `entity_id` | string | external entity id (null = customer-scoped) |
| `internal_entity_id` | string | 🔗 → `v2_3_entities.internal_id` (null = customer-scoped) |
| Column | Type | Notes |
| ---------------------- | ----------------- | --------------------------------------------------------- |
| `internal_id` | string | ⭐ stable key |
| `id` | string | external id, mutable |
| `customer_id` | string | external customer id |
| `internal_customer_id` | string | 🔗 → `v2_3_customers.internal_id` |
| `org_id` | string | your tenant id |
| `env` | string | `sandbox` / `live` |
| `plan_id` | string | external plan id |
| `internal_product_id` | string | 🔗 → `v2_3_plans.internal_id` |
| `expires_at` | number (epoch ms) | null if no expiry |
| `started_at` | number (epoch ms) | |
| `quantity` | number | |
| `entity_id` | string | external entity id (null = customer-scoped) |
| `internal_entity_id` | string | 🔗 → `v2_3_entities.internal_id` (null = customer-scoped) |
***
## Balances
Feature balances, their per-entitlement breakdowns, rollover grants, and boolean feature flags.
**These tables do not behave like a clean relational schema.** They are denormalized snapshots of Autumn's read-time balance computation, and they include **every** `customer_entitlement` row — across superseded product versions and past reset cycles — with **no active-status or current-cycle filter**. A naive `SELECT ... FROM v2_3_balances` therefore sums many lifetimes of a customer's history into one row. Before you query balances, breakdowns, or overage, read **[Working with balances](/documentation/lakehouse/balance-semantics)** — it explains what each column means, why `usage`/`granted`/`remaining` don't form a closed arithmetic triple, where overage comes from (it is **not** stored), and the active + current-cycle filter you must apply.
**Rollover balances are not in `v2_3_balances` or `v2_3_breakdowns`.** They live in their own table, `v2_3_rollovers` (below), and `remaining` / `usage` on the other two tables **exclude** them. Any customer holding rollovers therefore reads low until you add the rollover balance in yourself — and rollovers **expire**, so you must filter `expires_at` when you do. See [Working with balances → Rollovers](/documentation/lakehouse/balance-semantics#rollovers-live-in-their-own-table).
`entity_id` is the **scope** of the row: null means customer-scoped (pooled), non-null means the row belongs to that entity. In `v2_3_balances` and `v2_3_breakdowns` a given entitlement appears **exactly once**, under whichever scope it holds — the two kinds of row are disjoint, so filtering to `coalesce(entity_id, '') = ''` gives you customer-scoped rows only, and *dropping* entity-scoped ones. `v2_3_flags` is the exception: an entity-scoped flag is emitted **twice**, once at its own entity scope and once into the customer pool, so keep the pooled rows there to avoid double counting. (In ClickHouse use `coalesce`, **not** `entity_id IS NULL` — `IS NULL` throws on these Iceberg columns; BigQuery is unaffected. See [Querying → Pooled vs per-entity](/documentation/lakehouse/querying#pooled-vs-per-entity-rows).)
| Column | Type | Notes |
| ---------------------- | ----------------- | -------------------------------------------------------------------------------------------------- |
| `internal_customer_id` | string | ⭐🔗 part of key → `v2_3_customers.internal_id` |
| `internal_feature_id` | string | ⭐🔗 part of key → `v2_3_features.internal_id` |
| `entity_id` | string | ⭐ part of key (null = pooled) |
| `customer_id` | string | external customer id |
| `feature_id` | string | external feature id |
| `internal_entity_id` | string | 🔗 → `v2_3_entities.internal_id` (null = pooled) |
| `org_id` | string | your tenant id |
| `env` | string | `sandbox` / `live` |
| `unlimited` | boolean | true if any entitlement in the group is unlimited (then `granted`/`remaining`/`usage` are all `0`) |
| `granted` | number | Σ(`included_grant` + `prepaid_grant`) over **all** entitlements in the group |
| `remaining` | number | Σ(floored per-entitlement balance) — **floored at 0**, never negative. **Excludes rollovers** |
| `usage` | number | Σ(per-entitlement `usage`). **Not** `granted − remaining`; see below. **Excludes rollovers** |
| `reset_interval` | string | single interval or `multiple` |
| `reset_interval_count` | number | null if `multiple` or count 1 |
| `reset_resets_at` | number (epoch ms) | earliest reset across entitlements |
| `next_reset_at` | number (epoch ms) | earliest next reset |
`granted` / `remaining` / `usage` are **not** a closed arithmetic triple — `remaining ≠ granted − usage`. Each is aggregated **over every entitlement row for this customer × feature × scope**, including superseded product versions and past cycles, so a single row routinely sums many lifetimes of usage. `remaining` is floored per-entitlement, manual "Set Balance" decouples balance from grant, and rollover balances are omitted entirely (add them from `v2_3_rollovers`). **There is no overage column** — it is derived. Always read [Working with balances](/documentation/lakehouse/balance-semantics) and apply the active + current-cycle filter before trusting these numbers.
**One row per `customer_entitlement`** — `internal_id` alone is the key. (It used to be `(internal_id, entity_id)`, because one entitlement could emit a pooled row *plus* per-entity rows. That fan-out is gone; `entity_id` is now simply the scope this single row belongs to.)
| Column | Type | Notes |
| ------------------------------ | ----------------- | ------------------------------------------------------------------------------------------------------- |
| `internal_id` | string | ⭐ stable key (customer\_entitlement id) |
| `internal_customer_product_id` | string | 🔗 → `v2_3_subscriptions.internal_id` **or** `v2_3_purchases.internal_id` — the customer's own plan row |
| `internal_product_id` | string | 🔗 → `v2_3_plans.internal_id` (the plan *version*, not the customer's copy of it) |
| `internal_plan_item_id` | string | 🔗 → `v2_3_plan_items.internal_id` — the priced entitlement this balance came from |
| `internal_customer_id` | string | 🔗 → `v2_3_customers.internal_id` |
| `internal_feature_id` | string | 🔗 → `v2_3_features.internal_id` |
| `internal_entity_id` | string | 🔗 → `v2_3_entities.internal_id` (null = customer-scoped) |
| `id` | string | external id, mutable |
| `customer_id` | string | external customer id |
| `feature_id` | string | external feature id |
| `entity_id` | string | external entity id (null = customer-scoped) |
| `org_id` | string | your tenant id |
| `env` | string | `sandbox` / `live` |
| `unlimited` | boolean | |
| `included_grant` | number | allowance grant (allowance × plan quantity + adjustment) |
| `prepaid_grant` | number | prepaid quantity × billing units |
| `remaining` | number | floored balance — `max(0, balance)`, **never negative**. **Excludes rollovers** |
| `usage` | number | `included_grant` + `prepaid_grant` − raw (signed) balance. **Excludes rollovers** |
| `expires_at` | number (epoch ms) | null if no expiry |
| `reset_interval` | string | null for continuous-use; `one_off` for lifetime grants |
| `reset_interval_count` | number | null if count 1 |
| `reset_resets_at` | number (epoch ms) | next reset for **this** entitlement (use to pick the current cycle) |
**`plan_id` is gone from this table.** Breakdowns no longer join out to the plans table, so the external, human-readable plan id is not carried here — a query that selects `plan_id` from `v2_3_breakdowns` today will fail outright rather than return nulls. Get it by joining `internal_product_id` → `v2_3_plans.internal_id` and reading `plan_id` there. (Prefer `internal_product_id` itself wherever you can: `plan_id` is mutable and shared across plan versions.)
**`v2_3_breakdowns` has no `status` / `is_active` / `is_current` column** and mixes rows from superseded/cancelled product versions, past reset cycles, and pre-seeded future cycles. To get the rows the API would use, join `internal_customer_product_id` → `v2_3_subscriptions.internal_id` and keep the active ones, then pick the current cycle (earliest upcoming `reset_resets_at`); `one_off` rows are always live. This join is now **direct**: `internal_customer_product_id` is the customer's own subscription row, so one equality gets you its status. (Don't use `internal_product_id` for this — it points at the shared *plan version*, not at the customer's own copy of it.) See [Working with balances → The active + current-cycle filter](/documentation/lakehouse/balance-semantics#the-active-current-cycle-filter).
When a feature is configured to roll unused allowance into the next cycle, each carried-over grant lands here as its own row. **Nothing in `v2_3_balances` or `v2_3_breakdowns` includes these amounts** — you add them by joining `internal_breakdown_id` back to `v2_3_breakdowns.internal_id`.
Rollovers are a separate table rather than extra columns on `v2_3_breakdowns` because they are **sparse**: roughly 6.8% of customer entitlements carry one (about 7.8M rollovers against 115M entitlements). Folding them in would put mostly-null columns on every breakdown row, so the \~93% of rows with no rollover would pay for the 7% that do. One entitlement can also hold several grants with different expiries, which a flat column set can't represent at all.
| Column | Type | Notes |
| ------------------------------ | ----------------- | ----------------------------------------------------------------------------- |
| `internal_id` | string | ⭐ stable key (rollover id) |
| `internal_breakdown_id` | string | 🔗 → `v2_3_breakdowns.internal_id` — the entitlement this rollover belongs to |
| `internal_customer_product_id` | string | 🔗 → `v2_3_subscriptions.internal_id` **or** `v2_3_purchases.internal_id` |
| `internal_plan_item_id` | string | 🔗 → `v2_3_plan_items.internal_id` (carries the `rollover_*` config) |
| `internal_feature_id` | string | 🔗 → `v2_3_features.internal_id` |
| `customer_id` | string | external customer id |
| `org_id` | string | your tenant id |
| `env` | string | `sandbox` / `live` |
| `balance` | number | rollover amount still available |
| `usage` | number | rollover amount already drawn down |
| `expires_at` | number (epoch ms) | **null = never expires** |
| `entities` | json (string) | raw per-entity map, `{entity_id: {id, balance, usage}}` |
**Rollovers expire, and this table keeps the expired ones.** Summing `balance` without filtering overstates what a customer actually holds. Always filter on `expires_at`: in ClickHouse write `(coalesce(expires_at, 0) = 0 OR expires_at > )`, because `expires_at IS NULL` throws there, same as `entity_id`; in BigQuery plain `IS NULL` is fine. There is a worked query in [Querying → Balance including rollovers](/documentation/lakehouse/querying#balance-including-rollovers).
There is **no `entity_id` column** — per-entity rollover amounts are left packed in the `entities` JSON map rather than exploded into rows. Parse it if you need entity-level rollover detail.
| Column | Type | Notes |
| ------------------------------ | ----------------- | ------------------------------------------------------------------------- |
| `internal_id` | string | ⭐ part of key |
| `entity_id` | string | ⭐ part of key (null = pooled) |
| `id` | string | external id, mutable |
| `customer_id` | string | external customer id |
| `internal_customer_id` | string | 🔗 → `v2_3_customers.internal_id` |
| `internal_entity_id` | string | 🔗 → `v2_3_entities.internal_id` (null = pooled) |
| `feature_id` | string | external feature id |
| `internal_feature_id` | string | 🔗 → `v2_3_features.internal_id` |
| `internal_product_id` | string | 🔗 → `v2_3_plans.internal_id` |
| `internal_customer_product_id` | string | 🔗 → `v2_3_subscriptions.internal_id` **or** `v2_3_purchases.internal_id` |
| `subscription_ids_csv` | string | processor subscription ids, comma-separated (empty string if none) |
| `expires_at` | number (epoch ms) | null if no expiry |
| `org_id` | string | your tenant id |
| `env` | string | `sandbox` / `live` |
**`plan_id`, `customer_plan_status`, `customer_plan_starts_at`, and `customer_plan_ended_at` have been removed**, leaving the 14 columns above. Flags now follow the same rule as `v2_3_breakdowns`: **carry keys, never denormalized copies of data that lives on another table**. Resolve each of the four by joining outward —
* `plan_id` → join `internal_product_id` to `v2_3_plans` and read `plan_id` there, exactly as you would from a breakdown.
* the three `customer_plan_*` columns → join `internal_customer_product_id` to `v2_3_subscriptions.internal_id` (or `v2_3_purchases.internal_id`) and read `status`, `started_at`, `ended_at` / `expires_at` from the plan row itself. There is a ready-made double-join in [Querying → The status of the plan behind a flag](/documentation/lakehouse/querying#the-status-of-the-plan-behind-a-flag).
Dropping `plan_id` removed the plans join from the flags query outright, so the table is cheaper to keep in sync as well as simpler to reason about. If you previously filtered `customer_plan_status = 'active'` directly on this table, that query needs the join added.
The `subscription_ids` **array** was dropped — use `subscription_ids_csv`, which every engine handles identically; split on `,` if you need the individual ids.
***
## Invoices
Invoices and their line items.
| Column | Type | Notes |
| ---------------------- | ----------------- | --------------------------------------------------------- |
| `id` | string | ⭐ stable key (invoice id) |
| `org_id` | string | your tenant id |
| `env` | string | `sandbox` / `live` |
| `customer_id` | string | external customer id |
| `internal_customer_id` | string | 🔗 → `v2_3_customers.internal_id` |
| `entity_id` | string | external entity id (null = customer-scoped) |
| `internal_entity_id` | string | 🔗 → `v2_3_entities.internal_id` (null = customer-scoped) |
| `plan_ids` | string\[] | external plan ids |
| `internal_product_ids` | string\[] | 🔗 → `v2_3_plans.internal_id` |
| `stripe_id` | string | Stripe invoice id |
| `processor_type` | string | stripe / … |
| `status` | string | paid / open / void / draft |
| `total` | number | invoice total |
| `amount_paid` | number | |
| `refunded_amount` | number | |
| `currency` | string | ISO 4217 code |
| `created_at` | number (epoch ms) | |
| `hosted_invoice_url` | string | raw Stripe URL |
| `discounts` | json\[] (string) | array of discount objects |
| Column | Type | Notes |
| ------------------------ | ----------------- | ------------------------------------------------ |
| `id` | string | ⭐ stable key (line item id) |
| `org_id` | string | your tenant id |
| `env` | string | `sandbox` / `live` |
| `invoice_id` | string | 🔗 → `v2_3_invoices.id` |
| `customer_id` | string | external customer id |
| `description` | string | |
| `period_start` | number (epoch ms) | |
| `period_end` | number (epoch ms) | |
| `feature_id` | string | external feature id (null for non-feature lines) |
| `internal_feature_id` | string | 🔗 → `v2_3_features.internal_id` |
| `feature_name` | string | resolved feature name |
| `plan_id` | string | external plan id |
| `internal_product_id` | string | 🔗 → `v2_3_plans.internal_id` |
| `amount` | number | pre-discount |
| `amount_after_discounts` | number | |
| `currency` | string | ISO 4217 code |
| `direction` | string | charge / refund |
| `billing_timing` | string | in\_advance / in\_arrear |
| `prorated` | boolean | |
| `discounts` | json\[] (string) | array of discount objects |
***
## Events
The append-only usage event log. This is the highest-volume table and is **append-only** (no updates).
**The events table is `events`, not `v2_3_events`.** Events are immutable and **unversioned** — they are *not* subject to the `v2_3` schema versioning that every other object uses. Address it as `` ``.`.events` ``. Querying `v2_3_events` returns `Unknown table expression identifier` because that table does not exist.
| Column | Type | Notes |
| ---------------------- | ----------------- | ----------------------------------------------- |
| `id` | string | ⭐ stable key (event id) |
| `org_id` | string | your tenant id |
| `org_slug` | string | |
| `internal_customer_id` | string | 🔗 → `v2_3_customers.internal_id` |
| `env` | string | `sandbox` / `live` |
| `created_at` | number (epoch ms) | when Autumn recorded the event |
| `timestamp` | timestamp | event time — a **real timestamp**, use directly |
| `event_name` | string | |
| `idempotency_key` | string | |
| `value` | number | |
| `entity_id` | string | external entity id (null = customer-scoped) |
| `internal_entity_id` | string | 🔗 → `v2_3_entities.internal_id` |
| `internal_product_id` | string | 🔗 → `v2_3_plans.internal_id` |
| `customer_id` | string | external customer id |
| `properties` | json (string) | event properties (e.g. `subtype`, `model`) |
| `deductions` | json (string) | per-feature deductions for this event |
Unlike every other table, `events.timestamp` is a native `timestamp` — no epoch-ms conversion needed. `created_at` is still epoch-ms.
# Working with invoices
Source: https://docs.useautumn.com/documentation/lakehouse/working-with-invoices
Revenue, and paying-customer metrics — the rows to drop and the column that actually carries truth.
**Available on request** — The Autumn Lakehouse is provisioned per customer. Contact us at [hey@useautumn.com](mailto:hey@useautumn.com) to get access.
The same lesson as [Working with balances](/documentation/lakehouse/balance-semantics) applies across the rest of the schema: **the warehouse stores inputs; the business number is a derivation that drops rows.** Columns are named like a clean OLTP table, but realized revenue, MRR, and paying-customer counts each require knowing which rows to exclude and which column actually carries truth. The traps below all surfaced from running realistic BI queries against live data.
## Revenue: `total` is not realized revenue
`sum(total)` over invoices **overstates** what you collected — typically by low double digits — because `total` is the **gross, pre-refund** amount and includes discounts, proration, and partially-paid invoices. Realized revenue is what cleared, net of refunds:
```text theme={null}
realized_revenue = Σ amount_paid − Σ refunded_amount over status = 'paid'
```
Three traps around it:
* **Amounts are in the currency's major unit (dollars), not Stripe cents.** Sanity-check one known invoice before scaling — porting Stripe intuition will put you off by 100×.
* **`void` invoices carry real-looking totals** and must be excluded. Filter `status = 'paid'`, not merely non-null.
* **`paid` includes negative totals** (credit notes / refunds modeled as negative invoices) — expected, and correctly handled by the `amount_paid − refunded_amount` form.
```sql theme={null}
SELECT
sum(amount_paid) - sum(refunded_amount) AS net_revenue,
sum(total) AS gross_total_do_not_use
FROM ``.`.v2_3_invoices`
WHERE env = 'live' AND status = 'paid';
```
## Paying customers: `status = 'active'` is not "paying"
Active subscriptions include your entire **free** base and everyone **mid-trial**. A naive `count()` of active rows can overstate paying customers by orders of magnitude. A paying customer has an active, **priced**, **non-trial** base subscription — and you must dedup, because one customer holds several subscription rows (versions + add-ons).
```sql theme={null}
SELECT uniqExact(s.internal_customer_id) AS paying_customers
FROM ``.`.v2_3_subscriptions` AS s
INNER JOIN ``.`.v2_3_plans` AS p
ON p.internal_id = s.internal_product_id
WHERE s.env = 'live'
AND s.status = 'active'
AND s.add_on = false
AND coalesce(p.price_amount, 0) > 0
AND coalesce(s.trial_ends_at, 0) <= toUnixTimestamp(now()) * 1000; -- not currently in trial
```
Row count ≠ customer count: subscription rows exceed distinct customers because of plan versions, duplicate base rows, and add-ons. Anything customer-level needs `uniqExact(internal_customer_id)`, never `count()`.
## Cross-reference: which overage?
Overage (on the balances side) has the same "two figures" hazard as revenue here — **billable** (what you invoice) vs **displayed** (what the dashboard header shows) diverge by undrawn grants. If a report combines revenue and overage, make sure both pages agree on which overage you mean. See [Working with balances → Overage](/documentation/lakehouse/balance-semantics#overage-is-derived-not-stored-and-there-are-two-of-them).
There's a second trap in the same direction: `v2_3_balances` and `v2_3_breakdowns` **exclude rollover balances**, which live in `v2_3_rollovers`. Unspent rollover is real allowance, so an overage figure computed without it overstates — and it's the kind of error that only shows up on the accounts that roll over, which are usually your largest. See [Working with balances → Rollovers](/documentation/lakehouse/balance-semantics#rollovers-live-in-their-own-table).
All queries here use `env = 'live'` (**not** `production`) and the ClickHouse `` ``.`.v2_3_…` `` addressing form. On BigQuery, address tables as `` `..v2_3_…` `` and swap `uniqExact(x)` → `COUNT(DISTINCT x)` and `toUnixTimestamp(now()) * 1000` → `UNIX_MILLIS(CURRENT_TIMESTAMP())`; everything else runs as written. Join on `internal_*` ids — external ids are mutable and versioned. See [Querying](/documentation/lakehouse/querying) for the addressing and `IS NULL` footguns.
# MCP Server
Source: https://docs.useautumn.com/documentation/mcp
Connect Autumn's MCP server to AI assistants for billing actions, plan management, and request-log investigations.
## Intro
Autumn MCP connects AI assistants to Autumn's billing, customer, plan, balance,
and log tools.
### Starter prompt
```text theme={null}
Use Autumn MCP for this request.
- Always start with autumn://docs/concepts to understand Autumn's data model.
- Use autumn://docs/plan-management for pricing setup, plan creation, plan updates, and plan modeling.
- Use autumn://docs/billing for attaching plans, updating subscriptions, cancellations, schedules, trials, and billing state changes.
- Use autumn://docs/logs for API request logs, Stripe webhook timelines, customer request histories, and log analytics.
- Use https://docs.useautumn.com/llms.txt to find product docs if the MCP resources do not answer something.
- Preview billing changes before applying them, and ask for approval before any destructive write.
```
## Setup
Autumn MCP can be installed in any MCP client with the server URL:
```text theme={null}
https://mcp.useautumn.com/mcp
```
You do not need an API key. By default, your MCP client opens an Autumn sign-in
flow and connects to your organization.
For a long-lived setup, you can also use an Autumn secret key with Bearer auth:
```json theme={null}
{
"headers": {
"Authorization": "Bearer am_sk_test_..."
}
}
```
Run in terminal:
```bash theme={null}
claude mcp add --transport http autumn https://mcp.useautumn.com/mcp
```
Or add to your project's `.mcp.json`:
```json theme={null}
{
"mcpServers": {
"autumn": {
"type": "http",
"url": "https://mcp.useautumn.com/mcp"
}
}
}
```
Run in terminal:
```bash theme={null}
codex mcp add autumn --url https://mcp.useautumn.com/mcp
```
Or add to `~/.codex/config.toml`:
```toml theme={null}
[mcp_servers.autumn]
url = "https://mcp.useautumn.com/mcp"
```
[](https://cursor.com/en/install-mcp?name=autumn\&config=eyJuYW1lIjoiYXV0dW1uIiwidHlwZSI6Imh0dHAiLCJ1cmwiOiJodHRwczovL21jcC51c2VhdXR1bW4uY29tL21jcCJ9)
Or add to `~/.cursor/mcp.json`:
```json theme={null}
{
"mcpServers": {
"autumn": {
"url": "https://mcp.useautumn.com/mcp"
}
}
}
```
1. Open Claude Desktop settings.
2. Go to **Connectors**.
3. Click **Add custom connector**.
4. Paste `https://mcp.useautumn.com/mcp` and sign in.
Or add to `~/Library/Application Support/Claude/claude_desktop_config.json`:
```json theme={null}
{
"mcpServers": {
"autumn": {
"type": "http",
"url": "https://mcp.useautumn.com/mcp"
}
}
}
```
Add to `~/.config/opencode/opencode.json`:
```json theme={null}
{
"mcp": {
"autumn": {
"type": "remote",
"url": "https://mcp.useautumn.com/mcp",
"enabled": true
}
}
}
```
Add to `~/.config/zed/settings.json`:
```json theme={null}
{
"context_servers": {
"autumn": {
"url": "https://mcp.useautumn.com/mcp"
}
}
}
```
[](https://vscode.dev/redirect/mcp/install?name=autumn\&config=%7B%22type%22%3A%22http%22%2C%22url%22%3A%22https%3A%2F%2Fmcp.useautumn.com%2Fmcp%22%7D)
Or add to `.vscode/mcp.json`:
```json theme={null}
{
"servers": {
"autumn": {
"type": "http",
"url": "https://mcp.useautumn.com/mcp"
}
}
}
```
For other MCP clients that support remote MCP:
```json theme={null}
{
"mcpServers": {
"autumn": {
"url": "https://mcp.useautumn.com/mcp"
}
}
}
```
If your client does not support remote MCP servers directly:
```json theme={null}
{
"mcpServers": {
"autumn": {
"command": "npx",
"args": ["-y", "mcp-remote", "https://mcp.useautumn.com/mcp"]
}
}
}
```
## Using MCP
Autumn MCP exposes tools and resources. Ask your agent to read the relevant Autumn MCP resource before it acts:
* Start with `autumn://docs/concepts` to understand Autumn's data model.
* Use `autumn://docs/plan-management` for pricing setup, plan creation, and plan updates.
* Use `autumn://docs/billing` for attaching plans, updating subscriptions, cancellations, schedules, trials, and billing state changes.
* Use `autumn://docs/logs` for API request logs, Stripe webhook timelines, customer request histories, and log analytics.
## Resources
| Resource | Use for |
| ------------------------------- | ------------------------------------------------ |
| `autumn://docs/concepts` | Autumn concepts and object relationships |
| `autumn://docs/plan-management` | Creating and updating pricing plans |
| `autumn://docs/billing` | Billing actions and preview-first workflows |
| `autumn://docs/logs` | Request logs, Stripe webhooks, and log analytics |
# Add-Ons
Source: https://docs.useautumn.com/documentation/modelling-pricing/add-ons
Offer additional plans and features customers can purchase alongside their plan
Add-ons are plans that can be purchased alongside a customer's existing plan, rather than replacing it. They're used for top-ups, extra feature packs, or supplementary services.
> **Example**
> A customer on the Pro plan can purchase a "Storage Add-On" for an extra 100GB/month, or a one-time "Credit Top-Up" of 500 credits.
## Setting up
Set `addOn: true` on the plan:
```ts autumn.config.ts theme={null}
import { atmn, feature, plan } from "atmn";
export const storage = feature({
featureId: "storage",
name: "Storage (GB)",
type: "metered",
consumable: false,
});
export const credits = feature({
featureId: "credits",
name: "Credits",
type: "metered",
consumable: true,
});
export const storageAddOn = plan({
planId: "storage_add_on",
versionSlug: "v1",
active: true,
name: "Extra Storage",
addOn: true,
price: { amount: 5, interval: "month" },
items: [
{
featureId: storage.featureId,
included: 100,
},
],
});
export const creditTopUp = plan({
planId: "credit_top_up",
versionSlug: "v1",
active: true,
name: "Credit Top-Up",
addOn: true,
items: [
{
featureId: credits.featureId,
price: {
amount: 10,
billingUnits: 500,
billingMethod: "prepaid",
interval: "one_off",
},
},
],
});
export default atmn({
features: [storage, credits],
plans: [storageAddOn, creditTopUp],
});
```
Preview with `atmn push`, then apply with `atmn push --yes`.
1. Navigate to **Plans** and click **Create Plan**
2. Set the plan name and ID
3. Toggle the **Add-on** flag
4. Configure the price and features as needed
5. Click **Create**
## How add-ons work
Without the add-on flag, attaching a new plan replaces the customer's current plan (within the same [group](/documentation/concepts/plans#plan-properties)). With the add-on flag:
* The plan is **added alongside** the customer's existing plans
* Multiple add-ons can be active at the same time
* Add-ons don't participate in upgrade/downgrade logic
## Balance stacking
When an add-on provides the same feature as the customer's main plan, the balances [stack](/documentation/concepts/balances#balance-stacking). Each source is tracked separately in the `breakdown` array.
> **Example**
> A customer's Pro plan grants 1,000 credits/month. They purchase a one-time top-up of 500 credits. Their total balance is 1,500 credits, tracked as two separate sources.
Autumn uses [deduction order](/documentation/concepts/balances#deduction-order) to consume shorter-interval balances first (monthly before lifetime).
## Purchasing add-ons
Add-ons use the same checkout/attach flow as regular plans:
```typescript TypeScript theme={null}
import { Autumn } from "autumn-js";
const autumn = new Autumn({ secretKey: "am_sk_..." });
const { data } = await autumn.checkout({
customer_id: "user_123",
plan_id: "storage_add_on",
});
```
```python Python theme={null}
from autumn_sdk import Autumn
autumn = Autumn("am_sk_...")
response = await autumn.checkout(
customer_id="user_123",
plan_id="storage_add_on",
)
```
```bash cURL theme={null}
curl -X POST "https://api.useautumn.com/v1/checkout" \
-H "Authorization: Bearer am_sk_..." \
-H "Content-Type: application/json" \
-d '{
"customer_id": "user_123",
"plan_id": "storage_add_on"
}'
```
For prepaid add-ons (like a credit top-up), pass the quantity:
```typescript TypeScript theme={null}
const { data } = await autumn.checkout({
customer_id: "user_123",
plan_id: "credit_top_up",
options: [{
feature_id: "credits",
quantity: 1000,
}],
});
```
## Cancelling add-ons
Cancel an add-on using the same [cancel](/documentation/customers/subscription-lifecycle#cancellations) flow:
```typescript TypeScript theme={null}
await autumn.cancel({
customer_id: "user_123",
plan_id: "storage_add_on",
});
```
```python Python theme={null}
await autumn.cancel(
customer_id="user_123",
plan_id="storage_add_on",
)
```
```bash cURL theme={null}
curl -X POST "https://api.useautumn.com/v1/cancel" \
-H "Authorization: Bearer am_sk_..." \
-H "Content-Type: application/json" \
-d '{
"customer_id": "user_123",
"plan_id": "storage_add_on"
}'
```
## Common add-on patterns
| Pattern | Configuration |
| ---------------- | ------------------------------------------------------------------ |
| Recurring add-on | `addOn: true`, recurring price (e.g., \$5/month for extra storage) |
| One-time top-up | `addOn: true`, prepaid price, no base price |
| Feature pack | `addOn: true`, grants boolean or metered features |
# Auto Top-Ups
Source: https://docs.useautumn.com/documentation/modelling-pricing/auto-top-ups
Automatically replenish customer balances when they run low
Auto top-ups automatically purchase additional balance for a customer when their usage drops below a configured threshold. This prevents service interruptions for customers who don't want to manually manage their balance.
> **Example**
> A customer on the Standard plan gets 5,000 credits per month. When their balance drops below 500, Autumn automatically purchases 1,000 more credits at \$10 using the plan's one-off prepaid price.
## Prerequisites
Auto top-ups require:
1. A plan with a [one-off prepaid](/documentation/modelling-pricing/one-off-purchases) item for the feature you want to auto top-up
2. The customer must have a saved payment method on file
## Setting up
Auto top-ups are configured per customer, not in `autumn.config.ts`. Your plan needs a one-off prepaid item for the feature you want to auto top-up:
```ts autumn.config.ts theme={null}
import { atmn, feature, plan } from "atmn";
export const credits = feature({
featureId: "credits",
name: "Credits",
type: "metered",
consumable: true,
});
export const standard = plan({
planId: "standard",
versionSlug: "v1",
active: true,
name: "Standard",
price: { amount: 50, interval: "month" },
items: [
{
featureId: credits.featureId,
included: 5000,
reset: { interval: "month" },
},
{
featureId: credits.featureId,
price: {
amount: 10,
billingUnits: 1000,
interval: "one_off",
billingMethod: "prepaid",
},
},
],
});
export default atmn({ features: [credits], plans: [standard] });
```
The one-off prepaid item (`$10 per 1,000 credits`) is what Autumn uses to replenish the balance. Configure auto top-ups per customer via the API (see below).
1. Navigate to the **Plans** page and select (or create) the plan you want to add auto top-ups to
2. Add a new item for the feature with:
* **Interval** set to **One-Off**
* **Billing method** set to **Prepaid**
* Configure the price and billing units (e.g. \$10 per 1,000 credits)
3. Configure auto top-ups per customer via the API (see below)
The same feature can appear as multiple items on a plan. For example, you might have a monthly allowance of 5,000 credits **and** a one-off prepaid item for top-ups — both referencing the same feature.
## Configuring auto top-ups via API
Set up auto top-ups for a customer by updating their billing controls:
```typescript TypeScript theme={null}
import { Autumn } from "autumn-js";
const autumn = new Autumn({ secretKey: "am_sk_..." });
await autumn.customers.update({
customerId: "user_123",
billingControls: {
autoTopups: [{
featureId: "credits",
enabled: true,
threshold: 500,
quantity: 1000,
}],
},
});
```
```python Python theme={null}
from autumn_sdk import Autumn
autumn = Autumn("am_sk_...")
await autumn.customers.update(
customer_id="user_123",
billing_controls={
"auto_topups": [{
"feature_id": "credits",
"enabled": True,
"threshold": 500,
"quantity": 1000,
}],
},
)
```
```bash cURL theme={null}
curl -X POST "https://api.useautumn.com/v1/customers/update" \
-H "Authorization: Bearer am_sk_..." \
-H "Content-Type: application/json" \
-d '{
"customer_id": "user_123",
"billing_controls": {
"auto_topups": [{
"feature_id": "credits",
"enabled": true,
"threshold": 500,
"quantity": 1000
}]
}
}'
```
## Auto top-up configuration
| Field | Type | Description |
| ---------------- | ------- | --------------------------------------------- |
| `feature_id` | string | The feature to monitor |
| `enabled` | boolean | Whether auto top-up is active |
| `threshold` | number | Balance level that triggers a top-up |
| `quantity` | number | How many units to purchase each time |
| `purchase_limit` | object | Optional limit on how often top-ups can occur |
### Purchase limits
To prevent runaway spending, you can set a purchase limit:
```json theme={null}
{
"purchase_limit": {
"interval": "month",
"interval_count": 1,
"limit": 5
}
}
```
This limits the customer to 5 auto top-ups per month. Supported intervals: `hour`, `day`, `week`, `month`.
## How it works
1. After every usage event (via `track`), Autumn checks the customer's remaining balance
2. If the balance falls below the configured `threshold`, an auto top-up is triggered
3. Autumn creates an invoice for the configured `quantity` using the one-off prepaid price from the customer's plan
4. The invoice is charged to the customer's saved payment method
5. The balance is replenished with the purchased amount
Auto top-ups use burst suppression to prevent duplicate purchases when multiple track events happen in quick succession. There's a 30-second cooldown between top-ups for the same feature.
## Notifications
Subscribe to the [`billing.auto_topup_succeeded`](/api-reference/webhooks/billingAutoTopupSucceeded) webhook to be notified when a top-up grants credits. The payload includes the granted quantity, the new balance, and the underlying invoice — useful for sending receipts, updating internal ledgers, or reconciling balance after a recharge.
Subscribe to [`billing.auto_topup_failed`](/api-reference/webhooks/billingAutoTopupFailed) to monitor auto top-ups that are blocked, declined, or fail before granting balance. The payload includes a machine-readable `reason` and any available provider error details.
Limit-blocked failure webhooks are suppressed per blocking window to avoid duplicate notifications while the same limit remains active.
# Credit Systems
Source: https://docs.useautumn.com/documentation/modelling-pricing/credit-systems
Learn how to create a credit system in Autumn
Credit systems let you track actions with different credit costs from a single balance pool.
A credit system is made up of a list of [features](/documentation/concepts/features) that can draw from it, and a credit cost per unit of usage for each feature.
> **Example**
> You have a Pro plan that gives users `100 basic messages` per month, and `10 premium messages` per month. These 2 balances are separate and independent of each other.
> To give your users more flexibility, you instead decide to use a credit system, where:
>
> * `basic message`: costs 1 credit per message
> * `premium message`: costs 10 credits per message
>
> Instead of having 2 separate balances for each message type, your Pro plan can have `200 credits` per month. Your users can use the credits in any combination of basic and premium messages they want.
## Creating a credit system
Make sure you have some metered features created before creating a credit
system.
Define metered features, then create a `credit_system` feature with a `creditSchema` that maps each feature to a credit cost:
```ts autumn.config.ts theme={null}
import { atmn, feature, plan } from "atmn";
export const basicMessage = feature({
featureId: "basic_message",
name: "Basic Message",
type: "metered",
consumable: true,
});
export const premiumMessage = feature({
featureId: "premium_message",
name: "Premium Message",
type: "metered",
consumable: true,
});
export const credits = feature({
featureId: "credits",
name: "Credits",
type: "credit_system",
creditSchema: [
{ meteredFeatureId: basicMessage.featureId, creditCost: 1 },
{ meteredFeatureId: premiumMessage.featureId, creditCost: 10 },
],
});
export const pro = plan({
planId: "pro",
versionSlug: "v1",
active: true,
name: "Pro",
price: { amount: 20, interval: "month" },
items: [
{
featureId: credits.featureId,
included: 200,
reset: { interval: "month" },
},
],
});
export default atmn({
features: [basicMessage, premiumMessage, credits],
plans: [pro],
});
```
Preview with `atmn push`, then apply with `atmn push --yes`.
1. Navigate to the features page, under Plans.
2. Click "Create Credit System"
3. Add the features that can draw from this credit system.
4. For each feature, define how many credits each unit of usage should cost (eg, 3 credits per "premium request").
5. Click "Create"
**Example**
If each `premium_request` is worth 3 credits, then using 6 premium requests will cost 18 credits.
Now you can add this credit system to a plan, such as granting 50 credits per month or charging \$1 per credit.
## Tracking and limiting credit usage
When implementing a credit system into your application, **you should interact with the underlying features -- not the credit system itself**. This means passing in the underlying `feature_id` when checking or tracking usage.
#### Checking access
Before allowing a customer to use a feature, `check` if they have enough credits to do so. If each "premium request" is worth 3 credits, then this example will check if the customer has at least 18 credits remaining.
```typescript TypeScript theme={null}
import { Autumn } from "autumn-js";
const autumn = new Autumn({ secretKey: "am_sk_test_1234" });
const response = await autumn.check({
customerId: "user_123",
featureId: "premium_request",
requiredBalance: 6,
});
console.log(response.allowed);
```
```python Python theme={null}
from autumn_sdk import Autumn
autumn = Autumn("am_sk_test_1234")
response = await autumn.check(
customer_id="user_123",
feature_id="premium_request",
required_balance=6,
)
print(response.allowed)
```
```bash cURL theme={null}
curl -X POST "https://api.useautumn.com/v1/check" \
-H "Authorization: Bearer am_sk_test_1234" \
-H "Content-Type: application/json" \
-d '{
"customer_id": "user_123",
"feature_id": "premium_request",
"required_balance": 6
}'
```
The response will contain the balance for the credit system that is being deducted from.
```json theme={null}
{
"allowed": true,
"customerId": "user_123",
"requiredBalance": 6,
"balance": {
"featureId": "credits",
"granted": 100,
"remaining": 100,
"usage": 0,
"unlimited": false,
"overageAllowed": false,
"nextResetAt": 1757192635393
}
}
```
In this case, we have a balance of 100 credits remaining, so we're allowed to use our 6 "premium requests" feature.
If a feature is not defined in the credit system, it will return `allowed: false`
#### Tracking usage
Since the customer has sufficient credits, you can let them use their 6 "premium requests". Afterwards, you can [track](/documentation/customers/tracking-usage) the usage to update their balance.
This will decrement the customer's balance by 18 credits (6 requests \* 3 credits per request).
```typescript TypeScript theme={null}
import { Autumn } from "autumn-js";
const autumn = new Autumn({ secretKey: "am_sk_test_1234" });
await autumn.track({
customerId: "user_123",
featureId: "premium_request",
value: 6,
});
```
```python Python theme={null}
from autumn_sdk import Autumn
autumn = Autumn("am_sk_test_1234")
await autumn.track(
customer_id="user_123",
feature_id="premium_request",
value=6,
)
```
```bash cURL theme={null}
curl -X POST "https://api.useautumn.com/v1/track" \
-H "Authorization: Bearer am_sk_test_1234" \
-H "Content-Type: application/json" \
-d '{
"customer_id": "user_123",
"feature_id": "premium_request",
"value": 6
}'
```
```json theme={null}
{
"customerId": "user_123",
"value": 6,
"balance": {
"featureId": "credits",
"granted": 100,
"remaining": 82,
"usage": 18,
"unlimited": false,
"overageAllowed": false,
"nextResetAt": 1757192635393
}
}
```
Since the customer started with a balance of 100 credits, and used 18 credits, their remaining balance is 82 credits.
## Rate cards and dimensions
The `creditSchema` is the credit system's **rate card**: one row per metered feature. A row's rate can be flat, graduated by usage, or vary by the properties you send with each event.
### Billing units
`billingUnits` prices a bundle of usage at once: `{ meteredFeatureId: 'tokens', billingUnits: 1000, creditCost: 1 }` charges 1 credit per 1,000 tokens.
### Graduated rates
A graduated row steps the credit cost as usage in the current cycle grows. Tier boundaries are in units and the cost is per `billingUnits`, priced tier by tier: below, the first 10,000 tokens cost 1 credit per 1,000 tokens (10 credits), and everything after costs 0.5 credits per 1,000 tokens.
```ts autumn.config.ts theme={null}
{
meteredFeatureId: tokens.featureId,
billingUnits: 1000,
tierBehavior: 'graduated',
tiers: [
{ to: 10_000, creditCost: 1 },
{ to: 'inf', creditCost: 0.5 },
],
}
```
The final tier must use `'inf'`, and boundaries must strictly increase.
### Dimensions
A **dimension** is a named alternative rate that applies when an event's `properties` match. Pass the properties on `track` and `check`:
```ts theme={null}
await autumn.track({
customer_id: 'cus_123',
feature_id: 'actions',
value: 1,
properties: { size: 'large', region: 'eu' },
});
```
```ts autumn.config.ts theme={null}
{
meteredFeatureId: actions.featureId,
creditCost: 1,
dimensions: {
size_large: { match: { size: 'large' }, creditCost: 16 },
size_large_region_eu: {
match: { size: 'large', region: 'eu' },
creditCost: 20,
},
size_xl: {
match: { size: 'xl' },
tierBehavior: 'graduated',
tiers: [
{ to: 5, creditCost: 2 },
{ to: 'inf', creditCost: 1 },
],
},
},
multipliers: {
lifecycle_spot: { match: { lifecycle: 'spot' }, factor: 0.3 },
},
}
```
How a rate is chosen for an event:
1. The dimension whose `match` has the **most keys** that all match the event wins. `{ size: 'large', region: 'eu' }` beats `{ size: 'large' }`.
2. Ties on key count are broken by `priority` (higher wins). Two dimensions that could both match the same event with the same key count and no priority are rejected when you save.
3. If no dimension matches, the row's own rate applies.
4. **Multipliers** then scale the chosen rate: every matching multiplier's `factor` is multiplied together and every `add` is summed. A multiplier set that could push a rate below zero is rejected at save time.
Property values are compared as strings, so `{ size: 1 }` and `{ size: '1' }` match the same dimension. Dimension names must be at most 64 characters and cannot contain `::`.
Usage is attributed per dimension, so graduated dimensions progress through their own tiers, and invoice credit line items are broken down by feature and dimension.
A plan item can override its credit system's rate card for customers on that plan via `featureOverride: { creditSchema: [...] }`. The override replaces the rate card entirely, dimensions included.
## Itemized invoice credits
When a plan bills a credit system **pay-per-use at exactly one currency unit per credit** (for example `$1` per credit, or `$100` per 100 credits), Autumn treats the balance as invoice credits: every tracked usage is attributed to the feature that spent it, and the invoice lists one line per feature ("Premium messages, 40 units … \$8") plus a "Credits applied" line for the credits the plan included. Balances like this can only be moved by tracked usage and cycle resets, so the invoice always matches the ledger.
Any other price shape (a fractional price per credit, prepaid packs, included-only or pooled items) bills as an ordinary overage. The decision is made per customer when the plan is attached, so changing a plan's price later never rewrites an existing customer's invoices.
There is no switch to turn this on. The plan item's price decides, so a credit system can itemize on one plan and bill plainly on another.
## Stacking with direct balances
A feature can have both a direct balance **and** belong to a credit system. When this happens, the balances stack and **direct balances are always consumed before credit system balances**, regardless of interval.
> **Example**
> A customer's plan grants `10 premium messages` per month directly, plus `200 credits` per month from a credit system (where each premium message costs 10 credits).
> When the customer sends a premium message, Autumn deducts from the direct premium message balance first. Once those 10 direct messages are used up, subsequent premium messages draw from the credit pool instead.
The `check` endpoint accounts for both balances. If the customer has 5 direct premium messages remaining plus 100 credits (enough for 10 more premium messages), `check` will report that the customer is allowed.
## Monetary credits
You may want your credit system to represent a monetary value: eg, \$10 of credits. To implement this, you can map each credit to a cent value (eg, 1 credit = 1 cent).
1. When creating your credit system, define credit amounts in the per-cent cost
Eg: if each `premium_request` costs 3 cents, our credit cost should be 3.
2. When adding the credits to a plan, set the granted amount of credits in cents
Eg, if customers get 5 USD credits for free, they should have an included usage of `500`.
3. When charging for the credits, set the cost of each credit to 1 cent
See the credits pricing guide for a more detailed example of setting up a monetary credits system
## AI Credit Systems
For AI applications that need to track token usage with per-model pricing, you can create an AI credit system. This lets you define markup percentages for each model and automatically calculate costs based on input/output tokens.
Markups are optional. `defaultMarkup` applies to every model unless overridden — by `providerMarkups` (keyed by the first segment of the model ID, e.g. `openrouter`), or by `modelMarkups` for a specific model, which takes highest priority. With no markups set, models are billed at their Models.dev base cost.
A markup of `-100` makes the model free: usage events are still recorded, but nothing is deducted from the balance.
```ts Simplest setup — one markup for everything theme={null}
export const aiCredits = feature({
featureId: 'ai_credits',
name: 'AI Credits',
type: 'ai_credit_system',
defaultMarkup: 30, // every model billed at models.dev cost + 30%
});
```
Or mix the levels for finer control:
```ts autumn.config.ts theme={null}
import { atmn, feature, plan } from "atmn";
export const aiCredits = feature({
featureId: "ai_credits",
name: "AI Credits",
type: "ai_credit_system",
// Global fallback markup
defaultMarkup: 30,
// Per-provider defaults
providerMarkups: {
openrouter: { markup: 25 },
},
// Per-model overrides (highest priority)
modelMarkups: {
"anthropic/claude-opus-4-5": { markup: 20 },
"anthropic/claude-sonnet-4-5": { markup: 15 },
"openai/gpt-4o-mini": { markup: -100 }, // free for customers
// For custom/self-hosted models, specify input/output costs in $/M tokens
"custom/my-model": { markup: 25, inputCost: 0.01, outputCost: 0.03 },
},
});
export const pro = plan({
planId: "pro",
versionSlug: "v1",
active: true,
name: "Pro",
price: { amount: 50, interval: "month" },
items: [
{
featureId: aiCredits.featureId,
included: 10, // $10 worth of AI credits
reset: { interval: "month" },
},
],
});
export default atmn({ features: [aiCredits], plans: [pro] });
```
Preview with `atmn push`, then apply with `atmn push --yes`.
1. Navigate to the features page, under Plans.
2. Click "Create Credit System"
3. Toggle "AI Credit System" to enable model-based pricing
4. Set a default markup %, and optionally add providers with their own default markups
5. Add the models you want to support, overriding the markup per model where needed
6. For custom models, also specify input/output costs per million tokens
7. Click "Create"
### Model ID Format
Model IDs follow the `provider/model` format:
* Standard models: `anthropic/claude-opus-4-5`, `openai/gpt-4o`
* OpenRouter models: `openrouter/anthropic/claude-opus-4.6`
* Custom models: `custom/my-model-name`
For standard models, pricing is automatically fetched from models.dev, including separate rates for cache reads/writes, reasoning, and audio tokens where the model publishes them, plus large-context tier pricing (e.g. above 200k input tokens) when applicable.
For custom models, you must specify both `inputCost` and `outputCost` in dollars per million tokens — tracking fails if either is missing. Custom models bill input and output tokens only; cache, reasoning, and audio pools are ignored.
### Tracking Token Usage
Use the `trackTokens` endpoint to deduct credits based on token usage:
```typescript TypeScript theme={null}
import { Autumn } from "autumn-js";
const autumn = new Autumn({ secretKey: "am_sk_test_1234" });
await autumn.balances.trackTokens({
customerId: "user_123",
modelId: "anthropic/claude-opus-4-5",
inputTokens: 1500,
outputTokens: 500,
});
```
```python Python theme={null}
from autumn_sdk import Autumn
autumn = Autumn("am_sk_test_1234")
await autumn.balances.track_tokens(
customer_id="user_123",
model_id="anthropic/claude-opus-4-5",
input_tokens=1500,
output_tokens=500,
)
```
```bash cURL theme={null}
curl -X POST "https://api.useautumn.com/v1/balances.track_tokens" \
-H "Authorization: Bearer am_sk_test_1234" \
-H "Content-Type: application/json" \
-d '{
"customer_id": "user_123",
"model_id": "anthropic/claude-opus-4-5",
"input_tokens": 1500,
"output_tokens": 500
}'
```
The cost is calculated automatically based on the model's pricing plus your configured markup percentage.
# Entity Plans
Source: https://docs.useautumn.com/documentation/modelling-pricing/entity-plans
Give users, workspaces, or projects their own plans and balances under a parent customer
An **entity** is a resource that lives under a parent customer — a user, a workspace, a project. Entity plans let each of those hold its own plan, with its own balances, while the parent customer pays.
> **Example**
> A team plan costs \$30/seat/month. Each seat gets 50 AI meeting summaries per month. If a team has 5 users, each user has their own balance of 50 summaries — they can't use each other's allocation.
## Two ways to provision
Both approaches end in the same place: an entity holding a plan. They differ in **where capacity comes from**.
```
an entity holds a plan
│
┌────────────────────┴────────────────────┐
attach directly licenses
─────────────── ────────
capacity = whoever you attached capacity = a pool of seats you bought
charged when the entity is attached charged when the seats are bought
no unassigned state seats can sit empty, be reassigned
```
Pick with one question: **do you sell capacity before you know who fills it?**
| | Attach directly | Licenses |
| ---------------- | ------------------------------------------------ | ----------------------------------------------- |
| **Use when** | Entities appear and you bill for them as they do | Customers commit to a seat count upfront |
| **Buying** | `billing.attach` per entity | `licenseQuantities` on the parent plan |
| **Provisioning** | Same `billing.attach` call | `licenses.attach` assigns from the pool |
| **Removing** | `billing.update` with a cancel action | `licenses.release` returns the seat to the pool |
| **Empty seats** | Not possible | Bought but unassigned seats are normal |
Different tiers per entity work in **both** modes — attach different plans to different entities, or offer more than one license plan under the same parent.
Entities are created with a `feature_id` identifying their type (e.g. a non-consumable `seats` or `workspaces` feature). If you only need to *count* seats and bill for them, with no per-seat balances or identity, you don't need entities at all — see [per-seat pricing](/documentation/modelling-pricing/per-unit-pricing).
## Attaching plans directly
Create your plans as normal — no entity-specific configuration on the plan itself. Put plans that should replace each other on upgrade/downgrade in the same `group`.
```ts autumn.config.ts theme={null}
import { atmn, feature, plan } from "atmn";
export const requests = feature({
featureId: "requests",
name: "API Requests",
type: "metered",
consumable: true,
});
export const workspaceFree = plan({
planId: "workspace_free",
versionSlug: "v1",
active: true,
name: "Workspace Free",
group: "workspace",
items: [
{
featureId: requests.featureId,
included: 100,
reset: { interval: "month" },
},
],
});
export const workspacePro = plan({
planId: "workspace_pro",
versionSlug: "v1",
active: true,
name: "Workspace Pro",
group: "workspace",
price: { amount: 20, interval: "month" },
items: [
{
featureId: requests.featureId,
included: 10000,
reset: { interval: "month" },
},
],
});
export default atmn({
features: [requests],
plans: [workspaceFree, workspacePro],
});
```
Preview with `atmn push`, then apply with `atmn push --yes`.
1. Create your plan tiers as normal (e.g. "Workspace Free", "Workspace Pro")
2. Set the same **group** on plans that should replace each other on upgrade/downgrade
3. Entity-level attachment is handled via the API — no extra dashboard configuration needed
#### Create the entity
```typescript TypeScript theme={null}
import { Autumn } from "autumn-js";
const autumn = new Autumn({ secretKey: "am_sk_..." });
await autumn.entities.create({
customerId: "org_123",
entityId: "workspace_a",
featureId: "workspaces",
name: "Workspace A",
});
```
```python Python theme={null}
from autumn_sdk import Autumn
autumn = Autumn("am_sk_...")
await autumn.entities.create(
customer_id="org_123",
entity_id="workspace_a",
feature_id="workspaces",
name="Workspace A",
)
```
```bash cURL theme={null}
curl -X POST "https://api.useautumn.com/v1/entities.create" \
-H "Authorization: Bearer am_sk_..." \
-H "Content-Type: application/json" \
-d '{
"customer_id": "org_123",
"entity_id": "workspace_a",
"feature_id": "workspaces",
"name": "Workspace A"
}'
```
#### Attach a plan to it
Pass `entityId` to scope the attach to that entity:
```typescript TypeScript theme={null}
await autumn.billing.attach({
customerId: "org_123",
planId: "workspace_pro",
entityId: "workspace_a",
});
```
```python Python theme={null}
await autumn.billing.attach(
customer_id="org_123",
plan_id="workspace_pro",
entity_id="workspace_a",
)
```
```bash cURL theme={null}
curl -X POST "https://api.useautumn.com/v1/billing.attach" \
-H "Authorization: Bearer am_sk_..." \
-H "Content-Type: application/json" \
-d '{
"customer_id": "org_123",
"plan_id": "workspace_pro",
"entity_id": "workspace_a"
}'
```
Each entity's subscription is created separately in Stripe, with billing cycles synced to the parent customer.
To upgrade or downgrade, attach the new plan with the same `entityId` — the usual [upgrade/downgrade](/documentation/customers/subscription-lifecycle) logic applies.
#### Cancel an entity's plan
```typescript TypeScript theme={null}
await autumn.billing.update({
customerId: "org_123",
planId: "workspace_pro",
entityId: "workspace_a",
cancelAction: "cancel_end_of_cycle",
});
```
```python Python theme={null}
await autumn.billing.update(
customer_id="org_123",
plan_id="workspace_pro",
entity_id="workspace_a",
cancel_action="cancel_end_of_cycle",
)
```
```bash cURL theme={null}
curl -X POST "https://api.useautumn.com/v1/billing.update" \
-H "Authorization: Bearer am_sk_..." \
-H "Content-Type: application/json" \
-d '{
"customer_id": "org_123",
"plan_id": "workspace_pro",
"entity_id": "workspace_a",
"cancel_action": "cancel_end_of_cycle"
}'
```
The same [cancel/uncancel](/documentation/customers/subscription-lifecycle#cancellations) behavior applies.
## Licenses
A **license plan** describes everything one entity gets. The parent plan offers a pool of them, and you assign one to an entity to hand it its own balance.
```
team plan ──licenses: [{ seat, included: 1 }]──► pool of seats
│
licenses.attach │ licenses.release
▼
entity "user_alice" ──► own balance: 50 summaries/mo
```
The pool has a `granted` size (included seats plus any paid seats), a `usage` count (seats currently assigned), and a `remaining` count. Assigning consumes a seat; releasing gives it back.
Create the feature each seat consumes, then a license plan holding what one seat gets. Link it from the parent plan via `licenses`:
```ts autumn.config.ts theme={null}
import { atmn, feature, license, plan } from "atmn";
export const summaries = feature({
featureId: "summaries",
name: "Meeting Summaries",
type: "metered",
consumable: true,
});
// Everything one seat gets, priced per seat.
export const seat = plan({
planId: "seat",
versionSlug: "v1",
active: true,
name: "Seat",
group: "licenses",
price: { amount: 30, interval: "month" },
items: [
{
featureId: summaries.featureId,
included: 50,
reset: { interval: "month" },
},
],
});
export const team = plan({
planId: "team",
versionSlug: "v1",
active: true,
name: "Team",
licenses: [
license({
licensePlanId: seat.planId,
versionSlug: seat.versionSlug,
included: 1,
}),
],
});
export default atmn({ features: [summaries], plans: [seat, team] });
```
`included: 1` means the Team plan comes with one free seat. Seats beyond that are paid at the license plan's own price.
Preview with `atmn push`, then apply with `atmn push --yes`.
Give the license plan its own `group`. Attaching a plan replaces other plans in the same group, so a license plan sharing a group with its parent would knock the parent off.
1. Navigate to **Plans** and create the license plan (e.g. "Seat") — give it its own group, its per-seat price, and the features one seat receives (e.g. 50 Meeting Summaries per month)
2. Create or edit the parent plan (e.g. "Team")
3. Under **Licenses**, add the Seat plan and set how many seats are **included**
4. Save the plan
#### Buy seats
Seats are bought on the parent plan. `quantity` is the **total** number of seats, including the plan's free `included` amount:
```typescript TypeScript theme={null}
await autumn.billing.attach({
customerId: "org_123",
planId: "team",
licenseQuantities: [{
licensePlanId: "seat",
quantity: 5,
}],
});
```
```python Python theme={null}
await autumn.billing.attach(
customer_id="org_123",
plan_id="team",
license_quantities=[{
"license_plan_id": "seat",
"quantity": 5,
}],
)
```
```bash cURL theme={null}
curl -X POST "https://api.useautumn.com/v1/billing.attach" \
-H "Authorization: Bearer am_sk_..." \
-H "Content-Type: application/json" \
-d '{
"customer_id": "org_123",
"plan_id": "team",
"license_quantities": [
{ "license_plan_id": "seat", "quantity": 5 }
]
}'
```
With 1 included seat and `quantity: 5`, the customer gets 5 seats and pays for 4. Attach again with a new `quantity` to change the count later — Autumn prorates the difference.
A **priced** license plan must be attached at the customer level before it can be assigned to entities. Buying seats with `licenseQuantities` does this for you.
#### Assign a license
Assigning is what provisions the entity's individual balance — creating an entity on its own does not:
```typescript TypeScript theme={null}
await autumn.licenses.attach({
customerId: "org_123",
planId: "seat",
entities: [
{ entityId: "user_alice", name: "Alice", featureId: "seats" },
],
});
```
```python Python theme={null}
await autumn.licenses.attach(
customer_id="org_123",
plan_id="seat",
entities=[
{"entity_id": "user_alice", "name": "Alice", "feature_id": "seats"},
],
)
```
```bash cURL theme={null}
curl -X POST "https://api.useautumn.com/v1/licenses.attach" \
-H "Authorization: Bearer am_sk_..." \
-H "Content-Type: application/json" \
-d '{
"customer_id": "org_123",
"plan_id": "seat",
"entities": [
{ "entity_id": "user_alice", "name": "Alice", "feature_id": "seats" }
]
}'
```
`feature_id` is the entity type and is required only when the entity doesn't exist yet — Autumn creates it for you. You can pass several entities in one call.
Assignment is idempotent. Re-assigning an entity that already holds an active license for the same plan succeeds without consuming another seat. If the pool has no seats left, the call errors — buy more seats first.
#### Release a license
The entity's balance is removed and the seat returns to the pool, ready to reassign:
```typescript TypeScript theme={null}
await autumn.licenses.release({
customerId: "org_123",
licensePlanId: "seat",
entityIds: ["user_alice"],
});
```
```python Python theme={null}
await autumn.licenses.release(
customer_id="org_123",
license_plan_id="seat",
entity_ids=["user_alice"],
)
```
```bash cURL theme={null}
curl -X POST "https://api.useautumn.com/v1/licenses.release" \
-H "Authorization: Bearer am_sk_..." \
-H "Content-Type: application/json" \
-d '{
"customer_id": "org_123",
"license_plan_id": "seat",
"entity_ids": ["user_alice"]
}'
```
Releasing frees the seat but does not change what the customer pays — they keep the seats they bought. To stop paying for one, attach the parent plan again with a lower `quantity`.
`license_plan_id` is optional, and only needed to disambiguate when an entity holds licenses from more than one plan.
#### Inspect seats
[`licenses.list`](/api-reference/licenses/listLicenses) returns each pool with its `granted`, `usage`, and `remaining` counts. [`licenses.list_assignments`](/api-reference/licenses/listLicenseAssignments) returns which entities currently hold one.
```bash cURL theme={null}
curl -X POST "https://api.useautumn.com/v1/licenses.list" \
-H "Authorization: Bearer am_sk_..." \
-H "Content-Type: application/json" \
-d '{ "customer_id": "org_123" }'
```
## Checking and tracking per entity
Regardless of how the entity got its plan, pass `entity_id` to `check` and `track` to operate on that entity's balance:
```typescript TypeScript theme={null}
const { data } = await autumn.check({
customer_id: "org_123",
feature_id: "summaries",
entity_id: "user_alice",
});
console.log(data.allowed);
console.log(data.balance);
```
```python Python theme={null}
response = await autumn.check(
customer_id="org_123",
feature_id="summaries",
entity_id="user_alice",
)
print(response.allowed)
print(response.balance)
```
```bash cURL theme={null}
curl -X POST "https://api.useautumn.com/v1/check" \
-H "Authorization: Bearer am_sk_..." \
-H "Content-Type: application/json" \
-d '{
"customer_id": "org_123",
"feature_id": "summaries",
"entity_id": "user_alice"
}'
```
Track the same way:
```typescript TypeScript theme={null}
await autumn.track({
customer_id: "org_123",
feature_id: "summaries",
entity_id: "user_alice",
value: 1,
});
```
```python Python theme={null}
await autumn.track(
customer_id="org_123",
feature_id="summaries",
entity_id="user_alice",
value=1,
)
```
```bash cURL theme={null}
curl -X POST "https://api.useautumn.com/v1/track" \
-H "Authorization: Bearer am_sk_..." \
-H "Content-Type: application/json" \
-d '{
"customer_id": "org_123",
"feature_id": "summaries",
"entity_id": "user_alice",
"value": 1
}'
```
### Customer-level vs entity-level
| Level | How to use | Behavior |
| ------------------ | ------------------------------- | ---------------------------------------------------- |
| **Entity-level** | Pass `entity_id` in check/track | Checks/deducts from that entity's individual balance |
| **Customer-level** | Omit `entity_id` | Returns the total balance across all entities |
When tracking at the customer level (without `entity_id`), usage is deducted from the first-assigned entity to keep entity-level totals in sync with the customer-level total.
## Worked example
[Entity-level balances](/examples/entity-balances) walks the licenses model end to end: an AI meeting-notes product on team pricing, from customer creation through buying seats, assigning them, and releasing them when someone leaves.
# Free Plans
Source: https://docs.useautumn.com/documentation/modelling-pricing/free-plans
Offer free tiers with usage limits to onboard customers
Free plans let you give every new customer access to a limited set of features at no cost. They're the foundation of freemium models — customers start free and upgrade when they need more.
> **Example**
> A developer tool offers a free tier with 100 API requests per month and 1 workspace. When a user exceeds the limit, they're prompted to upgrade.
## Setting up
Create a plan with no `price` and set `autoEnable: true`:
```ts autumn.config.ts theme={null}
import { atmn, feature, plan } from "atmn";
export const apiRequests = feature({
featureId: "api_requests",
name: "API Requests",
type: "metered",
consumable: true,
});
export const workspaces = feature({
featureId: "workspaces",
name: "Workspaces",
type: "metered",
consumable: false,
});
export const free = plan({
planId: "free",
versionSlug: "v1",
active: true,
name: "Free",
group: "main",
autoEnable: true,
items: [
{
featureId: apiRequests.featureId,
included: 100,
reset: { interval: "month" },
},
{
featureId: workspaces.featureId,
included: 1,
},
],
});
export default atmn({ features: [apiRequests, workspaces], plans: [free] });
```
Preview with `atmn push`, then apply with `atmn push --yes`.
1. Navigate to **Plans** and click **Create Plan**
2. Set the plan name and ID (e.g., "Free", `free`)
3. Toggle **Auto-enable** so the plan is automatically assigned to new customers
4. Add features and save your changes
## How it works
When `autoEnable` is set, every new customer created via the API or SDK is automatically assigned this plan. This flag can only be set if there are no prices on the plan. Since there are no prices, no payment is required.
If a customer cancels their paid plan and you have an auto-enabled free plan in the same group, the free plan will be re-activated automatically.
## Gating features
Use the [check](/documentation/customers/check) endpoint to gate access based on the free plan's limits:
```typescript TypeScript theme={null}
import { Autumn } from "autumn-js";
const autumn = new Autumn({ secretKey: "am_sk_..." });
const { data } = await autumn.check({
customer_id: "user_123",
feature_id: "api_requests",
});
if (!data.allowed) {
// Prompt user to upgrade
}
```
```python Python theme={null}
from autumn_sdk import Autumn
autumn = Autumn("am_sk_...")
response = await autumn.check(
customer_id="user_123",
feature_id="api_requests",
)
if not response.allowed:
# Prompt user to upgrade
```
```bash cURL theme={null}
curl -X POST "https://api.useautumn.com/v1/check" \
-H "Authorization: Bearer am_sk_..." \
-H "Content-Type: application/json" \
-d '{
"customer_id": "user_123",
"feature_id": "api_requests"
}'
```
When `allowed` is `false`, the customer has exhausted their free tier balance. This is a good moment to prompt them to upgrade.
# Graduated Pricing
Source: https://docs.useautumn.com/documentation/modelling-pricing/graduated-pricing
Set tiered pricing where different usage ranges are charged at different rates
Graduated pricing splits usage into tiers, and each tier is charged at its own rate. This means the price per unit decreases as usage increases — customers pay less per unit for higher volumes, but each range has its own rate.
> **Example**
> An API service charges:
>
> * First 1,000 requests: \$0.01 each
> * Next 9,000 requests (1,001–10,000): \$0.008 each
> * Everything above 10,000: \$0.005 each
>
> A customer who makes 15,000 requests pays: (1,000 × $0.01) + (9,000 × $0.008) + (5,000 × $0.005) = **$107\*\*
## Setting up
Use the `tiers` array on a plan item price. By default, tiers use graduated behavior:
```ts autumn.config.ts theme={null}
import { atmn, feature, plan } from "atmn";
export const apiCalls = feature({
featureId: "api_calls",
name: "API Calls",
type: "metered",
consumable: true,
});
export const pro = plan({
planId: "pro",
versionSlug: "v1",
active: true,
name: "Pro",
price: { amount: 20, interval: "month" },
items: [
{
featureId: apiCalls.featureId,
reset: { interval: "month" },
price: {
tiers: [
{ to: 1000, amount: 0.01 },
{ to: 10000, amount: 0.008 },
{ to: "inf", amount: 0.005 },
],
billingMethod: "usage_based",
interval: "month",
},
},
],
});
export default atmn({ features: [apiCalls], plans: [pro] });
```
Preview with `atmn push`, then apply with `atmn push --yes`.
1. Navigate to **Plans** and create or edit a plan
2. Add a **consumable** feature
3. Under **Price**, select **Tiered**
4. The default tier behavior is **Graduated**
5. Add tiers with the **upper limit** (`to`) and **rate** (`amount`) for each range. Use `inf` for the final tier
6. Set the billing method to **Usage-based** and the billing interval
7. Save the plan
## How graduated pricing works
At the end of the billing period, Autumn calculates the total charge by applying each tier's rate to the usage that falls within that tier's range:
| Usage range | Rate | Charge |
| -------------- | ------- | -------------------- |
| 0 – 1,000 | \$0.01 | 1,000 × $0.01 = $10 |
| 1,001 – 10,000 | \$0.008 | 9,000 × $0.008 = $72 |
| 10,001+ | \$0.005 | 5,000 × $0.005 = $25 |
| **Total** | | **\$107** |
Each tier's rate only applies to the usage **within that tier's range**. This is in contrast to [volume-based pricing](/documentation/modelling-pricing/volume-based-tiers), where a single rate is applied to the entire usage.
## Tier configuration
Each tier has the following fields:
| Field | Type | Description |
| ------------- | ----------------- | ---------------------------------------------------------------- |
| `to` | number or `"inf"` | The upper boundary of this tier. Use `"inf"` for the final tier. |
| `amount` | number | Price per unit within this tier |
| `flat_amount` | number | Optional flat fee added when this tier is reached |
Tiers must be in ascending order by `to`. The final tier should always use `"inf"` to capture all remaining usage.
## Graduated vs volume-based
| | Graduated | Volume-based |
| ---------------- | ------------------------------------------ | ------------------------------------- |
| **Rate applied** | Each tier at its own rate | Entire usage at a single rate |
| **Total charge** | Sum of each tier's charge | Total usage × matching tier rate |
| **Best for** | Rewarding growth with lower marginal rates | Simpler pricing with volume discounts |
See [Volume-Based Tiers](/documentation/modelling-pricing/volume-based-tiers) for the alternative model.
# One-Off Purchases
Source: https://docs.useautumn.com/documentation/modelling-pricing/one-off-purchases
Configure one-time purchases and lifetime plans
One-off purchases are single-charge plans that don't recur. They're used for one-time top-ups, lifetime access plans, or any plan where the customer pays once.
> **Example**
> An AI platform lets users buy 500 credits for \$10 as a one-time purchase. The credits never expire and can be used at any pace.
## Setting up
Set `interval: "one_off"` on the plan's `price`, or on the item price, for a one-time charge:
```ts autumn.config.ts theme={null}
import { atmn, feature, plan } from "atmn";
export const credits = feature({
featureId: "credits",
name: "Credits",
type: "metered",
consumable: true,
});
export const creditTopUp = plan({
planId: "credit_top_up",
versionSlug: "v1",
active: true,
name: "Credit Top-Up",
items: [
{
featureId: credits.featureId,
price: {
amount: 10,
billingUnits: 500,
billingMethod: "prepaid",
interval: "one_off",
},
},
],
});
export default atmn({ features: [credits], plans: [creditTopUp] });
```
Preview with `atmn push`, then apply with `atmn push --yes`.
1. Navigate to **Plans** and click **Create Plan**
2. Set the plan name and ID
3. Under **Price**, select **One-off** as the interval — or leave no base price if pricing is purely feature-based
4. Add a feature with a **prepaid** price. The customer will select a quantity at checkout
5. Toggle **Add-on** if this should be purchasable alongside other plans
6. Click **Create**
## How it works
When a customer purchases a one-off plan:
* Autumn creates a Stripe invoice (not a subscription) and charges it immediately
* The feature balance is provisioned with the purchased quantity
* The balance has a `one_off` interval — it never resets or expires
One-off purchases don't create Stripe subscriptions. They generate a one-time invoice instead.
## Purchasing a one-off plan
For prepaid one-off plans, pass the desired `quantity` via the `options` array:
```typescript TypeScript theme={null}
import { Autumn } from "autumn-js";
const autumn = new Autumn({ secretKey: "am_sk_..." });
const { data } = await autumn.checkout({
customer_id: "user_123",
plan_id: "credit_top_up",
options: [{
feature_id: "credits",
quantity: 1000,
}],
});
```
```python Python theme={null}
from autumn_sdk import Autumn
autumn = Autumn("am_sk_...")
response = await autumn.checkout(
customer_id="user_123",
plan_id="credit_top_up",
options=[{
"feature_id": "credits",
"quantity": 1000,
}],
)
```
```bash cURL theme={null}
curl -X POST "https://api.useautumn.com/v1/checkout" \
-H "Authorization: Bearer am_sk_..." \
-H "Content-Type: application/json" \
-d '{
"customer_id": "user_123",
"plan_id": "credit_top_up",
"options": [{
"feature_id": "credits",
"quantity": 1000
}]
}'
```
## One-off prices within a subscription
A subscription plan can include both recurring and one-off prices. When it does, Autumn splits them at checkout:
* **Recurring prices** bill every cycle as part of the Stripe subscription
* **One-off prices** are charged once on the first invoice only
This is useful for setup fees, one-time credit grants, or any charge that should happen once when the customer subscribes.
> **Example**
> A Pro plan charges \$20/month plus a one-time \$50 setup fee. The customer's first invoice is \$70, and subsequent invoices are \$20.
Add a non-consumable feature for the setup fee, then include it as a separate one-off item alongside the recurring base price:
```ts autumn.config.ts expandable theme={null}
import { atmn, feature, plan } from "atmn";
export const setupFee = feature({
featureId: "setup_fee",
name: "Setup Fee",
type: "metered",
consumable: false,
});
export const pro = plan({
planId: "pro",
versionSlug: "v1",
active: true,
name: "Pro",
price: { amount: 20, interval: "month" },
items: [
{
featureId: setupFee.featureId,
price: {
amount: 50,
billingMethod: "prepaid",
interval: "one_off",
},
},
],
});
export default atmn({ features: [setupFee], plans: [pro] });
```
When you attach the plan, you can select a quantity for the setup fee. The \$20/month base price recurs on every invoice. The setup fee item is charged once on the first invoice only.
1. Create a **boolean** feature for the setup fee (e.g., `setup_fee`)
2. Create a plan with a **recurring** base price (e.g., \$20/month)
3. Add the setup fee feature as an item and set its price interval to **One-off**
4. The recurring charge will bill every cycle; the one-off charge applies to the first invoice only
## Balance stacking
One-off balances stack with existing balances from subscriptions. Autumn uses [deduction order](/documentation/concepts/balances#deduction-order) to ensure shorter-interval balances (e.g., monthly) are used before one-off (lifetime) balances.
## Use cases
| Use case | Configuration |
| ------------------------ | ----------------------------------------------------- |
| Credit top-up | Prepaid price, add-on, no base price |
| Lifetime plan | One-off base price, features with no reset |
| One-time fee | One-off base price, no features |
| Setup fee + subscription | Recurring base price, one-off item price on same plan |
# Per-Unit Pricing
Source: https://docs.useautumn.com/documentation/modelling-pricing/per-unit-pricing
Charge customers based on the number of units they use, such as seats or workspaces
Per-unit pricing charges customers based on the quantity of a resource they use — seats, workspaces, environments, or any other non-consumable feature. Customers either commit to a quantity upfront (prepaid) or are billed based on actual usage at the end of each billing cycle (usage-based).
> **Example**
> A collaboration tool charges \$10/seat/month. The plan includes 5 seats for free, and each additional seat costs \$10.
## Setting up
Create a `non-consumable` metered feature and add it to a plan with a per-unit price:
```ts autumn.config.ts theme={null}
import { atmn, feature, plan } from "atmn";
export const seats = feature({
featureId: "seats",
name: "Seats",
type: "metered",
consumable: false,
});
export const pro = plan({
planId: "pro",
versionSlug: "v1",
active: true,
name: "Pro",
price: { amount: 20, interval: "month" },
items: [
{
featureId: seats.featureId,
included: 5,
price: {
amount: 10,
interval: "month",
billingMethod: "usage_based",
},
},
],
});
export default atmn({ features: [seats], plans: [pro] });
```
Preview with `atmn push`, then apply with `atmn push --yes`.
1. Navigate to **Plans** and create or edit a plan
2. Add a `metered`, `non-consumable` feature (e.g., "Seats")
3. Set an **included** amount (e.g., 5 seats for free)
4. Add a **price** per unit (e.g., \$10 per seat per month)
5. Choose the **billing method**:
* **Prepaid** — customer selects quantity at checkout, charged upfront
* **Usage-based** — billed for actual usage at end of billing cycle
6. Under **Advanced**, configure [proration](/documentation/modelling-pricing/proration) behavior for mid-cycle changes
7. Save the plan
## Billing methods
| Method | When charged | Quantity | Best for |
| --------------- | ------------------------------------------ | --------------------------------- | ----------------------------------- |
| **Prepaid** | Upfront at purchase | Customer selects a fixed quantity | Seat licenses with committed counts |
| **Usage-based** | End of billing cycle (prorated on changes) | Automatic — tracks actual usage | Seats that fluctuate frequently |
### Prepaid per-unit
With prepaid, the customer selects a **total quantity** when purchasing. The `quantity` includes any free included amount — Autumn subtracts the included amount and charges for the remainder.
For example, with 5 included seats at \$10/extra seat, a customer who selects `quantity: 10` gets 10 seats total and pays for 5 extra seats (\$50/month).
Pass the quantity via `featureQuantities`:
```typescript TypeScript theme={null}
import { Autumn } from "autumn-js";
const autumn = new Autumn({ secretKey: "am_sk_..." });
const { data } = await autumn.billing.attach({
customerId: "user_123",
planId: "pro",
featureQuantities: [{
featureId: "seats",
quantity: 10,
}],
});
```
```python Python theme={null}
from autumn_sdk import Autumn
autumn = Autumn("am_sk_...")
response = await autumn.billing.attach(
customer_id="user_123",
plan_id="pro",
feature_quantities=[{
"feature_id": "seats",
"quantity": 10,
}],
)
```
```bash cURL theme={null}
curl -X POST "https://api.useautumn.com/v1/billing/attach" \
-H "Authorization: Bearer am_sk_..." \
-H "Content-Type: application/json" \
-d '{
"customer_id": "user_123",
"plan_id": "pro",
"feature_quantities": [{
"feature_id": "seats",
"quantity": 10
}]
}'
```
The customer's balance is set to the total quantity (10). If they're upgrading and already have seats in use, the existing usage is carried over — so a customer with 3 seats in use would see a remaining balance of 7.
Autumn does not prevent you from passing a `quantity` lower than the customer's current usage. If the customer has 5 seats in use and you pass `quantity: 3`, the balance goes negative (-2). The `check` endpoint will return `allowed: false`, preventing new seats from being added, but existing seats are not forcibly removed.
### Usage-based per-unit
With usage-based billing, no quantity is needed at purchase time. Track seat additions and removals as they happen, and Autumn bills for the actual number of seats in use.
```typescript TypeScript theme={null}
import { Autumn } from "autumn-js";
const autumn = new Autumn({ secretKey: "am_sk_..." });
// Add a seat
await autumn.track({
customer_id: "user_123",
feature_id: "seats",
value: 1,
});
// Remove a seat
await autumn.track({
customer_id: "user_123",
feature_id: "seats",
value: -1,
});
```
```python Python theme={null}
from autumn_sdk import Autumn
autumn = Autumn("am_sk_...")
# Add a seat
await autumn.track(
customer_id="user_123",
feature_id="seats",
value=1,
)
# Remove a seat
await autumn.track(
customer_id="user_123",
feature_id="seats",
value=-1,
)
```
```bash cURL theme={null}
# Add a seat
curl -X POST "https://api.useautumn.com/v1/track" \
-H "Authorization: Bearer am_sk_..." \
-H "Content-Type: application/json" \
-d '{
"customer_id": "user_123",
"feature_id": "seats",
"value": 1
}'
```
When a customer purchases the plan, any seats already in use are **automatically reflected** in their subscription from day one. For example, if a customer has 3 seats in use and purchases a plan with 5 included seats at \$10/extra seat:
* Their balance starts at 5 (the included amount)
* The 3 existing seats are carried over, leaving a remaining balance of 2
* No extra charge yet — they're within the included amount
* As they add seats beyond 5, each additional seat is billed at \$10/month with [proration](/documentation/modelling-pricing/proration)
## Existing usage on upgrade
When a customer upgrades from one plan to another, Autumn **automatically carries over** their current seat usage to the new plan. This ensures there's no gap in tracking — existing seats don't disappear or go unbilled.
### Prepaid
The customer's balance is set to their chosen quantity. Existing usage is then deducted from that balance.
> **Example**: Customer has **3 seats** in use. They purchase a plan with 5 included seats, passing `quantity: 10`.
>
> * Balance is set to 10 (5 included + 5 purchased)
> * 3 existing seats are deducted → **7 remaining**
> * Stripe charges for 10 seats (with 5 in the free tier)
### Usage-based
No quantity is needed. The Stripe subscription quantity is set to the customer's current usage automatically.
> **Example**: Customer has **3 seats** in use. They purchase a plan with 5 included seats at \$10/extra seat.
>
> * Balance starts at 5 (included amount)
> * 3 existing seats are deducted → **2 remaining**
> * Stripe subscription reflects 3 seats in use (within the free tier, so no extra charge)
> * When they add a 6th seat, billing begins at \$10/seat for the overage
| Scenario | Prepaid (qty: 8) | Usage-based |
| ------------------------ | ---------------------------------------------- | ------------------------------------------- |
| **3 in use, 5 included** | Balance: 8 → 5 remaining. Charged for 3 extra. | Balance: 5 → 2 remaining. No extra charge. |
| **3 in use, 0 included** | Balance: 8 → 5 remaining. Charged for 8. | Balance: 0 → -3. Charged for 3 seats. |
| **7 in use, 5 included** | Balance: 8 → 1 remaining. Charged for 3 extra. | Balance: 5 → -2. Charged for 2 extra seats. |
## Checking access
Before allowing a user to add a new seat, check if they have capacity:
```typescript TypeScript theme={null}
const { data } = await autumn.check({
customer_id: "user_123",
feature_id: "seats",
});
if (!data.allowed) {
// Prompt user to purchase more seats or upgrade
}
```
```python Python theme={null}
response = await autumn.check(
customer_id="user_123",
feature_id="seats",
)
if not response.allowed:
# Prompt user to purchase more seats or upgrade
```
```bash cURL theme={null}
curl -X POST "https://api.useautumn.com/v1/check" \
-H "Authorization: Bearer am_sk_..." \
-H "Content-Type: application/json" \
-d '{
"customer_id": "user_123",
"feature_id": "seats"
}'
```
For **prepaid**, `allowed` is `true` when the customer has remaining prepaid balance (ie. unused seats).
For **usage-based**, `allowed` is `true` as long as the customer has a usage-based price configured — additional seats are simply billed at the per-unit rate, so there's no hard cap.
## Proration on quantity changes
When a customer increases or decreases their seat count mid-billing-cycle, you can configure how the price adjustment is handled. See [Proration](/documentation/modelling-pricing/proration) for details.
# Plan Variants
Source: https://docs.useautumn.com/documentation/modelling-pricing/plan-variants
Group related plans under one base plan and keep their differences small
Plan variants let you model multiple versions of the same offer without duplicating the full plan. The base plan holds the shared definition, and each variant stores only the differences: usually a price change, an added item, or a different usage allowance.
> **Example**
> A Pro plan has the same core features for every customer, but is sold monthly, annually, and as a higher-volume package. Model these as variants of `pro` instead of three unrelated plans.
Variants are most useful for:
* Monthly vs annual billing intervals
* A/B testing plan packages
* Volume ladders that share most features but differ in included usage or overage price
## Setting up
Each variant is its own `variant({...})` fixture, listed in the base plan's `variants`:
```ts autumn.config.ts theme={null}
import { atmn, feature, plan, variant } from "atmn";
export const emails = feature({
featureId: "emails",
name: "Emails",
type: "metered",
consumable: true,
});
export const proAnnual = variant({
variantPlanId: "pro_annual",
versionSlug: "v1",
name: "Pro Annual",
customize: {
price: { amount: 200, interval: "year" },
},
});
export const pro100k = variant({
variantPlanId: "pro_100k",
versionSlug: "v1",
name: "Pro 100k",
customize: {
price: { amount: 35, interval: "month" },
removeItems: [{ featureId: emails.featureId, billingMethod: "usage_based" }],
addItems: [
{
featureId: emails.featureId,
included: 100000,
price: {
amount: 0.9,
billingUnits: 1000,
billingMethod: "usage_based",
interval: "month",
},
},
],
},
});
export const pro = plan({
planId: "pro",
versionSlug: "v1",
active: true,
name: "Pro",
price: { amount: 20, interval: "month" },
items: [
{
featureId: emails.featureId,
included: 10000,
price: {
amount: 1,
billingUnits: 1000,
billingMethod: "usage_based",
interval: "month",
},
},
],
variants: [proAnnual, pro100k],
});
export default atmn({ features: [emails], plans: [pro] });
```
Preview with `atmn push`, then apply with `atmn push --yes`.
1. Create or open the base plan
2. Create a variant from that plan
3. Change only the fields that differ, such as price or specific feature items
4. Save the variant
## How variants work
Each variant is still a plan you can attach by ID, such as `pro_annual` or `pro_100k`. The difference is that Autumn keeps it connected to the base plan.
Use variants when plans share most of their features. If a variant changes many unrelated parts of the plan, create a separate plan instead.
# Prepaid Pricing
Source: https://docs.useautumn.com/documentation/modelling-pricing/prepaid-pricing
Charge customers upfront for a quantity of a feature, and draw from it as usage occurs
Prepaid pricing lets customers pay for a fixed quantity of a feature upfront. They select how many units they want at purchase time, pay immediately, and their balance is decremented as they use it.
This is in contrast to [usage-based pricing](/documentation/modelling-pricing/usage-based-pricing), where customers are billed for actual usage at the end of a billing cycle.
> **Example**
> An AI platform has a Pro plan at \$20/month that includes:
>
> * **API Credits**: 500 included for free, then \$10 per 1,000 credits per month (consumable)
> * **Seats**: 3 included for free, then \$5 per seat per month (non-consumable)
>
> A customer selects 3,000 credits and 10 seats. They pay \$20 base + \$25 for 2,500 extra credits + \$35 for 7 extra seats = \$80/month.
## Setting up
Create your features and add them to a plan with `prepaid` prices:
```ts autumn.config.ts theme={null}
import { atmn, feature, plan } from "atmn";
export const apiCredits = feature({
featureId: "api_credits",
name: "API Credits",
type: "metered",
consumable: true,
});
export const seats = feature({
featureId: "seats",
name: "Seats",
type: "metered",
consumable: false,
});
export const pro = plan({
planId: "pro",
versionSlug: "v1",
active: true,
name: "Pro",
price: { amount: 20, interval: "month" },
items: [
{
featureId: apiCredits.featureId,
included: 500,
price: {
amount: 10,
billingUnits: 1000,
billingMethod: "prepaid",
interval: "month",
},
},
{
featureId: seats.featureId,
included: 3,
price: {
amount: 5,
billingMethod: "prepaid",
interval: "month",
},
},
],
});
export default atmn({ features: [apiCredits, seats], plans: [pro] });
```
Preview with `atmn push`, then apply with `atmn push --yes`.
1. Navigate to **Plans** and create or edit a plan
2. Add your features:
* A `metered`, `consumable` feature for credits (e.g., "API Credits") — set an **included** amount (500), a **price** (\$10 per 1,000 per month), and billing method **Prepaid**
* A `metered`, `non-consumable` feature for seats (e.g., "Seats") — set an **included** amount (3), a **price** (\$5 per seat per month), and billing method **Prepaid**
3. Save the plan
## How it works
When a plan has prepaid features, customers select a **quantity** at purchase time. This quantity determines:
* **How many units are granted** as their balance
* **How much they're charged**, based on the price and billing units
The `quantity` is the **total** number of feature units the customer will receive, including any included amount.
Using our example plan:
* A customer selects **3,000 API credits**. 500 are included, so they pay for 2,500 → \$10 × (2,500 / 1,000) = **\$25/month** for credits.
* The same customer selects **10 seats**. 3 are included, so they pay for 7 → \$5 × 7 = **\$35/month** for seats.
If you pass a `quantity` equal to or less than the included amount, the customer gets the included amount and pays nothing extra for that feature.
## Passing `feature_quantities`
When attaching a plan or updating a subscription that contains prepaid features, use the `feature_quantities` parameter to specify how many units the customer wants.
### Attaching a plan
Pass a `feature_quantities` entry for each prepaid feature on the plan:
```typescript TypeScript theme={null}
import { Autumn } from "autumn-js";
const autumn = new Autumn({ secretKey: "am_sk_..." });
const { data } = await autumn.billing.attach({
customerId: "user_123",
planId: "pro",
featureQuantities: [
{ featureId: "api_credits", quantity: 3000 },
{ featureId: "seats", quantity: 10 },
],
});
```
```python Python theme={null}
from autumn_sdk import Autumn
autumn = Autumn("am_sk_...")
response = await autumn.billing.attach(
customer_id="user_123",
plan_id="pro",
feature_quantities=[
{ "feature_id": "api_credits", "quantity": 3000 },
{ "feature_id": "seats", "quantity": 10 },
],
)
```
```bash cURL theme={null}
curl -X POST "https://api.useautumn.com/v1/billing/attach" \
-H "Authorization: Bearer am_sk_..." \
-H "Content-Type: application/json" \
-d '{
"customer_id": "user_123",
"plan_id": "pro",
"feature_quantities": [
{ "feature_id": "api_credits", "quantity": 3000 },
{ "feature_id": "seats", "quantity": 10 }
]
}'
```
### Updating a subscription
To change prepaid quantities on an existing subscription, use `billing.update`. For example, to add more seats mid-cycle:
```typescript TypeScript theme={null}
await autumn.billing.update({
customerId: "user_123",
planId: "pro",
featureQuantities: [
{ featureId: "api_credits", quantity: 3000 },
{ featureId: "seats", quantity: 15 },
],
});
```
```python Python theme={null}
await autumn.billing.update(
customer_id="user_123",
plan_id="pro",
feature_quantities=[
{ "feature_id": "api_credits", "quantity": 3000 },
{ "feature_id": "seats", "quantity": 15 },
],
)
```
```bash cURL theme={null}
curl -X POST "https://api.useautumn.com/v1/billing/update" \
-H "Authorization: Bearer am_sk_..." \
-H "Content-Type: application/json" \
-d '{
"customer_id": "user_123",
"plan_id": "pro",
"feature_quantities": [
{ "feature_id": "api_credits", "quantity": 3000 },
{ "feature_id": "seats", "quantity": 15 }
]
}'
```
See [Updating Subscriptions](/documentation/customers/updating-subscriptions) for more on previewing changes. When quantities change mid-cycle, Autumn can prorate the charge — see [Proration](/documentation/modelling-pricing/proration) for configuration options.
## Understanding prepaid balances
Once a customer is attached to a plan with prepaid features, their balance `breakdown` distinguishes between what was included for free and what was purchased.
| Field | Description |
| ---------------- | -------------------------------------------------------------------------------------------- |
| `included_grant` | The amount granted by the plan for free — the "included" amount configured on the plan item. |
| `prepaid_grant` | The amount purchased via `feature_quantities` — the quantity minus the included amount. |
| `granted` | Top-level total: `included_grant + prepaid_grant` summed across all breakdown items. |
| `remaining` | How much is left to use. |
| `usage` | How much has been consumed. |
Using the plan from our setup, a customer who attaches with 3,000 credits and 10 seats will have:
```json expandable theme={null}
{
"api_credits": {
"feature_id": "api_credits",
"granted": 3000,
"remaining": 3000,
"usage": 0,
"unlimited": false,
"overage_allowed": false,
"breakdown": [
{
"id": "cus_ent_abc123",
"plan_id": "pro",
"included_grant": 500,
"prepaid_grant": 2500,
"remaining": 3000,
"usage": 0,
"reset": {
"interval": "month",
"resets_at": 1773851121437
},
"price": {
"amount": 10,
"billing_units": 1000,
"billing_method": "prepaid"
},
"expires_at": null
}
]
},
"seats": {
"feature_id": "seats",
"granted": 10,
"remaining": 10,
"usage": 0,
"unlimited": false,
"overage_allowed": false,
"breakdown": [
{
"id": "cus_ent_def456",
"plan_id": "pro",
"included_grant": 3,
"prepaid_grant": 7,
"remaining": 10,
"usage": 0,
"reset": null,
"price": {
"amount": 5,
"billing_units": 1,
"billing_method": "prepaid"
},
"expires_at": null
}
]
}
}
```
Use the [check](/documentation/customers/check) endpoint before allowing a customer to use a prepaid feature, and [track](/documentation/customers/tracking-usage) usage afterwards to decrement their balance.
## Prepaid vs usage-based
| | Prepaid | Usage-based |
| ----------------------------- | ------------------------------- | -------------------------------- |
| **When charged** | Upfront at purchase | End of billing cycle |
| **Customer selects quantity** | Yes, via `feature_quantities` | No |
| **Balance behavior** | Decremented as usage occurs | Accumulated and billed |
| **Best for** | Credits, top-ups, seat licenses | Metered APIs, storage, bandwidth |
# Proration
Source: https://docs.useautumn.com/documentation/modelling-pricing/proration
Handle mid-cycle plan changes with prorated billing
Proration adjusts billing when a customer changes their subscription mid-cycle. That could be an upgrade, a downgrade, or a change to the quantity of a prepaid item like seats. Autumn works out the prorated amount and either charges or credits the customer.
> **Example**
> A customer on a \$20/month plan upgrades to a \$50/month plan halfway through the billing cycle. They're charged \$15 (the prorated difference for the remaining half of the month).
## Setting up
Add a `proration` config to a priced plan item:
```ts autumn.config.ts theme={null}
import { atmn, feature, plan } from "atmn";
export const seats = feature({
featureId: "seats",
name: "Seats",
type: "metered",
consumable: false,
});
export const pro = plan({
planId: "pro",
versionSlug: "v1",
active: true,
name: "Pro",
price: { amount: 20, interval: "month" },
items: [
{
featureId: seats.featureId,
included: 5,
price: {
amount: 10,
interval: "month",
billingUnits: 1,
billingMethod: "prepaid",
},
proration: {
onIncrease: "prorate_immediately",
onDecrease: "prorate_immediately",
},
},
],
});
export default atmn({ features: [seats], plans: [pro] });
```
Preview with `atmn push`, then apply with `atmn push --yes`.
1. Navigate to **Plans** and edit a plan
2. Select a **prepaid** priced item (e.g., seats)
3. Under **Advanced**, configure **Proration Behavior**:
* **On Increase**: what happens when the customer adds more units
* **On Decrease**: what happens when the customer removes units
4. Save the plan
## Proration options
### On Increase
| Option | Behavior |
| --------------------- | ----------------------------------------------------- |
| `prorate_immediately` | Charge the prorated difference immediately |
| `bill_immediately` | Charge the full unit price immediately (no proration) |
| `prorate_next_cycle` | Add the prorated difference to the next invoice |
| `bill_next_cycle` | Charge the full unit price on the next invoice |
### On Decrease
| Option | Behavior |
| --------------------- | ---------------------------------------------------------------------- |
| `prorate_immediately` | Credit the prorated difference immediately |
| `prorate_next_cycle` | Credit the prorated difference on the next invoice |
| `no_prorations` | No credit or refund. The change takes effect at the next billing cycle |
Item-level proration only applies to prepaid items. It decides how to bill a change in the quantity a customer bought, like seats or workspaces. Usage-based items are billed on what was used, so quantity changes don't apply.
## Plan-level proration
When a customer switches between plans (upgrade or downgrade), Autumn prorates automatically:
* **Upgrades**: the customer is charged the prorated difference between the old and new plan prices for the remainder of the billing cycle. This happens immediately.
* **Downgrades**: the plan change is **scheduled** to take effect at the end of the current billing period. The customer continues on their current plan until then.
**Example**
A customer is on a \$20/month plan and upgrades to a \$50/month plan on day 15 of a 30-day cycle.
* Old plan credit: $20 × (15/30) = $10 credit
* New plan charge: $50 × (15/30) = $25 charge
* Net charge: $25 - $10 = **\$15**
### Controlling proration in attach
By default, plan switches prorate immediately. You can override this behavior using the `proration_behavior` parameter in `billing.attach`:
| Value | Behavior |
| --------------------- | ----------------------------------------------------------------------- |
| `prorate_immediately` | **(default)** Charges or credits the prorated difference immediately |
| `none` | Skips proration — no charges or credits are created for the plan change |
```typescript TypeScript theme={null}
await autumn.billing.attach({
customerId: "user_123",
planId: "enterprise",
prorationBehavior: "none",
});
```
```python Python theme={null}
autumn.billing.attach(
customer_id="user_123",
plan_id="enterprise",
proration_behavior="none",
)
```
```bash cURL theme={null}
curl -X POST https://api.useautumn.com/v2/billing/attach \
-H "Authorization: Bearer am_sk_..." \
-H "Content-Type: application/json" \
-d '{
"customer_id": "user_123",
"plan_id": "enterprise",
"proration_behavior": "none"
}'
```
`proration_behavior: "none"` cannot be used when:
* Upgrading from a **free** plan to a **paid** plan
* Removing an active **free trial**
* Any transition that would result in a new charge
In these cases, Autumn requires immediate billing and will return an error.
### Custom line items
If you need full control over what the customer is charged during a plan switch, you can pass `custom_line_items` to replace the auto-generated proration invoice entirely. This is only valid for immediate plan changes (e.g. upgrades).
```typescript theme={null}
await autumn.billing.attach({
customerId: "user_123",
planId: "enterprise",
customLineItems: [
{ amount: 25, description: "Prorated upgrade credit" },
{ amount: -10, description: "Loyalty discount" },
],
});
```
When `custom_line_items` is provided, Autumn skips its own proration calculation and creates an invoice with exactly the line items you specified. Amounts can be negative to represent credits.
## Stripe integration
Autumn uses Stripe's proration system under the hood. Prorated amounts appear as line items on the customer's next invoice (or are charged immediately, depending on configuration).
# Recurring Plans
Source: https://docs.useautumn.com/documentation/modelling-pricing/recurring
Grant customers a recurring allowance of consumable features like messages, credits, or API calls
Recurring plans let you grant customers a fixed allowance of consumable features -- like messages, credits, or API calls -- that resets each billing period. Customers pay a base price at a regular interval (monthly, quarterly, annually), and receive a fresh grant of their included features at the start of each cycle.
> **Example**
> An AI writing tool offers a Pro plan at \$20/month that grants 1,000 messages per month. When the billing period resets, the customer's message balance is reset back to 1,000.
## Setting up
Define a recurring plan in your `autumn.config.ts`:
```ts autumn.config.ts expandable theme={null}
import { atmn, feature, plan } from "atmn";
export const messages = feature({
featureId: "messages",
name: "Messages",
type: "metered",
consumable: true,
});
export const pro = plan({
planId: "pro",
versionSlug: "v1",
active: true,
name: "Pro",
price: { amount: 20, interval: "month" },
items: [
{
featureId: messages.featureId,
included: 1000,
reset: { interval: "month" },
},
],
});
export default atmn({ features: [messages], plans: [pro] });
```
Preview with `atmn push`, then apply with `atmn push --yes`.
1. Navigate to **Plans** in the Autumn dashboard
2. Click **Create Plan**
3. Set a **name** and **ID** for the plan (e.g., "Pro", `pro`)
4. Under **Price**, set the amount and select a billing interval (`month`, `quarter`, `semi_annual`, or `year`)
5. Add consumable features to the plan -- set grant amounts and reset intervals. These will be granted to the customer each billing period once they subscribe.
6. Save your changes
## Attaching a subscription
Use [billing.attach](/documentation/customers/payment-flow) to attach a subscription to a customer. With `redirectMode: "always"`, a checkout URL is always returned for the customer to complete payment or confirm the plan change.
```typescript TypeScript theme={null}
import { Autumn } from "autumn-js";
const autumn = new Autumn({ secretKey: "am_sk_..." });
const response = await autumn.billing.attach({
customerId: "user_123",
planId: "pro",
redirectMode: "always",
});
// Redirect customer to complete payment or confirm plan change
redirect(response.paymentUrl);
```
```python Python theme={null}
import asyncio
from autumn_sdk import Autumn
autumn = Autumn("am_sk_...")
async def main():
response = await autumn.billing.attach(
customer_id="user_123",
plan_id="pro",
redirect_mode="always",
)
# Redirect customer to response.payment_url
asyncio.run(main())
```
```bash cURL theme={null}
curl -X POST "https://api.useautumn.com/v1/attach" \
-H "Authorization: Bearer am_sk_..." \
-H "Content-Type: application/json" \
-d '{
"customer_id": "user_123",
"plan_id": "pro",
"redirect_mode": "always"
}'
```
```json theme={null}
{
"id": "user_123",
"name": "Jane Smith",
"email": "jane@example.com",
"createdAt": 1771409161016,
"fingerprint": null,
"stripeId": "cus_U0BKxpq1mFhuJO",
"env": "sandbox",
"metadata": {},
"sendEmailReceipts": false,
"billingControls": {
"autoTopups": []
},
"subscriptions": [
{
"planId": "pro",
"autoEnable": false,
"addOn": false,
"status": "active",
"pastDue": false,
"canceledAt": null,
"expiresAt": null,
"trialEndsAt": null,
"startedAt": 1771431921437,
"currentPeriodStart": 1771431921437,
"currentPeriodEnd": 1773851121437,
"quantity": 1
}
],
"purchases": [],
"balances": {
"messages": {
"featureId": "messages",
"granted": 1000,
"remaining": 1000,
"usage": 0,
"unlimited": false,
"overageAllowed": false,
"maxPurchase": null,
"nextResetAt": 1773851121437,
"breakdown": [
{
"id": "cus_ent_abc123",
"planId": "pro",
"includedGrant": 1000,
"prepaidGrant": 0,
"remaining": 1000,
"usage": 0,
"unlimited": false,
"reset": {
"interval": "month",
"resetsAt": 1773851121437
},
"price": null,
"expiresAt": null
}
]
}
}
}
```
When a subscription is created, Autumn:
1. Creates a Stripe subscription with the plan's prices
2. Grants the customer their included [balances](/documentation/concepts/balances) for each consumable feature
3. Starts the billing cycle -- balances reset automatically at the start of each period
## Billing intervals
Plans support the following billing intervals:
| Interval | Description |
| ------------- | --------------------- |
| `week` | Billed every week |
| `month` | Billed every month |
| `quarter` | Billed every 3 months |
| `semi_annual` | Billed every 6 months |
| `year` | Billed annually |
You can create a separate plan for each interval you want to support. For example, if you want to support monthly and annual plans, you can create a `pro_monthly` plan and a `pro_annual` plan.
You can also configure a custom `interval_count` to charge at non-standard intervals (e.g., every 2 months).
### Billing interval vs reset interval
The billing interval (how often the customer is charged) and the reset interval (how often their feature balance replenishes) are configured independently. They don't have to match.
> **Example**
> A plan billed at \$200/year could grant 100 messages/month. The customer pays once a year, but their message balance resets to 100 every month.
This is useful when you want to offer an annual discount while still metering usage on a shorter cycle.
## Managing subscriptions
Once a customer has an active subscription, you can manage upgrades, downgrades, and cancellations. See [Managing Subscriptions](/documentation/customers/subscription-lifecycle) for details on:
* **Upgrades** — prorated charges for switching to a higher-priced plan
* **Downgrades** — scheduled at end of billing period
* **Cancellations** — immediate or end-of-period
## Subscription statuses
| Status | Description |
| ----------- | ----------------------------------------------------------------------------- |
| `active` | Subscription is in good standing |
| `trialing` | Customer is in a [free trial](/documentation/modelling-pricing/trials) period |
| `past_due` | Payment failed, needs attention |
| `scheduled` | Will activate at end of current billing period (e.g., downgrade) |
| `expired` | Subscription has ended |
# Rewards and Referrals
Source: https://docs.useautumn.com/documentation/modelling-pricing/rewards
Learn how to use rewards and referrals to incentivize your customers.
Rewards like discounts and free products are a powerful way to incentivize customers. You can give these rewards directly via promo codes, or automatically through a referral program.
## Rewards
Autumn's rewards are an enhanced layer over Stripe's coupons. You can create:
* **Percentage discounts** — a percentage off invoices
* **Fixed discounts** — a fixed amount off invoices
* **Free products** — grant a free add-on product to customers
### Setting up
1. Navigate to the **Products** page, and click the **Rewards** tab
2. Click **"+ Reward"**
3. Fill out the fields: Name, Promo Code, Discount value
4. Select which products it should apply to
5. Click **"Create"**
### Free products
You can give away any add-on product to a customer with a promo code.
> **Example**
> A customer has access to 50 AI messages per month. They redeem a code for a free booster pack of an additional 100 messages per month.
To create a free product reward, under reward **Type**, select "Free Product". Then choose the add-on product from the selector. You must have at least one add-on product created before doing this.
Free product promo codes cannot be redeemed through Stripe's checkout page.
Use the redeem endpoint instead.
### Using the CLI
Discount coupons and feature grants can also live in your `autumn.config.ts`, in the `rewards` list. A feature grant gives free usage of a feature when a code is redeemed. See the [config reference](/cli/config#rewards) for every field.
```ts autumn.config.ts theme={null}
import { atmn, coupon, feature, featureGrant } from "atmn";
export const messages = feature({
featureId: "messages",
name: "Messages",
type: "metered",
consumable: true,
});
export const launchDiscount = coupon({
id: "launch20",
name: "Launch discount",
type: "percentage_discount",
value: 20,
duration: { type: "months", length: 3 },
planIds: null,
promoCodes: [{ code: "LAUNCH20" }],
});
export const welcomeMessages = featureGrant({
id: "welcome_messages",
name: "Welcome messages",
grants: [
{
featureId: messages.featureId,
included: 500,
expiry: { type: "month", length: 1 },
},
],
promoCodes: [{ code: "WELCOME", maxUses: null }],
});
export default atmn({
features: [messages],
rewards: [launchDiscount, welcomeMessages],
});
```
Preview with `atmn push`, then apply with `atmn push --yes`.
Free product rewards are managed in the dashboard only. The CLI leaves them as they are.
## Referral Programs
Referral programs automatically grant rewards to customers who bring on new customers. You define the program in the Dashboard or your CLI config, then implement it in your application with just two API calls.
### Setting up
1. Navigate to the **Products** page, and click the **Rewards** tab
2. Click **"+ Referral Program"**
3. Give the program an **ID** (you'll use this in the API) and select a **reward** to grant
4. Choose the **trigger event** — when the new customer signs up, or when they purchase a product
5. Set a **max redemptions** limit (how many times one referrer can be rewarded)
6. Choose **who receives the reward** — the referrer only, or both the referrer and the new customer
### Referral program configuration
| Field | Description |
| --------------- | -------------------------------------------------------------------- |
| Program ID | Identifier used to refer to the program in the API |
| Reward | The reward to grant (discount or free product) |
| Trigger event | `customer_creation` (on sign up) or `checkout` (on product purchase) |
| Products | Which products trigger the reward (checkout trigger only) |
| Exclude trial | Skip triggering for trial subscriptions |
| Max redemptions | Limit how many times one referrer's code can be used |
| Received by | `referrer` only, or `all` (both referrer and redeemer) |
In the CLI config, a referral program is a `referralProgram()` entry in the `referralPrograms` list:
```ts autumn.config.ts theme={null}
import { atmn, coupon, referralProgram } from "atmn";
export const freeMonth = coupon({
id: "free-month",
name: "Free month",
type: "percentage_discount",
value: 100,
duration: { type: "months", length: 1 },
planIds: null,
promoCodes: [],
});
export const referrals = referralProgram({
id: "friend_referral",
rewardId: "free-month",
redeemOn: "customer_creation",
receivedBy: "all",
maxRedemptions: 10,
});
export default atmn({
rewards: [freeMonth],
referralPrograms: [referrals],
});
```
### Creating a referral code
Generate a referral code for the customer making the referral:
```typescript TypeScript theme={null}
import { Autumn } from "autumn-js";
const autumn = new Autumn({ secretKey: "am_sk_test_1234" });
const response = await autumn.referrals.createCode({
customerId: "user_123",
programId: "free-month",
});
console.log(response.code); // "4EXWV1"
```
```python Python theme={null}
from autumn_sdk import Autumn
autumn = Autumn("am_sk_test_1234")
response = await autumn.referrals.create_code(
customer_id="user_123",
program_id="free-month",
)
print(response.code) # "4EXWV1"
```
```bash cURL theme={null}
curl -X POST 'https://api.useautumn.com/v1/referrals.create_code' \
-H 'Authorization: Bearer am_sk_test_1234' \
-H 'Content-Type: application/json' \
-d '{
"customer_id": "user_123",
"program_id": "free-month"
}'
```
```json theme={null}
{
"code": "4EXWV1",
"customerId": "user_123",
"createdAt": 1744797427206
}
```
### Redeeming a referral code
From the new customer, redeem the referral code:
```typescript TypeScript theme={null}
import { Autumn } from "autumn-js";
const autumn = new Autumn({ secretKey: "am_sk_test_1234" });
const response = await autumn.referrals.redeemCode({
code: "4EXWV1",
customerId: "new_user_123",
});
console.log(response.rewardId); // "free-month"
```
```python Python theme={null}
from autumn_sdk import Autumn
autumn = Autumn("am_sk_test_1234")
response = await autumn.referrals.redeem_code(
code="4EXWV1",
customer_id="new_user_123",
)
print(response.reward_id) # "free-month"
```
```bash cURL theme={null}
curl -X POST 'https://api.useautumn.com/v1/referrals.redeem_code' \
-H 'Authorization: Bearer am_sk_test_1234' \
-H 'Content-Type: application/json' \
-d '{
"code": "4EXWV1",
"customer_id": "new_user_123"
}'
```
```json theme={null}
{
"id": "rr_2vo3Jt9oqF6XgAlWI1MjYktv4dB",
"customerId": "new_user_123",
"rewardId": "free-month",
"referrer": {
"id": "user_123",
"name": "Alice",
"email": "alice@example.com",
"createdAt": 1744700000000
},
"redeemer": {
"id": "new_user_123",
"name": "Bob",
"email": "bob@example.com",
"createdAt": 1744797427206
}
}
```
### How it works
1. A referrer generates a unique code via the [create code](/api-reference/referrals/createReferralCode) endpoint
2. A new customer redeems the code via the [redeem code](/api-reference/referrals/redeemReferralCode) endpoint
3. If the trigger is `customer_creation`, the reward is applied immediately on redemption
4. If the trigger is `checkout`, the reward is applied when the redeemer purchases an eligible product
5. The reward is granted to the referrer only, or both referrer and redeemer, depending on the program configuration
### Validation rules
* A customer **cannot redeem their own** referral code
* A customer can only **redeem one code per referral program**
* Referral codes respect the **max redemptions** limit set on the program
* If **exclude trial** is enabled, checkout rewards won't trigger for trial subscriptions
In the customer details page, you can see which customers have made referrals and been referred.
# Rollovers
Source: https://docs.useautumn.com/documentation/modelling-pricing/rollovers
Allow unused balances to carry over to the next billing period
Rollovers let unused feature balances carry forward to the next billing cycle instead of being lost at reset. This gives customers more flexibility and prevents wasted allocation.
> **Example**
> A customer on a plan with 1,000 credits/month only uses 600 in January. With rollovers enabled, the remaining 400 credits carry over — giving them 1,400 credits available in February.
## Setting up
Add a `rollover` config to a plan item:
```ts autumn.config.ts theme={null}
import { atmn, feature, plan } from "atmn";
export const credits = feature({
featureId: "credits",
name: "Credits",
type: "metered",
consumable: true,
});
export const pro = plan({
planId: "pro",
versionSlug: "v1",
active: true,
name: "Pro",
price: { amount: 20, interval: "month" },
items: [
{
featureId: credits.featureId,
included: 1000,
reset: { interval: "month" },
rollover: {
max: 2000,
expiryDurationType: "forever",
expiryDurationLength: 1,
},
},
],
});
export default atmn({ features: [credits], plans: [pro] });
```
Preview with `atmn push`, then apply with `atmn push --yes`.
1. Navigate to **Plans** and edit a plan
2. Select a **consumable** feature on the plan
3. Under **Advanced**, toggle on **Rollovers**
4. Set the **maximum rollover cap** — the most unused balance that can be carried over (leave empty for no cap)
5. Set the **expiry**:
* **Forever** — rollover balances never expire
* **Month** — rollover balances expire after a set number of months
6. Save the plan
## Rollover configuration
| Field | Description |
| ---------------------- | -------------------------------------------------------------------------------- |
| `max` | Maximum amount that can roll over. Set to `null` for no cap. |
| `expiryDurationType` | `"forever"` (never expires) or `"month"` (expires after N months) |
| `expiryDurationLength` | Number of months until rollover balances expire. Ignored if type is `"forever"`. |
## How rollovers work
At the end of each billing cycle, when a feature's balance resets:
1. Autumn checks how much unused balance remains
2. If rollovers are configured, the unused balance is saved as a **rollover balance**
3. The feature resets to its granted amount, and the rollover is added on top
4. If a `max` cap is set, the oldest rollover balances are trimmed first (FIFO)
5. Expired rollover balances are removed automatically
## Viewing rollover balances
Rollover balances appear in the `breakdown` array when you retrieve a customer's balances. Each rollover entry has its own expiry date:
```json theme={null}
{
"balances": {
"credits": {
"included_usage": 1400,
"balance": 1400,
"usage": 0,
"breakdown": [
{
"plan_id": "pro",
"included_usage": 1000,
"balance": 1000,
"usage": 0,
"interval": "month",
"next_reset_at": 1745193600000
},
{
"id": "roll_abc123",
"included_usage": 400,
"balance": 400,
"usage": 0,
"interval": "one_off",
"expires_at": null
}
]
}
}
}
```
## Deduction order
Rollovers are deducted **before** a customer's main balances for the same feature. Within the rollover pool, balances are consumed in `expires_at` order: soonest-expiring first, with rollovers that never expire going last. Only once all rollover balances are drained does Autumn fall through to the regular [deduction order](/documentation/concepts/balances#deduction-order) over the main entitlements.
This means carried-over balance is used up before fresh monthly allocation, so rollovers you're about to lose to expiry get spent first.
> **Example**
> A customer has a 1,000 credits/month balance that just reset, plus a 400 credits rollover from last month. They use 300 credits.
> Autumn deducts all 300 from the rollover, leaving 100 credits in rollover and the full 1,000 credits monthly untouched.
Rollovers are only available on `consumable` features with a reset interval. Non-consumable features (like seats) don't reset and therefore don't support rollovers.
## Entity rollovers
If you're using [entity plans](/documentation/modelling-pricing/entity-plans), rollovers are tracked per entity. Each entity's unused balance rolls over independently.
# Spend Limits & Usage Alerts
Source: https://docs.useautumn.com/documentation/modelling-pricing/spend-limits
Cap overage spending and get notified when usage crosses thresholds
Spend limits let you cap how much overage a customer (or entity) can accumulate on a usage-based feature. Without a spend limit, usage-based features allow unlimited overage — the customer is billed for whatever they use. With a spend limit, Autumn blocks usage once the overage reaches the configured cap.
> **Example**
> A customer is on a plan with 1,000 API calls included per month and \$1 per 1,000 additional calls. You set a spend limit of 5,000 on the `api_calls` feature. The customer can use up to 6,000 total API calls (1,000 included + 5,000 overage), and is blocked after that.
## Prerequisites
Spend limits apply to **usage-based** features — features with overage pricing that allow usage beyond the included amount. If a feature doesn't allow overage, spend limits have no effect.
You'll need a plan with a usage-based price on the feature you want to cap:
```ts autumn.config.ts theme={null}
import { atmn, feature, plan } from "atmn";
export const apiCalls = feature({
featureId: "api_calls",
name: "API Calls",
type: "metered",
consumable: true,
});
export const pro = plan({
planId: "pro",
versionSlug: "v1",
active: true,
name: "Pro",
price: { amount: 20, interval: "month" },
items: [
{
featureId: apiCalls.featureId,
included: 1000,
price: {
amount: 1,
interval: "month",
billingUnits: 1000,
billingMethod: "usage_based",
},
},
],
});
export default atmn({ features: [apiCalls], plans: [pro] });
```
Preview with `atmn push`, then apply with `atmn push --yes`. Then configure spend limits per customer via the API (see below).
1. Navigate to **Plans** and create or edit a plan
2. Add a **consumable** feature (e.g., "API Calls")
3. Set an **included** amount (e.g., 1,000)
4. Add a **price** with **Billing method: Usage-based**
5. Save the plan
Spend limits are then configured per customer via the API.
## Configuring spend limits
Spend limits are set per-customer (or per-entity) via the API, not at the plan level. Update a customer's `billingControls` to add spend limits:
```typescript TypeScript theme={null}
import { Autumn } from "autumn-js";
const autumn = new Autumn({ secretKey: "am_sk_..." });
await autumn.customers.update({
customerId: "user_123",
billingControls: {
spendLimits: [{
featureId: "api_calls",
enabled: true,
overageLimit: 5000,
}],
},
});
```
```python Python theme={null}
from autumn_sdk import Autumn
autumn = Autumn("am_sk_...")
await autumn.customers.update(
customer_id="user_123",
billing_controls={
"spend_limits": [{
"feature_id": "api_calls",
"enabled": True,
"overage_limit": 5000,
}],
},
)
```
```bash cURL theme={null}
curl -X POST "https://api.useautumn.com/v1/customers/update" \
-H "Authorization: Bearer am_sk_..." \
-H "Content-Type: application/json" \
-d '{
"customer_id": "user_123",
"billing_controls": {
"spend_limits": [{
"feature_id": "api_calls",
"enabled": true,
"overage_limit": 5000
}]
}
}'
```
## Spend limit fields
| Field | Type | Description |
| ---------------------- | ------------------ | --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| `feature_id` | string | The feature to apply the spend limit to |
| `enabled` | boolean | Whether the spend limit is active |
| `overage_limit` | number (optional) | Maximum overage units allowed beyond the included amount |
| `skip_overage_billing` | boolean (optional) | When `true`, overage on this feature is never billed — usage beyond the included amount is not added to the customer's invoice. Usage tracking and balance resets are unaffected. |
The `overage_limit` is measured in the same units as the feature's balance — not in dollars. For example, if your feature is "API calls", an `overage_limit` of 5,000 means 5,000 additional API calls beyond the included amount.
## Skipping overage billing
Set `skip_overage_billing` to `true` on a spend limit to let a customer use overage without being charged for it. Usage tracking, `check` responses, and end-of-cycle balance resets all behave as normal — the overage line items are simply never added to the customer's invoice.
```typescript TypeScript theme={null}
await autumn.customers.update({
customerId: "user_123",
billingControls: {
spendLimits: [{
featureId: "api_calls",
enabled: true,
skipOverageBilling: true,
}],
},
});
```
```python Python theme={null}
await autumn.customers.update(
customer_id="user_123",
billing_controls={
"spend_limits": [{
"feature_id": "api_calls",
"enabled": True,
"skip_overage_billing": True,
}],
},
)
```
```bash cURL theme={null}
curl -X POST "https://api.useautumn.com/v1/customers/update" \
-H "Authorization: Bearer am_sk_..." \
-H "Content-Type: application/json" \
-d '{
"customer_id": "user_123",
"billing_controls": {
"spend_limits": [{
"feature_id": "api_calls",
"enabled": true,
"skip_overage_billing": true
}]
}
}'
```
The spend limit must be `enabled` and have a `feature_id`. It can also be set on an [entity](/documentation/customers/feature-entities) — resolution is per-feature, and the nearest configuration wins: entity-level spend limit, then customer-level, then plan-level billing controls.
Combine `skip_overage_billing` with an `overage_limit` to allow a bounded amount of free overage: the customer is blocked once they hit the cap, and the overage they did use is never billed.
## How it works
1. The customer uses a usage-based feature and begins accumulating overage beyond their included amount
2. On each `check` or `track` call, Autumn computes total overage across all of the customer's usage-based entitlements for that feature
3. If the total overage would exceed the `overage_limit`, Autumn blocks the usage — `check` returns `allowed: false`, and `track` will not deduct beyond the limit
Spend limits aggregate overage across **all** of the customer's entitlements for a given feature. If a customer has the same feature on multiple plans (e.g., a base plan and an add-on), the total overage across both is compared against the spend limit.
## Checking access with spend limits
When a spend limit is configured, the `check` endpoint accounts for it in the `allowed` response:
```typescript TypeScript theme={null}
const { data } = await autumn.check({
customerId: "user_123",
featureId: "api_calls",
});
if (!data.allowed) {
// Customer has hit their spend limit
}
```
```python Python theme={null}
response = await autumn.check(
customer_id="user_123",
feature_id="api_calls",
)
if not response.allowed:
# Customer has hit their spend limit
```
```bash cURL theme={null}
curl -X POST "https://api.useautumn.com/v1/check" \
-H "Authorization: Bearer am_sk_..." \
-H "Content-Type: application/json" \
-d '{
"customer_id": "user_123",
"feature_id": "api_calls"
}'
```
```json theme={null}
{
"allowed": true,
"customerId": "user_123",
"requiredBalance": 1,
"balance": {
"featureId": "api_calls",
"granted": 1000,
"remaining": -3000,
"usage": 4000,
"unlimited": false,
"overageAllowed": true,
"nextResetAt": 1757192635393
}
}
```
The customer has used 4,000 API calls (3,000 overage) against a spend limit of 5,000. They still have 2,000 overage units remaining, so `allowed` is `true`.
```json theme={null}
{
"allowed": false,
"customerId": "user_123",
"requiredBalance": 1,
"balance": {
"featureId": "api_calls",
"granted": 1000,
"remaining": -5000,
"usage": 6000,
"unlimited": false,
"overageAllowed": true,
"nextResetAt": 1757192635393
}
}
```
The customer has reached their 5,000 overage limit (6,000 total usage). `allowed` is `false` even though the feature allows overage.
## Entity-level spend limits
You can also set spend limits on individual [entities](/documentation/customers/feature-entities) (users, workspaces, etc.) under a customer. Entity-level spend limits override customer-level limits for that entity.
```typescript TypeScript theme={null}
await autumn.entities.update({
customerId: "user_123",
entityId: "workspace_a",
billingControls: {
spendLimits: [{
featureId: "api_calls",
enabled: true,
overageLimit: 2000,
}],
},
});
```
```python Python theme={null}
await autumn.entities.update(
customer_id="user_123",
entity_id="workspace_a",
billing_controls={
"spend_limits": [{
"feature_id": "api_calls",
"enabled": True,
"overage_limit": 2000,
}],
},
)
```
```bash cURL theme={null}
curl -X POST "https://api.useautumn.com/v1/entities/update" \
-H "Authorization: Bearer am_sk_..." \
-H "Content-Type: application/json" \
-d '{
"customer_id": "user_123",
"entity_id": "workspace_a",
"billing_controls": {
"spend_limits": [{
"feature_id": "api_calls",
"enabled": true,
"overage_limit": 2000
}]
}
}'
```
This limits `workspace_a` to 2,000 overage API calls, regardless of the customer-level spend limit.
## Disabling a spend limit
To remove a spend limit, set `enabled` to `false` or omit the `overageLimit`:
```typescript TypeScript theme={null}
await autumn.customers.update({
customerId: "user_123",
billingControls: {
spendLimits: [{
featureId: "api_calls",
enabled: false,
}],
},
});
```
```python Python theme={null}
await autumn.customers.update(
customer_id="user_123",
billing_controls={
"spend_limits": [{
"feature_id": "api_calls",
"enabled": False,
}],
},
)
```
```bash cURL theme={null}
curl -X POST "https://api.useautumn.com/v1/customers/update" \
-H "Authorization: Bearer am_sk_..." \
-H "Content-Type: application/json" \
-d '{
"customer_id": "user_123",
"billing_controls": {
"spend_limits": [{
"feature_id": "api_calls",
"enabled": false
}]
}
}'
```
## Interaction with max purchase (usage limits)
Plans can also have a **max purchase** limit (also called "usage limit") set on a plan item. This is a per-entitlement cap configured in the plan editor or CLI, and applies globally to all customers on that plan.
When **both** a spend limit and a max purchase are configured for the same feature, the **spend limit takes precedence**. The per-entitlement max purchase is not enforced while a spend limit is active.
> **Example**
> A plan item has a max purchase of 1,000 (so customers can use up to 1,000 overage units). But you set a customer-level spend limit of 5,000 on that feature. The customer can use up to 5,000 overage units — the spend limit overrides the plan-level max purchase for that customer.
This lets you use max purchase as a sensible default for all customers, then selectively raise (or lower) the cap for specific customers using spend limits.
If you set a spend limit **higher** than the plan's max purchase, the customer will be able to exceed the plan-level limit. If you set it **lower**, the customer will be capped before hitting the plan-level limit. In either case, the spend limit is the one that's enforced.
## Spend limits vs max purchase
| | Spend Limits | Max Purchase |
| ----------------- | ---------------------------------------------------------------------------------------------------------------------- | ------------------------------------------ |
| **Configured on** | Customer or entity | Plan item (in the plan editor) |
| **Scope** | Aggregated across all entitlements for a feature | Per-entitlement |
| **Set via** | [Update Customer](/api-reference/customers/updateCustomer) / [Update Entity](/api-reference/entities/updateEntity) API | Dashboard or CLI when creating a plan |
| **Dynamic** | Yes — can be changed at any time per-customer | No — applies to all customers on the plan |
| **Precedence** | Overrides max purchase when set | Used as default when no spend limit is set |
| **Use case** | Per-customer overage caps (e.g., enterprise spending controls) | Global safety limits for a plan tier |
## Usage Alerts
Usage alerts send a webhook when a customer's usage crosses a threshold you define. You can use this to take an action like sending a warning email, prompting an upgrade, or flagging the account internally.
## Configuring usage alerts
Usage alerts are set per-customer (or per-entity) via the API, using the same `billingControls` field as spend limits. There are two threshold types:
* **`usage`** — fires when absolute usage reaches a specific count
* **`usage_percentage`** — fires when usage reaches a percentage of the included allowance
```typescript TypeScript theme={null}
import { Autumn } from "autumn-js";
const autumn = new Autumn({ secretKey: "am_sk_..." });
await autumn.customers.update({
customerId: "user_123",
billingControls: {
usageAlerts: [{
featureId: "api_calls",
threshold: 800,
thresholdType: "usage",
enabled: true,
name: "Approaching limit",
}],
},
});
```
```python Python theme={null}
from autumn_sdk import Autumn
autumn = Autumn("am_sk_...")
await autumn.customers.update(
customer_id="user_123",
billing_controls={
"usage_alerts": [{
"feature_id": "api_calls",
"threshold": 800,
"threshold_type": "usage",
"enabled": True,
"name": "Approaching limit",
}],
},
)
```
```bash cURL theme={null}
curl -X POST "https://api.useautumn.com/v1/customers/update" \
-H "Authorization: Bearer am_sk_..." \
-H "Content-Type: application/json" \
-d '{
"customer_id": "user_123",
"billing_controls": {
"usage_alerts": [{
"feature_id": "api_calls",
"threshold": 800,
"threshold_type": "usage",
"enabled": true,
"name": "Approaching limit"
}]
}
}'
```
For a percentage-based alert, use `threshold_type: "usage_percentage"` with a value between 0 and 100:
```typescript TypeScript theme={null}
await autumn.customers.update({
customerId: "user_123",
billingControls: {
usageAlerts: [{
featureId: "api_calls",
threshold: 80,
thresholdType: "usage_percentage",
enabled: true,
name: "80% usage warning",
}],
},
});
```
```python Python theme={null}
await autumn.customers.update(
customer_id="user_123",
billing_controls={
"usage_alerts": [{
"feature_id": "api_calls",
"threshold": 80,
"threshold_type": "usage_percentage",
"enabled": True,
"name": "80% usage warning",
}],
},
)
```
```bash cURL theme={null}
curl -X POST "https://api.useautumn.com/v1/customers/update" \
-H "Authorization: Bearer am_sk_..." \
-H "Content-Type: application/json" \
-d '{
"customer_id": "user_123",
"billing_controls": {
"usage_alerts": [{
"feature_id": "api_calls",
"threshold": 80,
"threshold_type": "usage_percentage",
"enabled": true,
"name": "80% usage warning"
}]
}
}'
```
The `usage_percentage` threshold is calculated against the **included** allowance only. If the customer has overage enabled with a spend limit or max purchase, the percentage still refers to the included balance — not the total available usage.
### Usage alert fields
| Field | Type | Description |
| ---------------- | ----------------- | --------------------------------------------------------------------------------------------------------- |
| `feature_id` | string (optional) | The feature to monitor. If omitted, applies to all features. |
| `threshold` | number | The value that triggers the alert. Absolute count for `usage`, percentage (0-100) for `usage_percentage`. |
| `threshold_type` | string | `"usage"` for an absolute count, `"usage_percentage"` for a percentage of the included allowance. |
| `enabled` | boolean | Whether the alert is active. Defaults to `true`. |
| `name` | string (optional) | A label to distinguish multiple alerts on the same feature. |
## How usage alerts work
1. On each `track` call, Autumn compares the customer's old and new usage against each enabled alert
2. If the usage crosses the threshold (old usage was below, new usage is at or above), Autumn fires a `balances.usage_alert_triggered` webhook
3. The alert fires **once** per threshold crossing — it won't re-fire on subsequent track calls unless usage drops below the threshold and crosses it again
Alerts also work at the entity level. If you configure alerts on an [entity](/documentation/customers/feature-entities), they fire based on that entity's usage independently.
See the [balances.usage\_alert\_triggered webhook schema](/api-reference/webhooks/balancesUsageAlertTriggered) for the full payload reference.
## Multiple usage alerts
You can configure multiple alerts on the same feature or across different features. Each alert fires independently when its threshold is crossed.
```typescript TypeScript theme={null}
await autumn.customers.update({
customerId: "user_123",
billingControls: {
usageAlerts: [
{
featureId: "api_calls",
threshold: 500,
thresholdType: "usage",
enabled: true,
name: "500 calls used",
},
{
featureId: "api_calls",
threshold: 90,
thresholdType: "usage_percentage",
enabled: true,
name: "90% allowance used",
},
],
},
});
```
```python Python theme={null}
await autumn.customers.update(
customer_id="user_123",
billing_controls={
"usage_alerts": [
{
"feature_id": "api_calls",
"threshold": 500,
"threshold_type": "usage",
"enabled": True,
"name": "500 calls used",
},
{
"feature_id": "api_calls",
"threshold": 90,
"threshold_type": "usage_percentage",
"enabled": True,
"name": "90% allowance used",
},
],
},
)
```
```bash cURL theme={null}
curl -X POST "https://api.useautumn.com/v1/customers/update" \
-H "Authorization: Bearer am_sk_..." \
-H "Content-Type: application/json" \
-d '{
"customer_id": "user_123",
"billing_controls": {
"usage_alerts": [
{
"feature_id": "api_calls",
"threshold": 500,
"threshold_type": "usage",
"enabled": true,
"name": "500 calls used"
},
{
"feature_id": "api_calls",
"threshold": 90,
"threshold_type": "usage_percentage",
"enabled": true,
"name": "90% allowance used"
}
]
}
}'
```
In this example, the customer will receive two separate webhook events as they use their API calls: one when they hit 500 absolute calls, and another when they reach 90% of their included allowance.
# Trials
Source: https://docs.useautumn.com/documentation/modelling-pricing/trials
Let customers try paid plans before committing
Free trials give customers temporary access to a paid plan before they're charged. Autumn supports two trial modes: **card required** (collect payment info upfront, bill when trial ends) and **card not required** (no payment info needed, access expires automatically).
> **Example**
> A SaaS tool offers a 14-day free trial of their Pro plan. If the customer doesn't cancel, billing begins on day 15.
## Setting up
Add a `freeTrial` object to your plan:
```ts autumn.config.ts expandable theme={null}
import { atmn, feature, plan } from "atmn";
export const messages = feature({
featureId: "messages",
name: "Messages",
type: "metered",
consumable: true,
});
export const pro = plan({
planId: "pro",
versionSlug: "v1",
active: true,
name: "Pro",
group: "main",
price: { amount: 20, interval: "month" },
freeTrial: {
durationLength: 14,
durationType: "day",
cardRequired: true,
},
items: [
{
featureId: messages.featureId,
included: 1000,
reset: { interval: "month" },
},
],
});
export default atmn({ features: [messages], plans: [pro] });
```
Trial duration types: `day`, `month`, `year`.
Preview with `atmn push`, then apply with `atmn push --yes`.
1. Navigate to **Plans** and open your plan (or create a new one)
2. Under **Plan Settings**, toggle on **Free Trial**
3. Set the **duration** (e.g., 14 days)
4. Choose whether a **card is required**:
* **Card required**: customer goes through Stripe Checkout, but isn't charged until the trial ends
* **Card not required**: no checkout needed — the plan can be attached directly
5. Save your changes
## Card required trials
When `cardRequired` is `true`, the customer must provide payment information to start the trial. Stripe creates a subscription with a trial period — no charge occurs until the trial ends.
```typescript TypeScript theme={null}
import { Autumn } from "autumn-js";
const autumn = new Autumn({ secretKey: "am_sk_..." });
const { data } = await autumn.checkout({
customer_id: "user_123",
plan_id: "pro",
});
// Returns Stripe Checkout URL — customer adds card and starts trial
```
```python Python theme={null}
from autumn_sdk import Autumn
autumn = Autumn("am_sk_...")
response = await autumn.checkout(
customer_id="user_123",
plan_id="pro",
)
# Returns Stripe Checkout URL
```
```bash cURL theme={null}
curl -X POST "https://api.useautumn.com/v1/checkout" \
-H "Authorization: Bearer am_sk_..." \
-H "Content-Type: application/json" \
-d '{
"customer_id": "user_123",
"plan_id": "pro"
}'
```
If the customer doesn't cancel before the trial ends, their card is automatically charged.
## Card not required trials
When `cardRequired` is `false`, no checkout is needed. You can attach the plan directly:
```typescript TypeScript theme={null}
const { data } = await autumn.attach({
customer_id: "user_123",
plan_id: "pro",
});
```
```python Python theme={null}
response = await autumn.attach(
customer_id="user_123",
plan_id="pro",
)
```
```bash cURL theme={null}
curl -X POST "https://api.useautumn.com/v1/attach" \
-H "Authorization: Bearer am_sk_..." \
-H "Content-Type: application/json" \
-d '{
"customer_id": "user_123",
"plan_id": "pro"
}'
```
When the trial expires, the customer loses access unless they add a payment method. If a [free plan](/documentation/modelling-pricing/free-plans) with `autoEnable` exists in the same group, it's activated as a fallback.
You can combine `autoEnable` with `cardRequired: false` to create an **auto-trial** plan. The trial starts automatically when a customer is created, and expires after the trial period — no API call needed.
## Checking trial status
The customer's subscription includes a `trial_ends_at` timestamp when a trial is active. You can also expand `trials_used` to see which trials a customer has consumed:
```typescript TypeScript theme={null}
const { data } = await autumn.customers.get("user_123");
for (const sub of data.subscriptions) {
if (sub.trialEndsAt) {
console.log(`Trialing until ${new Date(sub.trialEndsAt)}`);
}
}
```
```python Python theme={null}
response = await autumn.customers.get("user_123")
for sub in response.subscriptions:
if sub.trial_ends_at:
print(f"Trialing until {sub.trial_ends_at}")
```
## Trial deduplication
Each customer can only use a plan's trial **once**. If they try to attach the same plan again, the trial is skipped and they're billed immediately.
To prevent trial abuse across multiple accounts, set a `fingerprint` when creating a customer (e.g., device ID, browser fingerprint). Autumn checks whether any customer with the same fingerprint has already used the trial.
```typescript TypeScript theme={null}
await autumn.customers.create({
id: "user_456",
name: "Jane Doe",
email: "jane@example.com",
fingerprint: "device_abc123",
});
```
```python Python theme={null}
await autumn.customers.create(
id="user_456",
name="Jane Doe",
email="jane@example.com",
fingerprint="device_abc123",
)
```
```bash cURL theme={null}
curl -X POST "https://api.useautumn.com/v1/customers" \
-H "Authorization: Bearer am_sk_..." \
-H "Content-Type: application/json" \
-d '{
"id": "user_456",
"name": "Jane Doe",
"email": "jane@example.com",
"fingerprint": "device_abc123"
}'
```
Custom trials passed via `customize.freeTrial` always **bypass** deduplication. Use this for support cases where you want to grant a second trial.
You can check which trials a customer has already used by expanding `trials_used` on the customer object:
```typescript TypeScript theme={null}
const customer = await autumn.customers.getOrCreate({
customerId: "user_123",
expand: ["trials_used"],
});
```
```python Python theme={null}
customer = await autumn.customers.get_or_create(
customer_id="user_123",
expand=["trials_used"],
)
```
```bash cURL theme={null}
curl -X POST "https://api.useautumn.com/v1/customers" \
-H "Authorization: Bearer am_sk_..." \
-H "Content-Type: application/json" \
-d '{
"id": "user_123",
"expand": ["trials_used"]
}'
```
## Upgrades and Downgrades
When upgrading to a plan with a trial, the trial behavior depends on the customer's current state and whether the new plan has an unused trial:
| Current state | Unused trial? | Result |
| --------------------- | ------------- | --------------------------------------------------- |
| Trialing | Yes | Current trial ends. Fresh trial starts on new plan. |
| Trialing | No | Current trial ends. Billing starts immediately. |
| Active (not trialing) | Yes | Trial starts. Current cycle refunded. |
| Active (not trialing) | No | No trial. Billing starts at new price. |
When a customer downgrades during a trial, the lower plan is scheduled to activate when the trial ends. The lower plan's own trial is not applied - you cannot get a new trial on a downgrade.
You can override any of these behaviors by passing `customize.freeTrial` on the attach call. See [Overriding trial behavior](#overriding-trial-behavior) below.
## Overriding trial behavior
You can override the default trial behavior on any `/attach` or `/update-subscription` call by passing `customize.freeTrial`:
Pass a `freeTrial` object to start a trial with a custom duration. This **bypasses deduplication** — the customer always gets the trial, even if they've trialed this plan before.
```typescript TypeScript theme={null}
await autumn.attach({
customerId: "user_123",
planId: "pro",
customize: {
freeTrial: {
durationLength: 30,
durationType: "day",
cardRequired: true,
},
},
});
```
```python Python theme={null}
await autumn.attach(
customer_id="user_123",
plan_id="pro",
customize={
"free_trial": {
"duration_length": 30,
"duration_type": "day",
"card_required": True,
}
},
)
```
```bash cURL theme={null}
curl -X POST "https://api.useautumn.com/v1/attach" \
-H "Authorization: Bearer am_sk_..." \
-H "Content-Type: application/json" \
-d '{
"customer_id": "user_123",
"plan_id": "pro",
"customize": {
"free_trial": {
"duration_length": 30,
"duration_type": "day",
"card_required": true
}
}
}'
```
Pass `freeTrial: null` to skip the trial entirely and begin billing immediately — even if the plan has a trial configured.
```typescript TypeScript theme={null}
await autumn.attach({
customerId: "user_123",
planId: "pro",
customize: {
freeTrial: null,
},
});
// Charged immediately, no trial
```
```python Python theme={null}
await autumn.attach(
customer_id="user_123",
plan_id="pro",
customize={"free_trial": None},
)
```
```bash cURL theme={null}
curl -X POST "https://api.useautumn.com/v1/attach" \
-H "Authorization: Bearer am_sk_..." \
-H "Content-Type: application/json" \
-d '{
"customer_id": "user_123",
"plan_id": "pro",
"customize": { "free_trial": null }
}'
```
You can also pass `freeTrial: null` on `/update-subscription` to end an active trial early and start billing right away.
To extend a trial, call `/update-subscription` with a new `customize.freeTrial`. The new trial duration is computed **from now** — it replaces the current trial end date rather than adding to it.
```typescript TypeScript theme={null}
// Customer is 5 days into a 14-day trial.
// This gives them a fresh 14 days from now (not 14 + 9 remaining).
await autumn.updateSubscription({
customerId: "user_123",
planId: "pro",
customize: {
freeTrial: {
durationLength: 14,
durationType: "day",
},
},
});
```
```python Python theme={null}
await autumn.update_subscription(
customer_id="user_123",
plan_id="pro",
customize={
"free_trial": {
"duration_length": 14,
"duration_type": "day",
}
},
)
```
Trial extensions are **replacement**, not additive. If a customer is 5 days into a 14-day trial and you set a new 14-day trial, they get 14 days from today (19 days total from the original start), not 14 days added to the remaining 9.
## Trials with shared subscriptions
When using [entities](/documentation/modelling-pricing/entity-plans) or add-ons, trial state is shared across the same Stripe subscription. This is because Stripe manages trials at the subscription level.
You can pass in `newBillingSubscription: true` to create a new subscription for each plan, rather than merging into the existing subscription.
Here are some principles to keep in mind when using trials with shared subscriptions:
#### First entity gets the trial
When the first entity is attached with a trial plan, the trial starts on the shared subscription. Any subsequent entities attached to the same subscription **inherit the existing trial state** — they don't start their own independent trial.
#### Adding plans to a non-trialing subscription
If the subscription is **not** trialing, new plans are charged immediately — even if the product they're being attached to has a trial configured. The product's trial config is ignored for merges into an active subscription.
#### Shared trial state affects all plans
Because entities (by default) share a subscription, trial state changes affect **all** entities:
* **Entity upgrade to a plan with a trial**: a fresh trial starts, and all other entities on the subscription inherit the new trial end date.
* **Entity upgrade to a plan without a trial**: the trial ends for **all** entities, and they're all billed immediately.
* **Entity downgrade during trial**: the downgrade is scheduled for when the trial ends.
Passing `customize.freeTrial` on an entity attach or upgrade affects the **shared subscription**, so all entities are affected. Similarly, passing `freeTrial: null` ends the trial for all entities on the subscription.
## Resetting usage after trial
This feature is coming soon.
By default, feature usage during a trial carries over into the paid period. If you want usage to **reset when billing starts**, pass `transition_rules.reset_after_trial_end` with the feature IDs to reset:
```typescript TypeScript theme={null}
await autumn.attach({
customerId: "user_123",
planId: "pro",
transitionRules: {
resetAfterTrialEnd: ["messages"],
},
});
```
```python Python theme={null}
await autumn.attach(
customer_id="user_123",
plan_id="pro",
transition_rules={
"reset_after_trial_end": ["messages"],
},
)
```
```bash cURL theme={null}
curl -X POST "https://api.useautumn.com/v1/attach" \
-H "Authorization: Bearer am_sk_..." \
-H "Content-Type: application/json" \
-d '{
"customer_id": "user_123",
"plan_id": "pro",
"transition_rules": {
"reset_after_trial_end": ["messages"]
}
}'
```
This sets the feature's reset cycle to begin when the trial ends rather than when the trial starts, so the customer gets a full fresh allowance once they start paying.
# Usage-Based Pricing
Source: https://docs.useautumn.com/documentation/modelling-pricing/usage-based-pricing
Bill customers based on actual usage at the end of each billing period
Pay-per-use (usage-based) pricing charges customers based on how much of a feature they actually consume, billed at the end of each billing period. This is ideal for products where usage varies significantly between customers.
> **Example**
> A notification service charges \$1 per 1,000 notifications sent. A customer who sends 5,000 notifications in a month pays \$5 at the end of that month.
## Setting up
Create a consumable feature with a `usage_based` price:
```ts autumn.config.ts theme={null}
import { atmn, feature, plan } from "atmn";
export const notifications = feature({
featureId: "notifications",
name: "Notifications",
type: "metered",
consumable: true,
});
export const payAsYouGo = plan({
planId: "pay_as_you_go",
versionSlug: "v1",
active: true,
name: "Pay As You Go",
group: "main",
items: [
{
featureId: notifications.featureId,
included: 1000,
reset: { interval: "month" },
price: {
amount: 1,
interval: "month",
billingUnits: 1000,
billingMethod: "usage_based",
},
},
],
});
export default atmn({ features: [notifications], plans: [payAsYouGo] });
```
Preview with `atmn push`, then apply with `atmn push --yes`.
1. Navigate to **Plans** and create a plan
2. Add a **consumable** feature (e.g., notifications)
3. Set an optional **included** amount (free usage before charges begin)
4. Add a **price** with:
* **Billing method**: Usage-based
* **Amount**: price per billing unit (e.g., \$1)
* **Billing units**: the package size (e.g., 1,000 notifications)
* **Interval**: billing frequency (e.g., monthly)
5. Save the plan
## How it works
1. A customer's usage is tracked via the [track](/documentation/customers/tracking-usage) endpoint throughout the billing period
2. Usage first draws down from the **included** amount (if any) at no charge
3. Usage beyond the included amount is **overage** — billed at the configured rate
4. At the end of the billing period, Autumn generates a Stripe invoice for the total overage
Usage-based features allow overage by default. The `check` endpoint will return `allowed: true` even if the customer has exceeded their included balance, as long as a usage-based price is configured.
## Tracking usage
Track usage as it occurs — Autumn accumulates it over the billing period:
```typescript TypeScript theme={null}
import { Autumn } from "autumn-js";
const autumn = new Autumn({ secretKey: "am_sk_..." });
await autumn.track({
customer_id: "user_123",
feature_id: "notifications",
value: 500,
});
```
```python Python theme={null}
from autumn_sdk import Autumn
autumn = Autumn("am_sk_...")
await autumn.track(
customer_id="user_123",
feature_id="notifications",
value=500,
)
```
```bash cURL theme={null}
curl -X POST "https://api.useautumn.com/v1/track" \
-H "Authorization: Bearer am_sk_..." \
-H "Content-Type: application/json" \
-d '{
"customer_id": "user_123",
"feature_id": "notifications",
"value": 500
}'
```
## Checking access
Check if the customer can use the feature. For usage-based features with overage, `allowed` is `true` as long as the feature exists on the customer's plan:
```typescript TypeScript theme={null}
const { data } = await autumn.check({
customer_id: "user_123",
feature_id: "notifications",
});
console.log(data.allowed); // true (overage allowed)
console.log(data.balance);
```
```python Python theme={null}
response = await autumn.check(
customer_id="user_123",
feature_id="notifications",
)
print(response.allowed) # True (overage allowed)
print(response.balance)
```
```bash cURL theme={null}
curl -X POST "https://api.useautumn.com/v1/check" \
-H "Authorization: Bearer am_sk_..." \
-H "Content-Type: application/json" \
-d '{
"customer_id": "user_123",
"feature_id": "notifications"
}'
```
```json theme={null}
{
"allowed": true,
"customerId": "user_123",
"balance": {
"featureId": "notifications",
"granted": 1000,
"remaining": -500,
"usage": 1500,
"unlimited": false,
"overageAllowed": true,
"nextResetAt": 1757192635393
}
}
```
## Combining with free tiers
A common pattern is pairing usage-based pricing with a [free plan](/documentation/modelling-pricing/free-plans). Free users are blocked when they exceed their limit, while paying users are billed for overages.
| Plan | Over limit | Result |
| ------------- | ---------- | -------------------------------- |
| Free | Yes | Blocked (`allowed: false`) |
| Pay-as-you-go | Yes | Allowed, billed at end of period |
# Volume-Based Tiers
Source: https://docs.useautumn.com/documentation/modelling-pricing/volume-based-tiers
Charge a single rate based on the total volume of usage
Volume-based pricing uses tiers to determine a single flat charge based on the total usage volume. Unlike [graduated pricing](/documentation/modelling-pricing/graduated-pricing), where each tier has its own rate, volume-based pricing charges a single flat amount based on which tier the total usage falls into.
> **Example**
> A data platform charges:
>
> * 0–1,000 records: \$100 flat
> * 1,001–10,000 records: \$500 flat
> * 10,001+: \$1,000 flat
>
> A customer who processes 15,000 records falls into the 10,001+ tier and pays a flat **\$1,000**
>
> Compare this to graduated pricing, where each tier is charged separately and summed together
## Setting up
Use the `tiers` array with `tierBehavior: 'volume'` on a plan item price:
```ts autumn.config.ts theme={null}
import { atmn, feature, plan } from "atmn";
export const records = feature({
featureId: "records",
name: "Records Processed",
type: "metered",
consumable: true,
});
export const pro = plan({
planId: "pro",
versionSlug: "v1",
active: true,
name: "Pro",
price: { amount: 50, interval: "month" },
items: [
{
featureId: records.featureId,
reset: { interval: "month" },
price: {
tiers: [
{ to: 1000, flatAmount: 100 },
{ to: 10000, flatAmount: 500 },
{ to: "inf", flatAmount: 1000 },
],
tierBehavior: "volume",
billingMethod: "prepaid",
interval: "month",
},
},
],
});
export default atmn({ features: [records], plans: [pro] });
```
Preview with `atmn push`, then apply with `atmn push --yes`.
1. Navigate to **Plans** and create or edit a plan
2. Add a **consumable** feature
3. Under **Price**, select **Tiered**
4. Switch the tier behavior to **Volume**
5. Add tiers with the upper limit (`to`) and flat amount for each range
6. Set the billing method to **Prepaid** and the billing interval
7. Save the plan
## How volume-based pricing works
Autumn:
1. Looks at the total volume for the feature
2. Finds the tier the total falls into
3. Charges the flat amount for that tier
Volume tiers are prepaid-only.
| Total volume | Matching tier | Charge |
| ------------ | ------------- | ----------- |
| 500 | 0–1,000 | **\$100** |
| 5,000 | 1,001–10,000 | **\$500** |
| 15,000 | 10,001+ | **\$1,000** |
## Tier configuration
Each tier has the following fields:
| Field | Type | Description |
| ------------ | ----------------- | --------------------------------------------------------------------------------------- |
| `to` | number or `"inf"` | The upper boundary of this tier |
| `flatAmount` | number | Flat fee charged when the total volume falls in this tier (`flat_amount` over the API) |
| `amount` | number | Optional per-unit price applied to the total volume when this tier is the matching tier |
Tiers must be in ascending order by `to`. The final tier should use `"inf"`.
## Combining flat and per-unit amounts
Each tier can include both `flatAmount` and `amount`: a fixed fee plus a per-unit charge when that tier is the matching tier. This is useful for combining a base fee with per-unit volume pricing.
```ts theme={null}
price: {
tiers: [
{ to: 1000, amount: 0.10, flatAmount: 0 },
{ to: 10000, amount: 0.08, flatAmount: 50 },
{ to: "inf", amount: 0.05, flatAmount: 100 },
],
tierBehavior: "volume",
billingMethod: "prepaid",
interval: "month",
}
```
A customer with 5,000 records would pay: (5,000 × $0.08) + $50 = **\$450**
## Graduated vs volume-based
| | Graduated | Volume-based |
| ---------------- | ------------------------------------------ | ---------------------------------------- |
| **Rate applied** | Each tier at its own rate | Single flat amount for the matching tier |
| **Total charge** | Sum of each tier's charge | Flat amount of the matching tier |
| **Best for** | Rewarding growth with lower marginal rates | Simpler pricing with volume discounts |
See [Graduated Pricing](/documentation/modelling-pricing/graduated-pricing) for the alternative model.
# Rate Limits
Source: https://docs.useautumn.com/documentation/rate-limits
Default API rate limits and how to request increases
Autumn enforces rate limits to ensure reliable performance for all users. Limits are applied per **organization** or per **customer**, depending on the endpoint.
## Default Limits
| Endpoint Group | Limit | Window | Scope |
| ---------------------------------------- | --------------- | -------- | ---------------- |
| **Check / Entitled / Get Customer** | 10,000 requests | 1 second | Per customer |
| **Track / Usage / Balance updates** | 10,000 requests | 1 second | Per customer |
| **Attach / Cancel / Billing operations** | 30 requests | 1 minute | Per customer |
| **Events (list / aggregate / query)** | 5 requests | 1 second | Per customer |
| **List Customers** | 5 requests | 1 second | Per organization |
| **All other endpoints** | 25 requests | 1 second | Per organization |
## Scopes
* **Per customer** -- the limit applies independently to each customer you make requests for. For example, tracking usage for `customer_a` and `customer_b` each get their own 10,000 req/s allowance.
* **Per organization** -- the limit is shared across all requests from your API key, regardless of which customer the request is for.
## What happens when you hit a limit
When a rate limit is exceeded, the API returns a `429 Too Many Requests` response. Your application should back off and retry after the rate limit window resets.
## Service overload (503)
Under heavy load, customer-state endpoints (`/customers.get_or_create`, `/customers.get`, `/entities.get`) may briefly return a `503` with code `service_unavailable` and a `Retry-After` header (seconds). This is transient and unrelated to your request volume -- retry after the indicated delay. `check` and `track` are never shed this way (see [Fail-Open Defaults](/documentation/fail-open)).
## Preview endpoints are not rate limited
Preview endpoints like `/v1/attach/preview`, `/v1/billing.preview_attach`, and `/v1/billing.preview_update` are **not** subject to rate limits. You can call these freely to display pricing previews to your users.
## Requesting higher limits
The default limits are designed to handle the vast majority of use cases. If your application requires higher throughput, we can increase rate limits for your organization on a case-by-case basis.
Reach out to us on [Discord](https://discord.gg/STqxY92zuS) or email **[support@useautumn.com](mailto:support@useautumn.com)** and include:
* Your organization name
* Which endpoint group needs a higher limit
* The throughput you need
We typically respond within a few hours.
# Slack and Discord Notifications
Source: https://docs.useautumn.com/documentation/slack-discord-notifications
Send Autumn webhook events to Slack or Discord channels with rich, formatted messages using Svix transformations.
Forward Autumn webhook events to a Slack or Discord channel with ready-made
[Svix transformations](https://docs.svix.com/transformations) that turn each
event into a clean, formatted message.
## Supported events
| Event | Slack | Discord |
| -------------------------------- | :---: | :-----: |
| `customer.products.updated` | ✓ | ✓ |
| `balances.limit_reached` | ✓ | ✓ |
| `balances.usage_alert_triggered` | ✓ | ✓ |
Other event types — including Vercel Marketplace events — are skipped by the
transforms so they are never delivered to your Slack or Discord channel.
## Setup
Follow the official guide for the platform you want to use:
* [Slack — Sending messages using incoming webhooks](https://docs.slack.dev/messaging/sending-messages-using-incoming-webhooks/)
* [Discord — Intro to webhooks](https://support.discord.com/hc/en-us/articles/228383668-Intro-to-Webhooks)
Both flows give you a webhook URL that looks like
`https://hooks.slack.com/services/...` or
`https://discord.com/api/webhooks/...`. Keep it handy for the next step.
In your Autumn dashboard, go to **Developer → Webhooks** and click
**Add Endpoint**. Paste in the URL from the previous step and select the
events you want to subscribe to.
Open the endpoint you just created, switch to the **Advanced** tab, and
click **Edit transformation**.
Paste in the transform code below for the platform you're targeting,
then click **Save and Enable**.
Back on the **Advanced** tab, click **Edit** next to **Endpoint Throttling**
and set a sensible RPS (requests-per-second) limit. This prevents your
Slack or Discord channel from being flooded during high-volume events such
as bulk customer migrations or backfills.
## Transform code
Copy the transform for your platform into the **Code** editor on the
transformation page, then click **Save and Enable**.
```js Slack theme={null}
/**
* @param webhook the webhook object
* @param webhook.method destination method. Allowed values: "POST", "PUT"
* @param webhook.url current destination address
* @param webhook.eventType current webhook Event Type
* @param webhook.payload JSON payload
* @param webhook.cancel whether to cancel dispatch of the given webhook
*/
function handler(webhook) {
var AUTUMN_BASE = "https://app.useautumn.com/customers/";
var AUTUMN_USERNAME = "Autumn";
var AUTUMN_ICON_URL = "https://i.ibb.co/BHCF1ZqL/autumnicon.png";
var payload = webhook.payload || {};
var data = payload.data || payload;
// ============ customer.products.updated ============
if (webhook.eventType === "customer.products.updated") {
var scenario = data.scenario || "updated";
var customer = data.customer || {};
var entity = data.entity || null;
var product = data.updated_product || {};
var customerName = customer.name || customer.email || customer.id || "Customer";
var customerEmail = customer.email || null;
var customerId = customer.id || "";
var productName = product.name || "their plan";
if (product.version && product.version !== 1) {
productName = productName + " V" + product.version;
}
var entityLabel = null;
if (entity) {
entityLabel = entity.name || entity.id || null;
}
var meta = {
"new": { emoji: "🎉", header: "New Subscription", verb: "subscribed to" },
"upgrade": { emoji: "🚀", header: "Customer Upgraded", verb: "upgraded to" },
"downgrade": { emoji: "📉", header: "Customer Downgraded", verb: "downgraded to" },
"cancel": { emoji: "⚠️", header: "Subscription Cancelled", verb: "cancelled" },
"renew": { emoji: "🔄", header: "Subscription Uncancelled", verb: "uncancelled" },
"expired": { emoji: "💀", header: "Subscription Expired", verb: "expired on" },
"scheduled": { emoji: "📅", header: "Change Scheduled", verb: "scheduled a change to" }
}[scenario] || { emoji: "🔔", header: "Subscription Updated", verb: "updated" };
var sentence;
if (scenario === "expired") {
sentence = "*" + customerName + "*'s *" + productName + "* expired";
} else {
sentence = "*" + customerName + "* " + meta.verb + " *" + productName + "*";
}
var previewText = meta.emoji + " " + customerName + " " + meta.verb + " " + productName;
var fields = [
{ type: "mrkdwn", text: "*Customer:*\n" + customerName }
];
if (customerEmail) {
fields.push({ type: "mrkdwn", text: "*Email:*\n" + customerEmail });
}
fields.push({ type: "mrkdwn", text: "*Product:*\n" + productName });
fields.push({ type: "mrkdwn", text: "*Scenario:*\n`" + scenario + "`" });
if (entityLabel) {
fields.push({ type: "mrkdwn", text: "*Entity:*\n" + entityLabel });
}
var contextParts = [];
if (customerId) {
contextParts.push("Customer ID: `" + customerId + "`");
}
if (entity && entity.id) {
contextParts.push("Entity: `" + entity.id + "`");
}
var blocks = [
{
type: "header",
text: { type: "plain_text", text: meta.emoji + " " + meta.header, emoji: true }
},
{
type: "section",
text: { type: "mrkdwn", text: sentence }
},
{
type: "section",
fields: fields
}
];
if (customerId) {
blocks.push({
type: "actions",
elements: [
{
type: "button",
text: { type: "plain_text", text: "View in Autumn", emoji: true },
url: AUTUMN_BASE + customerId,
style: "primary"
}
]
});
}
if (contextParts.length > 0) {
blocks.push({
type: "context",
elements: [
{ type: "mrkdwn", text: contextParts.join(" | ") }
]
});
}
webhook.payload = {
username: AUTUMN_USERNAME,
icon_url: AUTUMN_ICON_URL,
text: previewText,
blocks: blocks
};
return webhook;
}
// ============ balances.limit_reached ============
if (webhook.eventType === "balances.limit_reached") {
var lrCustomerId = data.customer_id || "";
var lrFeatureId = data.feature_id || "feature";
var lrLimitType = data.limit_type || "included";
var lrEntityId = data.entity_id || null;
var lrCustomerLink = lrCustomerId
? "<" + AUTUMN_BASE + lrCustomerId + "|`" + lrCustomerId + "`>"
: "`unknown`";
var lrSentence =
lrCustomerLink + " hit their *" + lrFeatureId + "* `" + lrLimitType + "` limit";
var lrPreview = "🚫 " + lrCustomerId + " hit their " + lrFeatureId + " limit";
var lrFields = [
{ type: "mrkdwn", text: "*Customer:*\n" + lrCustomerLink },
{ type: "mrkdwn", text: "*Feature:*\n`" + lrFeatureId + "`" },
{ type: "mrkdwn", text: "*Limit Type:*\n`" + lrLimitType + "`" }
];
if (lrEntityId) {
lrFields.push({ type: "mrkdwn", text: "*Entity:*\n`" + lrEntityId + "`" });
}
var lrContextParts = [];
if (lrCustomerId) lrContextParts.push("Customer ID: `" + lrCustomerId + "`");
if (lrEntityId) lrContextParts.push("Entity: `" + lrEntityId + "`");
var lrBlocks = [
{
type: "header",
text: { type: "plain_text", text: "🚫 Limit Reached", emoji: true }
},
{
type: "section",
text: { type: "mrkdwn", text: lrSentence }
},
{
type: "section",
fields: lrFields
}
];
if (lrCustomerId) {
lrBlocks.push({
type: "actions",
elements: [
{
type: "button",
text: { type: "plain_text", text: "View in Autumn", emoji: true },
url: AUTUMN_BASE + lrCustomerId,
style: "danger"
}
]
});
}
if (lrContextParts.length > 0) {
lrBlocks.push({
type: "context",
elements: [
{ type: "mrkdwn", text: lrContextParts.join(" | ") }
]
});
}
webhook.payload = {
username: AUTUMN_USERNAME,
icon_url: AUTUMN_ICON_URL,
text: lrPreview,
blocks: lrBlocks
};
return webhook;
}
// ============ balances.usage_alert_triggered ============
if (webhook.eventType === "balances.usage_alert_triggered") {
var uaCustomerId = data.customer_id || "";
var uaFeatureId = data.feature_id || "feature";
var uaEntityId = data.entity_id || null;
var uaAlert = data.usage_alert || {};
var uaAlertName = uaAlert.name || "Usage alert";
var uaThreshold = uaAlert.threshold;
var uaThresholdType = uaAlert.threshold_type || "usage";
function formatThreshold(value, type) {
if (value === undefined || value === null) return "—";
if (type === "usage_percentage") return value + "% used";
if (type === "remaining_percentage") return value + "% remaining";
if (type === "remaining") return value + " remaining";
return value + " used";
}
var uaThresholdLabel = formatThreshold(uaThreshold, uaThresholdType);
var uaCustomerLink = uaCustomerId
? "<" + AUTUMN_BASE + uaCustomerId + "|`" + uaCustomerId + "`>"
: "`unknown`";
var uaSentence =
uaCustomerLink + " crossed the *" + uaAlertName + "* threshold on *" + uaFeatureId + "*";
var uaPreview = "📊 Usage Alert: " + uaAlertName + " (" + uaCustomerId + ")";
var uaFields = [
{ type: "mrkdwn", text: "*Customer:*\n" + uaCustomerLink },
{ type: "mrkdwn", text: "*Feature:*\n`" + uaFeatureId + "`" },
{ type: "mrkdwn", text: "*Alert:*\n" + uaAlertName },
{ type: "mrkdwn", text: "*Threshold:*\n" + uaThresholdLabel }
];
if (uaEntityId) {
uaFields.push({ type: "mrkdwn", text: "*Entity:*\n`" + uaEntityId + "`" });
}
var uaContextParts = [];
if (uaCustomerId) uaContextParts.push("Customer ID: `" + uaCustomerId + "`");
if (uaEntityId) uaContextParts.push("Entity: `" + uaEntityId + "`");
var uaBlocks = [
{
type: "header",
text: { type: "plain_text", text: "📊 Usage Alert: " + uaAlertName, emoji: true }
},
{
type: "section",
text: { type: "mrkdwn", text: uaSentence }
},
{
type: "section",
fields: uaFields
}
];
if (uaCustomerId) {
uaBlocks.push({
type: "actions",
elements: [
{
type: "button",
text: { type: "plain_text", text: "View in Autumn", emoji: true },
url: AUTUMN_BASE + uaCustomerId
}
]
});
}
if (uaContextParts.length > 0) {
uaBlocks.push({
type: "context",
elements: [
{ type: "mrkdwn", text: uaContextParts.join(" | ") }
]
});
}
webhook.payload = {
username: AUTUMN_USERNAME,
icon_url: AUTUMN_ICON_URL,
text: uaPreview,
blocks: uaBlocks
};
return webhook;
}
// Cancel any other event types — they don't match Slack's expected schema and would error.
webhook.cancel = true;
return webhook;
}
```
```js Discord theme={null}
/**
* @param webhook the webhook object
* @param webhook.method destination method. Allowed values: "POST", "PUT"
* @param webhook.url current destination address
* @param webhook.eventType current webhook Event Type
* @param webhook.payload JSON payload
* @param webhook.cancel whether to cancel dispatch of the given webhook
*/
function handler(webhook) {
var AUTUMN_BASE = "https://app.useautumn.com/customers/";
var AUTUMN_USERNAME = "Autumn";
var AUTUMN_AVATAR_URL = "https://i.ibb.co/BHCF1ZqL/autumnicon.png";
// Discord embed colors (decimal RGB).
var COLOR_SUCCESS = 0x22c55e;
var COLOR_INFO = 0x3b82f6;
var COLOR_WARNING = 0xf59e0b;
var COLOR_DANGER = 0xef4444;
var COLOR_NEUTRAL = 0x6b7280;
var payload = webhook.payload || {};
var data = payload.data || payload;
// ============ customer.products.updated ============
if (webhook.eventType === "customer.products.updated") {
var scenario = data.scenario || "updated";
var customer = data.customer || {};
var entity = data.entity || null;
var product = data.updated_product || {};
var customerName = customer.name || customer.email || customer.id || "Customer";
var customerEmail = customer.email || null;
var customerId = customer.id || "";
var productName = product.name || "their plan";
if (product.version && product.version !== 1) {
productName = productName + " V" + product.version;
}
var entityLabel = null;
if (entity) {
entityLabel = entity.name || entity.id || null;
}
var emoji = "🔔";
var header = "Subscription Updated";
var verb = "updated";
var color = COLOR_NEUTRAL;
if (scenario === "new") {
emoji = "🎉"; header = "New Subscription"; verb = "subscribed to"; color = COLOR_SUCCESS;
} else if (scenario === "upgrade") {
emoji = "🚀"; header = "Customer Upgraded"; verb = "upgraded to"; color = COLOR_SUCCESS;
} else if (scenario === "downgrade") {
emoji = "📉"; header = "Customer Downgraded"; verb = "downgraded to"; color = COLOR_WARNING;
} else if (scenario === "cancel") {
emoji = "⚠️"; header = "Subscription Cancelled"; verb = "cancelled"; color = COLOR_WARNING;
} else if (scenario === "renew") {
emoji = "🔄"; header = "Subscription Uncancelled"; verb = "uncancelled"; color = COLOR_SUCCESS;
} else if (scenario === "expired") {
emoji = "💀"; header = "Subscription Expired"; verb = "expired on"; color = COLOR_DANGER;
} else if (scenario === "scheduled") {
emoji = "📅"; header = "Change Scheduled"; verb = "scheduled a change to"; color = COLOR_INFO;
}
var sentence;
if (scenario === "expired") {
sentence = "**" + customerName + "**'s **" + productName + "** expired";
} else {
sentence = "**" + customerName + "** " + verb + " **" + productName + "**";
}
var description = sentence;
if (customerId) {
description += "\n\n[View in Autumn](" + AUTUMN_BASE + customerId + ")";
}
var fields = [
{ name: "Customer", value: customerName, inline: true }
];
if (customerEmail) {
fields.push({ name: "Email", value: customerEmail, inline: true });
}
fields.push({ name: "Product", value: productName, inline: true });
fields.push({ name: "Scenario", value: "`" + scenario + "`", inline: true });
if (entityLabel) {
fields.push({ name: "Entity", value: entityLabel, inline: true });
}
var embed = {
title: emoji + " " + header,
description: description,
color: color,
fields: fields
};
if (customerId) {
embed.url = AUTUMN_BASE + customerId;
}
var footerParts = [];
if (customerId) footerParts.push("Customer ID: " + customerId);
if (entity && entity.id) footerParts.push("Entity: " + entity.id);
if (footerParts.length > 0) {
embed.footer = { text: footerParts.join(" | ") };
}
webhook.payload = {
username: AUTUMN_USERNAME,
avatar_url: AUTUMN_AVATAR_URL,
embeds: [embed]
};
return webhook;
}
// ============ balances.limit_reached ============
if (webhook.eventType === "balances.limit_reached") {
var lrCustomerId = data.customer_id || "";
var lrFeatureId = data.feature_id || "feature";
var lrLimitType = data.limit_type || "included";
var lrEntityId = data.entity_id || null;
var lrCustomerDisplay = lrCustomerId
? "[`" + lrCustomerId + "`](" + AUTUMN_BASE + lrCustomerId + ")"
: "`unknown`";
var lrDescription =
lrCustomerDisplay + " hit their **" + lrFeatureId + "** `" + lrLimitType + "` limit";
if (lrCustomerId) {
lrDescription += "\n\n[View in Autumn](" + AUTUMN_BASE + lrCustomerId + ")";
}
var lrFields = [
{
name: "Customer",
value: lrCustomerId ? "`" + lrCustomerId + "`" : "—",
inline: true
},
{ name: "Feature", value: "`" + lrFeatureId + "`", inline: true },
{ name: "Limit Type", value: "`" + lrLimitType + "`", inline: true }
];
if (lrEntityId) {
lrFields.push({ name: "Entity", value: "`" + lrEntityId + "`", inline: true });
}
var lrEmbed = {
title: "🚫 Limit Reached",
description: lrDescription,
color: COLOR_DANGER,
fields: lrFields
};
if (lrCustomerId) {
lrEmbed.url = AUTUMN_BASE + lrCustomerId;
}
var lrFooterParts = [];
if (lrCustomerId) lrFooterParts.push("Customer ID: " + lrCustomerId);
if (lrEntityId) lrFooterParts.push("Entity: " + lrEntityId);
if (lrFooterParts.length > 0) {
lrEmbed.footer = { text: lrFooterParts.join(" | ") };
}
webhook.payload = {
username: AUTUMN_USERNAME,
avatar_url: AUTUMN_AVATAR_URL,
embeds: [lrEmbed]
};
return webhook;
}
// ============ balances.usage_alert_triggered ============
if (webhook.eventType === "balances.usage_alert_triggered") {
var uaCustomerId = data.customer_id || "";
var uaFeatureId = data.feature_id || "feature";
var uaEntityId = data.entity_id || null;
var uaAlert = data.usage_alert || {};
var uaAlertName = uaAlert.name || "Usage alert";
var uaThreshold = uaAlert.threshold;
var uaThresholdType = uaAlert.threshold_type || "usage";
var uaThresholdLabel = "—";
if (uaThreshold !== undefined && uaThreshold !== null) {
if (uaThresholdType === "usage_percentage") {
uaThresholdLabel = uaThreshold + "% used";
} else if (uaThresholdType === "remaining_percentage") {
uaThresholdLabel = uaThreshold + "% remaining";
} else if (uaThresholdType === "remaining") {
uaThresholdLabel = uaThreshold + " remaining";
} else {
uaThresholdLabel = uaThreshold + " used";
}
}
var uaCustomerDisplay = uaCustomerId
? "[`" + uaCustomerId + "`](" + AUTUMN_BASE + uaCustomerId + ")"
: "`unknown`";
var uaDescription =
uaCustomerDisplay + " crossed the **" + uaAlertName + "** threshold on **" + uaFeatureId + "**";
if (uaCustomerId) {
uaDescription += "\n\n[View in Autumn](" + AUTUMN_BASE + uaCustomerId + ")";
}
var uaFields = [
{
name: "Customer",
value: uaCustomerId ? "`" + uaCustomerId + "`" : "—",
inline: true
},
{ name: "Feature", value: "`" + uaFeatureId + "`", inline: true },
{ name: "Alert", value: uaAlertName, inline: true },
{ name: "Threshold", value: uaThresholdLabel, inline: true }
];
if (uaEntityId) {
uaFields.push({ name: "Entity", value: "`" + uaEntityId + "`", inline: true });
}
var uaEmbed = {
title: "📊 Usage Alert: " + uaAlertName,
description: uaDescription,
color: COLOR_WARNING,
fields: uaFields
};
if (uaCustomerId) {
uaEmbed.url = AUTUMN_BASE + uaCustomerId;
}
var uaFooterParts = [];
if (uaCustomerId) uaFooterParts.push("Customer ID: " + uaCustomerId);
if (uaEntityId) uaFooterParts.push("Entity: " + uaEntityId);
if (uaFooterParts.length > 0) {
uaEmbed.footer = { text: uaFooterParts.join(" | ") };
}
webhook.payload = {
username: AUTUMN_USERNAME,
avatar_url: AUTUMN_AVATAR_URL,
embeds: [uaEmbed]
};
return webhook;
}
// Unmatched event type — cancel dispatch.
webhook.cancel = true;
return webhook;
}
```
# Webhooks
Source: https://docs.useautumn.com/documentation/webhooks
Receive real-time notifications when customer billing events occur
With Autumn, you don't need webhooks for managing billing — subscription state, usage tracking, and access control are all synchronized automatically.
However, webhooks can still be useful for specific use cases where you want to trigger actions in your own systems.
## Use Cases
While Autumn handles billing complexity for you, webhooks are helpful for:
* **Sending activation emails** — Welcome new subscribers or notify users when their plan changes
* **Triggering workflows** — Start onboarding sequences, provision resources, or update CRM records
* **Syncing with external systems** — Keep your database, analytics, or other tools in sync with subscription changes
* **Deprovisioning access to services** — Shut off access to downstream services when a customer cancels their subscription
## Available Events
### billing.updated
Fired whenever a customer's plans change — new subscriptions, upgrades, downgrades, etc. Each event carries a `plan_changes` array describing exactly what happened to each affected plan.
| Action | Description |
| ----------- | ------------------------------------------------------------------------------------------------------------ |
| `activated` | A plan is now active on the customer (newly attached, or a previously scheduled plan reached its start date) |
| `scheduled` | A plan has been queued to start at a future date |
| `updated` | A plan's state changed in place (cancellation set or cleared, `past_due` flipped, items added or removed) |
| `expired` | A plan ended and is no longer in effect |
Each entry also includes the `subscription` (or `purchase` for one-off products) after the change, and `previous_attributes` holding the prior values of any fields that were updated. For instance, if a plan was canceled at period end:
```json expandable theme={null}
{
"action": "updated",
"subscription": {
"plan_id": "pro",
"status": "active",
"past_due": false,
"started_at": 1759248000000,
"canceled_at": 1761840000000,
"expires_at": 1764432000000,
"trial_ends_at": null,
"current_period_start": 1761840000000,
"current_period_end": 1764432000000
},
"previous_attributes": {
"canceled_at": null,
"expires_at": null
},
"item_changes": []
}
```
The top-level `tags` array surfaces optional reason tags describing why the event fired:
| Tag | When |
| --------------- | ---------------------------------------------------------------------------- |
| `trial_ended` | A trial just ended (Stripe subscription transition or the trial-expiry cron) |
| `phase_changed` | A Stripe subscription schedule phase advanced |
**Example payload (upgrade from `free` to `pro`):**
```json expandable theme={null}
{
"type": "billing.updated",
"data": {
"object": "billing.updated",
"customer_id": "user_123",
"plan_changes": [
{
"action": "activated",
"subscription": {
"plan_id": "pro",
"status": "active",
"past_due": false,
"started_at": 1761840000000,
"canceled_at": null,
"expires_at": null,
"trial_ends_at": null,
"current_period_start": 1761840000000,
"current_period_end": 1764432000000
},
"previous_attributes": null,
"item_changes": []
},
{
"action": "expired",
"subscription": {
"plan_id": "free",
"status": "expired",
"past_due": false,
"started_at": 1759248000000,
"canceled_at": 1761840000000,
"expires_at": 1761840000000,
"trial_ends_at": null,
"current_period_start": null,
"current_period_end": null
},
"previous_attributes": { "status": "active" },
"item_changes": []
}
],
"tags": []
}
}
```
For entity-scoped events, the payload will also include an `entity_id`:
```json expandable theme={null}
{
"type": "billing.updated",
"data": {
"object": "billing.updated",
"customer_id": "user_123",
"entity_id": "team_456",
"plan_changes": [ ... ],
"tags": []
}
}
```
**Common patterns:**
* **Sync Autumn state back to your DB** — listen for every `billing.updated` and persist each `plan_changes` entry's `subscription` snapshot keyed by `customer_id` (+ `entity_id` if set).
* **Notify on upgrades** — filter for entries with `action: "activated"`. For "upgrade from previous plan" specifically, pair it with an `action: "expired"` entry on the same event.
* **Detect cancellations** — filter for entries where `previous_attributes.canceled_at === null` (a cancellation was just set) or `previous_attributes.canceled_at` is a number (an uncancel).
* **Trial-end emails** — filter for `tags.includes("trial_ended")`.
### balances.limit\_reached
Fired when a customer hits a usage limit for a feature. A limit can be the included allowance, a max purchase cap, or a spend limit.
| Limit Type | Description |
| -------------- | --------------------------------------------------------- |
| `included` | Customer has exhausted their included allowance |
| `max_purchase` | Customer has reached the maximum purchase cap for overage |
| `spend_limit` | Customer has hit their configured spend limit |
**Example payload:**
```json expandable theme={null}
{
"type": "balances.limit_reached",
"data": {
"customer_id": "user_123",
"feature_id": "api_calls",
"limit_type": "included"
}
}
```
For entity-scoped usage, the payload will also include an `entity_id`:
```json expandable theme={null}
{
"type": "balances.limit_reached",
"data": {
"customer_id": "user_123",
"feature_id": "api_calls",
"entity_id": "team_456",
"limit_type": "max_purchase"
}
}
```
### billing.auto\_topup\_succeeded
Fired when an [auto top-up](/documentation/modelling-pricing/auto-top-ups) successfully grants additional prepaid balance. Useful for sending receipts, updating internal ledgers, or reconciling balance after a recharge.
For auto-charged top-ups, the event fires only after the Stripe invoice is `paid`. For `invoice_mode` top-ups, the event fires once credits are granted and the invoice is finalized — `invoice.status` will typically be `"open"` until the customer pays.
Use `invoice.stripe_id` as a stable dedupe key. The top-level `id` field (e.g. `evt_auto_topup_...`) is a unique identifier for the event itself.
**Example payload (auto-charge):**
```json expandable theme={null}
{
"type": "billing.auto_topup_succeeded",
"id": "evt_auto_topup_2abc123",
"occurred_at": 1761840000000,
"data": {
"customer_id": "user_123",
"feature_id": "credits",
"quantity_granted": 1000,
"threshold": 500,
"balance_after": 1450,
"invoice_mode": false,
"invoice": {
"stripe_id": "in_1A2B3C4D5E6F",
"status": "paid",
"total": 1000,
"currency": "usd",
"hosted_invoice_url": "https://invoice.stripe.com/i/..."
}
}
}
```
**Example payload (invoice mode):**
```json expandable theme={null}
{
"type": "billing.auto_topup_succeeded",
"id": "evt_auto_topup_3xyz456",
"occurred_at": 1761840000000,
"data": {
"customer_id": "user_123",
"feature_id": "credits",
"quantity_granted": 1000,
"threshold": 500,
"balance_after": 1450,
"invoice_mode": true,
"invoice": {
"stripe_id": "in_2G3H4I5J6K7L",
"status": "open",
"total": 1000,
"currency": "usd",
"hosted_invoice_url": "https://invoice.stripe.com/i/..."
}
}
}
```
### billing.auto\_topup\_failed
Fired when an [auto top-up](/documentation/modelling-pricing/auto-top-ups) is blocked, declined, or fails before granting additional prepaid balance. This includes charge failures, purchase/attempt limits, missing payment methods, unavailable customer billing setup, lock contention, and transient infrastructure issues.
Use `reason` to branch on the failure mode.
Limit-blocked failures are suppressed per blocking window, so repeated attempts while the same purchase, attempt, or failed-attempt limit is active do not emit duplicate webhooks.
**Example payload:**
```json expandable theme={null}
{
"type": "billing.auto_topup_failed",
"id": "evt_auto_topup_failed_2abc123",
"occurred_at": 1761840000000,
"data": {
"customer_id": "user_123",
"feature_id": "credits",
"reason": "charge_failed",
"quantity": 1000,
"threshold": 500,
"balance": 250,
"invoice_mode": false,
"error": {
"code": "card_declined",
"message": "Your card was declined.",
"type": "card_error",
"decline_code": "generic_decline"
}
}
}
```
### balances.usage\_alert\_triggered
Fired when a customer crosses a configured usage alert threshold. Usage alerts let you monitor when customers approach or exceed specific usage levels for a feature.
| Alert Threshold Type | Description |
| -------------------- | ----------------------------------------------- |
| `usage` | An absolute usage count was crossed |
| `usage_percentage` | A percentage of the usage allowance was crossed |
**Example payload:**
```json expandable theme={null}
{
"type": "balances.usage_alert_triggered",
"data": {
"customer_id": "user_123",
"feature_id": "api_calls",
"usage_alert": {
"name": "80% usage warning",
"threshold": 80,
"threshold_type": "usage_percentage"
}
}
}
```
## Setup
Configure your webhook endpoints in the Autumn dashboard:
Go to the **Developer** section in your Autumn dashboard and select the **Webhooks** tab.
Click **Add Endpoint** and enter the URL where you want to receive webhook events.
Choose which events you want to subscribe to. You can select all events or specific ones.
Save your endpoint configuration. You can use the **Send Test Event** button to verify your endpoint is receiving events correctly.
## Webhook Security
Autumn uses [Svix](https://www.svix.com/) for reliable webhook delivery. Each webhook request includes signature headers that you can use to verify the request is genuinely from Autumn:
* `svix-id` — Unique message identifier
* `svix-timestamp` — Timestamp of when the message was sent
* `svix-signature` — Signature for verifying authenticity
You can use the [Svix libraries](https://docs.svix.com/receiving/verifying-payloads/how) to easily verify webhook signatures in your application.
## Retry Policy
If your endpoint returns an error or is unavailable, Autumn will automatically retry the webhook with exponential backoff. You can view delivery attempts and retry failed webhooks from the dashboard.
# Entity-level balances
Source: https://docs.useautumn.com/examples/entity-balances
Grant usage limits per entity, such as 50 credits per user per month
Entities are a resource that lives under a parent customer, that can have it's own plans and feature balances.
Entity-level balances let you set usage limits that apply to each entity (like users, workspaces, or projects) individually. Instead of a single shared pool, each entity gets their own balance.
You model this with a **license plan**: a plan describing everything one entity gets. The parent plan offers a pool of those licenses, and you assign a license to an entity to give it its own balance.
This is useful when you want to ensure fair usage across team members or isolate resource consumption per workspace.
For the mechanics behind this and the other way to provision entity plans, see [entity plans](/documentation/modelling-pricing/entity-plans). If you only need to charge by headcount, with no per-seat limits, see [per-seat pricing](/examples/per-seat) instead.
## Example case
We have an AI meeting notes product with team-based pricing:
* **Team plan**: \$30 per seat per month
* **Each seat gets**: 50 meeting summaries per month
If a team has 8 users, they pay \$30 \times 8 = \$240/month, and each user gets their own 50 summaries.
## Configure Pricing
#### Create Features
Create two features:
1. **Seats** - A `metered` `non-consumable` feature identifying the entity type (team members)
2. **Meeting Summaries** - A `metered` `consumable` feature for the number of meeting summaries generated
#### Create the Seat License Plan
Create a **Seat** plan holding everything one team member gets:
1. A **\$30/month price**
2. **Meeting Summaries**: 50 per month
Give it its own group. Attaching a plan replaces other plans in the same group, so a license plan sharing a group with its parent would knock the parent off.
#### Create Team Plan
Create a Team plan and, under **Licenses**, add the Seat plan with **0 included** seats.
The Team plan now offers a pool of Seat licenses at \$30/month each. (Set **included** above 0 to give the plan some free seats.) A team member only receives their own 50 summaries once a license is assigned to them.
## Implementation
#### Create an Autumn Customer
When an organization signs up, create an Autumn customer.
```typescript Node.js theme={null}
import { Autumn } from "autumn-js";
const autumn = new Autumn({
secretKey: 'am_sk_42424242',
});
const { data, error } = await autumn.customers.create({
id: "org_123",
name: "Acme Corp",
email: "admin@acme.com",
});
```
```python Python theme={null}
import asyncio
from autumn import Autumn
autumn = Autumn('am_sk_42424242')
async def main():
customer = await autumn.customers.create(
id="org_123",
name="Acme Corp",
email="admin@acme.com",
)
asyncio.run(main())
```
```bash cURL theme={null}
curl --request POST \
--url https://api.useautumn.com/v1/customers \
--header 'Authorization: Bearer am_sk_42424242' \
--header 'Content-Type: application/json' \
--data '{
"id": "org_123",
"name": "Acme Corp",
"email": "admin@acme.com"
}'
```
#### Create Initial Entity
Create an entity for the admin user who is signing up. This just registers the entity — no balance is granted until a license is assigned to it. This should be done server-side for security.
```typescript Node.js theme={null}
import { Autumn } from "autumn-js";
const autumn = new Autumn({
secretKey: 'am_sk_42424242',
});
// Create entity for the initial admin user
await autumn.entities.create("org_123", {
id: "user_admin",
name: "Admin User",
feature_id: "seats",
});
```
```python Python theme={null}
import asyncio
from autumn import Autumn
autumn = Autumn("am_sk_42424242")
async def main():
# Create entity for the initial admin user
await autumn.features.create_entity(
customer_id="org_123",
id="user_admin",
name="Admin User",
feature_id="seats",
)
asyncio.run(main())
```
```bash cURL theme={null}
curl -X POST "https://api.useautumn.com/v1/customers/org_123/entities" \
-H "Authorization: Bearer am_sk_42424242" \
-H "Content-Type: application/json" \
-d '{
"id": "user_admin",
"name": "Admin User",
"feature_id": "seats"
}'
```
This entity exists but has no balances yet. It receives its 50 meeting summaries once you assign it a Seat license, a couple of steps below.
#### Attach the Team Plan and Buy Seats
When the customer upgrades to Team, attach the plan. Pass `licenseQuantities` to say how many Seat licenses they want — `quantity` is the **total** number of seats, including any the plan includes for free.
```typescript Node.js theme={null}
import { Autumn } from "autumn-js";
const autumn = new Autumn({
secretKey: 'am_sk_42424242',
});
// 4 seats at $30/month = $120/month
const { data } = await autumn.billing.attach({
customerId: "org_123",
planId: "team",
licenseQuantities: [{
licensePlanId: "seat_license",
quantity: 4,
}],
});
if (data.paymentUrl) {
// Redirect to Stripe checkout
}
```
```python Python theme={null}
import asyncio
from autumn import Autumn
autumn = Autumn("am_sk_42424242")
async def main():
# 4 seats at $30/month = $120/month
response = await autumn.billing.attach(
customer_id="org_123",
plan_id="team",
license_quantities=[{
"license_plan_id": "seat_license",
"quantity": 4,
}],
)
if response.payment_url:
# Redirect to Stripe checkout
pass
asyncio.run(main())
```
```bash cURL theme={null}
curl -X POST "https://api.useautumn.com/v1/billing.attach" \
-H "Authorization: Bearer am_sk_42424242" \
-H "Content-Type: application/json" \
-d '{
"customer_id": "org_123",
"plan_id": "team",
"license_quantities": [
{ "license_plan_id": "seat_license", "quantity": 4 }
]
}'
```
Change the seat count later by attaching again with a new `quantity`. Autumn prorates the difference.
#### Assign Seat Licenses
When team members are added, assign each of them a Seat license. This is what gives them their own balance of 50 summaries. It consumes one seat from the pool bought in the previous step.
```typescript Node.js theme={null}
import { Autumn } from "autumn-js";
const autumn = new Autumn({
secretKey: 'am_sk_42424242',
});
// Assign a seat to each team member
await autumn.licenses.attach({
customerId: "org_123",
planId: "seat_license",
entities: [
{ entityId: "user_alice", name: "Alice Smith", featureId: "seats" },
{ entityId: "user_bob", name: "Bob Jones", featureId: "seats" },
{ entityId: "user_charlie", name: "Charlie Brown", featureId: "seats" },
],
});
```
```python Python theme={null}
import asyncio
from autumn import Autumn
autumn = Autumn("am_sk_42424242")
async def main():
# Assign a seat to each team member
await autumn.licenses.attach(
customer_id="org_123",
plan_id="seat_license",
entities=[
{"entity_id": "user_alice", "name": "Alice Smith", "feature_id": "seats"},
{"entity_id": "user_bob", "name": "Bob Jones", "feature_id": "seats"},
{"entity_id": "user_charlie", "name": "Charlie Brown", "feature_id": "seats"},
],
)
asyncio.run(main())
```
```bash cURL theme={null}
curl -X POST "https://api.useautumn.com/v1/licenses.attach" \
-H "Authorization: Bearer am_sk_42424242" \
-H "Content-Type: application/json" \
-d '{
"customer_id": "org_123",
"plan_id": "seat_license",
"entities": [
{ "entity_id": "user_alice", "name": "Alice Smith", "feature_id": "seats" },
{ "entity_id": "user_bob", "name": "Bob Jones", "feature_id": "seats" },
{ "entity_id": "user_charlie", "name": "Charlie Brown", "feature_id": "seats" }
]
}'
```
`feature_id` is only required when the entity doesn't exist yet — Autumn creates it for you, so you can skip the separate entity-create call.
Assignment is idempotent: re-assigning someone who already holds an active Seat license succeeds without consuming another seat. If the pool has no seats left, the call errors — buy more seats first.
After assigning, navigate to the Autumn customer page and you will see the entity and its balance.
#### Check Access Per Entity
Before generating a meeting summary, check if that specific user has remaining balance.
```typescript Node.js theme={null}
import { Autumn } from "autumn-js";
const autumn = new Autumn({
secretKey: 'am_sk_42424242',
});
// Check Alice's individual balance
const { data } = await autumn.check({
customer_id: "org_123",
feature_id: "meeting_summaries",
entity_id: "user_alice",
});
if (!data.allowed) {
console.log("Alice has used all her meeting summaries");
} else {
console.log(`Alice has ${data.balance} summaries remaining`);
}
```
```python Python theme={null}
import asyncio
from autumn import Autumn
autumn = Autumn("am_sk_42424242")
async def main():
# Check Alice's individual balance
response = await autumn.check(
customer_id="org_123",
feature_id="meeting_summaries",
entity_id="user_alice",
)
if not response.allowed:
print("Alice has used all her meeting summaries")
else:
print(f"Alice has {response.balance} summaries remaining")
asyncio.run(main())
```
```bash cURL theme={null}
curl -X POST "https://api.useautumn.com/v1/check" \
-H "Authorization: Bearer am_sk_42424242" \
-H "Content-Type: application/json" \
-d '{
"customer_id": "org_123",
"feature_id": "meeting_summaries",
"entity_id": "user_alice"
}'
```
```json theme={null}
{
"allowed": true,
"customer_id": "org_123",
"feature_id": "meeting_summaries",
"entity_id": "user_alice",
"balance": 47,
"usage": 3,
"included_usage": 50,
"unlimited": false
}
```
#### Track Usage Per Entity
When a user generates a summary, track the usage against their entity.
```typescript Node.js theme={null}
import { Autumn } from "autumn-js";
const autumn = new Autumn({
secretKey: 'am_sk_42424242',
});
// Track usage for Alice
await autumn.track({
customer_id: "org_123",
feature_id: "meeting_summaries",
entity_id: "user_alice",
value: 1,
});
```
```python Python theme={null}
import asyncio
from autumn import Autumn
autumn = Autumn("am_sk_42424242")
async def main():
# Track usage for Alice
await autumn.track(
customer_id="org_123",
feature_id="meeting_summaries",
entity_id="user_alice",
value=1,
)
asyncio.run(main())
```
```bash cURL theme={null}
curl -X POST "https://api.useautumn.com/v1/track" \
-H "Authorization: Bearer am_sk_42424242" \
-H "Content-Type: application/json" \
-d '{
"customer_id": "org_123",
"feature_id": "meeting_summaries",
"entity_id": "user_alice",
"value": 1
}'
```
#### Check Customer-level Balance (Optional)
You can also check the total balance across all entities, useful for admin dashboards.
```typescript Node.js theme={null}
import { Autumn } from "autumn-js";
const autumn = new Autumn({
secretKey: 'am_sk_42424242',
});
// Check total balance across all users (omit entity_id)
const { data } = await autumn.check({
customer_id: "org_123",
feature_id: "meeting_summaries",
});
// With 3 users at 50 each = 150 total
console.log(`Team has ${data.balance} total summaries remaining`);
```
```python Python theme={null}
import asyncio
from autumn import Autumn
autumn = Autumn("am_sk_42424242")
async def main():
# Check total balance across all users
response = await autumn.check(
customer_id="org_123",
feature_id="meeting_summaries",
)
print(f"Team has {response.balance} total summaries remaining")
asyncio.run(main())
```
```bash cURL theme={null}
curl -X POST "https://api.useautumn.com/v1/check" \
-H "Authorization: Bearer am_sk_42424242" \
-H "Content-Type: application/json" \
-d '{
"customer_id": "org_123",
"feature_id": "meeting_summaries"
}'
```
```json theme={null}
{
"allowed": true,
"customer_id": "org_123",
"feature_id": "meeting_summaries",
"balance": 141,
"usage": 9,
"included_usage": 150,
"unlimited": false
}
```
The total is the sum of all entity balances (3 users × 50 = 150 included).
#### Release Seat Licenses
When a team member leaves, release their license. Their balance is removed and the seat returns to the pool, ready to be assigned to someone else.
```typescript Node.js theme={null}
import { Autumn } from "autumn-js";
const autumn = new Autumn({
secretKey: 'am_sk_42424242',
});
// Free up Bob's seat
await autumn.licenses.release({
customerId: "org_123",
licensePlanId: "seat_license",
entityIds: ["user_bob"],
});
```
```python Python theme={null}
import asyncio
from autumn import Autumn
autumn = Autumn("am_sk_42424242")
async def main():
# Free up Bob's seat
await autumn.licenses.release(
customer_id="org_123",
license_plan_id="seat_license",
entity_ids=["user_bob"],
)
asyncio.run(main())
```
```bash cURL theme={null}
curl -X POST "https://api.useautumn.com/v1/licenses.release" \
-H "Authorization: Bearer am_sk_42424242" \
-H "Content-Type: application/json" \
-d '{
"customer_id": "org_123",
"license_plan_id": "seat_license",
"entity_ids": ["user_bob"]
}'
```
Releasing a license frees the seat but does not change what the customer pays — they keep the 4 seats they bought. To stop paying for a seat, attach the Team plan again with a lower `quantity`; Autumn prorates the refund.
`license_plan_id` is optional, and only needed to disambiguate when an entity holds licenses from more than one plan.
## Summary
| Level | Check/Track With | Use Case |
| ------------------ | ------------------------- | ----------------------------------- |
| **Entity-level** | `entity_id: "user_alice"` | Individual user limits, fair usage |
| **Customer-level** | No `entity_id` | Admin dashboards, total consumption |
Entity-level balances are ideal when you want to:
* Ensure fair usage across team members
* Isolate consumption per workspace or project
* Bill per-entity while providing entity-specific limits
To see how many seats a customer has bought and used, call [`licenses.list`](/api-reference/licenses/listLicenses). To see who currently holds one, call [`licenses.list_assignments`](/api-reference/licenses/listLicenseAssignments).
# Monetary credits
Source: https://docs.useautumn.com/examples/monetary-credits
Grant your users a currency-based balance of credits, that various features can draw from
When you have multiple features that cost different amounts, you can use a credit system to deduct usage from a single balance. This can be great to simplify billing and usage tracking, especially when you have lots of features.
## Example case
We have a AI chatbot product with 2 different models, and each model costs a different amount to use.
* Basic message: \$1 per 100 messages
* Premium message: \$10 per 100 messages
And we have the following plans:
* Free tier: \$5 credits per month for free
* Pro tier: \$10 credits per month, at \$10 per month
Users should also be able to top up their balance with more credits.
## Configure Pricing
#### Create Features
Create a `metered` `consumable` feature for each message type, so that we can track the usage of each:
#### Create Credit System
Now, we'll create a credit system, where we'll define the cost of each message type. We'll define the cost per message in USD:
| Feature | Cost per message (USD) | Credit cost per message (USD) |
| --------------- | ---------------------- | ----------------------------- |
| Basic message | \$1 per 100 messages | 0.01 |
| Premium message | \$10 per 100 messages | 0.10 |
#### Create Free, Pro and Top-up Plans
Let's create our free and pro plans, and add the credits amounts to each.
Make sure to set the `auto-enable` flag on the free plan, so that it is automatically assigned to new customers.
Then, we'll create our top-up plan. We'll add a price to our credit feature, where each credit is worth \$1. These top up credits will be `one-off` `prepaid` purchases that never expire.
## Implementation
#### Create an Autumn Customer
When your user signs up, create an Autumn customer. This will automatically assign them the Free plan, and grant them \$5 credits per month.
```typescript TypeScript theme={null}
import { Autumn } from "autumn-js";
const autumn = new Autumn({ secretKey: "am_sk_test_1234" });
const customer = await autumn.customers.getOrCreate({
customerId: "user_123",
name: "John Yeo",
email: "john@example.com",
});
```
```python Python theme={null}
from autumn_sdk import Autumn
autumn = Autumn("am_sk_test_1234")
customer = await autumn.customers.get_or_create(
customer_id="user_123",
name="John Yeo",
email="john@example.com",
)
```
```bash cURL theme={null}
curl -X POST "https://api.useautumn.com/v1/customers" \
-H "Authorization: Bearer am_sk_test_1234" \
-H "Content-Type: application/json" \
-d '{
"customer_id": "user_123",
"name": "John Yeo",
"email": "john@example.com"
}'
```
#### Checking for access
Every time our user sends a message to the chatbot, we'll first check if they have enough credits remaining to send the message.
The `requiredBalance` parameter will convert the number of messages to credits. Eg, if you pass `requiredBalance: 5` for basic messages, then check will return `allowed: true` if the user has at least 0.05 USD credits remaining.
Note how we're interacting with the underlying features (`basic_messages`,
`premium_messages`) here--not the credit system.
```typescript TypeScript theme={null}
import { Autumn } from "autumn-js";
const autumn = new Autumn({ secretKey: "am_sk_test_1234" });
const response = await autumn.check({
customerId: "user_123",
featureId: "basic_messages",
requiredBalance: 1,
});
if (!response.allowed) {
console.log("User has run out of basic message credits");
return;
}
```
```python Python theme={null}
from autumn_sdk import Autumn
autumn = Autumn("am_sk_test_1234")
response = await autumn.check(
customer_id="user_123",
feature_id="basic_messages",
required_balance=1,
)
if not response.allowed:
print("User has run out of basic message credits")
```
```bash cURL theme={null}
curl -X POST "https://api.useautumn.com/v1/check" \
-H "Authorization: Bearer am_sk_test_1234" \
-H "Content-Type: application/json" \
-d '{
"customer_id": "user_123",
"feature_id": "basic_messages",
"required_balance": 1
}'
```
The credit system ID will be returned in the balance.
```json theme={null}
{
"allowed": true,
"customerId": "user_123",
"requiredBalance": 0.01,
"balance": {
"featureId": "usd_credits",
"granted": 5,
"remaining": 5,
"usage": 0,
"unlimited": false,
"overageAllowed": false,
"nextResetAt": 1769110978704
}
}
```
#### Tracking messages and using credits
Now let's implement our usage tracking and use up our credits. In this example, we're using 2 basic messages, which will cost us 0.02 USD credits.
```typescript TypeScript theme={null}
import { Autumn } from "autumn-js";
const autumn = new Autumn({ secretKey: "am_sk_test_1234" });
await autumn.track({
customerId: "user_123",
featureId: "basic_messages",
value: 2,
});
```
```python Python theme={null}
from autumn_sdk import Autumn
autumn = Autumn("am_sk_test_1234")
await autumn.track(
customer_id="user_123",
feature_id="basic_messages",
value=2,
)
```
```bash cURL theme={null}
curl -X POST "https://api.useautumn.com/v1/track" \
-H "Authorization: Bearer am_sk_test_1234" \
-H "Content-Type: application/json" \
-d '{
"customer_id": "user_123",
"feature_id": "basic_messages",
"value": 2
}'
```
```json theme={null}
{
"customerId": "user_123",
"value": 2,
"balance": {
"featureId": "usd_credits",
"granted": 5,
"remaining": 4.98,
"usage": 0.02,
"unlimited": false,
"overageAllowed": false,
"nextResetAt": 1769110978704
}
}
```
#### Upgrading to Pro
We can prompt the user to upgrade. When they click our "upgrade" button, we can use the `billing.attach` route to get a checkout URL for them to make a payment.
```typescript TypeScript theme={null}
import { Autumn } from "autumn-js";
const autumn = new Autumn({ secretKey: "am_sk_test_1234" });
const response = await autumn.billing.attach({
customerId: "user_123",
planId: "pro",
});
// Redirect user to checkout
redirect(response.paymentUrl);
```
```python Python theme={null}
from autumn_sdk import Autumn
autumn = Autumn("am_sk_test_1234")
response = await autumn.billing.attach(
customer_id="user_123",
plan_id="pro",
)
# Redirect user to response.payment_url
```
```bash cURL theme={null}
curl -X POST "https://api.useautumn.com/v1/attach" \
-H "Authorization: Bearer am_sk_test_1234" \
-H "Content-Type: application/json" \
-d '{
"customer_id": "user_123",
"plan_id": "pro"
}'
```
#### Purchasing Top-ups
When users run low on credits, they can purchase additional credits using our top-up plan. In this example, the user is purchasing 20 USD credits, which will cost them \$20.
```typescript TypeScript theme={null}
import { Autumn } from "autumn-js";
const autumn = new Autumn({ secretKey: "am_sk_test_1234" });
const response = await autumn.billing.attach({
customerId: "user_123",
planId: "top_up",
featureQuantities: [{
featureId: "usd_credits",
quantity: 20,
}],
});
redirect(response.paymentUrl);
```
```python Python theme={null}
from autumn_sdk import Autumn
autumn = Autumn("am_sk_test_1234")
response = await autumn.billing.attach(
customer_id="user_123",
plan_id="top_up",
feature_quantities=[{
"feature_id": "usd_credits",
"quantity": 20,
}],
)
# Redirect to response.payment_url
```
```bash cURL theme={null}
curl -X POST "https://api.useautumn.com/v1/attach" \
-H "Authorization: Bearer am_sk_test_1234" \
-H "Content-Type: application/json" \
-d '{
"customer_id": "user_123",
"plan_id": "top_up",
"feature_quantities": [{
"feature_id": "usd_credits",
"quantity": 20
}]
}'
```
# Pay-as-you-go overages
Source: https://docs.useautumn.com/examples/pay-as-you-go-overages
Let free plan users optionally add a card to pay for usage overages instead of getting blocked
Free plan users can optionally add a payment method so that if they exceed their included usage, they're billed for the overage rather than blocked. This is done by having two plans: a Free plan (no overages) and a Pay-as-you-go plan (with overage pricing).
This is useful when you want to:
* Avoid blocking engaged free users who exceed limits
* Convert free users to paying customers through natural usage growth
* Offer a "soft limit" experience without requiring upfront payment
## Example case
We have a product with the following pricing:
* **Free plan**: 1,000 notifications per month included, blocked when exceeded
* **Pay-as-you-go plan**: 1,000 notifications per month included, \$1 per 1,000 notifications beyond the included amount
If a free user exceeds 1,000 notifications, they get blocked.
If they've switched to Pay-as-you-go (by adding a card), they're charged \$1 per 1,000 notifications at the end of the billing period.
## Configure Pricing
#### Create Feature
Create a `metered` `consumable` feature called "notifications".
#### Create Free Plan
Create a free plan with 1,000 notifications included per month. Set `auto-enable` so new customers automatically start on this plan.
#### Create Pay-as-you-go Plan
Create a Pay-as-you-go plan with the same 1,000 notifications included, but with overage pricing:
* **Grant amount**: 1,000 notifications
* **Price**: \$1 per 1,000 notifications per month
* **Billing method**: Usage-based
In advanced, toggle **off** the "Reset usage when enabled" flag. This ensures that when a user switches from Free to Pay-as-you-go, their existing usage carries over instead of resetting to 0.
## Implementation
#### Create an Autumn Customer
When your user signs up, create an Autumn customer. This will automatically assign them the Free plan with 1,000 included notifications.
```typescript Node.js theme={null}
import { Autumn } from "autumn-js";
const autumn = new Autumn({
secretKey: 'am_sk_42424242',
});
const { data, error } = await autumn.customers.create({
id: "user_123",
name: "Jane Doe",
email: "jane@example.com",
});
```
```python Python theme={null}
import asyncio
from autumn import Autumn
autumn = Autumn('am_sk_42424242')
async def main():
customer = await autumn.customers.create(
id="user_123",
name="Jane Doe",
email="jane@example.com",
)
asyncio.run(main())
```
```bash cURL theme={null}
curl --request POST \
--url https://api.useautumn.com/customers \
--header 'Authorization: Bearer am_sk_42424242' \
--header 'Content-Type: application/json' \
--data '{
"id": "user_123",
"name": "Jane Doe",
"email": "jane@example.com"
}'
```
#### Check Access
Before sending a notification, check if the customer has remaining capacity.
```typescript Node.js theme={null}
import { Autumn } from "autumn-js";
const autumn = new Autumn({
secretKey: 'am_sk_42424242',
});
const { data } = await autumn.check({
customer_id: "user_123",
feature_id: "notifications",
});
if (!data.allowed) {
console.log("User is over limit on Free plan");
// Prompt them to switch to Pay-as-you-go
}
```
```python Python theme={null}
import asyncio
from autumn import Autumn
autumn = Autumn("am_sk_42424242")
async def main():
response = await autumn.check(
customer_id="user_123",
feature_id="notifications",
)
if not response.allowed:
print("User is over limit on Free plan")
# Prompt them to switch to Pay-as-you-go
asyncio.run(main())
```
```bash cURL theme={null}
curl -X POST "https://api.useautumn.com/v1/check" \
-H "Authorization: Bearer am_sk_42424242" \
-H "Content-Type: application/json" \
-d '{
"customer_id": "user_123",
"feature_id": "notifications"
}'
```
```json theme={null}
{
"allowed": true,
"customer_id": "user_123",
"feature_id": "notifications",
"balance": 870,
"usage": 130,
"included_usage": 1000,
"unlimited": false,
"overage_allowed": false
}
```
When `balance` reaches 0 and `overage_allowed` is `false`, the user will be blocked.
#### Track Usage
After sending a notification, track the usage.
```typescript Node.js theme={null}
import { Autumn } from "autumn-js";
const autumn = new Autumn({
secretKey: 'am_sk_42424242',
});
await autumn.track({
customer_id: "user_123",
feature_id: "notifications",
value: 1,
});
```
```python Python theme={null}
import asyncio
from autumn import Autumn
autumn = Autumn("am_sk_42424242")
async def main():
await autumn.track(
customer_id="user_123",
feature_id="notifications",
value=1,
)
asyncio.run(main())
```
```bash cURL theme={null}
curl -X POST "https://api.useautumn.com/v1/track" \
-H "Authorization: Bearer am_sk_42424242" \
-H "Content-Type: application/json" \
-d '{
"customer_id": "user_123",
"feature_id": "notifications",
"value": 1
}'
```
#### Switch to Pay-as-you-go
When the user is approaching or has exceeded their limit, prompt them to switch to the Pay-as-you-go plan. Use `attach` with `setup_payment: true` to collect their card without charging upfront.
You can retrieve the user's notification balance from the `check` or `customer` method, and use this to conditionally prompt them to add a payment method.
```typescript Node.js theme={null}
import { Autumn } from "autumn-js";
const autumn = new Autumn({
secretKey: 'am_sk_42424242',
});
const { data } = await autumn.attach({
customer_id: "user_123",
product_id: "pay_as_you_go",
setup_payment: true,
success_url: "https://your-app.com/settings",
});
if (data.url) {
// Redirect user to Stripe setup page
}
```
```python Python theme={null}
import asyncio
from autumn import Autumn
autumn = Autumn("am_sk_42424242")
async def main():
response = await autumn.attach(
customer_id="user_123",
product_id="pay_as_you_go",
setup_payment=True,
success_url="https://your-app.com/settings",
)
if response.url:
# Redirect user to Stripe setup page
pass
asyncio.run(main())
```
```bash cURL theme={null}
curl -X POST "https://api.useautumn.com/v1/attach" \
-H "Authorization: Bearer am_sk_42424242" \
-H "Content-Type: application/json" \
-d '{
"customer_id": "user_123",
"product_id": "pay_as_you_go",
"setup_payment": true,
"success_url": "https://your-app.com/settings"
}'
```
Once the user completes the setup, they'll be switched from the Free plan to the Pay-as-you-go plan. Because "Reset usage when enabled" is off, their existing usage carries over. Any usage beyond 1,000 notifications will be billed at the end of the billing period.
#### Overages are Now Enabled
After switching to Pay-as-you-go, the user's `check` response will show `overage_allowed: true`. They can continue using the feature beyond their included limit.
```json theme={null}
{
"allowed": true,
"customer_id": "user_123",
"feature_id": "notifications",
"balance": -200,
"usage": 1200,
"included_usage": 1000,
"unlimited": false,
"overage_allowed": true
}
```
The user has sent 1,200 notifications (200 over the limit). They will be billed \$0.20 at the end of the billing period.
## Summary
| Plan | Over Limit | Result |
| ------------- | ---------- | ---------------------------------- |
| Free | No | ✅ Allowed |
| Free | Yes | ❌ Blocked |
| Pay-as-you-go | No | ✅ Allowed |
| Pay-as-you-go | Yes | ✅ Allowed, billed at end of period |
# Per-seat pricing
Source: https://docs.useautumn.com/examples/per-seat
Implement per-seat pricing with free included seats and paid additional seats
Per-seat pricing is a common model for B2B SaaS products where customers pay based on the number of users or team members using the product. This guide covers how to implement per-seat pricing with free included seats and paid additional seats.
Seats here are just a number you bill for. If each seat also needs its own quota — 50 summaries per user per month, say — see [entity-level balances](/examples/entity-balances).
## Example case
We have a B2B collaboration tool with the following pricing:
* **Free tier**: 3 seats included for free
* **Pro tier**: \$20/month base price with 5 seats included, plus \$10/seat/month for additional seats
For additional seats, there are two ways to configure pricing in Autumn:
| Billing Model | Description |
| --------------- | ------------------------------------------------------------------------ |
| **Prepaid** | Customer commits to a fixed number of seats upfront and pays immediately |
| **Usage-based** | Customer pays for actual seats used at the end of each billing cycle |
## Configure Pricing
#### Create Feature
Create a `metered` `non-consumable` feature called "seats". Non-consumable features are for persistent resources like seats, GB storage, or workspaces.
#### Create Free Plan
Create a free plan with 3 included seats. Set `auto-enable` so new customers automatically get this plan.
#### Create Pro Plan
Create a Pro plan with a \$20/month base price and 5 included seats.
For additional seats beyond the included 5, add a priced feature at \$10/seat/month. Choose your billing model:
* **Prepaid**: Customer selects quantity upfront, charged immediately
* **Pay per use**: Customer is billed for actual usage at end of billing cycle
For non-consumable features like seats, you can configure how price changes are handled mid-billing cycle.
**On Increase** (adding seats):
| Option | Behavior |
| --------------------- | ------------------------------------ |
| `prorate_immediately` | Charge prorated amount now (default) |
| `bill_immediately` | Charge full amount now |
| `prorate_next_cycle` | Add prorated amount to next invoice |
| `bill_next_cycle` | Add full amount to next invoice |
**On Decrease** (removing seats):
| Option | Behavior |
| --------------------- | ------------------------------------ |
| `prorate_immediately` | Credit prorated amount now (default) |
| `prorate_next_cycle` | Credit on next invoice |
| `no_prorations` | No refund or credit |
You can configure these in the "Advanced" section when adding the priced feature to your plan.
## Implementation
#### Create an Autumn Customer
When your user signs up, create an Autumn customer. This will automatically assign them the Free plan with 3 included seats.
```typescript Node.js theme={null}
import { Autumn } from "autumn-js";
const autumn = new Autumn({
secretKey: 'am_sk_42424242',
});
const { data, error } = await autumn.customers.create({
id: "org_123",
name: "Acme Corp",
email: "admin@acme.com",
});
```
```python Python theme={null}
import asyncio
from autumn import Autumn
autumn = Autumn('am_sk_42424242')
async def main():
customer = await autumn.customers.create(
id="org_123",
name="Acme Corp",
email="admin@acme.com",
)
asyncio.run(main())
```
```bash cURL theme={null}
curl --request POST \
--url https://api.useautumn.com/customers \
--header 'Authorization: Bearer am_sk_42424242' \
--header 'Content-Type: application/json' \
--data '{
"id": "org_123",
"name": "Acme Corp",
"email": "admin@acme.com"
}'
```
#### Check Seat Access
Before adding a new team member, check if the customer has available seats.
```typescript Node.js theme={null}
import { Autumn } from "autumn-js";
const autumn = new Autumn({
secretKey: 'am_sk_42424242',
});
const { data } = await autumn.check({
customer_id: "org_123",
feature_id: "seats",
});
if (!data.allowed) {
console.log("No seats available");
// Prompt upgrade or purchase more seats
}
```
```python Python theme={null}
import asyncio
from autumn import Autumn
autumn = Autumn("am_sk_42424242")
async def main():
response = await autumn.check(
customer_id="org_123",
feature_id="seats",
)
if not response.allowed:
print("No seats available")
# Prompt upgrade or purchase more seats
asyncio.run(main())
```
```bash cURL theme={null}
curl -X POST "https://api.useautumn.com/v1/check" \
-H "Authorization: Bearer am_sk_42424242" \
-H "Content-Type: application/json" \
-d '{
"customer_id": "org_123",
"feature_id": "seats"
}'
```
```json theme={null}
{
"allowed": true,
"customer_id": "org_123",
"feature_id": "seats",
"balance": 1,
"usage": 2,
"included_usage": 3,
"unlimited": false,
"overage_allowed": false
}
```
#### Track Seat Usage
When team members are added, track seat usage. You can use the `track` endpoint to increment usage, or the `usage` endpoint to set the total directly.
Remember to track the usage for the initial user as well, after customer creation.
```typescript Node.js theme={null}
import { Autumn } from "autumn-js";
const autumn = new Autumn({
secretKey: 'am_sk_42424242',
});
// Increment by 1 when a seat is added
await autumn.track({
customer_id: "org_123",
feature_id: "seats",
value: 1,
});
// Or set the total directly
await autumn.usage({
customer_id: "org_123",
feature_id: "seats",
value: 2, // Total seats now in use
});
```
```python Python theme={null}
import asyncio
from autumn import Autumn
autumn = Autumn('am_sk_42424242')
async def main():
# Increment by 1 when a seat is added
await autumn.track(
customer_id="org_123",
feature_id="seats",
value=1,
)
# Or set the total directly
await autumn.features.set_usage(
customer_id="org_123",
feature_id="seats",
value=2, # Total seats now in use
)
asyncio.run(main())
```
```bash cURL theme={null}
# Increment by 1
curl -X POST "https://api.useautumn.com/v1/track" \
-H "Authorization: Bearer am_sk_42424242" \
-H "Content-Type: application/json" \
-d '{
"customer_id": "org_123",
"feature_id": "seats",
"value": 1
}'
# Or set total directly
curl -X POST "https://api.useautumn.com/v1/usage" \
-H "Authorization: Bearer am_sk_42424242" \
-H "Content-Type: application/json" \
-d '{
"customer_id": "org_123",
"feature_id": "seats",
"value": 2
}'
```
Seat usage tracked on the Free tier will **carry over** when the customer upgrades to Pro. If a customer is using 2 seats on Free and upgrades to Pro, those 2 seats remain in use and count against Pro's included seats.
#### Upgrade to Pro
When the customer upgrades to Pro, use the `checkout` endpoint. If they need additional paid seats beyond the 5 included, pass the quantity in `options`.
The `quantity` in options represents the **additional paid seats only**, not total seats. Pro includes 5 seats, so if the customer wants 8 total seats, pass `quantity: 3`.
```typescript Node.js theme={null}
import { Autumn } from "autumn-js";
const autumn = new Autumn({
secretKey: 'am_sk_42424242',
});
// Customer wants 8 total seats (5 included + 3 paid)
const { data } = await autumn.checkout({
customer_id: "org_123",
product_id: "pro",
options: [{
feature_id: "seats",
quantity: 3, // 3 paid seats beyond the 5 included
}],
});
if (data.url) {
// Redirect to Stripe checkout
}
```
```python Python theme={null}
import asyncio
from autumn import Autumn
autumn = Autumn("am_sk_42424242")
async def main():
# Customer wants 8 total seats (5 included + 3 paid)
response = await autumn.checkout(
customer_id="org_123",
product_id="pro",
options=[{
"feature_id": "seats",
"quantity": 3, # 3 paid seats beyond the 5 included
}],
)
if response.url:
# Redirect to Stripe checkout
pass
asyncio.run(main())
```
```bash cURL theme={null}
curl -X POST "https://api.useautumn.com/v1/checkout" \
-H "Authorization: Bearer am_sk_42424242" \
-H "Content-Type: application/json" \
-d '{
"customer_id": "org_123",
"product_id": "pro",
"options": [{
"feature_id": "seats",
"quantity": 3
}]
}'
```
If the customer only needs the 5 included seats, pass `quantity: 0` or omit the options entirely.
#### Update Seat Quantity
How you update seat quantity depends on your billing model:
For prepaid seats, use the `attach` endpoint with updated `options` to change the seat quantity. This will handle proration based on your configuration.
```typescript Node.js theme={null}
import { Autumn } from "autumn-js";
const autumn = new Autumn({
secretKey: 'am_sk_42424242',
});
// Increase from 3 paid seats to 5 paid seats (8 total → 10 total)
const { data } = await autumn.attach({
customer_id: "org_123",
product_id: "pro",
options: [{
feature_id: "seats",
quantity: 5, // New paid seat count
}],
});
```
```python Python theme={null}
import asyncio
from autumn import Autumn
autumn = Autumn("am_sk_42424242")
async def main():
# Increase from 3 paid seats to 5 paid seats (8 total → 10 total)
response = await autumn.attach(
customer_id="org_123",
product_id="pro",
options=[{
"feature_id": "seats",
"quantity": 5, # New paid seat count
}],
)
asyncio.run(main())
```
```bash cURL theme={null}
curl -X POST "https://api.useautumn.com/v1/attach" \
-H "Authorization: Bearer am_sk_42424242" \
-H "Content-Type: application/json" \
-d '{
"customer_id": "org_123",
"product_id": "pro",
"options": [{
"feature_id": "seats",
"quantity": 5
}]
}'
```
**Prepaid quantity math:**
* Pro includes 5 seats
* Current: `quantity: 3` → 8 total seats (5 + 3)
* Updated: `quantity: 5` → 10 total seats (5 + 5)
* Customer is charged prorated amount for 2 additional seats
For usage-based seats, simply track the actual seat usage. Billing happens automatically at the end of each billing cycle based on usage.
```typescript Node.js theme={null}
import { Autumn } from "autumn-js";
const autumn = new Autumn({
secretKey: 'am_sk_42424242',
});
// When a new team member is added
await autumn.track({
customer_id: "org_123",
feature_id: "seats",
value: 1,
});
// Or set the exact count
await autumn.usage({
customer_id: "org_123",
feature_id: "seats",
value: 10, // Now using 10 seats total
});
```
```python Python theme={null}
import asyncio
from autumn import Autumn
autumn = Autumn('am_sk_42424242')
async def main():
# When a new team member is added
await autumn.track(
customer_id="org_123",
feature_id="seats",
value=1,
)
# Or set the exact count
await autumn.features.set_usage(
customer_id="org_123",
feature_id="seats",
value=10, # Now using 10 seats total
)
asyncio.run(main())
```
```bash cURL theme={null}
# Increment when adding a seat
curl -X POST "https://api.useautumn.com/v1/track" \
-H "Authorization: Bearer am_sk_42424242" \
-H "Content-Type: application/json" \
-d '{
"customer_id": "org_123",
"feature_id": "seats",
"value": 1
}'
# Or set the exact count
curl -X POST "https://api.useautumn.com/v1/usage" \
-H "Authorization: Bearer am_sk_42424242" \
-H "Content-Type: application/json" \
-d '{
"customer_id": "org_123",
"feature_id": "seats",
"value": 10
}'
```
With usage-based billing, if the customer uses 10 seats and Pro includes 5, they'll be charged for 5 additional seats (\$50) at the end of the billing cycle.
#### Decrease Seat Quantity
When team members leave, you'll want to decrease the seat count.
Update the `options` with a lower quantity. Depending on your proration configuration, the customer may receive a credit.
```typescript Node.js theme={null}
import { Autumn } from "autumn-js";
const autumn = new Autumn({
secretKey: 'am_sk_42424242',
});
// Decrease from 5 paid seats to 2 paid seats (10 total → 7 total)
const { data } = await autumn.attach({
customer_id: "org_123",
product_id: "pro",
options: [{
feature_id: "seats",
quantity: 2, // New paid seat count
}],
});
```
```python Python theme={null}
import asyncio
from autumn import Autumn
autumn = Autumn("am_sk_42424242")
async def main():
# Decrease from 5 paid seats to 2 paid seats (10 total → 7 total)
response = await autumn.attach(
customer_id="org_123",
product_id="pro",
options=[{
"feature_id": "seats",
"quantity": 2, # New paid seat count
}],
)
asyncio.run(main())
```
```bash cURL theme={null}
curl -X POST "https://api.useautumn.com/v1/attach" \
-H "Authorization: Bearer am_sk_42424242" \
-H "Content-Type: application/json" \
-d '{
"customer_id": "org_123",
"product_id": "pro",
"options": [{
"feature_id": "seats",
"quantity": 2
}]
}'
```
Track the removal or set the new total directly.
```typescript Node.js theme={null}
import { Autumn } from "autumn-js";
const autumn = new Autumn({
secretKey: 'am_sk_42424242',
});
// Decrement by 1 when a seat is removed
await autumn.track({
customer_id: "org_123",
feature_id: "seats",
value: -1,
});
// Or set the new total
await autumn.usage({
customer_id: "org_123",
feature_id: "seats",
value: 7, // Now using 7 seats
});
```
```python Python theme={null}
import asyncio
from autumn import Autumn
autumn = Autumn('am_sk_42424242')
async def main():
# Decrement by 1 when a seat is removed
await autumn.track(
customer_id="org_123",
feature_id="seats",
value=-1,
)
# Or set the new total
await autumn.features.set_usage(
customer_id="org_123",
feature_id="seats",
value=7, # Now using 7 seats
)
asyncio.run(main())
```
```bash cURL theme={null}
# Decrement by 1
curl -X POST "https://api.useautumn.com/v1/track" \
-H "Authorization: Bearer am_sk_42424242" \
-H "Content-Type: application/json" \
-d '{
"customer_id": "org_123",
"feature_id": "seats",
"value": -1
}'
# Or set new total
curl -X POST "https://api.useautumn.com/v1/usage" \
-H "Authorization: Bearer am_sk_42424242" \
-H "Content-Type: application/json" \
-d '{
"customer_id": "org_123",
"feature_id": "seats",
"value": 7
}'
```
## Summary
| Billing Model | Add Seats | Remove Seats | When Billed |
| --------------- | ---------------------------- | ------------------------------ | ---------------------- |
| **Prepaid** | `attach` with new `quantity` | `attach` with lower `quantity` | Immediately (prorated) |
| **Usage-based** | `track` or `usage` | `track` (negative) or `usage` | End of billing cycle |
# One-time top ups
Source: https://docs.useautumn.com/examples/prepaid
Let customers purchase a prepaid package to top up their balance when it falls low.
If a user hits a usage limit you granted them, they may be willing to purchase a top-up.
These are typically one-time purchases (but can also be recurring add-ons) that grant a fixed usage of a feature.
This gives users full spend control and allows your business to be paid upfront. For these reasons, it tends to be a more popular alternative to usage-based pricing -- eg, OpenAI uses this model for their API.
## Example case
In this example, we have an AI chatbot that offers:
* 10 messages per month for free
* An option for customers to top-up messages in packages of \$10 per 100 messages.
## Configure Pricing
#### Create Features
Create a `metered` `consumable` feature for our messages, so we can track their balance.
#### Create Free and Top-up Plans
**Free Plan**
Create a free plan, and assign 10 messages to it. We'll add an interval of "month", so that the user is granted 10 periodically.
Make sure to set the `auto-enable` flag on the free plan, so that it is automatically assigned to new customers.
**Top up Plan**
Now we'll create our top-up plan. Again, we'll assign the messages feature, but this time with a `prepaid` price of \$10 per 100 messages.
Since these messages have interval "one-off", the messages will last forever (unlike our Free plan messages, which reset every month).
Features with a `prepaid` price require a `quantity` to be passed in when a customer purchases the plan, so the customer can specify how many messages they want to top up with.
## Implementation
#### Create an Autumn Customer
When your user signs up, create an Autumn customer. This will automatically assign them the Free plan, and grant them the 10 monthly messages.
```typescript Node.js theme={null}
import { Autumn } from "autumn-js";
const autumn = new Autumn({
secretKey: 'am_sk_42424242',
});
const { data, error } = await autumn.customers.create({
id: "user_or_org_id_from_auth",
name: "John Yeo",
email: "john@example.com",
});
```
```python Python theme={null}
import asyncio
from autumn import Autumn
autumn = Autumn('am_sk_42424242')
async def main():
customer = await autumn.customers.create(
id="user_or_org_id_from_auth",
name="John Yeo",
email="john@example.com",
)
asyncio.run(main())
```
```bash cURL theme={null}
curl --request POST \
--url https://api.useautumn.com/customers \
--header 'Authorization: Bearer am_sk_42424242' \
--header 'Content-Type: application/json' \
--data '{
"id": "user_or_org_id_from_auth",
"name": "John Yeo",
"email": "john@example.com"
}'
```
#### Checking for access
Before our user sends a message, we'll first check if they have a balance of messages remaining.
```typescript Node.js theme={null}
import { Autumn } from "autumn-js";
const autumn = new Autumn({
secretKey: 'am_sk_42424242',
});
const { data } = await autumn.check({
customer_id: "user_or_org_id_from_auth",
feature_id: "messages",
});
if (!data.allowed) {
console.log("User has run out of messages");
return;
}
```
```python Python theme={null}
import asyncio
from autumn import Autumn
autumn = Autumn("am_sk_1234567890")
async def main():
response = await autumn.check(
customer_id="user_or_org_id_from_auth",
feature_id="messages",
)
if not response.allowed:
print("User has run out of messages")
return
asyncio.run(main())
```
```bash cURL theme={null}
curl -X POST "https://api.useautumn.com/v1/check" \
-H "Authorization: Bearer am_sk_1234567890" \
-H "Content-Type: application/json" \
-d '{
"customer_id": "user_or_org_id_from_auth",
"feature_id": "messages"
}'
```
```json theme={null}
{
"customer_id": "user_or_org_id_from_auth",
"feature_id": "messages",
"code": "feature_found",
"allowed": true,
"balance": 10,
"usage": 0,
"included_usage": 10,
"unlimited": false,
"interval": null,
"interval_count": 1,
"next_reset_at": 2803498203,
"overage_allowed": false
}
```
#### Tracking messages used
After the user has used a message, record it in Autumn to decrease their remaining balance. In this example, the user used 5 messages.
```typescript Node.js theme={null}
import { Autumn } from "autumn-js";
const autumn = new Autumn({
secretKey: 'am_sk_42424242',
});
await autumn.track({
customer_id: "user_or_org_id_from_auth",
feature_id: "messages",
value: 5,
});
```
```python Python theme={null}
import asyncio
from autumn import Autumn
autumn = Autumn("am_sk_42424242")
async def main():
await autumn.track(
customer_id="user_or_org_id_from_auth",
feature_id="messages",
value=5,
)
asyncio.run(main())
```
```bash cURL theme={null}
curl -X POST "https://api.useautumn.com/v1/track" \
-H "Authorization: Bearer am_sk_42424242" \
-H "Content-Type: application/json" \
-d '{
"customer_id": "user_or_org_id_from_auth",
"feature_id": "messages",
"value": 5
}'
```
```json theme={null}
{
"code": "event_received",
"customer_id": "user_or_org_id_from_auth",
"feature_id": "messages"
}
```
#### Purchasing top-ups
When users run out of messages, they can purchase additional messages using our top-up plan. In this example, the user is purchasing 200 premium messages, which will cost them \$20.
```typescript Node.js theme={null}
import { Autumn } from "autumn-js";
const autumn = new Autumn({
secretKey: 'am_sk_42424242',
});
const { data } = await autumn.checkout({
customer_id: "user_or_org_id_from_auth",
product_id: "top_up",
options: [{
feature_id: "messages",
quantity: 200,
}],
});
if (data.url) {
// Redirect user to Stripe checkout URL
} else {
// Show purchase preview to user
}
```
```python Python theme={null}
import asyncio
from autumn import Autumn
autumn = Autumn("am_sk_42424242")
async def main():
response = await autumn.checkout(
customer_id="user_or_org_id_from_auth",
product_id="top-up",
options=[{
"feature_id": "messages",
"quantity": 200,
}],
)
if response.url:
# Redirect user to Stripe checkout URL
pass
else:
# Show purchase preview to user
pass
asyncio.run(main())
```
```bash cURL theme={null}
curl -X POST "https://api.useautumn.com/v1/checkout" \
-H "Authorization: Bearer am_sk_42424242" \
-H "Content-Type: application/json" \
-d '{
"customer_id": "user_or_org_id_from_auth",
"product_id": "top-up",
"options": [{
"feature_id": "messages",
"quantity": 200
}]
}'
```
```json theme={null}
{
"customer_id": "user_or_org_id_from_auth",
"lines": [
{
"description": "Top-up - 200 premium messages",
"amount": 20,
"item": {
"type": "feature",
"feature_id": "premium-messages",
"feature_type": "prepaid",
"feature": {
"id": "premium-messages",
"name": "Premium messages",
"type": "metered",
"display": {
"singular": "premium message",
"plural": "premium messages"
}
},
"quantity": 200,
"price": 10,
"price_per": 100,
"display": {
"primary_text": "200 premium messages",
"secondary_text": "$10 per 100 messages"
}
}
}
],
"product": {
"id": "top-up",
"name": "Top-up",
"group": null,
"env": "sandbox",
"is_add_on": false,
"is_default": false,
"archived": false,
"version": 1,
"created_at": 1766428038264,
"items": [
{
"type": "feature",
"feature_id": "premium-messages",
"feature_type": "prepaid",
"feature": {
"id": "premium-messages",
"name": "Premium messages",
"type": "metered",
"display": {
"singular": "premium message",
"plural": "premium messages"
}
},
"price": 10,
"price_per": 100,
"display": {
"primary_text": "$10 per 100 messages"
}
}
],
"free_trial": null,
"base_variant_id": null,
"scenario": "attach",
"properties": {
"is_free": false,
"is_one_off": true,
"has_trial": false,
"updateable": false
}
},
"total": 20,
"currency": "usd",
"url": "https://checkout.stripe.com/c/pay/.......",
"has_prorations": false
}
```
Once the customer completes the payment, they will have an additional 200 premium messages available to use.
#### Displaying balances to the user
You can display to the user by getting balances from the `customer` method. Under the `customer.features` record, you'll be able to retrieve a current balance, total granted, and a `breakdown` of their monthly vs top-up messages.
```typescript Node.js [expandable] theme={null}
import { Autumn } from "autumn-js";
const autumn = new Autumn({
secretKey: 'am_sk_42424242',
});
const { data } = await autumn.customer({
customer_id: "user_or_org_id_from_auth",
});
const messages = data?.features?.messages;
// Extract monthly vs prepaid balances from the breakdown
const monthlyBalance = messages?.breakdown?.find(
(b) => b.interval === "month"
);
const prepaidBalance = messages?.breakdown?.find(
(b) => b.interval === "lifetime"
);
console.log(`Monthly: ${monthlyBalance?.balance ?? 0} remaining`);
console.log(`Prepaid: ${prepaidBalance?.balance ?? 0} remaining`);
console.log(`Total: ${messages?.balance ?? 0} messages available`);
```
```python Python [expandable] theme={null}
import asyncio
from autumn import Autumn
autumn = Autumn("am_sk_42424242")
async def main():
response = await autumn.customer(
customer_id="user_or_org_id_from_auth",
)
messages = response.features.get("messages", {})
breakdown = messages.get("breakdown", [])
# Extract monthly vs prepaid balances
monthly = next((b for b in breakdown if b.get("interval") == "month"), None)
prepaid = next((b for b in breakdown if b.get("interval") == "lifetime"), None)
print(f"Monthly: {monthly['balance'] if monthly else 0} remaining")
print(f"Prepaid: {prepaid['balance'] if prepaid else 0} remaining")
print(f"Total: {messages.get('balance', 0)} messages available")
asyncio.run(main())
```
```bash cURL theme={null}
curl -X GET "https://api.useautumn.com/v1/customers/user_or_org_id_from_auth" \
-H "Authorization: Bearer am_sk_42424242" \
-H "Content-Type: application/json"
# get features usage object from customer.features.[feature_id]
```
```json theme={null}
{
"features": {
"messages": {
"id": "messages",
"type": "single_use",
"name": "Messages",
"interval": "multiple",
"interval_count": null,
"unlimited": false,
"balance": 205,
"usage": 5,
"included_usage": 210,
"next_reset_at": null,
"overage_allowed": false,
"breakdown": [
{
"interval": "month",
"interval_count": 1,
"balance": 5,
"usage": 5,
"included_usage": 10,
"next_reset_at": 1772191445539,
"overage_allowed": false
},
{
"interval": "lifetime",
"interval_count": 1,
"balance": 200,
"usage": 0,
"included_usage": 200,
"next_reset_at": null,
"overage_allowed": false
}
]
}
},
}
```
# Trial - card not required
Source: https://docs.useautumn.com/examples/trial-card-not-required
Enable a trial period that customers can access without providing payment information
Card-not-required trials give customers full access to a paid plan for a limited time without requiring payment information upfront. Customers can optionally add a payment method during the trial to continue using the plan after it expires.
After the trial period, if no payment method is provided, customers lose access to the plan. If they add a payment method, billing begins automatically when the trial ends.
Companies using this model include Cursor, Greptile and Vercel.
## Configure Pricing
You can toggle on a trial for a plan when creating it, or in the "plan settings" section. Switch off the "card required" flag.
The "card required" flag will only be visible if the plan is a paid plan. However, you can also add a limited-time trial to a free plan.
This is similar to a card-not-required trial, but there will be no automatic billing when the trial ends. Instead, you can manually `attach` the plan to the customer to bill them.
Since no card is required, you can choose whether the plan is enabled automatically when a customer is created, or if you want to manually attach the plan to a customer (eg, when they opt-in to the trial).
If you switch the "auto-enable" flag to true, the trial plan will be automatically applied to newly created customers. The plan will be labelled as an `auto-trial` plan. Customers will only be able to access this trial once.
You can also create another `free` `auto-enable` plan without a trial. This will be enabled if the customer does not add a payment method during the trial, or if they cancel their plan later on.
## Implementation
#### Enabling the trial
Attach the plan to the customer to enable the trial. Since no card is required, no checkout is needed.
If you switched the "auto-enable" flag to true, you can skip the attach step as the trial will be automatically applied to newly created customers.
```typescript TypeScript theme={null}
import { Autumn } from "autumn-js";
const autumn = new Autumn({ secretKey: "am_sk_test_1234" });
const response = await autumn.billing.attach({
customerId: "user_123",
planId: "pro",
});
// For card-not-required trials, paymentUrl may be null
// if the trial is enabled without requiring payment
```
```python Python theme={null}
from autumn_sdk import Autumn
autumn = Autumn("am_sk_test_1234")
response = await autumn.billing.attach(
customer_id="user_123",
plan_id="pro",
)
```
```bash cURL theme={null}
curl -X POST "https://api.useautumn.com/v1/attach" \
-H "Authorization: Bearer am_sk_test_1234" \
-H "Content-Type: application/json" \
-d '{
"customer_id": "user_123",
"plan_id": "pro"
}'
```
The trial will only be applied once per customer.
#### Adding a payment method
Customers can add a payment method and transition to the paid version of the plan using the setup payment endpoint. Once the trial ends, they will be charged for the plan.
If the customer does not add a payment method, the trial will expire and they will lose access to the plan.
```typescript TypeScript theme={null}
import { Autumn } from "autumn-js";
const autumn = new Autumn({ secretKey: "am_sk_test_1234" });
const response = await autumn.billing.setupPayment({
customerId: "user_123",
successUrl: "https://your-app.com/success",
});
redirect(response.url);
```
```python Python theme={null}
from autumn_sdk import Autumn
autumn = Autumn("am_sk_test_1234")
response = await autumn.billing.setup_payment(
customer_id="user_123",
success_url="https://your-app.com/success",
)
# Redirect to response.url
```
```bash cURL theme={null}
curl -X POST "https://api.useautumn.com/v1/billing.setup_payment" \
-H "Authorization: Bearer am_sk_test_1234" \
-H "Content-Type: application/json" \
-d '{
"customer_id": "user_123",
"success_url": "https://your-app.com/success"
}'
```
If there's a payment method on file, the customer will be charged. Otherwise, the trial plan will expire. If there's another non-trial auto-enable plan (like a free tier), it will be automatically enabled.
#### Ending the trial early
You can end the trial early by cancelling the plan immediately, and attaching it again. You may want to pass in a `reward` into the attach request to give the customer a discount for upgrading early.
Make sure to warn the user that this action will cancel their current trial before proceeding.
```typescript TypeScript theme={null}
import { Autumn } from "autumn-js";
const autumn = new Autumn({ secretKey: "am_sk_test_1234" });
// Cancel the trial immediately
await autumn.billing.update({
customerId: "user_123",
planId: "pro",
cancelAction: "cancel_immediately",
});
// Attach the plan again with a reward
const response = await autumn.billing.attach({
customerId: "user_123",
planId: "pro",
reward: "early_end",
});
console.log("Trial ended early");
```
```python Python theme={null}
from autumn_sdk import Autumn
autumn = Autumn("am_sk_test_1234")
# Cancel the trial immediately
await autumn.billing.update(
customer_id="user_123",
plan_id="pro",
cancel_action="cancel_immediately",
)
# Attach the plan again with a reward
response = await autumn.billing.attach(
customer_id="user_123",
plan_id="pro",
reward="early_end",
)
print("Trial ended early")
```
```bash cURL theme={null}
# Cancel the trial immediately
curl -X POST "https://api.useautumn.com/v1/billing/update" \
-H "Authorization: Bearer am_sk_test_1234" \
-H "Content-Type: application/json" \
-d '{
"customer_id": "user_123",
"plan_id": "pro",
"cancel_action": "cancel_immediately"
}'
# Attach the plan again with a reward
curl -X POST "https://api.useautumn.com/v1/attach" \
-H "Authorization: Bearer am_sk_test_1234" \
-H "Content-Type: application/json" \
-d '{
"customer_id": "user_123",
"plan_id": "pro",
"reward": "early_end"
}'
```
***
# Trial - card required
Source: https://docs.useautumn.com/examples/trial-card-required
Enable a trial period where customers must provide payment information upfront.
Card-required trials give customers full access to a paid plan for a limited time. Payment information is collected upfront, and customers are billed after the trial ends.
Customers can cancel anytime during the trial period. If they cancel, their account downgrades when the trial expires. If they don't cancel, billing begins automatically.
Companies using this model include Lindy, Descript and Fxyer.
## Configure Pricing
You can toggle on a free trial for a plan when creating it, or in the "plan settings" section. By default, the "card required" flag is set to true.
You can optionally charge a small upfront fee for trial access, often used to qualify leads and reduce trial abuse while maintaining low barrier to entry.
Create an add-on plan, with a one-time price. We will attach the plan with a free trial, and the trial-fee add on at the same time.
## Implementation
#### Enabling the trial
Enable the trial with the normal plan enablement flow. Only customers that have not used the trial before will be able to access it.
```typescript TypeScript theme={null}
import { Autumn } from "autumn-js";
const autumn = new Autumn({ secretKey: "am_sk_test_1234" });
const response = await autumn.billing.attach({
customerId: "user_123",
planId: "pro",
});
// Redirect to Stripe Checkout for card collection
redirect(response.paymentUrl);
```
```python Python theme={null}
from autumn_sdk import Autumn
autumn = Autumn("am_sk_test_1234")
response = await autumn.billing.attach(
customer_id="user_123",
plan_id="pro",
)
# Redirect to response.payment_url
```
```bash cURL theme={null}
curl -X POST "https://api.useautumn.com/v1/attach" \
-H "Authorization: Bearer am_sk_test_1234" \
-H "Content-Type: application/json" \
-d '{
"customer_id": "user_123",
"plan_id": "pro"
}'
```
```typescript TypeScript theme={null}
import { Autumn } from "autumn-js";
const autumn = new Autumn({ secretKey: "am_sk_test_1234" });
const response = await autumn.billing.attach({
customerId: "user_123",
planIds: ["pro", "trial_fee"],
});
redirect(response.paymentUrl);
```
```python Python theme={null}
from autumn_sdk import Autumn
autumn = Autumn("am_sk_test_1234")
response = await autumn.billing.attach(
customer_id="user_123",
plan_ids=["pro", "trial_fee"],
)
# Redirect to response.payment_url
```
```bash cURL theme={null}
curl -X POST "https://api.useautumn.com/v1/attach" \
-H "Authorization: Bearer am_sk_test_1234" \
-H "Content-Type: application/json" \
-d '{
"customer_id": "user_123",
"plan_ids": ["pro", "trial_fee"]
}'
```
You may want to block certain users from accessing the trial. You can pass in `freeTrial: false` into the attach request to disable the trial.
After the trial ends, the customer will be automatically charged the full price of the plan.
#### Ending the trial early
You can end the trial early by cancelling the plan immediately, and attaching it again. You may want to pass in a `reward` into the attach request to give the customer a discount for upgrading early.
```typescript TypeScript theme={null}
import { Autumn } from "autumn-js";
const autumn = new Autumn({ secretKey: "am_sk_test_1234" });
// Cancel the trial immediately
await autumn.billing.update({
customerId: "user_123",
planId: "pro",
cancelAction: "cancel_immediately",
});
// Attach the plan again with a reward
const response = await autumn.billing.attach({
customerId: "user_123",
planId: "pro",
reward: "early_end",
});
console.log("Trial ended early");
```
```python Python theme={null}
from autumn_sdk import Autumn
autumn = Autumn("am_sk_test_1234")
# Cancel the trial immediately
await autumn.billing.update(
customer_id="user_123",
plan_id="pro",
cancel_action="cancel_immediately",
)
# Attach the plan again with a reward
response = await autumn.billing.attach(
customer_id="user_123",
plan_id="pro",
reward="early_end",
)
print("Trial ended early")
```
```bash cURL theme={null}
# Cancel the trial immediately
curl -X POST "https://api.useautumn.com/v1/billing/update" \
-H "Authorization: Bearer am_sk_test_1234" \
-H "Content-Type: application/json" \
-d '{
"customer_id": "user_123",
"plan_id": "pro",
"cancel_action": "cancel_immediately"
}'
# Attach the plan again with a reward
curl -X POST "https://api.useautumn.com/v1/attach" \
-H "Authorization: Bearer am_sk_test_1234" \
-H "Content-Type: application/json" \
-d '{
"customer_id": "user_123",
"plan_id": "pro",
"reward": "early_end"
}'
```
#### Cancelling the trial
Customers can cancel the trial at any time. If they cancel, the plan will expire when the trial ends. If there is an `auto-enable` plan (eg your free tier), this will then be enabled.
You can uncancel the trial plan by attaching it again.
```typescript TypeScript theme={null}
import { Autumn } from "autumn-js";
const autumn = new Autumn({ secretKey: "am_sk_test_1234" });
await autumn.billing.update({
customerId: "user_123",
planId: "pro",
cancelAction: "cancel_end_of_cycle",
});
console.log("Trial cancelled");
```
```python Python theme={null}
from autumn_sdk import Autumn
autumn = Autumn("am_sk_test_1234")
await autumn.billing.update(
customer_id="user_123",
plan_id="pro",
cancel_action="cancel_end_of_cycle",
)
print("Trial cancelled")
```
```bash cURL theme={null}
curl -X POST "https://api.useautumn.com/v1/billing/update" \
-H "Authorization: Bearer am_sk_test_1234" \
-H "Content-Type: application/json" \
-d '{
"customer_id": "user_123",
"plan_id": "pro",
"cancel_action": "cancel_end_of_cycle"
}'
```
***
1. Enabling the trial
2. Ending the trial period
3. Ending the trial early
4. Cancelling trial
You can test using stripe test clock
# Welcome to Autumn
Source: https://docs.useautumn.com/welcome
Drop-in, open-source control layer for AI and SaaS monetization.
## What is Autumn?
Autumn is your source of truth for billing and entitlements between your application and Stripe.
It manages subscription state, credit balances, feature entitlements, and usage enforcement — the logic you'd otherwise build and maintain across your codebase, database, and Stripe webhooks.
Your app can query Autumn inline to determine what a customer is allowed to do (send an AI message, access SSO, add a seat) and to track usage against their balance.
Because billing logic lives in Autumn, pricing changes and custom deals become a simple configuration change. No migrations or rebuild.
## Why use Autumn?
AI monetization is harder than what came before. For reference, OpenAI wrote a [post](https://openai.com/index/beyond-rate-limits/) about their in-house system.
| Area | What you'd build |
| ---------------- | ------------------------------------------------------------------------------------------------ |
| Subscriptions | Checkouts, proration, schedules, add-ons, trials. |
| Credit ledgers | Real-time enforcement, periodic and one-time grants, rollovers, expiration, concurrency control. |
| Observability | Usage history charts, groups and filters, logs, ClickHouse. |
| Entitlements | Feature gating per plan, boolean and metered features, seat-based allowances. |
| Billing Controls | Spend caps, auto top-ups, overage handling, usage alerts. |
| Pricing changes | Versioning, grandfathering, migration scripts, backwards compatibility. |
| Enterprise | Custom contracts, tiered pricing, per-customer credit grants, expansion logic. |
| Edge cases | Plan switching, monthly↔annual changes, failed payments, 3DS, race conditions, refunds. |
Billing starts with a simple checkout flow, and balloons in complexity as you add more features and scale. And when you want to change your pricing, you need to rebuild everything. Yet, it's a critical part of your product that you cannot afford to get wrong.
You can choose to build this yourself, or use Autumn to offload all this logic out of your codebase. It's less work, more flexible, and more reliable.
## How is this different?
Other billing tools are designed for post-hoc invoicing: you send usage events, they generate invoices at end of period. Your app still owns access control, usage limits, and plan change logic.
Autumn is a real-time system of record. You can query it for the current state of any customer (plan, entitlements, balances) inline, via cache, or via webhooks. Because Autumn owns the state (not your code or database), edge cases like proration, failed payments, and concurrency are handled automatically. Pricing changes become config, not code.
Autumn builds on top of Stripe rather than replacing it. Your subscriptions, customers, and payment details stay in your own Stripe account.
While Autumn's core focus is credit-based AI monetization, it handles any SaaS pricing model. Many of our users have no usage-based features at all, and just prefer the developer experience (eg, no webhooks).
## FAQ
Yes. Autumn works with Stripe — it handles the billing logic that Stripe doesn't. You keep your Stripe account, your customer relationships, and your payment data. Autumn sits between your app and Stripe, managing webhooks, usage limits, and state.
Your subscriptions live in Stripe. You're never locked in.
For latency-sensitive operations, you may not want to make an `autumn.check()` network call before every action.
You can either cache the Autumn customer data on your end, or use the `customer.products.updated` webhook to replicate Autumn state into your own system.
Not being able to reach Autumn does not mean your app goes down. The SDKs default to fail-open and fail-fast, meaning in a worst case, some users get temporary additional access.
We can help reconcile usage tracking and balances afterward if needed.
Orb and Metronome focus on usage metering — tracking how much customers consume for end-of-period invoicing. You still build access control and state management separately.
Autumn is a complete system of record: usage metering, entitlements, feature gating, and billing state in one API.
Autumn is open source. You can self-host anytime, or export all your data. Your Stripe subscriptions, customers, and payment details remain yours.
You can migrate gradually: replicate customer state into your own system via webhooks, then make a full transition.
If you're setting up payments for the first time, most teams go live in under an hour. Migrating from an existing billing system typically takes 1–2 weeks depending on complexity.
For larger companies, we provide a forward-deployed service: dual-write to your internal system and Autumn, then migrate over.
Autumn supports 10,000+ events per second per end customer. If you have specific throughput requirements, reach out and we'll walk through the architecture.
We'll help you model your pricing and go live in a couple of days.
Connect with us, other users, and get integration support within minutes.