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

# Update Customer

> Updates an existing customer by ID.

### Balance allocations

Set `billing_controls.balance_allocations` to reserve shared credits for entities. This customer-update-only control replaces the full configuration: include every feature and entity you want to keep, omit the field to leave it unchanged, or send `[]` to release all allocations.

```typescript TypeScript theme={null}
await autumn.customers.update({
  customerId: "customer_123",
  billingControls: {
    balanceAllocations: [{
      featureId: "credits",
      interval: "month",
      allocations: [
        { entityId: "workspace_a", amount: 300 },
        { entityId: "workspace_b", amount: 200 },
      ],
    }],
  },
});
```

The response returns requested amounts under `billing_controls.balance_allocations`; read `balances` for effective amounts after proportional scaling.

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

**properties**

Replace all customer-level balance allocations. Omit to keep existing allocations; pass \[] to release all. Available only when updating an existing customer.

**properties**

The feature whose shared customer credits are allocated.

The reset interval of the shared credits being allocated.

Complete list of entity allocations for this feature. Omitted entities release their shares.

**properties**

The public entity ID.

Requested credits per cycle, before proportional scaling. 0 releases the allocation.

List of auto top-up configurations per feature.

**properties**

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 or amount to set the current window's consumed top-ups or charged amount.

**properties**

What `limit` caps: the number of auto top-ups (`count`, default) or the total amount charged for them, in the customer's currency (`amount`).

The time interval for the purchase limit window.

Number of intervals in the purchase limit window.

Maximum allowed within the interval: a number of auto top-ups when limit\_type is count, or a total charge (e.g. 500 for \$500, pre-tax) when limit\_type is amount.

Set the current window's consumed auto top-up count. Omit to leave runtime state unchanged.

Set the amount already charged by auto top-ups in the current window. 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).

**properties**

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.

**properties**

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.

**properties**

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.

**properties**

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. remaining and remaining\_percentage accept negative values with basis balance, to alert once the balance is overdrawn.

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.

**properties**

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.

**properties**

The feature ID this overage allowed control applies to.

Whether overage is allowed for this feature.

Miscellaneous configurations for the customer.

**properties**

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.

Keeps this customer's plans working while past due: balances still reset, usage is not blocked and Stripe does not cancel the subscription. When set, this overrides each plan's ignore\_past\_due setting.

How this customer's renewal invoices are issued when the subscription is invoiced (send\_invoice). draft leaves the renewal invoice editable for manual review. finalize opens it without Stripe emailing, reminding or charging (auto\_advance off). send lets Stripe finalize and email it as usual. invoice\_mode.issue\_method on attach only shapes the subscription's first invoice; renewals follow this. Pass null to clear it.

Billing details stored on the linked Stripe customer. Requires a Stripe customer.

**properties**

Billing address, used for tax and shown on invoices. Replaces the whole address, as in Stripe; null clears it.

**properties**

Two-letter country code (ISO 3166-1 alpha-2).

Tax IDs to add or remove (e.g. VAT). Stripe tax IDs cannot be edited, so change one by removing the old ID and adding the new one. IDs not listed are kept.

**properties**

Tax IDs to add. IDs the customer already has are ignored.

**properties**

Stripe tax ID type, e.g. eu\_vat, gb\_vat, us\_ein. See [https://docs.stripe.com/billing/customer/tax-ids#supported-tax-id](https://docs.stripe.com/billing/customer/tax-ids#supported-tax-id)

The tax ID, e.g. DE123456789.

Tax IDs to remove, matched by type and value. IDs the customer doesn't have are ignored.

**properties**

Stripe tax ID type, e.g. eu\_vat, gb\_vat, us\_ein. See [https://docs.stripe.com/billing/customer/tax-ids#supported-tax-id](https://docs.stripe.com/billing/customer/tax-ids#supported-tax-id)

The tax ID, e.g. DE123456789.

Tax exemption status. Use reverse for reverse-charge customers.

**properties**

Up to 4 custom fields shown on every invoice, e.g. a PO number. Replaces the existing list; null clears it.

**properties**

Label, e.g. PO Number.

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

**properties**

Customer-level entity allocations of shared credits. Amounts are requested shares before proportional scaling.

**properties**

The feature whose shared customer credits are allocated.

The reset interval of the shared credits being allocated.

Complete list of entity allocations for this feature. Omitted entities release their shares.

**properties**

The public entity ID.

Requested credits per cycle, before proportional scaling. 0 releases the allocation.

List of auto top-up configurations per feature.

**properties**

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 the count of top ups, amount charged and the next\_reset\_at.

**properties**

What `limit` caps: `count` of auto top-ups or `amount` charged. Null when no purchase limit is configured.

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 allowed within the interval (top-ups for count, charge for amount). Null when no purchase limit is configured.

Number of auto top-ups already consumed in the current window.

Amount charged by auto top-ups in the current window, pre-tax, in the customer's currency.

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

**properties**

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.

**properties**

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.

**properties**

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.

**properties**

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. remaining and remaining\_percentage accept negative values with basis balance, to alert once the balance is overdrawn.

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.

**properties**

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.

**properties**

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.

**properties**

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.

**properties**

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.

**properties**

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.

**properties**

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

**properties**

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.

**properties**

**properties**

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.

**properties**

Bills this many feature units when outstanding overage reaches it.

**properties**

The ID of the feature this item configures.

The full feature object if expanded.

**properties**

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.

**properties**

The singular display name for the feature.

The plural display name for the feature.

Credit cost schema for credit system features.

**properties**

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.

**properties**

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.

**properties**

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

**properties**

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

**properties**

**properties**

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.

How tiers price usage. 'graduated' (default) charges each unit at the rate of the tier it falls in. 'volume' picks one tier from total usage. On usage-based items it bills only usage past the included amount, at the rate of the tier total usage reaches, plus its flat\_amount. On prepaid items it charges every unit, the included ones too, at that tier's rate plus its flat\_amount.

Billing interval for this price. For usage-based features, should match reset.interval, unless the price has graduated tiers and reset.interval is a whole multiple of it: each invoice then bills only the newly owed usage, at the tier the reset period has reached.

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.

**properties**

**properties**

Stripe price ID. For prepaid with included > 0 this is the V2 price.

Display text for showing this item in pricing pages.

**properties**

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.

**properties**

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.

Purchased units expire this long after each purchase. One-off prepaid consumable items only.

**properties**

Overrides fields of this item's feature for customers on this plan (e.g. a credit system's credit\_schema).

**properties**

For credit system features: merges into the feature's credit\_schema by metered\_feature\_id for customers on this plan. A row with a rate overrides or adds that feature, a row with `excluded: true` removes it, and unlisted features keep the credit system's rate.

**properties**

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.

Named adjustments chosen by event properties. Every match applies: factors multiply, then adds are summed.

**properties**

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.

**properties**

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.

Removes this feature from the credit system for customers on this plan. Cannot be combined with a rate.

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.

**properties**

Default percentage markup for customers on this plan. Use -100 to make usage free.

Per-provider markup percentages for customers on this plan.

**properties**

Per-model markup overrides for customers on this plan.

**properties**

Payment processors this plan is connected to. Omitted when unset.

**properties**

**properties**

Stripe product ID this plan is billed under.

Extra Stripe product IDs aliased to this plan.

**properties**

Every RevenueCat product that maps to this plan. Replaces the current set.

**properties**

RevenueCat product ID that grants this plan when purchased.

Prepaid quantities granted when this specific RevenueCat product is purchased, in feature units.

**properties**

Free trial configuration. If set, new customers can try this plan before being charged.

**properties**

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.

**properties**

If true, entitlements attached to this plan will still reset on schedule even when the customer's product is in a past\_due state.

Anchor billing and reset cycles to the 1st of the month (UTC).

Plan-level billing controls used as customer defaults.

**properties**

List of auto top-up configurations per feature.

**properties**

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 limit on auto top-ups per window, by number of top-ups or amount charged.

**properties**

What `limit` caps: the number of auto top-ups (`count`, default) or the total amount charged for them, in the customer's currency (`amount`).

The time interval for the purchase limit window.

Number of intervals in the purchase limit window.

Maximum allowed within the interval: a number of auto top-ups when limit\_type is count, or a total charge (e.g. 500 for \$500, pre-tax) when limit\_type is amount.

When true, auto top-up creates a send\_invoice invoice instead of auto-charging.

List of overage spend limits per feature (caps overage spend).

**properties**

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

**properties**

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.

**properties**

List of usage alert configurations per feature.

**properties**

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. remaining and remaining\_percentage accept negative values with basis balance, to alert once the balance is overdrawn.

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.

**properties**

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.

**properties**

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.

**properties**

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.

**properties**

The ID of the base plan this variant was derived from.

The customization that transforms the base plan into this variant.

**properties**

Base price configuration for a plan.

**properties**

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.

**properties**

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

**properties**

Bills this many feature units when outstanding overage reaches it.

**properties**

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.

**properties**

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.

**properties**

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

**properties**

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

**properties**

**properties**

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.

How tiers price usage. 'graduated' (default) charges each unit at the rate of the tier it falls in. 'volume' picks one tier from total usage. On usage-based items it bills only usage past the included amount, at the rate of the tier total usage reaches, plus its flat\_amount. On prepaid items it charges every unit, the included ones too, at that tier's rate plus its flat\_amount.

Billing interval. For usage-based features, should match reset.interval, unless the price has graduated tiers and reset.interval is a whole multiple of it: each invoice then bills only the newly owed usage, at the tier the reset period has reached.

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.

**properties**

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.

**properties**

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.

Purchased units expire this long after each purchase. One-off prepaid consumable items only.

**properties**

Overrides fields of this item's feature for customers on this plan (e.g. a credit system's credit\_schema).

**properties**

For credit system features: merges into the feature's credit\_schema by metered\_feature\_id for customers on this plan. A row with a rate overrides or adds that feature, a row with `excluded: true` removes it, and unlisted features keep the credit system's rate.

**properties**

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.

Named adjustments chosen by event properties. Every match applies: factors multiply, then adds are summed.

**properties**

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.

**properties**

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.

Removes this feature from the credit system for customers on this plan. Cannot be combined with a rate.

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.

**properties**

Default percentage markup for customers on this plan. Use -100 to make usage free.

Per-provider markup percentages for customers on this plan.

**properties**

Per-model markup overrides for customers on this plan.

**properties**

Filters selecting items to remove from the plan.

**properties**

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.

**properties**

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.

**properties**

List of auto top-up configurations per feature.

**properties**

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 or amount to set the current window's consumed top-ups or charged amount.

**properties**

What `limit` caps: the number of auto top-ups (`count`, default) or the total amount charged for them, in the customer's currency (`amount`).

The time interval for the purchase limit window.

Number of intervals in the purchase limit window.

Maximum allowed within the interval: a number of auto top-ups when limit\_type is count, or a total charge (e.g. 500 for \$500, pre-tax) when limit\_type is amount.

Set the current window's consumed auto top-up count. Omit to leave runtime state unchanged.

Set the amount already charged by auto top-ups in the current window. 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).

**properties**

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

**properties**

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.

**properties**

List of usage alert configurations per feature.

**properties**

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. remaining and remaining\_percentage accept negative values with basis balance, to alert once the balance is overdrawn.

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.

**properties**

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.

**properties**

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.

**properties**

**properties**

Base price configuration for a plan.

**properties**

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.

**properties**

Three-letter Stripe-supported currency code (e.g. 'eur', 'gbp').

Price amount in this currency. Set explicitly per currency, not converted from the base amount.

**properties**

Bills this many feature units when outstanding overage reaches it.

**properties**

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.

**properties**

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.

**properties**

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

**properties**

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

**properties**

**properties**

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.

How tiers price usage. 'graduated' (default) charges each unit at the rate of the tier it falls in. 'volume' picks one tier from total usage. On usage-based items it bills only usage past the included amount, at the rate of the tier total usage reaches, plus its flat\_amount. On prepaid items it charges every unit, the included ones too, at that tier's rate plus its flat\_amount.

Billing interval. For usage-based features, should match reset.interval, unless the price has graduated tiers and reset.interval is a whole multiple of it: each invoice then bills only the newly owed usage, at the tier the reset period has reached.

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.

**properties**

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.

**properties**

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.

Purchased units expire this long after each purchase. One-off prepaid consumable items only.

**properties**

Overrides fields of this item's feature for customers on this plan (e.g. a credit system's credit\_schema).

**properties**

For credit system features: merges into the feature's credit\_schema by metered\_feature\_id for customers on this plan. A row with a rate overrides or adds that feature, a row with `excluded: true` removes it, and unlisted features keep the credit system's rate.

**properties**

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.

Named adjustments chosen by event properties. Every match applies: factors multiply, then adds are summed.

**properties**

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.

**properties**

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.

Removes this feature from the credit system for customers on this plan. Cannot be combined with a rate.

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.

**properties**

Default percentage markup for customers on this plan. Use -100 to make usage free.

Per-provider markup percentages for customers on this plan.

**properties**

Per-model markup overrides for customers on this plan.

**properties**

**properties**

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.

**properties**

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.

When the trial ends or ended. Null if the subscription never had a trial. Compare with the current time to know whether it's still trialing.

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.

**properties**

The full plan object if expanded.

**properties**

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.

**properties**

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.

**properties**

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

**properties**

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.

**properties**

**properties**

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.

**properties**

Bills this many feature units when outstanding overage reaches it.

**properties**

The ID of the feature this item configures.

The full feature object if expanded.

**properties**

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.

**properties**

The singular display name for the feature.

The plural display name for the feature.

Credit cost schema for credit system features.

**properties**

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.

**properties**

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.

**properties**

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

**properties**

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

**properties**

**properties**

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.

How tiers price usage. 'graduated' (default) charges each unit at the rate of the tier it falls in. 'volume' picks one tier from total usage. On usage-based items it bills only usage past the included amount, at the rate of the tier total usage reaches, plus its flat\_amount. On prepaid items it charges every unit, the included ones too, at that tier's rate plus its flat\_amount.

Billing interval for this price. For usage-based features, should match reset.interval, unless the price has graduated tiers and reset.interval is a whole multiple of it: each invoice then bills only the newly owed usage, at the tier the reset period has reached.

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.

**properties**

**properties**

Stripe price ID. For prepaid with included > 0 this is the V2 price.

Display text for showing this item in pricing pages.

**properties**

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.

**properties**

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.

Purchased units expire this long after each purchase. One-off prepaid consumable items only.

**properties**

Overrides fields of this item's feature for customers on this plan (e.g. a credit system's credit\_schema).

**properties**

For credit system features: merges into the feature's credit\_schema by metered\_feature\_id for customers on this plan. A row with a rate overrides or adds that feature, a row with `excluded: true` removes it, and unlisted features keep the credit system's rate.

**properties**

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.

Named adjustments chosen by event properties. Every match applies: factors multiply, then adds are summed.

**properties**

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.

**properties**

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.

Removes this feature from the credit system for customers on this plan. Cannot be combined with a rate.

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.

**properties**

Default percentage markup for customers on this plan. Use -100 to make usage free.

Per-provider markup percentages for customers on this plan.

**properties**

Per-model markup overrides for customers on this plan.

**properties**

Payment processors this plan is connected to. Omitted when unset.

**properties**

**properties**

Stripe product ID this plan is billed under.

Extra Stripe product IDs aliased to this plan.

**properties**

Every RevenueCat product that maps to this plan. Replaces the current set.

**properties**

RevenueCat product ID that grants this plan when purchased.

Prepaid quantities granted when this specific RevenueCat product is purchased, in feature units.

**properties**

Free trial configuration. If set, new customers can try this plan before being charged.

**properties**

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.

**properties**

If true, entitlements attached to this plan will still reset on schedule even when the customer's product is in a past\_due state.

Anchor billing and reset cycles to the 1st of the month (UTC).

Plan-level billing controls used as customer defaults.

**properties**

List of auto top-up configurations per feature.

**properties**

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 limit on auto top-ups per window, by number of top-ups or amount charged.

**properties**

What `limit` caps: the number of auto top-ups (`count`, default) or the total amount charged for them, in the customer's currency (`amount`).

The time interval for the purchase limit window.

Number of intervals in the purchase limit window.

Maximum allowed within the interval: a number of auto top-ups when limit\_type is count, or a total charge (e.g. 500 for \$500, pre-tax) when limit\_type is amount.

When true, auto top-up creates a send\_invoice invoice instead of auto-charging.

List of overage spend limits per feature (caps overage spend).

**properties**

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

**properties**

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.

**properties**

List of usage alert configurations per feature.

**properties**

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. remaining and remaining\_percentage accept negative values with basis balance, to alert once the balance is overdrawn.

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.

**properties**

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.

**properties**

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.

**properties**

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.

**properties**

The ID of the base plan this variant was derived from.

The customization that transforms the base plan into this variant.

**properties**

Base price configuration for a plan.

**properties**

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.

**properties**

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

**properties**

Bills this many feature units when outstanding overage reaches it.

**properties**

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.

**properties**

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.

**properties**

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

**properties**

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

**properties**

**properties**

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.

How tiers price usage. 'graduated' (default) charges each unit at the rate of the tier it falls in. 'volume' picks one tier from total usage. On usage-based items it bills only usage past the included amount, at the rate of the tier total usage reaches, plus its flat\_amount. On prepaid items it charges every unit, the included ones too, at that tier's rate plus its flat\_amount.

Billing interval. For usage-based features, should match reset.interval, unless the price has graduated tiers and reset.interval is a whole multiple of it: each invoice then bills only the newly owed usage, at the tier the reset period has reached.

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.

**properties**

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.

**properties**

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.

Purchased units expire this long after each purchase. One-off prepaid consumable items only.

**properties**

Overrides fields of this item's feature for customers on this plan (e.g. a credit system's credit\_schema).

**properties**

For credit system features: merges into the feature's credit\_schema by metered\_feature\_id for customers on this plan. A row with a rate overrides or adds that feature, a row with `excluded: true` removes it, and unlisted features keep the credit system's rate.

**properties**

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.

Named adjustments chosen by event properties. Every match applies: factors multiply, then adds are summed.

**properties**

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.

**properties**

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.

Removes this feature from the credit system for customers on this plan. Cannot be combined with a rate.

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.

**properties**

Default percentage markup for customers on this plan. Use -100 to make usage free.

Per-provider markup percentages for customers on this plan.

**properties**

Per-model markup overrides for customers on this plan.

**properties**

Filters selecting items to remove from the plan.

**properties**

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.

**properties**

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.

**properties**

List of auto top-up configurations per feature.

**properties**

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 or amount to set the current window's consumed top-ups or charged amount.

**properties**

What `limit` caps: the number of auto top-ups (`count`, default) or the total amount charged for them, in the customer's currency (`amount`).

The time interval for the purchase limit window.

Number of intervals in the purchase limit window.

Maximum allowed within the interval: a number of auto top-ups when limit\_type is count, or a total charge (e.g. 500 for \$500, pre-tax) when limit\_type is amount.

Set the current window's consumed auto top-up count. Omit to leave runtime state unchanged.

Set the amount already charged by auto top-ups in the current window. 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).

**properties**

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

**properties**

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.

**properties**

List of usage alert configurations per feature.

**properties**

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. remaining and remaining\_percentage accept negative values with basis balance, to alert once the balance is overdrawn.

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.

**properties**

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.

**properties**

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.

**properties**

**properties**

Base price configuration for a plan.

**properties**

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.

**properties**

Three-letter Stripe-supported currency code (e.g. 'eur', 'gbp').

Price amount in this currency. Set explicitly per currency, not converted from the base amount.

**properties**

Bills this many feature units when outstanding overage reaches it.

**properties**

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.

**properties**

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.

**properties**

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

**properties**

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

**properties**

**properties**

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.

How tiers price usage. 'graduated' (default) charges each unit at the rate of the tier it falls in. 'volume' picks one tier from total usage. On usage-based items it bills only usage past the included amount, at the rate of the tier total usage reaches, plus its flat\_amount. On prepaid items it charges every unit, the included ones too, at that tier's rate plus its flat\_amount.

Billing interval. For usage-based features, should match reset.interval, unless the price has graduated tiers and reset.interval is a whole multiple of it: each invoice then bills only the newly owed usage, at the tier the reset period has reached.

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.

**properties**

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.

**properties**

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.

Purchased units expire this long after each purchase. One-off prepaid consumable items only.

**properties**

Overrides fields of this item's feature for customers on this plan (e.g. a credit system's credit\_schema).

**properties**

For credit system features: merges into the feature's credit\_schema by metered\_feature\_id for customers on this plan. A row with a rate overrides or adds that feature, a row with `excluded: true` removes it, and unlisted features keep the credit system's rate.

**properties**

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.

Named adjustments chosen by event properties. Every match applies: factors multiply, then adds are summed.

**properties**

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.

**properties**

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.

Removes this feature from the credit system for customers on this plan. Cannot be combined with a rate.

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.

**properties**

Default percentage markup for customers on this plan. Use -100 to make usage free.

Per-provider markup percentages for customers on this plan.

**properties**

Per-model markup overrides for customers on this plan.

**properties**

**properties**

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.

**properties**

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.

**properties**

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.

**properties**

The feature ID this balance is for.

The full feature object if expanded.

**properties**

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

How grants of this feature from several plans combine: 'sum' adds them up, 'max' / 'min' keep the highest / lowest grant among plan items with no price. Omitted when 'sum'.

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.

**properties**

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.

Named adjustments chosen by event properties. Every match applies: factors multiply, then adds are summed.

**properties**

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.

**properties**

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.

Per-model markup overrides for AI credit systems.

**properties**

Default percentage markup for AI credit systems. Use -100 to make usage free.

Per-provider default markup percentages for AI credit systems.

**properties**

Display names for the feature in billing UI and customer-facing components.

**properties**

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.

**properties**

**properties**

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.

**properties**

The unique identifier for this balance breakdown.

The plan ID this balance originates from, or null for standalone and pooled 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.

**properties**

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.

**properties**

The per-unit price amount.

Tiered pricing configuration if applicable.

**properties**

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.

Where this row's credits come from: shared at the customer level, or owned by the entity.

Set when this row's numbers are the entity's allocated share of the customer's credits.

**properties**

The amount allocated to this entity.

The plans funding this shared pooled balance, usually on the customer's entities, and how much each adds this cycle and next. Present on pooled rows when expand includes `pooled_contributions`.

**properties**

The first 10 plans contributing to the pool, competing shares first, then newest.

**properties**

Entity holding the contributing plan. Null for customer-level plans.

Display name of the contributing entity.

The plan contributing to the pool.

Display name of the contributing plan.

Amount this source contributes to the pool this cycle.

Amount this source will contribute next cycle.

True when this source competes under a 'max' / 'min' feature: only the winning competing share counts, instead of adding up.

True when this source grants unlimited usage, either as a competing source or as an unlimited share riding a limited pool.

Total number of plans contributing to the pool.

Rollover balances carried over from previous periods.

**properties**

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.

Shared credits held for entities by allocations; present only when the customer allocates this feature.

Remaining shared credits no allocation holds; any entity may use them.

Boolean feature flags keyed by feature ID, showing enabled access for on/off features.

**properties**

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.

**properties**

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

How grants of this feature from several plans combine: 'sum' adds them up, 'max' / 'min' keep the highest / lowest grant among plan items with no price. Omitted when 'sum'.

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.

**properties**

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.

Named adjustments chosen by event properties. Every match applies: factors multiply, then adds are summed.

**properties**

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.

**properties**

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.

Per-model markup overrides for AI credit systems.

**properties**

Default percentage markup for AI credit systems. Use -100 to make usage free.

Per-provider default markup percentages for AI credit systems.

**properties**

Display names for the feature in billing UI and customer-facing components.

**properties**

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.

**properties**

**properties**

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.

**properties**

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.

Keeps this customer's plans working while past due: balances still reset, usage is not blocked and Stripe does not cancel the subscription. When set, this overrides each plan's ignore\_past\_due setting.

How this customer's renewal invoices are issued when the subscription is invoiced (send\_invoice). draft leaves the renewal invoice editable for manual review. finalize opens it without Stripe emailing, reminding or charging (auto\_advance off). send lets Stripe finalize and email it as usual. invoice\_mode.issue\_method on attach only shapes the subscription's first invoice; renewals follow this.

Payment processors this customer is connected to (Stripe, Vercel, RevenueCat). Omitted entirely when the customer has not been created in any processor.

**properties**

Stripe processor connection for the customer.

**properties**

Stripe customer ID.

Vercel processor connection for the customer (public-safe subset).

**properties**

Vercel marketplace installation ID for this customer.

Vercel account ID associated with the installation.

RevenueCat processor connection for the customer.

**properties**

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
  }
}
```


## OpenAPI

````yaml openapi POST /v1/customers.update
openapi: 3.1.0
info:
  title: Autumn API
  version: 2.6.0
servers:
  - url: https://api.useautumn.com
    description: Production server
security:
  - secretKey: []
paths:
  /v1/customers.update:
    post:
      tags:
        - customers
      description: Updates an existing customer by ID.
      operationId: updateCustomer
      parameters:
        - name: x-api-version
          in: header
          required: true
          schema:
            type: string
            default: 2.6.0
          x-speakeasy-globals-hidden: true
      requestBody:
        required: true
        content:
          application/json:
            schema:
              type: object
              properties:
                customer_id:
                  type: string
                  title: CustomerId
                  description: ID of the customer to update
                name:
                  anyOf:
                    - type: string
                    - type: 'null'
                  description: Customer's name
                email:
                  anyOf:
                    - type: string
                      format: email
                    - type: 'null'
                  description: Customer's email address
                fingerprint:
                  anyOf:
                    - type: string
                    - type: 'null'
                  description: >-
                    Unique identifier (eg, serial number) to detect duplicate
                    customers and prevent free trial abuse
                metadata:
                  anyOf:
                    - type: object
                      propertyNames:
                        type: string
                      additionalProperties: {}
                    - type: 'null'
                  description: Additional metadata for the customer
                stripe_id:
                  anyOf:
                    - type: string
                    - type: 'null'
                  description: Stripe customer ID if you already have one
                send_email_receipts:
                  type: boolean
                  description: Whether to send email receipts to this customer
                currency:
                  anyOf:
                    - type: string
                    - type: 'null'
                  description: >-
                    Currency to bill this customer in (e.g. usd, eur). Defaults
                    to the organization's default currency.
                billing_controls:
                  type: object
                  properties:
                    balance_allocations:
                      type: array
                      items:
                        type: object
                        properties:
                          feature_id:
                            type: string
                            description: >-
                              The feature whose shared customer credits are
                              allocated.
                          interval:
                            enum:
                              - one_off
                              - minute
                              - hour
                              - day
                              - week
                              - month
                              - quarter
                              - semi_annual
                              - year
                            type: string
                            description: >-
                              The reset interval of the shared credits being
                              allocated.
                          allocations:
                            type: array
                            maxItems: 1000
                            items:
                              type: object
                              properties:
                                entity_id:
                                  type: string
                                  description: The public entity ID.
                                amount:
                                  type: number
                                  minimum: 0
                                  description: >-
                                    Requested credits per cycle, before
                                    proportional scaling. 0 releases the
                                    allocation.
                              required:
                                - entity_id
                                - amount
                            description: >-
                              Complete list of entity allocations for this
                              feature. Omitted entities release their shares.
                        required:
                          - feature_id
                          - interval
                          - allocations
                      description: >-
                        Replace all customer-level balance allocations. Omit to
                        keep existing allocations; pass [] to release all.
                        Available only when updating an existing customer.
                    auto_topups:
                      type: array
                      items:
                        type: object
                        properties:
                          feature_id:
                            type: string
                            description: >-
                              The ID of the feature (credit balance) to auto
                              top-up.
                          enabled:
                            type: boolean
                            default: false
                            description: Whether auto top-up is enabled.
                          threshold:
                            type: number
                            description: >-
                              When the balance drops below this threshold, an
                              auto top-up will be purchased.
                          quantity:
                            type: number
                            minimum: 1
                            description: Amount of credits to add per auto top-up.
                          purchase_limit:
                            type: object
                            properties:
                              limit_type:
                                enum:
                                  - count
                                  - amount
                                type: string
                                description: >-
                                  What `limit` caps: the number of auto top-ups
                                  (`count`, default) or the total amount charged
                                  for them, in the customer's currency
                                  (`amount`).
                              interval:
                                enum:
                                  - hour
                                  - day
                                  - week
                                  - month
                                type: string
                                description: >-
                                  The time interval for the purchase limit
                                  window.
                              interval_count:
                                type: number
                                minimum: 1
                                default: 1
                                description: >-
                                  Number of intervals in the purchase limit
                                  window.
                              limit:
                                type: number
                                exclusiveMinimum: 0
                                description: >-
                                  Maximum allowed within the interval: a number
                                  of auto top-ups when limit_type is count, or a
                                  total charge (e.g. 500 for $500, pre-tax) when
                                  limit_type is amount.
                              count:
                                type: number
                                minimum: 0
                                description: >-
                                  Set the current window's consumed auto top-up
                                  count. Omit to leave runtime state unchanged.
                              amount:
                                type: number
                                minimum: 0
                                description: >-
                                  Set the amount already charged by auto top-ups
                                  in the current window. Omit to leave runtime
                                  state unchanged.
                            required:
                              - interval
                              - limit
                            description: >-
                              Optional rate limit to cap how often auto top-ups
                              occur. Pass count or amount to set the current
                              window's consumed top-ups or charged amount.
                          invoice_mode:
                            type: boolean
                            description: >-
                              When true, auto top-up creates a send_invoice
                              invoice instead of auto-charging.
                        required:
                          - feature_id
                          - threshold
                          - quantity
                      description: List of auto top-up configurations per feature.
                      default: []
                    spend_limits:
                      type: array
                      items:
                        type: object
                        properties:
                          feature_id:
                            type: string
                            description: Optional feature ID this spend limit applies to.
                          enabled:
                            type: boolean
                            default: false
                            description: Whether the overage spend limit is enabled.
                          limit_type:
                            enum:
                              - absolute
                              - usage_percentage
                            type: string
                            description: >-
                              How overage_limit is interpreted: an absolute
                              overage cap (default) or a percentage of the
                              main-plan allowance.
                          overage_limit:
                            type: number
                            minimum: 0
                            description: >-
                              Overage cap for the feature: absolute units, or a
                              percent (e.g. 120) when limit_type is
                              usage_percentage.
                          skip_overage_billing:
                            type: boolean
                            description: >-
                              When true, overage for this feature is not posted
                              to Stripe. Usage tracking and balance resets still
                              behave normally.
                      description: >-
                        List of overage spend limits per feature (caps overage
                        spend).
                      default: []
                    usage_limits:
                      type: array
                      items:
                        anyOf:
                          - type: object
                            properties:
                              feature_id:
                                type: string
                                description: The feature this usage limit applies to.
                              enabled:
                                type: boolean
                                default: true
                                description: Whether this usage limit is enabled.
                              limit:
                                type: number
                                minimum: 0
                                description: Maximum units allowed per interval.
                              interval:
                                enum:
                                  - day
                                  - week
                                  - month
                                  - year
                                type: string
                                description: >-
                                  Interval for the cap, aligned to the
                                  customer's billing cycle.
                              anchor:
                                enum:
                                  - billing_cycle
                                  - utc
                                type: string
                                description: >-
                                  Window alignment. 'billing_cycle' phases the
                                  interval to the customer's renewal time; 'utc'
                                  aligns to the UTC calendar.
                              filter:
                                type: object
                                properties:
                                  properties:
                                    type: object
                                    propertyNames:
                                      type: string
                                      minLength: 1
                                      maxLength: 64
                                    additionalProperties:
                                      anyOf:
                                        - type: string
                                          minLength: 1
                                          maxLength: 128
                                        - type: number
                                        - type: boolean
                                required:
                                  - properties
                                description: >-
                                  When set, only usage from events whose
                                  properties match counts toward this cap. Omit
                                  to count all usage of the feature.
                              usage:
                                type: number
                                minimum: 0
                                description: >-
                                  Usage consumed in the active interval, stored
                                  in the usage-window counter.
                              source:
                                enum:
                                  - customer
                                  - plan
                                type: string
                                description: >-
                                  Response-only: whether the entry is a
                                  customer-level override or inherited from an
                                  attached plan's defaults.
                            required:
                              - feature_id
                              - limit
                              - interval
                          - type: object
                            properties:
                              feature_id:
                                type: string
                                description: The feature this usage limit applies to.
                              filter:
                                type: object
                                properties:
                                  properties:
                                    type: object
                                    propertyNames:
                                      type: string
                                      minLength: 1
                                      maxLength: 64
                                    additionalProperties:
                                      anyOf:
                                        - type: string
                                          minLength: 1
                                          maxLength: 128
                                        - type: number
                                        - type: boolean
                                required:
                                  - properties
                                description: >-
                                  When set, only usage from events whose
                                  properties match counts toward this cap. Omit
                                  to count all usage of the feature.
                              source:
                                enum:
                                  - customer
                                  - plan
                                type: string
                                description: >-
                                  Response-only: whether the entry is a
                                  customer-level override or inherited from an
                                  attached plan's defaults.
                              usage:
                                type: number
                                minimum: 0
                                description: >-
                                  Usage consumed in the active interval, stored
                                  in the usage-window counter.
                            required:
                              - feature_id
                              - usage
                            additionalProperties: false
                      description: >-
                        List of hard usage caps per feature. An entry with only
                        feature_id and usage sets the current counter without
                        changing configuration.
                    usage_alerts:
                      type: array
                      items:
                        type: object
                        properties:
                          feature_id:
                            type: string
                            description: The feature ID this alert applies to.
                          enabled:
                            type: boolean
                            default: true
                            description: Whether this usage alert is enabled.
                          threshold:
                            type: number
                            description: >-
                              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. remaining and remaining_percentage
                              accept negative values with basis balance, to
                              alert once the balance is overdrawn.
                          threshold_type:
                            enum:
                              - usage
                              - usage_percentage
                              - remaining
                              - remaining_percentage
                            type: string
                            description: >-
                              Whether the threshold is an absolute count or a
                              percentage of the usage allowance or remaining
                              balance.
                          basis:
                            enum:
                              - balance
                              - included
                              - recurring
                              - usage_limit
                            type: string
                            default: balance
                            description: >-
                              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.
                          filter:
                            type: object
                            properties:
                              properties:
                                type: object
                                propertyNames:
                                  type: string
                                  minLength: 1
                                  maxLength: 64
                                additionalProperties:
                                  anyOf:
                                    - type: string
                                      minLength: 1
                                      maxLength: 128
                                    - type: number
                                    - type: boolean
                            required:
                              - properties
                            description: >-
                              Only valid with basis usage_limit. Points the
                              alert at the usage limit carrying the same filter.
                          name:
                            type: string
                            description: >-
                              Optional user-defined label to distinguish
                              multiple alerts on the same feature.
                        required:
                          - threshold
                          - threshold_type
                      description: List of usage alert configurations per feature.
                      default: []
                    overage_allowed:
                      type: array
                      items:
                        type: object
                        properties:
                          feature_id:
                            type: string
                            description: >-
                              The feature ID this overage allowed control
                              applies to.
                          enabled:
                            type: boolean
                            default: false
                            description: Whether overage is allowed for this feature.
                        required:
                          - feature_id
                      description: >-
                        List of overage allowed controls per feature. When
                        enabled, usage can exceed balance.
                      default: []
                config:
                  type: object
                  properties:
                    disable_pooled_balance:
                      type: boolean
                      description: >-
                        Whether to disable the shared customer-level pool for
                        entities.
                    disable_overage_billing:
                      type: boolean
                      description: >-
                        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.
                    ignore_past_due:
                      type: boolean
                      description: >-
                        Keeps this customer's plans working while past due:
                        balances still reset, usage is not blocked and Stripe
                        does not cancel the subscription. When set, this
                        overrides each plan's ignore_past_due setting.
                    renewal_issue_method:
                      anyOf:
                        - enum:
                            - draft
                            - finalize
                            - send
                          type: string
                        - type: 'null'
                      description: >-
                        How this customer's renewal invoices are issued when the
                        subscription is invoiced (send_invoice). draft leaves
                        the renewal invoice editable for manual review. finalize
                        opens it without Stripe emailing, reminding or charging
                        (auto_advance off). send lets Stripe finalize and email
                        it as usual. invoice_mode.issue_method on attach only
                        shapes the subscription's first invoice; renewals follow
                        this. Pass null to clear it.
                  description: Miscellaneous configurations for the customer.
                billing_details:
                  type: object
                  properties:
                    address:
                      anyOf:
                        - type: object
                          properties:
                            line1:
                              anyOf:
                                - type: string
                                - type: 'null'
                            line2:
                              anyOf:
                                - type: string
                                - type: 'null'
                            city:
                              anyOf:
                                - type: string
                                - type: 'null'
                            state:
                              anyOf:
                                - type: string
                                - type: 'null'
                            postal_code:
                              anyOf:
                                - type: string
                                - type: 'null'
                            country:
                              anyOf:
                                - type: string
                                - type: 'null'
                              description: Two-letter country code (ISO 3166-1 alpha-2).
                          title: BillingDetailsAddress
                        - type: 'null'
                      description: >-
                        Billing address, used for tax and shown on invoices.
                        Replaces the whole address, as in Stripe; null clears
                        it.
                    tax_ids:
                      type: object
                      properties:
                        add:
                          type: array
                          items:
                            type: object
                            properties:
                              type:
                                type: string
                                description: >-
                                  Stripe tax ID type, e.g. eu_vat, gb_vat,
                                  us_ein. See
                                  https://docs.stripe.com/billing/customer/tax-ids#supported-tax-id
                              value:
                                type: string
                                description: The tax ID, e.g. DE123456789.
                            required:
                              - type
                              - value
                            title: BillingDetailsTaxId
                          description: >-
                            Tax IDs to add. IDs the customer already has are
                            ignored.
                        remove:
                          type: array
                          items:
                            type: object
                            properties:
                              type:
                                type: string
                                description: >-
                                  Stripe tax ID type, e.g. eu_vat, gb_vat,
                                  us_ein. See
                                  https://docs.stripe.com/billing/customer/tax-ids#supported-tax-id
                              value:
                                type: string
                                description: The tax ID, e.g. DE123456789.
                            required:
                              - type
                              - value
                            title: BillingDetailsTaxId
                          description: >-
                            Tax IDs to remove, matched by type and value. IDs
                            the customer doesn't have are ignored.
                      description: >-
                        Tax IDs to add or remove (e.g. VAT). Stripe tax IDs
                        cannot be edited, so change one by removing the old ID
                        and adding the new one. IDs not listed are kept.
                    tax_exempt:
                      enum:
                        - none
                        - exempt
                        - reverse
                      type: string
                      description: >-
                        Tax exemption status. Use reverse for reverse-charge
                        customers.
                    invoice_settings:
                      type: object
                      properties:
                        custom_fields:
                          anyOf:
                            - type: array
                              maxItems: 4
                              items:
                                type: object
                                properties:
                                  name:
                                    type: string
                                    maxLength: 40
                                    description: Label, e.g. PO Number.
                                  value:
                                    type: string
                                    maxLength: 140
                                required:
                                  - name
                                  - value
                                title: BillingDetailsCustomField
                            - type: 'null'
                          description: >-
                            Up to 4 custom fields shown on every invoice, e.g. a
                            PO number. Replaces the existing list; null clears
                            it.
                  title: BillingDetailsParams
                  description: >-
                    Billing details stored on the linked Stripe customer.
                    Requires a Stripe customer.
                new_customer_id:
                  $ref: '#/components/schemas/CustomerId'
                  description: New ID for the customer
              required:
                - customer_id
              title: UpdateCustomerParams
              examples:
                - customer_id: cus_123
                  name: Jane Doe
                  email: jane@example.com
                - customer_id: customer_123
                  billing_controls:
                    balance_allocations:
                      - feature_id: credits
                        interval: month
                        allocations:
                          - entity_id: workspace_a
                            amount: 300
                          - entity_id: workspace_b
                            amount: 200
            example:
              customer_id: cus_123
              name: Jane Doe
              email: jane@example.com
      responses:
        '200':
          description: OK
          content:
            application/json:
              schema:
                type: object
                properties:
                  id:
                    anyOf:
                      - type: string
                      - type: 'null'
                    description: Your unique identifier for the customer.
                  name:
                    anyOf:
                      - type: string
                      - type: 'null'
                    description: The name of the customer.
                  email:
                    anyOf:
                      - type: string
                      - type: 'null'
                    description: The email address of the customer.
                  created_at:
                    type: number
                    description: >-
                      Timestamp of customer creation in milliseconds since
                      epoch.
                  fingerprint:
                    anyOf:
                      - type: string
                      - type: 'null'
                    description: >-
                      A unique identifier (eg. serial number) to de-duplicate
                      customers across devices or browsers. For example: apple
                      device ID.
                  stripe_id:
                    anyOf:
                      - type: string
                      - type: 'null'
                    description: Stripe customer ID.
                  env:
                    enum:
                      - sandbox
                      - live
                    type: string
                    description: The environment this customer was created in.
                  metadata:
                    type: object
                    propertyNames: {}
                    additionalProperties: {}
                    description: The metadata for the customer.
                  send_email_receipts:
                    type: boolean
                    description: Whether to send email receipts to the customer.
                  billing_controls:
                    type: object
                    properties:
                      balance_allocations:
                        type: array
                        items:
                          type: object
                          properties:
                            feature_id:
                              type: string
                              description: >-
                                The feature whose shared customer credits are
                                allocated.
                            interval:
                              enum:
                                - one_off
                                - minute
                                - hour
                                - day
                                - week
                                - month
                                - quarter
                                - semi_annual
                                - year
                              type: string
                              description: >-
                                The reset interval of the shared credits being
                                allocated.
                            allocations:
                              type: array
                              maxItems: 1000
                              items:
                                type: object
                                properties:
                                  entity_id:
                                    type: string
                                    description: The public entity ID.
                                  amount:
                                    type: number
                                    minimum: 0
                                    description: >-
                                      Requested credits per cycle, before
                                      proportional scaling. 0 releases the
                                      allocation.
                                required:
                                  - entity_id
                                  - amount
                              description: >-
                                Complete list of entity allocations for this
                                feature. Omitted entities release their shares.
                          required:
                            - feature_id
                            - interval
                            - allocations
                        description: >-
                          Customer-level entity allocations of shared credits.
                          Amounts are requested shares before proportional
                          scaling.
                      auto_topups:
                        type: array
                        items:
                          type: object
                          properties:
                            feature_id:
                              type: string
                              description: >-
                                The ID of the feature (credit balance) to auto
                                top-up.
                            enabled:
                              type: boolean
                              default: false
                              description: Whether auto top-up is enabled.
                            threshold:
                              type: number
                              description: >-
                                When the balance drops below this threshold, an
                                auto top-up will be purchased.
                            quantity:
                              type: number
                              minimum: 1
                              description: Amount of credits to add per auto top-up.
                            purchase_limit:
                              anyOf:
                                - type: object
                                  properties:
                                    limit_type:
                                      anyOf:
                                        - enum:
                                            - count
                                            - amount
                                          type: string
                                        - type: 'null'
                                      description: >-
                                        What `limit` caps: `count` of auto
                                        top-ups or `amount` charged. Null when
                                        no purchase limit is configured.
                                    interval:
                                      anyOf:
                                        - enum:
                                            - hour
                                            - day
                                            - week
                                            - month
                                          type: string
                                        - type: 'null'
                                      description: >-
                                        The time interval for the purchase limit
                                        window. Null when no purchase limit is
                                        configured.
                                    interval_count:
                                      anyOf:
                                        - type: number
                                          minimum: 1
                                        - type: 'null'
                                      description: >-
                                        Number of intervals in the purchase
                                        limit window. Null when no purchase
                                        limit is configured.
                                    limit:
                                      anyOf:
                                        - type: number
                                          exclusiveMinimum: 0
                                        - type: 'null'
                                      description: >-
                                        Maximum allowed within the interval
                                        (top-ups for count, charge for amount).
                                        Null when no purchase limit is
                                        configured.
                                    count:
                                      type: number
                                      description: >-
                                        Number of auto top-ups already consumed
                                        in the current window.
                                    amount:
                                      type: number
                                      description: >-
                                        Amount charged by auto top-ups in the
                                        current window, pre-tax, in the
                                        customer's currency.
                                    next_reset_at:
                                      type: number
                                      description: >-
                                        Unix ms timestamp when the current
                                        purchase window ends and the count
                                        resets.
                                  required:
                                    - limit_type
                                    - interval
                                    - interval_count
                                    - limit
                                    - count
                                    - amount
                                    - next_reset_at
                                - type: object
                                  properties:
                                    limit_type:
                                      enum:
                                        - count
                                        - amount
                                      type: string
                                      description: >-
                                        What `limit` caps: the number of auto
                                        top-ups (`count`, default) or the total
                                        amount charged for them, in the
                                        customer's currency (`amount`).
                                    interval:
                                      enum:
                                        - hour
                                        - day
                                        - week
                                        - month
                                      type: string
                                      description: >-
                                        The time interval for the purchase limit
                                        window.
                                    interval_count:
                                      type: number
                                      minimum: 1
                                      default: 1
                                      description: >-
                                        Number of intervals in the purchase
                                        limit window.
                                    limit:
                                      type: number
                                      exclusiveMinimum: 0
                                      description: >-
                                        Maximum allowed within the interval: a
                                        number of auto top-ups when limit_type
                                        is count, or a total charge (e.g. 500
                                        for $500, pre-tax) when limit_type is
                                        amount.
                                  required:
                                    - interval
                                    - limit
                              description: >-
                                Optional rate limit to cap how often auto
                                top-ups occur. Expand
                                billing_controls.auto_topups.purchase_limit for
                                the count of top ups, amount charged and the
                                next_reset_at.
                            invoice_mode:
                              type: boolean
                              description: >-
                                When true, auto top-up creates a send_invoice
                                invoice instead of auto-charging.
                            source:
                              enum:
                                - customer
                                - plan
                              type: string
                              description: >-
                                Response-only: whether the entry is a
                                customer-level override or inherited from an
                                attached plan's defaults.
                          required:
                            - feature_id
                            - threshold
                            - quantity
                        description: List of auto top-up configurations per feature.
                      spend_limits:
                        type: array
                        items:
                          type: object
                          properties:
                            feature_id:
                              type: string
                              description: Optional feature ID this spend limit applies to.
                            enabled:
                              type: boolean
                              default: false
                              description: Whether the overage spend limit is enabled.
                            limit_type:
                              enum:
                                - absolute
                                - usage_percentage
                              type: string
                              description: >-
                                How overage_limit is interpreted: an absolute
                                overage cap (default) or a percentage of the
                                main-plan allowance.
                            overage_limit:
                              type: number
                              minimum: 0
                              description: >-
                                Overage cap for the feature: absolute units, or
                                a percent (e.g. 120) when limit_type is
                                usage_percentage.
                            skip_overage_billing:
                              type: boolean
                              description: >-
                                When true, overage for this feature is not
                                posted to Stripe. Usage tracking and balance
                                resets still behave normally.
                            source:
                              enum:
                                - customer
                                - plan
                              type: string
                              description: >-
                                Response-only: whether the entry is a
                                customer-level override or inherited from an
                                attached plan's defaults.
                        description: >-
                          List of overage spend limits per feature (caps overage
                          spend).
                      usage_limits:
                        type: array
                        items:
                          type: object
                          properties:
                            feature_id:
                              type: string
                              description: The feature this usage limit applies to.
                            enabled:
                              type: boolean
                              default: true
                              description: Whether this usage limit is enabled.
                            limit:
                              type: number
                              minimum: 0
                              description: Maximum units allowed per interval.
                            interval:
                              enum:
                                - day
                                - week
                                - month
                                - year
                              type: string
                              description: >-
                                Interval for the cap, aligned to the customer's
                                billing cycle.
                            anchor:
                              enum:
                                - billing_cycle
                                - utc
                              type: string
                              description: >-
                                Window alignment. 'billing_cycle' phases the
                                interval to the customer's renewal time; 'utc'
                                aligns to the UTC calendar.
                            filter:
                              type: object
                              properties:
                                properties:
                                  type: object
                                  propertyNames:
                                    type: string
                                    minLength: 1
                                    maxLength: 64
                                  additionalProperties:
                                    type: string
                              required:
                                - properties
                              description: >-
                                When set, only usage from events whose
                                properties match counts toward this cap. Omit to
                                count all usage of the feature.
                            usage:
                              type: number
                              minimum: 0
                              description: >-
                                Usage consumed in the active interval, stored in
                                the usage-window counter.
                            source:
                              enum:
                                - customer
                                - plan
                              type: string
                              description: >-
                                Response-only: whether the entry is a
                                customer-level override or inherited from an
                                attached plan's defaults.
                          required:
                            - feature_id
                            - limit
                            - interval
                        description: >-
                          List of hard usage caps per feature, with current
                          interval usage.
                      usage_alerts:
                        type: array
                        items:
                          type: object
                          properties:
                            feature_id:
                              type: string
                              description: The feature ID this alert applies to.
                            enabled:
                              type: boolean
                              default: true
                              description: Whether this usage alert is enabled.
                            threshold:
                              type: number
                              description: >-
                                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. remaining and
                                remaining_percentage accept negative values with
                                basis balance, to alert once the balance is
                                overdrawn.
                            threshold_type:
                              enum:
                                - usage
                                - usage_percentage
                                - remaining
                                - remaining_percentage
                              type: string
                              description: >-
                                Whether the threshold is an absolute count or a
                                percentage of the usage allowance or remaining
                                balance.
                            basis:
                              enum:
                                - balance
                                - included
                                - recurring
                                - usage_limit
                              type: string
                              default: balance
                              description: >-
                                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.
                            filter:
                              type: object
                              properties:
                                properties:
                                  type: object
                                  propertyNames:
                                    type: string
                                    minLength: 1
                                    maxLength: 64
                                  additionalProperties:
                                    type: string
                              required:
                                - properties
                              description: >-
                                Only valid with basis usage_limit. Points the
                                alert at the usage limit carrying the same
                                filter.
                            name:
                              type: string
                              description: >-
                                Optional user-defined label to distinguish
                                multiple alerts on the same feature.
                            source:
                              enum:
                                - customer
                                - plan
                              type: string
                              description: >-
                                Response-only: whether the entry is a
                                customer-level override or inherited from an
                                attached plan's defaults.
                          required:
                            - threshold
                            - threshold_type
                        description: List of usage alert configurations per feature.
                      overage_allowed:
                        type: array
                        items:
                          type: object
                          properties:
                            feature_id:
                              type: string
                              description: >-
                                The feature ID this overage allowed control
                                applies to.
                            enabled:
                              type: boolean
                              default: false
                              description: Whether overage is allowed for this feature.
                            source:
                              enum:
                                - customer
                                - plan
                              type: string
                              description: >-
                                Response-only: whether the entry is a
                                customer-level override or inherited from an
                                attached plan's defaults.
                          required:
                            - feature_id
                        description: >-
                          List of overage allowed controls per feature. When
                          enabled, usage can exceed balance.
                    description: Billing controls for the customer (auto top-ups, etc.)
                  subscriptions:
                    type: array
                    items:
                      type: object
                      properties:
                        id:
                          type: string
                          description: >-
                            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.
                        plan:
                          $ref: '#/components/schemas/Plan'
                          description: The full plan object if expanded.
                        plan_id:
                          type: string
                          description: The unique identifier of the subscribed plan.
                        auto_enable:
                          type: boolean
                          description: >-
                            Whether the plan was automatically enabled for the
                            customer.
                        add_on:
                          type: boolean
                          description: >-
                            Whether this is an add-on plan rather than a base
                            subscription.
                        status:
                          enum:
                            - active
                            - scheduled
                          type: string
                          description: Current status of the subscription.
                        past_due:
                          type: boolean
                          description: Whether the subscription has overdue payments.
                        canceled_at:
                          anyOf:
                            - type: number
                            - type: 'null'
                          description: >-
                            Timestamp when the subscription was canceled, or
                            null if not canceled.
                        expires_at:
                          anyOf:
                            - type: number
                            - type: 'null'
                          description: >-
                            Timestamp when the subscription will expire, or null
                            if no expiry set.
                        trial_ends_at:
                          anyOf:
                            - type: number
                            - type: 'null'
                          description: >-
                            When the trial ends or ended. Null if the
                            subscription never had a trial. Compare with the
                            current time to know whether it's still trialing.
                        started_at:
                          type: number
                          description: Timestamp when the subscription started.
                        current_period_start:
                          anyOf:
                            - type: number
                            - type: 'null'
                          description: Start timestamp of the current billing period.
                        current_period_end:
                          anyOf:
                            - type: number
                            - type: 'null'
                          description: End timestamp of the current billing period.
                        quantity:
                          type: number
                          description: >-
                            Number of units of this subscription (for per-seat
                            plans).
                        scope:
                          enum:
                            - customer
                            - entity
                          type: string
                          description: >-
                            Whether this subscription is attached at the
                            customer level or entity level.
                      required:
                        - id
                        - plan_id
                        - auto_enable
                        - add_on
                        - status
                        - past_due
                        - canceled_at
                        - expires_at
                        - trial_ends_at
                        - started_at
                        - current_period_start
                        - current_period_end
                        - quantity
                    description: >-
                      Active and scheduled recurring plans that this customer
                      has attached.
                  purchases:
                    type: array
                    items:
                      type: object
                      properties:
                        plan:
                          $ref: '#/components/schemas/Plan'
                          description: The full plan object if expanded.
                        plan_id:
                          type: string
                          description: The unique identifier of the purchased plan.
                        expires_at:
                          anyOf:
                            - type: number
                            - type: 'null'
                          description: >-
                            Timestamp when the purchase expires, or null for
                            lifetime access.
                        started_at:
                          type: number
                          description: Timestamp when the purchase was made.
                        quantity:
                          type: number
                          description: Number of units purchased.
                        scope:
                          enum:
                            - customer
                            - entity
                          type: string
                          description: >-
                            Whether this purchase is attached at the customer
                            level or entity level.
                      required:
                        - plan_id
                        - expires_at
                        - started_at
                        - quantity
                    description: One-time purchases made by the customer.
                  licenses:
                    type: array
                    items:
                      type: object
                      properties:
                        license_plan_id:
                          type: string
                          description: The plan offered as an assignable license.
                        parent_plan_id:
                          type: string
                          description: The plan that offers this license.
                        license_plan_name:
                          type: string
                          description: Display name of the license plan.
                        granted:
                          type: number
                          description: >-
                            Total seats the customer has for this license,
                            included plus paid.
                        usage:
                          type: number
                          description: Seats currently assigned to entities.
                        remaining:
                          type: number
                          description: Seats still available to assign.
                        paid_quantity:
                          type: number
                          description: >-
                            Paid seats purchased on top of the plan's included
                            amount.
                      required:
                        - license_plan_id
                        - parent_plan_id
                        - license_plan_name
                        - granted
                        - usage
                        - remaining
                        - paid_quantity
                    description: >-
                      License seat pools granted by the customer's plans, with
                      seat counts.
                  balances:
                    type: object
                    propertyNames:
                      type: string
                    additionalProperties:
                      $ref: '#/components/schemas/Balance'
                    description: >-
                      Feature balances keyed by feature ID, showing usage limits
                      and remaining amounts.
                  flags:
                    type: object
                    propertyNames:
                      type: string
                    additionalProperties:
                      type: object
                      properties:
                        id:
                          type: string
                          description: The unique identifier for this flag.
                        plan_id:
                          anyOf:
                            - type: string
                            - type: 'null'
                          description: >-
                            The plan ID this flag originates from, or null for
                            standalone flags.
                        expires_at:
                          anyOf:
                            - type: number
                            - type: 'null'
                          description: >-
                            Timestamp when this flag expires, or null for no
                            expiration.
                        feature_id:
                          type: string
                          description: The feature ID this flag is for.
                        feature:
                          type: object
                          properties:
                            id:
                              type: string
                              description: >-
                                The unique identifier for this feature, used in
                                /check and /track calls.
                            name:
                              type: string
                              description: >-
                                Human-readable name displayed in the dashboard
                                and billing UI.
                            type:
                              enum:
                                - boolean
                                - metered
                                - credit_system
                                - ai_credit_system
                              type: string
                              description: >-
                                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.
                            consumable:
                              type: boolean
                              description: >-
                                For metered features: true if usage resets
                                periodically (API calls, credits), false if
                                allocated persistently (seats, storage).
                            combine:
                              enum:
                                - sum
                                - max
                                - min
                              type: string
                              description: >-
                                How grants of this feature from several plans
                                combine: 'sum' adds them up, 'max' / 'min' keep
                                the highest / lowest grant among plan items with
                                no price. Omitted when 'sum'.
                            event_names:
                              type: array
                              items:
                                type: string
                              description: >-
                                Event names that trigger this feature's balance.
                                Allows multiple features to respond to a single
                                event.
                            credit_schema:
                              type: array
                              items:
                                anyOf:
                                  - type: object
                                    properties:
                                      metered_feature_id:
                                        type: string
                                        minLength: 1
                                        description: >-
                                          ID of the metered feature that draws
                                          from this credit system.
                                      billing_units:
                                        type: number
                                        exclusiveMinimum: 0
                                        description: >-
                                          Number of metered-feature units priced
                                          together. Defaults to one when omitted.
                                      dimensions:
                                        type: object
                                        propertyNames:
                                          type: string
                                          minLength: 1
                                          maxLength: 64
                                        additionalProperties:
                                          $ref: '#/components/schemas/CreditDimension'
                                        description: >-
                                          Named rates chosen by event properties.
                                          The most specific match sets the rate;
                                          with no match the item's own rate
                                          applies.
                                      multipliers:
                                        type: object
                                        propertyNames:
                                          type: string
                                          minLength: 1
                                          maxLength: 64
                                        additionalProperties:
                                          type: object
                                          properties:
                                            match:
                                              type: object
                                              propertyNames:
                                                type: string
                                              additionalProperties:
                                                type: string
                                              description: >-
                                                Event properties this entry applies to.
                                                Every key must equal the tracked
                                                property, compared as strings.
                                            factor:
                                              type: number
                                              exclusiveMinimum: 0
                                              description: >-
                                                Multiplies the matched rate. All
                                                matching multipliers stack.
                                            add:
                                              type: number
                                              description: >-
                                                Added to the rate after every factor is
                                                applied, in credits per billing-unit
                                                group.
                                          required:
                                            - match
                                          additionalProperties: false
                                        description: >-
                                          Named adjustments chosen by event
                                          properties. Every match applies: factors
                                          multiply, then adds are summed.
                                      tier_behavior:
                                        const: graduated
                                      tiers:
                                        type: array
                                        minItems: 1
                                        items:
                                          type: object
                                          properties:
                                            to:
                                              anyOf:
                                                - type: number
                                                  exclusiveMinimum: 0
                                                - enum:
                                                    - inf
                                                  type: string
                                              description: >-
                                                Inclusive upper usage boundary for this
                                                graduated tier. The final tier must be
                                                'inf'.
                                            credit_cost:
                                              type: number
                                              minimum: 0
                                              description: >-
                                                Credits consumed per billing-unit group
                                                within this tier.
                                          required:
                                            - to
                                            - credit_cost
                                    required:
                                      - metered_feature_id
                                      - tier_behavior
                                      - tiers
                                    additionalProperties: false
                                  - type: object
                                    properties:
                                      metered_feature_id:
                                        type: string
                                        minLength: 1
                                        description: >-
                                          ID of the metered feature that draws
                                          from this credit system.
                                      billing_units:
                                        type: number
                                        exclusiveMinimum: 0
                                        description: >-
                                          Number of metered-feature units priced
                                          together. Defaults to one when omitted.
                                      dimensions:
                                        type: object
                                        propertyNames:
                                          type: string
                                          minLength: 1
                                          maxLength: 64
                                        additionalProperties:
                                          $ref: '#/components/schemas/CreditDimension'
                                        description: >-
                                          Named rates chosen by event properties.
                                          The most specific match sets the rate;
                                          with no match the item's own rate
                                          applies.
                                      multipliers:
                                        type: object
                                        propertyNames:
                                          type: string
                                          minLength: 1
                                          maxLength: 64
                                        additionalProperties:
                                          type: object
                                          properties:
                                            match:
                                              type: object
                                              propertyNames:
                                                type: string
                                              additionalProperties:
                                                type: string
                                              description: >-
                                                Event properties this entry applies to.
                                                Every key must equal the tracked
                                                property, compared as strings.
                                            factor:
                                              type: number
                                              exclusiveMinimum: 0
                                              description: >-
                                                Multiplies the matched rate. All
                                                matching multipliers stack.
                                            add:
                                              type: number
                                              description: >-
                                                Added to the rate after every factor is
                                                applied, in credits per billing-unit
                                                group.
                                          required:
                                            - match
                                          additionalProperties: false
                                        description: >-
                                          Named adjustments chosen by event
                                          properties. Every match applies: factors
                                          multiply, then adds are summed.
                                      credit_cost:
                                        type: number
                                        minimum: 0
                                        description: Credits consumed per billing-unit group.
                                    required:
                                      - metered_feature_id
                                      - credit_cost
                                    additionalProperties: false
                                  - type: object
                                    properties:
                                      metered_feature_id:
                                        const: ''
                                      billing_units:
                                        type: number
                                        exclusiveMinimum: 0
                                        description: >-
                                          Number of metered-feature units priced
                                          together. Defaults to one when omitted.
                                      dimensions:
                                        type: object
                                        propertyNames:
                                          type: string
                                          minLength: 1
                                          maxLength: 64
                                        additionalProperties:
                                          $ref: '#/components/schemas/CreditDimension'
                                        description: >-
                                          Named rates chosen by event properties.
                                          The most specific match sets the rate;
                                          with no match the item's own rate
                                          applies.
                                      multipliers:
                                        type: object
                                        propertyNames:
                                          type: string
                                          minLength: 1
                                          maxLength: 64
                                        additionalProperties:
                                          type: object
                                          properties:
                                            match:
                                              type: object
                                              propertyNames:
                                                type: string
                                              additionalProperties:
                                                type: string
                                              description: >-
                                                Event properties this entry applies to.
                                                Every key must equal the tracked
                                                property, compared as strings.
                                            factor:
                                              type: number
                                              exclusiveMinimum: 0
                                              description: >-
                                                Multiplies the matched rate. All
                                                matching multipliers stack.
                                            add:
                                              type: number
                                              description: >-
                                                Added to the rate after every factor is
                                                applied, in credits per billing-unit
                                                group.
                                          required:
                                            - match
                                          additionalProperties: false
                                        description: >-
                                          Named adjustments chosen by event
                                          properties. Every match applies: factors
                                          multiply, then adds are summed.
                                      credit_cost:
                                        type: number
                                        minimum: 0
                                        description: Credits consumed per billing-unit group.
                                    required:
                                      - metered_feature_id
                                      - credit_cost
                                    additionalProperties: false
                              description: >-
                                For classic credit systems: maps metered
                                features to flat or graduated credit costs.
                            model_markups:
                              anyOf:
                                - type: object
                                  propertyNames:
                                    type: string
                                    pattern: .+\/.+
                                  additionalProperties:
                                    type: object
                                    properties:
                                      markup:
                                        type: number
                                        minimum: -100
                                      input_cost:
                                        type: number
                                        minimum: 0
                                      output_cost:
                                        type: number
                                        minimum: 0
                                - type: 'null'
                              description: >-
                                Per-model markup overrides for AI credit
                                systems.
                            default_markup:
                              type: number
                              minimum: -100
                              description: >-
                                Default percentage markup for AI credit systems.
                                Use -100 to make usage free.
                            provider_markups:
                              anyOf:
                                - type: object
                                  propertyNames:
                                    type: string
                                  additionalProperties:
                                    type: object
                                    properties:
                                      markup:
                                        type: number
                                        minimum: -100
                                    required:
                                      - markup
                                - type: 'null'
                              description: >-
                                Per-provider default markup percentages for AI
                                credit systems.
                            display:
                              type: object
                              properties:
                                singular:
                                  anyOf:
                                    - type: string
                                    - type: 'null'
                                  description: >-
                                    Singular form for UI display (e.g., 'API
                                    call', 'seat').
                                plural:
                                  anyOf:
                                    - type: string
                                    - type: 'null'
                                  description: >-
                                    Plural form for UI display (e.g., 'API
                                    calls', 'seats').
                              description: >-
                                Display names for the feature in billing UI and
                                customer-facing components.
                            archived:
                              type: boolean
                              description: >-
                                Whether the feature is archived and hidden from
                                the dashboard.
                            processors:
                              type: object
                              properties:
                                stripe:
                                  type: object
                                  properties:
                                    product_id:
                                      type: string
                                      description: >-
                                        Stripe product ID this feature's usage
                                        prices bill under.
                                    meter_id:
                                      type: string
                                      description: >-
                                        Stripe meter ID used to create this
                                        feature's metered price.
                              x-atmn-mapping: true
                              description: >-
                                Processor mappings for this feature. Present
                                when a Stripe product or meter is set.
                          required:
                            - id
                            - name
                            - type
                            - consumable
                            - archived
                          description: The full feature object if expanded.
                      required:
                        - id
                        - plan_id
                        - expires_at
                        - feature_id
                      examples:
                        - id: cus_ent_39qmLooixXLAqMywgXywjAz96rV
                          plan_id: pro_plan
                          expires_at: null
                          feature_id: dashboard
                    description: >-
                      Boolean feature flags keyed by feature ID, showing enabled
                      access for on/off features.
                  config:
                    type: object
                    properties:
                      disable_pooled_balance:
                        type: boolean
                        description: >-
                          Whether to disable the shared customer-level pool for
                          entities.
                      disable_overage_billing:
                        type: boolean
                        description: >-
                          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.
                      ignore_past_due:
                        type: boolean
                        description: >-
                          Keeps this customer's plans working while past due:
                          balances still reset, usage is not blocked and Stripe
                          does not cancel the subscription. When set, this
                          overrides each plan's ignore_past_due setting.
                      renewal_issue_method:
                        enum:
                          - draft
                          - finalize
                          - send
                        type: string
                        description: >-
                          How this customer's renewal invoices are issued when
                          the subscription is invoiced (send_invoice). draft
                          leaves the renewal invoice editable for manual review.
                          finalize opens it without Stripe emailing, reminding
                          or charging (auto_advance off). send lets Stripe
                          finalize and email it as usual.
                          invoice_mode.issue_method on attach only shapes the
                          subscription's first invoice; renewals follow this.
                    description: Configuration for the customer.
                  processors:
                    type: object
                    properties:
                      stripe:
                        type: object
                        properties:
                          id:
                            type: string
                            description: Stripe customer ID.
                        required:
                          - id
                        description: Stripe processor connection for the customer.
                      vercel:
                        type: object
                        properties:
                          installation_id:
                            type: string
                            description: >-
                              Vercel marketplace installation ID for this
                              customer.
                          account_id:
                            type: string
                            description: >-
                              Vercel account ID associated with the
                              installation.
                        required:
                          - installation_id
                          - account_id
                        description: >-
                          Vercel processor connection for the customer
                          (public-safe subset).
                      revenuecat:
                        type: object
                        properties:
                          id:
                            anyOf:
                              - type: string
                              - type: 'null'
                            description: >-
                              Customer's external ID, used as the RevenueCat app
                              user ID. Null if the customer has no external ID
                              set.
                        required:
                          - id
                        description: RevenueCat processor connection for the customer.
                    description: >-
                      Payment processors this customer is connected to (Stripe,
                      Vercel, RevenueCat). Omitted entirely when the customer
                      has not been created in any processor.
                required:
                  - id
                  - name
                  - email
                  - created_at
                  - fingerprint
                  - stripe_id
                  - env
                  - metadata
                  - send_email_receipts
                  - billing_controls
                  - subscriptions
                  - purchases
                  - licenses
                  - balances
                  - flags
                examples:
                  - 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
              example:
                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
      x-codeSamples:
        - lang: typescript
          label: Typescript (SDK)
          source: |-
            import { Autumn } from 'autumn-js'

            const autumn = new Autumn()

            const result = await autumn.customers.update({
              customerId: "cus_123",
              name: "Jane Doe",
              email: "jane@example.com",
            });
        - lang: python
          label: Python (SDK)
          source: |-
            from autumn_sdk import Autumn

            autumn = Autumn(secret_key="am_sk_test...")

            res = autumn.customers.update(
                customer_id="cus_123",
                name="Jane Doe",
                email="jane@example.com",
            )
components:
  schemas:
    CustomerId:
      type: string
      title: CustomerId
      description: Your unique identifier for the customer
    Plan:
      type: object
      properties:
        id:
          type: string
          description: Unique identifier for the plan.
        name:
          type: string
          description: Display name of the plan.
        description:
          anyOf:
            - type: string
            - type: 'null'
          description: Optional description of the plan.
        group:
          anyOf:
            - type: string
            - type: 'null'
          description: >-
            Group identifier for organizing related plans. Plans in the same
            group are mutually exclusive.
        version:
          type: number
          description: >-
            Version number of the plan. Incremented when plan configuration
            changes.
        version_slug:
          anyOf:
            - type: string
            - type: 'null'
          description: >-
            User-facing version identity. Defaults to v{n} when the version is
            minted.
        active:
          type: boolean
          description: >-
            Whether this is the active version of the plan. At most one version
            is active.
        add_on:
          type: boolean
          description: >-
            Whether this is an add-on plan that can be attached alongside a main
            plan.
        auto_enable:
          type: boolean
          description: >-
            If true, this plan is automatically attached when a customer is
            created. Used for free plans.
        price:
          anyOf:
            - type: object
              properties:
                amount:
                  type: number
                  description: >-
                    Base price amount for the plan, in major currency units
                    (e.g. dollars).
                additional_currencies:
                  type: array
                  items:
                    type: object
                    properties:
                      currency:
                        type: string
                        description: >-
                          Three-letter Stripe-supported currency code (e.g.
                          'eur', 'gbp').
                      amount:
                        type: number
                        description: >-
                          Price amount in this currency. Set explicitly per
                          currency, not converted from the base amount.
                    required:
                      - currency
                      - amount
                  description: >-
                    Base price amounts in additional currencies. The base
                    'amount' is in the org's default currency.
                interval:
                  enum:
                    - one_off
                    - week
                    - month
                    - quarter
                    - semi_annual
                    - year
                  type: string
                  description: Billing interval (e.g. 'month', 'year').
                interval_count:
                  type: number
                  description: Number of intervals per billing cycle. Defaults to 1.
                display:
                  type: object
                  properties:
                    primary_text:
                      type: string
                      description: Main display text (e.g. '$10' or '100 messages').
                    secondary_text:
                      type: string
                      description: >-
                        Secondary display text (e.g. 'per month' or 'then $0.5
                        per 100').
                  required:
                    - primary_text
                  description: Display text for showing this price in pricing pages.
                processors:
                  type: object
                  properties:
                    stripe:
                      anyOf:
                        - type: object
                          properties:
                            price_id:
                              type: string
                              description: >-
                                Stripe price ID. For prepaid with included > 0
                                this is the V2 price.
                          required:
                            - price_id
                        - type: 'null'
                  x-atmn-mapping: true
                  description: >-
                    Payment processors this base price is connected to. Omitted
                    when unset.
              required:
                - amount
                - interval
            - type: 'null'
          description: >-
            Base recurring price for the plan. Null for free plans or usage-only
            plans.
        items:
          type: array
          items:
            type: object
            properties:
              threshold_billing:
                anyOf:
                  - type: object
                    properties:
                      threshold:
                        type: number
                        exclusiveMinimum: 0
                    required:
                      - threshold
                  - type: 'null'
                description: >-
                  Bills this many feature units when outstanding overage reaches
                  it.
              feature_id:
                type: string
                description: The ID of the feature this item configures.
              feature:
                type: object
                properties:
                  id:
                    type: string
                    description: >-
                      The ID of the feature, used to refer to it in other API
                      calls like /track or /check.
                  name:
                    anyOf:
                      - type: string
                      - type: 'null'
                    description: The name of the feature.
                  type:
                    enum:
                      - static
                      - boolean
                      - single_use
                      - continuous_use
                      - credit_system
                      - ai_credit_system
                    type: string
                    description: The type of the feature
                  display:
                    anyOf:
                      - type: object
                        properties:
                          singular:
                            type: string
                            description: The singular display name for the feature.
                          plural:
                            type: string
                            description: The plural display name for the feature.
                        required:
                          - singular
                          - plural
                      - type: 'null'
                    description: Singular and plural display names for the feature.
                  credit_schema:
                    anyOf:
                      - type: array
                        items:
                          type: object
                          properties:
                            metered_feature_id:
                              type: string
                              description: >-
                                The ID of the metered feature (should be a
                                single_use feature).
                            credit_cost:
                              type: number
                              description: The credit cost of the metered feature.
                          required:
                            - metered_feature_id
                            - credit_cost
                      - type: 'null'
                    description: Credit cost schema for credit system features.
                  archived:
                    anyOf:
                      - type: boolean
                      - type: 'null'
                    description: Whether or not the feature is archived.
                required:
                  - id
                  - type
                description: The full feature object if expanded.
              included:
                type: number
                description: >-
                  Number of free units included. For consumable features,
                  balance resets to this number each interval.
              unlimited:
                type: boolean
                description: Whether the customer has unlimited access to this feature.
              pooled:
                type: boolean
                default: false
                description: >-
                  Whether entity-level grants contribute to a shared customer
                  balance.
              reset:
                anyOf:
                  - type: object
                    properties:
                      interval:
                        enum:
                          - one_off
                          - minute
                          - hour
                          - day
                          - week
                          - month
                          - quarter
                          - semi_annual
                          - year
                        type: string
                        description: >-
                          The interval at which the feature balance resets (e.g.
                          'month', 'year'). For consumable features, usage
                          resets to 0 and included units are restored.
                      interval_count:
                        type: number
                        description: Number of intervals between resets. Defaults to 1.
                    required:
                      - interval
                  - type: 'null'
                description: >-
                  Reset configuration for consumable features. Null for
                  non-consumable features like seats where usage persists across
                  billing cycles.
              price:
                anyOf:
                  - type: object
                    properties:
                      amount:
                        type: number
                        description: >-
                          Price per billing_units after included usage is
                          consumed. Mutually exclusive with tiers.
                      additional_currencies:
                        type: array
                        items:
                          type: object
                          properties:
                            currency:
                              type: string
                              description: >-
                                Three-letter Stripe-supported currency code
                                (e.g. 'eur', 'gbp').
                            amount:
                              type: number
                              description: >-
                                Price amount in this currency. Set explicitly
                                per currency, not converted from the base
                                amount.
                          required:
                            - currency
                            - amount
                        description: >-
                          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).
                      tiers:
                        type: array
                        items:
                          type: object
                          properties:
                            to:
                              anyOf:
                                - type: number
                                - const: inf
                            amount:
                              type: number
                            flat_amount:
                              type: number
                            additional_currencies:
                              type: array
                              items:
                                type: object
                                properties:
                                  currency:
                                    type: string
                                    description: >-
                                      Three-letter Stripe-supported currency
                                      code (e.g. 'eur', 'gbp').
                                  amount:
                                    type: number
                                    description: >-
                                      Per-unit amount for this tier in this
                                      currency.
                                  flat_amount:
                                    type: number
                                    description: >-
                                      Flat amount for this tier in this
                                      currency, if the tier uses one.
                                required:
                                  - currency
                          required:
                            - to
                            - amount
                        description: >-
                          Tiered pricing configuration. Each tier's 'to'
                          INCLUDES the included amount. Either 'tiers' or
                          'amount' is required.
                      tier_behavior:
                        enum:
                          - graduated
                          - volume
                        type: string
                        description: >-
                          How tiers price usage. 'graduated' (default) charges
                          each unit at the rate of the tier it falls in.
                          'volume' picks one tier from total usage. On
                          usage-based items it bills only usage past the
                          included amount, at the rate of the tier total usage
                          reaches, plus its flat_amount. On prepaid items it
                          charges every unit, the included ones too, at that
                          tier's rate plus its flat_amount.
                      interval:
                        enum:
                          - one_off
                          - week
                          - month
                          - quarter
                          - semi_annual
                          - year
                        type: string
                        description: >-
                          Billing interval for this price. For usage-based
                          features, should match reset.interval, unless the
                          price has graduated tiers and reset.interval is a
                          whole multiple of it: each invoice then bills only the
                          newly owed usage, at the tier the reset period has
                          reached.
                      interval_count:
                        type: number
                        description: Number of intervals per billing cycle. Defaults to 1.
                      billing_units:
                        type: number
                        description: >-
                          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).
                      billing_method:
                        enum:
                          - prepaid
                          - usage_based
                        type: string
                        description: >-
                          'prepaid' for features like seats where customers pay
                          upfront, 'usage_based' for pay-as-you-go after
                          included usage.
                      max_purchase:
                        anyOf:
                          - type: number
                          - type: 'null'
                        description: >-
                          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.
                      processors:
                        type: object
                        properties:
                          stripe:
                            anyOf:
                              - type: object
                                properties:
                                  price_id:
                                    type: string
                                    description: >-
                                      Stripe price ID. For prepaid with included
                                      > 0 this is the V2 price.
                                required:
                                  - price_id
                              - type: 'null'
                        x-atmn-mapping: true
                        description: >-
                          Payment processors this item price is connected to.
                          Omitted when unset.
                    required:
                      - interval
                      - billing_units
                      - billing_method
                      - max_purchase
                  - type: 'null'
                description: >-
                  Pricing configuration for usage beyond included units. Null if
                  feature is entirely free.
              display:
                type: object
                properties:
                  primary_text:
                    type: string
                    description: Main display text (e.g. '$10' or '100 messages').
                  secondary_text:
                    type: string
                    description: >-
                      Secondary display text (e.g. 'per month' or 'then $0.5 per
                      100').
                required:
                  - primary_text
                description: Display text for showing this item in pricing pages.
              rollover:
                type: object
                properties:
                  max:
                    anyOf:
                      - type: number
                      - type: 'null'
                    description: Maximum rollover units. Null for unlimited rollover.
                  max_percentage:
                    anyOf:
                      - type: number
                      - type: 'null'
                    description: >-
                      Maximum rollover as a percentage (0-100) of included +
                      prepaid grant. Mutually exclusive with max.
                  expiry_duration_type:
                    enum:
                      - month
                      - forever
                    type: string
                    description: When rolled over units expire.
                  expiry_duration_length:
                    type: number
                    description: Number of periods before expiry.
                required:
                  - max
                  - expiry_duration_type
                description: >-
                  Rollover configuration for unused units. If set, unused
                  included units roll over to the next period.
              expiry:
                anyOf:
                  - type: object
                    properties:
                      duration:
                        enum:
                          - day
                          - week
                          - month
                          - year
                        type: string
                      length:
                        type: number
                    required:
                      - duration
                      - length
                  - type: 'null'
                description: >-
                  Purchased units expire this long after each purchase. One-off
                  prepaid consumable items only.
              feature_override:
                type: object
                properties:
                  credit_schema:
                    type: array
                    items:
                      anyOf:
                        - type: object
                          properties:
                            metered_feature_id:
                              type: string
                              minLength: 1
                              description: >-
                                ID of the metered feature that draws from this
                                credit system.
                            billing_units:
                              type: number
                              exclusiveMinimum: 0
                              description: >-
                                Number of metered-feature units priced together.
                                Defaults to one when omitted.
                            dimensions:
                              type: object
                              propertyNames:
                                type: string
                                minLength: 1
                                maxLength: 64
                              additionalProperties:
                                $ref: '#/components/schemas/CreditDimension'
                              description: >-
                                Named rates chosen by event properties. The most
                                specific match sets the rate; with no match the
                                item's own rate applies.
                            multipliers:
                              type: object
                              propertyNames:
                                type: string
                                minLength: 1
                                maxLength: 64
                              additionalProperties:
                                type: object
                                properties:
                                  match:
                                    type: object
                                    propertyNames:
                                      type: string
                                    additionalProperties:
                                      type: string
                                    description: >-
                                      Event properties this entry applies to.
                                      Every key must equal the tracked property,
                                      compared as strings.
                                  factor:
                                    type: number
                                    exclusiveMinimum: 0
                                    description: >-
                                      Multiplies the matched rate. All matching
                                      multipliers stack.
                                  add:
                                    type: number
                                    description: >-
                                      Added to the rate after every factor is
                                      applied, in credits per billing-unit
                                      group.
                                required:
                                  - match
                                additionalProperties: false
                              description: >-
                                Named adjustments chosen by event properties.
                                Every match applies: factors multiply, then adds
                                are summed.
                            tier_behavior:
                              const: graduated
                            tiers:
                              type: array
                              minItems: 1
                              items:
                                type: object
                                properties:
                                  to:
                                    anyOf:
                                      - type: number
                                        exclusiveMinimum: 0
                                      - enum:
                                          - inf
                                        type: string
                                    description: >-
                                      Inclusive upper usage boundary for this
                                      graduated tier. The final tier must be
                                      'inf'.
                                  credit_cost:
                                    type: number
                                    minimum: 0
                                    description: >-
                                      Credits consumed per billing-unit group
                                      within this tier.
                                required:
                                  - to
                                  - credit_cost
                          required:
                            - metered_feature_id
                            - tier_behavior
                            - tiers
                          additionalProperties: false
                        - type: object
                          properties:
                            metered_feature_id:
                              type: string
                              minLength: 1
                              description: >-
                                ID of the metered feature that draws from this
                                credit system.
                            billing_units:
                              type: number
                              exclusiveMinimum: 0
                              description: >-
                                Number of metered-feature units priced together.
                                Defaults to one when omitted.
                            dimensions:
                              type: object
                              propertyNames:
                                type: string
                                minLength: 1
                                maxLength: 64
                              additionalProperties:
                                $ref: '#/components/schemas/CreditDimension'
                              description: >-
                                Named rates chosen by event properties. The most
                                specific match sets the rate; with no match the
                                item's own rate applies.
                            multipliers:
                              type: object
                              propertyNames:
                                type: string
                                minLength: 1
                                maxLength: 64
                              additionalProperties:
                                type: object
                                properties:
                                  match:
                                    type: object
                                    propertyNames:
                                      type: string
                                    additionalProperties:
                                      type: string
                                    description: >-
                                      Event properties this entry applies to.
                                      Every key must equal the tracked property,
                                      compared as strings.
                                  factor:
                                    type: number
                                    exclusiveMinimum: 0
                                    description: >-
                                      Multiplies the matched rate. All matching
                                      multipliers stack.
                                  add:
                                    type: number
                                    description: >-
                                      Added to the rate after every factor is
                                      applied, in credits per billing-unit
                                      group.
                                required:
                                  - match
                                additionalProperties: false
                              description: >-
                                Named adjustments chosen by event properties.
                                Every match applies: factors multiply, then adds
                                are summed.
                            credit_cost:
                              type: number
                              minimum: 0
                              description: Credits consumed per billing-unit group.
                          required:
                            - metered_feature_id
                            - credit_cost
                          additionalProperties: false
                        - type: object
                          properties:
                            metered_feature_id:
                              type: string
                              minLength: 1
                              description: >-
                                ID of the metered feature to remove from the
                                credit system.
                            excluded:
                              const: true
                              description: >-
                                Removes this feature from the credit system for
                                customers on this plan. Cannot be combined with
                                a rate.
                          required:
                            - metered_feature_id
                            - excluded
                          additionalProperties: false
                    description: >-
                      For credit system features: merges into the feature's
                      credit_schema by metered_feature_id for customers on this
                      plan. A row with a rate overrides or adds that feature, a
                      row with `excluded: true` removes it, and unlisted
                      features keep the credit system's rate.
                  markups:
                    type: object
                    properties:
                      default_markup:
                        type: number
                        minimum: -100
                        description: >-
                          Default percentage markup for customers on this plan.
                          Use -100 to make usage free.
                      provider_markups:
                        anyOf:
                          - type: object
                            propertyNames:
                              type: string
                            additionalProperties:
                              type: object
                              properties:
                                markup:
                                  type: number
                                  minimum: -100
                              required:
                                - markup
                          - type: 'null'
                        description: >-
                          Per-provider markup percentages for customers on this
                          plan.
                      model_markups:
                        anyOf:
                          - type: object
                            propertyNames:
                              type: string
                              pattern: .+\/.+
                            additionalProperties:
                              type: object
                              properties:
                                markup:
                                  type: number
                                  minimum: -100
                                input_cost:
                                  type: number
                                  minimum: 0
                                output_cost:
                                  type: number
                                  minimum: 0
                          - type: 'null'
                        description: Per-model markup overrides for customers on this plan.
                    additionalProperties: false
                    description: >-
                      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.
                additionalProperties: false
                description: >-
                  Overrides fields of this item's feature for customers on this
                  plan (e.g. a credit system's credit_schema).
            required:
              - feature_id
              - included
              - unlimited
              - reset
              - price
          description: >-
            Feature configurations included in this plan. Each item defines
            included units, pricing, and reset behavior for a feature.
        processors:
          type: object
          properties:
            stripe:
              anyOf:
                - type: object
                  properties:
                    product_id:
                      type: string
                      description: Stripe product ID this plan is billed under.
                    additional_product_ids:
                      type: array
                      items:
                        type: string
                      description: Extra Stripe product IDs aliased to this plan.
                  required:
                    - product_id
                - type: 'null'
            revenuecat:
              anyOf:
                - type: object
                  properties:
                    products:
                      type: array
                      items:
                        type: object
                        properties:
                          product_id:
                            type: string
                            description: >-
                              RevenueCat product ID that grants this plan when
                              purchased.
                          feature_quantities:
                            type: array
                            items:
                              type: object
                              properties:
                                feature_id:
                                  type: string
                                quantity:
                                  type: number
                                  minimum: 0
                              required:
                                - feature_id
                            description: >-
                              Prepaid quantities granted when this specific
                              RevenueCat product is purchased, in feature units.
                        required:
                          - product_id
                      description: >-
                        Every RevenueCat product that maps to this plan.
                        Replaces the current set.
                  required:
                    - products
                - type: 'null'
          x-atmn-mapping: true
          description: Payment processors this plan is connected to. Omitted when unset.
        free_trial:
          type: object
          properties:
            duration_length:
              type: number
              description: Number of duration_type periods the trial lasts.
            duration_type:
              enum:
                - day
                - month
                - year
              type: string
              description: Unit of time for the trial duration ('day', 'month', 'year').
            card_required:
              type: boolean
              description: >-
                Whether a payment method is required to start the trial. If
                true, customer will be charged after trial ends.
            on_end:
              anyOf:
                - enum:
                    - bill
                    - revert
                  type: string
                - type: 'null'
              description: >-
                Behavior when the trial ends. 'bill' charges the customer
                (default). 'revert' expires the trial and restores the
                customer's previous plan.
          required:
            - duration_length
            - duration_type
            - card_required
          description: >-
            Free trial configuration. If set, new customers can try this plan
            before being charged.
        created_at:
          type: number
          description: Unix timestamp (ms) when the plan was created.
        env:
          enum:
            - sandbox
            - live
          type: string
          description: Environment this plan belongs to ('sandbox' or 'live').
        archived:
          type: boolean
          description: >-
            Whether the plan is archived. Archived plans cannot be attached to
            new customers.
        config:
          type: object
          properties:
            ignore_past_due:
              type: boolean
              default: false
              description: >-
                If true, entitlements attached to this plan will still reset on
                schedule even when the customer's product is in a past_due
                state.
            anchor_to_month_start:
              type: boolean
              description: Anchor billing and reset cycles to the 1st of the month (UTC).
              default: false
          description: Miscellaneous plan-level configuration flags.
        billing_controls:
          type: object
          properties:
            auto_topups:
              type: array
              items:
                type: object
                properties:
                  feature_id:
                    type: string
                    description: The ID of the feature (credit balance) to auto top-up.
                  enabled:
                    type: boolean
                    default: false
                    description: Whether auto top-up is enabled.
                  threshold:
                    type: number
                    description: >-
                      When the balance drops below this threshold, an auto
                      top-up will be purchased.
                  quantity:
                    type: number
                    minimum: 1
                    description: Amount of credits to add per auto top-up.
                  purchase_limit:
                    type: object
                    properties:
                      limit_type:
                        enum:
                          - count
                          - amount
                        type: string
                        description: >-
                          What `limit` caps: the number of auto top-ups
                          (`count`, default) or the total amount charged for
                          them, in the customer's currency (`amount`).
                      interval:
                        enum:
                          - hour
                          - day
                          - week
                          - month
                        type: string
                        description: The time interval for the purchase limit window.
                      interval_count:
                        type: number
                        minimum: 1
                        default: 1
                        description: Number of intervals in the purchase limit window.
                      limit:
                        type: number
                        exclusiveMinimum: 0
                        description: >-
                          Maximum allowed within the interval: a number of auto
                          top-ups when limit_type is count, or a total charge
                          (e.g. 500 for $500, pre-tax) when limit_type is
                          amount.
                    required:
                      - interval
                      - limit
                    description: >-
                      Optional limit on auto top-ups per window, by number of
                      top-ups or amount charged.
                  invoice_mode:
                    type: boolean
                    description: >-
                      When true, auto top-up creates a send_invoice invoice
                      instead of auto-charging.
                required:
                  - feature_id
                  - threshold
                  - quantity
              description: List of auto top-up configurations per feature.
            spend_limits:
              type: array
              items:
                type: object
                properties:
                  feature_id:
                    type: string
                    description: Optional feature ID this spend limit applies to.
                  enabled:
                    type: boolean
                    default: false
                    description: Whether the overage spend limit is enabled.
                  limit_type:
                    enum:
                      - absolute
                      - usage_percentage
                    type: string
                    description: >-
                      How overage_limit is interpreted: an absolute overage cap
                      (default) or a percentage of the main-plan allowance.
                  overage_limit:
                    type: number
                    minimum: 0
                    description: >-
                      Overage cap for the feature: absolute units, or a percent
                      (e.g. 120) when limit_type is usage_percentage.
                  skip_overage_billing:
                    type: boolean
                    description: >-
                      When true, overage for this feature is not posted to
                      Stripe. Usage tracking and balance resets still behave
                      normally.
              description: List of overage spend limits per feature (caps overage spend).
            usage_limits:
              type: array
              items:
                type: object
                properties:
                  feature_id:
                    type: string
                    description: The feature this usage limit applies to.
                  enabled:
                    type: boolean
                    default: true
                    description: Whether this usage limit is enabled.
                  limit:
                    type: number
                    minimum: 0
                    description: Maximum units allowed per interval.
                  interval:
                    enum:
                      - day
                      - week
                      - month
                      - year
                    type: string
                    description: >-
                      Interval for the cap, aligned to the customer's billing
                      cycle.
                  anchor:
                    enum:
                      - billing_cycle
                      - utc
                    type: string
                    description: >-
                      Window alignment. 'billing_cycle' phases the interval to
                      the customer's renewal time; 'utc' aligns to the UTC
                      calendar.
                  filter:
                    type: object
                    properties:
                      properties:
                        type: object
                        propertyNames:
                          type: string
                          minLength: 1
                          maxLength: 64
                        additionalProperties:
                          type: string
                    required:
                      - properties
                    description: >-
                      When set, only usage from events whose properties match
                      counts toward this cap. Omit to count all usage of the
                      feature.
                required:
                  - feature_id
                  - limit
                  - interval
              description: List of hard usage caps per feature (max units per interval).
            usage_alerts:
              type: array
              items:
                type: object
                properties:
                  feature_id:
                    type: string
                    description: The feature ID this alert applies to.
                  enabled:
                    type: boolean
                    default: true
                    description: Whether this usage alert is enabled.
                  threshold:
                    type: number
                    description: >-
                      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. remaining
                      and remaining_percentage accept negative values with basis
                      balance, to alert once the balance is overdrawn.
                  threshold_type:
                    enum:
                      - usage
                      - usage_percentage
                      - remaining
                      - remaining_percentage
                    type: string
                    description: >-
                      Whether the threshold is an absolute count or a percentage
                      of the usage allowance or remaining balance.
                  basis:
                    enum:
                      - balance
                      - included
                      - recurring
                      - usage_limit
                    type: string
                    default: balance
                    description: >-
                      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.
                  filter:
                    type: object
                    properties:
                      properties:
                        type: object
                        propertyNames:
                          type: string
                          minLength: 1
                          maxLength: 64
                        additionalProperties:
                          type: string
                    required:
                      - properties
                    description: >-
                      Only valid with basis usage_limit. Points the alert at the
                      usage limit carrying the same filter.
                  name:
                    type: string
                    description: >-
                      Optional user-defined label to distinguish multiple alerts
                      on the same feature.
                required:
                  - threshold
                  - threshold_type
              description: List of usage alert configurations per feature.
            overage_allowed:
              type: array
              items:
                type: object
                properties:
                  feature_id:
                    type: string
                    description: The feature ID this overage allowed control applies to.
                  enabled:
                    type: boolean
                    default: false
                    description: Whether overage is allowed for this feature.
                required:
                  - feature_id
              description: >-
                List of overage allowed controls per feature. When enabled,
                usage can exceed balance.
          description: Plan-level billing controls used as customer defaults.
        metadata:
          type: object
          propertyNames:
            type: string
          additionalProperties: {}
          description: >-
            Arbitrary key-value metadata defined by you for your own use. Shared
            across all versions of the plan.
        customer_eligibility:
          type: object
          properties:
            trial_available:
              type: boolean
              description: >-
                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.
            status:
              enum:
                - active
                - scheduled
              type: string
              description: >-
                The customer's current status with this plan. 'active' if
                attached, 'scheduled' if pending activation.
            canceling:
              type: boolean
              description: >-
                Whether the customer's active instance of this plan is set to
                cancel.
            trialing:
              type: boolean
              description: Whether the customer is currently on a free trial of this plan.
            attach_action:
              enum:
                - activate
                - upgrade
                - downgrade
                - none
                - purchase
              type: string
              description: >-
                The action that would occur if this plan were attached to the
                customer.
          required:
            - attach_action
        base_variant_id:
          anyOf:
            - type: string
            - type: 'null'
          description: >-
            Deprecated. Use variant_details.base_plan_id instead. If this is a
            variant, the ID of the base plan it was created from.
        variant_details:
          type: object
          properties:
            base_plan_id:
              type: string
              description: The ID of the base plan this variant was derived from.
            customize:
              type: object
              properties:
                price:
                  anyOf:
                    - type: object
                      properties:
                        amount:
                          type: number
                          description: >-
                            Base price amount for the plan, in major currency
                            units (e.g. dollars).
                        interval:
                          enum:
                            - one_off
                            - week
                            - month
                            - quarter
                            - semi_annual
                            - year
                          type: string
                          description: Billing interval (e.g. 'month', 'year').
                        interval_count:
                          type: number
                          description: >-
                            Number of intervals per billing cycle. Defaults to
                            1.
                          default: 1
                        additional_currencies:
                          type: array
                          items:
                            type: object
                            properties:
                              currency:
                                type: string
                                description: >-
                                  Three-letter Stripe-supported currency code
                                  (e.g. 'eur', 'gbp').
                              amount:
                                type: number
                                description: >-
                                  Price amount in this currency. Set explicitly
                                  per currency, not converted from the base
                                  amount.
                            required:
                              - currency
                              - amount
                          description: >-
                            Base price amounts in additional currencies. The
                            base 'amount' is in the org's default currency.
                      required:
                        - amount
                        - interval
                      title: BasePrice
                      description: Base price configuration for a plan.
                    - type: 'null'
                  description: >-
                    Override the base price of the plan. Pass null to remove the
                    base price.
                add_items:
                  type: array
                  items:
                    type: object
                    properties:
                      threshold_billing:
                        anyOf:
                          - type: object
                            properties:
                              threshold:
                                type: number
                                exclusiveMinimum: 0
                            required:
                              - threshold
                          - type: 'null'
                        description: >-
                          Bills this many feature units when outstanding overage
                          reaches it.
                      feature_id:
                        type: string
                        description: The ID of the feature to configure.
                      included:
                        type: number
                        maximum: 10000000000000
                        description: >-
                          Number of free units included. Balance resets to this
                          each interval for consumable features.
                      unlimited:
                        type: boolean
                        description: >-
                          If true, customer has unlimited access to this
                          feature.
                      pooled:
                        type: boolean
                        default: false
                        description: >-
                          Whether entity-level grants contribute to a shared
                          customer balance.
                      reset:
                        type: object
                        properties:
                          interval:
                            enum:
                              - one_off
                              - minute
                              - hour
                              - day
                              - week
                              - month
                              - quarter
                              - semi_annual
                              - year
                            type: string
                            description: >-
                              Interval at which balance resets (e.g. 'month',
                              'year'). For consumable features only.
                          interval_count:
                            type: number
                            description: Number of intervals between resets. Defaults to 1.
                            default: 1
                        required:
                          - interval
                        description: >-
                          Reset configuration for consumable features. Omit for
                          non-consumable features like seats.
                      price:
                        type: object
                        properties:
                          amount:
                            type: number
                            description: >-
                              Price per billing_units after included usage.
                              Either 'amount' or 'tiers' is required.
                          additional_currencies:
                            type: array
                            items:
                              type: object
                              properties:
                                currency:
                                  type: string
                                  description: >-
                                    Three-letter Stripe-supported currency code
                                    (e.g. 'eur', 'gbp').
                                amount:
                                  type: number
                                  description: >-
                                    Price amount in this currency. Set
                                    explicitly per currency, not converted from
                                    the base amount.
                              required:
                                - currency
                                - amount
                            description: >-
                              Amounts in additional currencies for this flat
                              price. The base 'amount' is in the org's default
                              currency. Only valid with 'amount', not 'tiers'.
                          tiers:
                            type: array
                            items:
                              type: object
                              properties:
                                to:
                                  anyOf:
                                    - type: number
                                    - const: inf
                                amount:
                                  type: number
                                flat_amount:
                                  type: number
                                additional_currencies:
                                  type: array
                                  items:
                                    type: object
                                    properties:
                                      currency:
                                        type: string
                                        description: >-
                                          Three-letter Stripe-supported currency
                                          code (e.g. 'eur', 'gbp').
                                      amount:
                                        type: number
                                        description: >-
                                          Per-unit amount for this tier in this
                                          currency.
                                      flat_amount:
                                        type: number
                                        description: >-
                                          Flat amount for this tier in this
                                          currency, if the tier uses one.
                                    required:
                                      - currency
                              required:
                                - to
                                - amount
                            description: >-
                              Tiered pricing.  Either 'amount' or 'tiers' is
                              required.
                          tier_behavior:
                            enum:
                              - graduated
                              - volume
                            type: string
                            description: >-
                              How tiers price usage. 'graduated' (default)
                              charges each unit at the rate of the tier it falls
                              in. 'volume' picks one tier from total usage. On
                              usage-based items it bills only usage past the
                              included amount, at the rate of the tier total
                              usage reaches, plus its flat_amount. On prepaid
                              items it charges every unit, the included ones
                              too, at that tier's rate plus its flat_amount.
                          interval:
                            enum:
                              - one_off
                              - week
                              - month
                              - quarter
                              - semi_annual
                              - year
                            type: string
                            description: >-
                              Billing interval. For usage-based features, should
                              match reset.interval, unless the price has
                              graduated tiers and reset.interval is a whole
                              multiple of it: each invoice then bills only the
                              newly owed usage, at the tier the reset period has
                              reached.
                          interval_count:
                            type: number
                            description: >-
                              Number of intervals per billing cycle. Defaults to
                              1.
                            default: 1
                          billing_units:
                            type: number
                            default: 1
                            description: >-
                              Units per price increment. Usage is rounded UP
                              when billed (e.g. billing_units=100 means 101
                              rounds to 200).
                          billing_method:
                            enum:
                              - prepaid
                              - usage_based
                            type: string
                            description: >-
                              'prepaid' for upfront payment (seats),
                              'usage_based' for pay-as-you-go.
                          max_purchase:
                            anyOf:
                              - type: number
                              - type: 'null'
                            description: >-
                              Max units purchasable beyond included. E.g.
                              included=100, max_purchase=300 allows 400 total.
                              Null for no limit.
                        required:
                          - interval
                          - billing_method
                        description: >-
                          Pricing for usage beyond included units. Omit for free
                          features.
                      proration:
                        type: object
                        properties:
                          on_increase:
                            enum:
                              - bill_immediately
                              - prorate_immediately
                              - prorate_next_cycle
                              - bill_next_cycle
                            type: string
                            description: >-
                              Billing behavior when quantity increases
                              mid-cycle.
                          on_decrease:
                            enum:
                              - prorate
                              - prorate_immediately
                              - prorate_next_cycle
                              - none
                              - no_prorations
                            type: string
                            description: Credit behavior when quantity decreases mid-cycle.
                        required:
                          - on_increase
                          - on_decrease
                        description: >-
                          Proration settings for prepaid features. Controls
                          mid-cycle quantity change billing.
                      rollover:
                        type: object
                        properties:
                          max:
                            type: number
                            description: Max rollover units. Omit for unlimited rollover.
                          max_percentage:
                            type: number
                            description: >-
                              Maximum rollover as a percentage (0-100) of
                              included + prepaid grant. Mutually exclusive with
                              max.
                          expiry_duration_type:
                            enum:
                              - month
                              - forever
                            type: string
                            description: When rolled over units expire.
                          expiry_duration_length:
                            type: number
                            description: Number of periods before expiry.
                        required:
                          - expiry_duration_type
                        description: >-
                          Rollover config for unused units. If set, unused
                          included units carry over.
                      expiry:
                        type: object
                        properties:
                          duration:
                            enum:
                              - day
                              - week
                              - month
                              - year
                            type: string
                          length:
                            type: number
                        required:
                          - duration
                          - length
                        description: >-
                          Purchased units expire this long after each purchase.
                          One-off prepaid consumable items only.
                      feature_override:
                        type: object
                        properties:
                          credit_schema:
                            type: array
                            items:
                              anyOf:
                                - type: object
                                  properties:
                                    metered_feature_id:
                                      type: string
                                      minLength: 1
                                      description: >-
                                        ID of the metered feature that draws
                                        from this credit system.
                                    billing_units:
                                      type: number
                                      exclusiveMinimum: 0
                                      description: >-
                                        Number of metered-feature units priced
                                        together. Defaults to one when omitted.
                                    dimensions:
                                      type: object
                                      propertyNames:
                                        type: string
                                        minLength: 1
                                        maxLength: 64
                                      additionalProperties:
                                        $ref: '#/components/schemas/CreditDimension'
                                      description: >-
                                        Named rates chosen by event properties.
                                        The most specific match sets the rate;
                                        with no match the item's own rate
                                        applies.
                                    multipliers:
                                      type: object
                                      propertyNames:
                                        type: string
                                        minLength: 1
                                        maxLength: 64
                                      additionalProperties:
                                        type: object
                                        properties:
                                          match:
                                            type: object
                                            propertyNames:
                                              type: string
                                            additionalProperties:
                                              type: string
                                            description: >-
                                              Event properties this entry applies to.
                                              Every key must equal the tracked
                                              property, compared as strings.
                                          factor:
                                            type: number
                                            exclusiveMinimum: 0
                                            description: >-
                                              Multiplies the matched rate. All
                                              matching multipliers stack.
                                          add:
                                            type: number
                                            description: >-
                                              Added to the rate after every factor is
                                              applied, in credits per billing-unit
                                              group.
                                        required:
                                          - match
                                        additionalProperties: false
                                      description: >-
                                        Named adjustments chosen by event
                                        properties. Every match applies: factors
                                        multiply, then adds are summed.
                                    tier_behavior:
                                      const: graduated
                                    tiers:
                                      type: array
                                      minItems: 1
                                      items:
                                        type: object
                                        properties:
                                          to:
                                            anyOf:
                                              - type: number
                                                exclusiveMinimum: 0
                                              - enum:
                                                  - inf
                                                type: string
                                            description: >-
                                              Inclusive upper usage boundary for this
                                              graduated tier. The final tier must be
                                              'inf'.
                                          credit_cost:
                                            type: number
                                            minimum: 0
                                            description: >-
                                              Credits consumed per billing-unit group
                                              within this tier.
                                        required:
                                          - to
                                          - credit_cost
                                  required:
                                    - metered_feature_id
                                    - tier_behavior
                                    - tiers
                                  additionalProperties: false
                                - type: object
                                  properties:
                                    metered_feature_id:
                                      type: string
                                      minLength: 1
                                      description: >-
                                        ID of the metered feature that draws
                                        from this credit system.
                                    billing_units:
                                      type: number
                                      exclusiveMinimum: 0
                                      description: >-
                                        Number of metered-feature units priced
                                        together. Defaults to one when omitted.
                                    dimensions:
                                      type: object
                                      propertyNames:
                                        type: string
                                        minLength: 1
                                        maxLength: 64
                                      additionalProperties:
                                        $ref: '#/components/schemas/CreditDimension'
                                      description: >-
                                        Named rates chosen by event properties.
                                        The most specific match sets the rate;
                                        with no match the item's own rate
                                        applies.
                                    multipliers:
                                      type: object
                                      propertyNames:
                                        type: string
                                        minLength: 1
                                        maxLength: 64
                                      additionalProperties:
                                        type: object
                                        properties:
                                          match:
                                            type: object
                                            propertyNames:
                                              type: string
                                            additionalProperties:
                                              type: string
                                            description: >-
                                              Event properties this entry applies to.
                                              Every key must equal the tracked
                                              property, compared as strings.
                                          factor:
                                            type: number
                                            exclusiveMinimum: 0
                                            description: >-
                                              Multiplies the matched rate. All
                                              matching multipliers stack.
                                          add:
                                            type: number
                                            description: >-
                                              Added to the rate after every factor is
                                              applied, in credits per billing-unit
                                              group.
                                        required:
                                          - match
                                        additionalProperties: false
                                      description: >-
                                        Named adjustments chosen by event
                                        properties. Every match applies: factors
                                        multiply, then adds are summed.
                                    credit_cost:
                                      type: number
                                      minimum: 0
                                      description: Credits consumed per billing-unit group.
                                  required:
                                    - metered_feature_id
                                    - credit_cost
                                  additionalProperties: false
                                - type: object
                                  properties:
                                    metered_feature_id:
                                      type: string
                                      minLength: 1
                                      description: >-
                                        ID of the metered feature to remove from
                                        the credit system.
                                    excluded:
                                      const: true
                                      description: >-
                                        Removes this feature from the credit
                                        system for customers on this plan.
                                        Cannot be combined with a rate.
                                  required:
                                    - metered_feature_id
                                    - excluded
                                  additionalProperties: false
                            description: >-
                              For credit system features: merges into the
                              feature's credit_schema by metered_feature_id for
                              customers on this plan. A row with a rate
                              overrides or adds that feature, a row with
                              `excluded: true` removes it, and unlisted features
                              keep the credit system's rate.
                          markups:
                            type: object
                            properties:
                              default_markup:
                                type: number
                                minimum: -100
                                description: >-
                                  Default percentage markup for customers on
                                  this plan. Use -100 to make usage free.
                              provider_markups:
                                anyOf:
                                  - type: object
                                    propertyNames:
                                      type: string
                                    additionalProperties:
                                      type: object
                                      properties:
                                        markup:
                                          type: number
                                          minimum: -100
                                      required:
                                        - markup
                                  - type: 'null'
                                description: >-
                                  Per-provider markup percentages for customers
                                  on this plan.
                              model_markups:
                                anyOf:
                                  - type: object
                                    propertyNames:
                                      type: string
                                      pattern: .+\/.+
                                    additionalProperties:
                                      type: object
                                      properties:
                                        markup:
                                          type: number
                                          minimum: -100
                                        input_cost:
                                          type: number
                                          minimum: 0
                                        output_cost:
                                          type: number
                                          minimum: 0
                                  - type: 'null'
                                description: >-
                                  Per-model markup overrides for customers on
                                  this plan.
                            additionalProperties: false
                            description: >-
                              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.
                        additionalProperties: false
                        description: >-
                          Overrides fields of this item's feature for customers
                          on this plan (e.g. a credit system's credit_schema).
                    required:
                      - feature_id
                    title: PlanItem
                    description: >-
                      Configuration for a feature item in a plan, including
                      usage limits, pricing, and rollover settings.
                  description: Items to add to the plan.
                remove_items:
                  type: array
                  items:
                    type: object
                    properties:
                      feature_id:
                        type: string
                        description: Match items linked to this feature.
                      billing_method:
                        enum:
                          - prepaid
                          - usage_based
                        type: string
                        description: >-
                          Match items with this billing method (prepaid or
                          usage_based).
                      interval:
                        anyOf:
                          - enum:
                              - one_off
                              - week
                              - month
                              - quarter
                              - semi_annual
                              - year
                            type: string
                          - enum:
                              - one_off
                              - minute
                              - hour
                              - day
                              - week
                              - month
                              - quarter
                              - semi_annual
                              - year
                            type: string
                        description: >-
                          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.
                      interval_count:
                        type: integer
                        minimum: -9007199254740991
                        maximum: 9007199254740991
                        exclusiveMinimum: 0
                        description: >-
                          Match items with this interval_count. Disambiguates
                          between items that share an interval but differ in
                          count.
                      included:
                        type: number
                        maximum: 10000000000000
                        description: >-
                          Match items whose grant equals this included usage.
                          Omitted is a wildcard.
                    title: PlanItemFilter
                    description: >-
                      Filter for matching plan items. All provided fields must
                      match (AND).
                  description: Filters selecting items to remove from the plan.
                free_trial:
                  anyOf:
                    - type: object
                      properties:
                        duration_length:
                          type: number
                          description: Number of duration_type periods the trial lasts.
                        duration_type:
                          enum:
                            - day
                            - month
                            - year
                          type: string
                          default: month
                          description: Unit of time for the trial ('day', 'month', 'year').
                        card_required:
                          type: boolean
                          default: false
                          description: >-
                            If true, a payment method is required to start the
                            trial and the customer is charged when it ends.
                            Defaults to false.
                        on_end:
                          enum:
                            - bill
                            - revert
                          type: string
                          description: >-
                            Behavior when the trial ends. 'bill' charges the
                            customer (default). 'revert' expires the trial and
                            restores the customer's previous plan.
                          default: bill
                      required:
                        - duration_length
                      title: FreeTrialParams
                      description: Free trial configuration for a plan.
                    - type: 'null'
                  description: >-
                    Override the plan's default free trial. Pass an object to
                    set a custom trial, or null to remove the trial entirely.
                billing_controls:
                  type: object
                  properties:
                    auto_topups:
                      type: array
                      items:
                        type: object
                        properties:
                          feature_id:
                            type: string
                            description: >-
                              The ID of the feature (credit balance) to auto
                              top-up.
                          enabled:
                            type: boolean
                            default: false
                            description: Whether auto top-up is enabled.
                          threshold:
                            type: number
                            description: >-
                              When the balance drops below this threshold, an
                              auto top-up will be purchased.
                          quantity:
                            type: number
                            minimum: 1
                            description: Amount of credits to add per auto top-up.
                          purchase_limit:
                            type: object
                            properties:
                              limit_type:
                                enum:
                                  - count
                                  - amount
                                type: string
                                description: >-
                                  What `limit` caps: the number of auto top-ups
                                  (`count`, default) or the total amount charged
                                  for them, in the customer's currency
                                  (`amount`).
                              interval:
                                enum:
                                  - hour
                                  - day
                                  - week
                                  - month
                                type: string
                                description: >-
                                  The time interval for the purchase limit
                                  window.
                              interval_count:
                                type: number
                                minimum: 1
                                default: 1
                                description: >-
                                  Number of intervals in the purchase limit
                                  window.
                              limit:
                                type: number
                                exclusiveMinimum: 0
                                description: >-
                                  Maximum allowed within the interval: a number
                                  of auto top-ups when limit_type is count, or a
                                  total charge (e.g. 500 for $500, pre-tax) when
                                  limit_type is amount.
                              count:
                                type: number
                                minimum: 0
                                description: >-
                                  Set the current window's consumed auto top-up
                                  count. Omit to leave runtime state unchanged.
                              amount:
                                type: number
                                minimum: 0
                                description: >-
                                  Set the amount already charged by auto top-ups
                                  in the current window. Omit to leave runtime
                                  state unchanged.
                            required:
                              - interval
                              - limit
                            description: >-
                              Optional rate limit to cap how often auto top-ups
                              occur. Pass count or amount to set the current
                              window's consumed top-ups or charged amount.
                          invoice_mode:
                            type: boolean
                            description: >-
                              When true, auto top-up creates a send_invoice
                              invoice instead of auto-charging.
                        required:
                          - feature_id
                          - threshold
                          - quantity
                      description: List of auto top-up configurations per feature.
                      default: []
                    spend_limits:
                      type: array
                      items:
                        type: object
                        properties:
                          feature_id:
                            type: string
                            description: Optional feature ID this spend limit applies to.
                          enabled:
                            type: boolean
                            default: false
                            description: Whether the overage spend limit is enabled.
                          limit_type:
                            enum:
                              - absolute
                              - usage_percentage
                            type: string
                            description: >-
                              How overage_limit is interpreted: an absolute
                              overage cap (default) or a percentage of the
                              main-plan allowance.
                          overage_limit:
                            type: number
                            minimum: 0
                            description: >-
                              Overage cap for the feature: absolute units, or a
                              percent (e.g. 120) when limit_type is
                              usage_percentage.
                          skip_overage_billing:
                            type: boolean
                            description: >-
                              When true, overage for this feature is not posted
                              to Stripe. Usage tracking and balance resets still
                              behave normally.
                      description: >-
                        List of overage spend limits per feature (caps overage
                        spend).
                      default: []
                    usage_limits:
                      type: array
                      items:
                        type: object
                        properties:
                          feature_id:
                            type: string
                            description: The feature this usage limit applies to.
                          enabled:
                            type: boolean
                            default: true
                            description: Whether this usage limit is enabled.
                          limit:
                            type: number
                            minimum: 0
                            description: Maximum units allowed per interval.
                          interval:
                            enum:
                              - day
                              - week
                              - month
                              - year
                            type: string
                            description: >-
                              Interval for the cap, aligned to the customer's
                              billing cycle.
                          anchor:
                            enum:
                              - billing_cycle
                              - utc
                            type: string
                            description: >-
                              Window alignment. 'billing_cycle' phases the
                              interval to the customer's renewal time; 'utc'
                              aligns to the UTC calendar.
                          filter:
                            type: object
                            properties:
                              properties:
                                type: object
                                propertyNames:
                                  type: string
                                  minLength: 1
                                  maxLength: 64
                                additionalProperties:
                                  type: string
                            required:
                              - properties
                            description: >-
                              When set, only usage from events whose properties
                              match counts toward this cap. Omit to count all
                              usage of the feature.
                        required:
                          - feature_id
                          - limit
                          - interval
                      description: >-
                        List of hard usage caps per feature (max units per
                        interval).
                      default: []
                    usage_alerts:
                      type: array
                      items:
                        type: object
                        properties:
                          feature_id:
                            type: string
                            description: The feature ID this alert applies to.
                          enabled:
                            type: boolean
                            default: true
                            description: Whether this usage alert is enabled.
                          threshold:
                            type: number
                            description: >-
                              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. remaining and remaining_percentage
                              accept negative values with basis balance, to
                              alert once the balance is overdrawn.
                          threshold_type:
                            enum:
                              - usage
                              - usage_percentage
                              - remaining
                              - remaining_percentage
                            type: string
                            description: >-
                              Whether the threshold is an absolute count or a
                              percentage of the usage allowance or remaining
                              balance.
                          basis:
                            enum:
                              - balance
                              - included
                              - recurring
                              - usage_limit
                            type: string
                            default: balance
                            description: >-
                              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.
                          filter:
                            type: object
                            properties:
                              properties:
                                type: object
                                propertyNames:
                                  type: string
                                  minLength: 1
                                  maxLength: 64
                                additionalProperties:
                                  type: string
                            required:
                              - properties
                            description: >-
                              Only valid with basis usage_limit. Points the
                              alert at the usage limit carrying the same filter.
                          name:
                            type: string
                            description: >-
                              Optional user-defined label to distinguish
                              multiple alerts on the same feature.
                        required:
                          - threshold
                          - threshold_type
                      description: List of usage alert configurations per feature.
                      default: []
                    overage_allowed:
                      type: array
                      items:
                        type: object
                        properties:
                          feature_id:
                            type: string
                            description: >-
                              The feature ID this overage allowed control
                              applies to.
                          enabled:
                            type: boolean
                            default: false
                            description: Whether overage is allowed for this feature.
                        required:
                          - feature_id
                      description: >-
                        List of overage allowed controls per feature. When
                        enabled, usage can exceed balance.
                      default: []
                  description: >-
                    Override the plan's billing controls (auto top-ups, spend
                    limits, usage limits, usage alerts, overage allowed) for
                    this customer.
                upsert_licenses:
                  type: array
                  items:
                    type: object
                    properties:
                      license_plan_id:
                        type: string
                      version_slug:
                        type: string
                      included:
                        type: integer
                        minimum: 0
                        maximum: 9007199254740991
                      prepaid_only:
                        type: boolean
                      customize:
                        anyOf:
                          - type: object
                            properties:
                              price:
                                anyOf:
                                  - type: object
                                    properties:
                                      amount:
                                        type: number
                                        description: >-
                                          Base price amount for the plan, in major
                                          currency units (e.g. dollars).
                                      interval:
                                        enum:
                                          - one_off
                                          - week
                                          - month
                                          - quarter
                                          - semi_annual
                                          - year
                                        type: string
                                        description: Billing interval (e.g. 'month', 'year').
                                      interval_count:
                                        type: number
                                        description: >-
                                          Number of intervals per billing cycle.
                                          Defaults to 1.
                                        default: 1
                                      additional_currencies:
                                        type: array
                                        items:
                                          type: object
                                          properties:
                                            currency:
                                              type: string
                                              description: >-
                                                Three-letter Stripe-supported currency
                                                code (e.g. 'eur', 'gbp').
                                            amount:
                                              type: number
                                              description: >-
                                                Price amount in this currency. Set
                                                explicitly per currency, not converted
                                                from the base amount.
                                          required:
                                            - currency
                                            - amount
                                        description: >-
                                          Base price amounts in additional
                                          currencies. The base 'amount' is in the
                                          org's default currency.
                                    required:
                                      - amount
                                      - interval
                                    title: BasePrice
                                    description: Base price configuration for a plan.
                                  - type: 'null'
                              add_items:
                                type: array
                                items:
                                  type: object
                                  properties:
                                    threshold_billing:
                                      anyOf:
                                        - type: object
                                          properties:
                                            threshold:
                                              type: number
                                              exclusiveMinimum: 0
                                          required:
                                            - threshold
                                        - type: 'null'
                                      description: >-
                                        Bills this many feature units when
                                        outstanding overage reaches it.
                                    feature_id:
                                      type: string
                                      description: The ID of the feature to configure.
                                    included:
                                      type: number
                                      maximum: 10000000000000
                                      description: >-
                                        Number of free units included. Balance
                                        resets to this each interval for
                                        consumable features.
                                    unlimited:
                                      type: boolean
                                      description: >-
                                        If true, customer has unlimited access
                                        to this feature.
                                    pooled:
                                      type: boolean
                                      default: false
                                      description: >-
                                        Whether entity-level grants contribute
                                        to a shared customer balance.
                                    reset:
                                      type: object
                                      properties:
                                        interval:
                                          enum:
                                            - one_off
                                            - minute
                                            - hour
                                            - day
                                            - week
                                            - month
                                            - quarter
                                            - semi_annual
                                            - year
                                          type: string
                                          description: >-
                                            Interval at which balance resets (e.g.
                                            'month', 'year'). For consumable
                                            features only.
                                        interval_count:
                                          type: number
                                          description: >-
                                            Number of intervals between resets.
                                            Defaults to 1.
                                          default: 1
                                      required:
                                        - interval
                                      description: >-
                                        Reset configuration for consumable
                                        features. Omit for non-consumable
                                        features like seats.
                                    price:
                                      type: object
                                      properties:
                                        amount:
                                          type: number
                                          description: >-
                                            Price per billing_units after included
                                            usage. Either 'amount' or 'tiers' is
                                            required.
                                        additional_currencies:
                                          type: array
                                          items:
                                            type: object
                                            properties:
                                              currency:
                                                type: string
                                                description: >-
                                                  Three-letter Stripe-supported currency
                                                  code (e.g. 'eur', 'gbp').
                                              amount:
                                                type: number
                                                description: >-
                                                  Price amount in this currency. Set
                                                  explicitly per currency, not converted
                                                  from the base amount.
                                            required:
                                              - currency
                                              - amount
                                          description: >-
                                            Amounts in additional currencies for
                                            this flat price. The base 'amount' is in
                                            the org's default currency. Only valid
                                            with 'amount', not 'tiers'.
                                        tiers:
                                          type: array
                                          items:
                                            type: object
                                            properties:
                                              to:
                                                anyOf:
                                                  - type: number
                                                  - const: inf
                                              amount:
                                                type: number
                                              flat_amount:
                                                type: number
                                              additional_currencies:
                                                type: array
                                                items:
                                                  type: object
                                                  properties:
                                                    currency:
                                                      type: string
                                                      description: >-
                                                        Three-letter Stripe-supported currency
                                                        code (e.g. 'eur', 'gbp').
                                                    amount:
                                                      type: number
                                                      description: >-
                                                        Per-unit amount for this tier in this
                                                        currency.
                                                    flat_amount:
                                                      type: number
                                                      description: >-
                                                        Flat amount for this tier in this
                                                        currency, if the tier uses one.
                                                  required:
                                                    - currency
                                            required:
                                              - to
                                              - amount
                                          description: >-
                                            Tiered pricing.  Either 'amount' or
                                            'tiers' is required.
                                        tier_behavior:
                                          enum:
                                            - graduated
                                            - volume
                                          type: string
                                          description: >-
                                            How tiers price usage. 'graduated'
                                            (default) charges each unit at the rate
                                            of the tier it falls in. 'volume' picks
                                            one tier from total usage. On
                                            usage-based items it bills only usage
                                            past the included amount, at the rate of
                                            the tier total usage reaches, plus its
                                            flat_amount. On prepaid items it charges
                                            every unit, the included ones too, at
                                            that tier's rate plus its flat_amount.
                                        interval:
                                          enum:
                                            - one_off
                                            - week
                                            - month
                                            - quarter
                                            - semi_annual
                                            - year
                                          type: string
                                          description: >-
                                            Billing interval. For usage-based
                                            features, should match reset.interval,
                                            unless the price has graduated tiers and
                                            reset.interval is a whole multiple of
                                            it: each invoice then bills only the
                                            newly owed usage, at the tier the reset
                                            period has reached.
                                        interval_count:
                                          type: number
                                          description: >-
                                            Number of intervals per billing cycle.
                                            Defaults to 1.
                                          default: 1
                                        billing_units:
                                          type: number
                                          default: 1
                                          description: >-
                                            Units per price increment. Usage is
                                            rounded UP when billed (e.g.
                                            billing_units=100 means 101 rounds to
                                            200).
                                        billing_method:
                                          enum:
                                            - prepaid
                                            - usage_based
                                          type: string
                                          description: >-
                                            'prepaid' for upfront payment (seats),
                                            'usage_based' for pay-as-you-go.
                                        max_purchase:
                                          anyOf:
                                            - type: number
                                            - type: 'null'
                                          description: >-
                                            Max units purchasable beyond included.
                                            E.g. included=100, max_purchase=300
                                            allows 400 total. Null for no limit.
                                      required:
                                        - interval
                                        - billing_method
                                      description: >-
                                        Pricing for usage beyond included units.
                                        Omit for free features.
                                    proration:
                                      type: object
                                      properties:
                                        on_increase:
                                          enum:
                                            - bill_immediately
                                            - prorate_immediately
                                            - prorate_next_cycle
                                            - bill_next_cycle
                                          type: string
                                          description: >-
                                            Billing behavior when quantity increases
                                            mid-cycle.
                                        on_decrease:
                                          enum:
                                            - prorate
                                            - prorate_immediately
                                            - prorate_next_cycle
                                            - none
                                            - no_prorations
                                          type: string
                                          description: >-
                                            Credit behavior when quantity decreases
                                            mid-cycle.
                                      required:
                                        - on_increase
                                        - on_decrease
                                      description: >-
                                        Proration settings for prepaid features.
                                        Controls mid-cycle quantity change
                                        billing.
                                    rollover:
                                      type: object
                                      properties:
                                        max:
                                          type: number
                                          description: >-
                                            Max rollover units. Omit for unlimited
                                            rollover.
                                        max_percentage:
                                          type: number
                                          description: >-
                                            Maximum rollover as a percentage (0-100)
                                            of included + prepaid grant. Mutually
                                            exclusive with max.
                                        expiry_duration_type:
                                          enum:
                                            - month
                                            - forever
                                          type: string
                                          description: When rolled over units expire.
                                        expiry_duration_length:
                                          type: number
                                          description: Number of periods before expiry.
                                      required:
                                        - expiry_duration_type
                                      description: >-
                                        Rollover config for unused units. If
                                        set, unused included units carry over.
                                    expiry:
                                      type: object
                                      properties:
                                        duration:
                                          enum:
                                            - day
                                            - week
                                            - month
                                            - year
                                          type: string
                                        length:
                                          type: number
                                      required:
                                        - duration
                                        - length
                                      description: >-
                                        Purchased units expire this long after
                                        each purchase. One-off prepaid
                                        consumable items only.
                                    feature_override:
                                      type: object
                                      properties:
                                        credit_schema:
                                          type: array
                                          items:
                                            anyOf:
                                              - type: object
                                                properties:
                                                  metered_feature_id:
                                                    type: string
                                                    minLength: 1
                                                    description: >-
                                                      ID of the metered feature that draws
                                                      from this credit system.
                                                  billing_units:
                                                    type: number
                                                    exclusiveMinimum: 0
                                                    description: >-
                                                      Number of metered-feature units priced
                                                      together. Defaults to one when omitted.
                                                  dimensions:
                                                    type: object
                                                    propertyNames:
                                                      type: string
                                                      minLength: 1
                                                      maxLength: 64
                                                    additionalProperties:
                                                      $ref: '#/components/schemas/CreditDimension'
                                                    description: >-
                                                      Named rates chosen by event properties.
                                                      The most specific match sets the rate;
                                                      with no match the item's own rate
                                                      applies.
                                                  multipliers:
                                                    type: object
                                                    propertyNames:
                                                      type: string
                                                      minLength: 1
                                                      maxLength: 64
                                                    additionalProperties:
                                                      type: object
                                                      properties:
                                                        match:
                                                          type: object
                                                          propertyNames:
                                                            type: string
                                                          additionalProperties:
                                                            type: string
                                                          description: >-
                                                            Event properties this entry applies to.
                                                            Every key must equal the tracked
                                                            property, compared as strings.
                                                        factor:
                                                          type: number
                                                          exclusiveMinimum: 0
                                                          description: >-
                                                            Multiplies the matched rate. All
                                                            matching multipliers stack.
                                                        add:
                                                          type: number
                                                          description: >-
                                                            Added to the rate after every factor is
                                                            applied, in credits per billing-unit
                                                            group.
                                                      required:
                                                        - match
                                                      additionalProperties: false
                                                    description: >-
                                                      Named adjustments chosen by event
                                                      properties. Every match applies: factors
                                                      multiply, then adds are summed.
                                                  tier_behavior:
                                                    const: graduated
                                                  tiers:
                                                    type: array
                                                    minItems: 1
                                                    items:
                                                      type: object
                                                      properties:
                                                        to:
                                                          anyOf:
                                                            - type: number
                                                              exclusiveMinimum: 0
                                                            - enum:
                                                                - inf
                                                              type: string
                                                          description: >-
                                                            Inclusive upper usage boundary for this
                                                            graduated tier. The final tier must be
                                                            'inf'.
                                                        credit_cost:
                                                          type: number
                                                          minimum: 0
                                                          description: >-
                                                            Credits consumed per billing-unit group
                                                            within this tier.
                                                      required:
                                                        - to
                                                        - credit_cost
                                                required:
                                                  - metered_feature_id
                                                  - tier_behavior
                                                  - tiers
                                                additionalProperties: false
                                              - type: object
                                                properties:
                                                  metered_feature_id:
                                                    type: string
                                                    minLength: 1
                                                    description: >-
                                                      ID of the metered feature that draws
                                                      from this credit system.
                                                  billing_units:
                                                    type: number
                                                    exclusiveMinimum: 0
                                                    description: >-
                                                      Number of metered-feature units priced
                                                      together. Defaults to one when omitted.
                                                  dimensions:
                                                    type: object
                                                    propertyNames:
                                                      type: string
                                                      minLength: 1
                                                      maxLength: 64
                                                    additionalProperties:
                                                      $ref: '#/components/schemas/CreditDimension'
                                                    description: >-
                                                      Named rates chosen by event properties.
                                                      The most specific match sets the rate;
                                                      with no match the item's own rate
                                                      applies.
                                                  multipliers:
                                                    type: object
                                                    propertyNames:
                                                      type: string
                                                      minLength: 1
                                                      maxLength: 64
                                                    additionalProperties:
                                                      type: object
                                                      properties:
                                                        match:
                                                          type: object
                                                          propertyNames:
                                                            type: string
                                                          additionalProperties:
                                                            type: string
                                                          description: >-
                                                            Event properties this entry applies to.
                                                            Every key must equal the tracked
                                                            property, compared as strings.
                                                        factor:
                                                          type: number
                                                          exclusiveMinimum: 0
                                                          description: >-
                                                            Multiplies the matched rate. All
                                                            matching multipliers stack.
                                                        add:
                                                          type: number
                                                          description: >-
                                                            Added to the rate after every factor is
                                                            applied, in credits per billing-unit
                                                            group.
                                                      required:
                                                        - match
                                                      additionalProperties: false
                                                    description: >-
                                                      Named adjustments chosen by event
                                                      properties. Every match applies: factors
                                                      multiply, then adds are summed.
                                                  credit_cost:
                                                    type: number
                                                    minimum: 0
                                                    description: Credits consumed per billing-unit group.
                                                required:
                                                  - metered_feature_id
                                                  - credit_cost
                                                additionalProperties: false
                                              - type: object
                                                properties:
                                                  metered_feature_id:
                                                    type: string
                                                    minLength: 1
                                                    description: >-
                                                      ID of the metered feature to remove from
                                                      the credit system.
                                                  excluded:
                                                    const: true
                                                    description: >-
                                                      Removes this feature from the credit
                                                      system for customers on this plan.
                                                      Cannot be combined with a rate.
                                                required:
                                                  - metered_feature_id
                                                  - excluded
                                                additionalProperties: false
                                          description: >-
                                            For credit system features: merges into
                                            the feature's credit_schema by
                                            metered_feature_id for customers on this
                                            plan. A row with a rate overrides or
                                            adds that feature, a row with `excluded:
                                            true` removes it, and unlisted features
                                            keep the credit system's rate.
                                        markups:
                                          type: object
                                          properties:
                                            default_markup:
                                              type: number
                                              minimum: -100
                                              description: >-
                                                Default percentage markup for customers
                                                on this plan. Use -100 to make usage
                                                free.
                                            provider_markups:
                                              anyOf:
                                                - type: object
                                                  propertyNames:
                                                    type: string
                                                  additionalProperties:
                                                    type: object
                                                    properties:
                                                      markup:
                                                        type: number
                                                        minimum: -100
                                                    required:
                                                      - markup
                                                - type: 'null'
                                              description: >-
                                                Per-provider markup percentages for
                                                customers on this plan.
                                            model_markups:
                                              anyOf:
                                                - type: object
                                                  propertyNames:
                                                    type: string
                                                    pattern: .+\/.+
                                                  additionalProperties:
                                                    type: object
                                                    properties:
                                                      markup:
                                                        type: number
                                                        minimum: -100
                                                      input_cost:
                                                        type: number
                                                        minimum: 0
                                                      output_cost:
                                                        type: number
                                                        minimum: 0
                                                - type: 'null'
                                              description: >-
                                                Per-model markup overrides for customers
                                                on this plan.
                                          additionalProperties: false
                                          description: >-
                                            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.
                                      additionalProperties: false
                                      description: >-
                                        Overrides fields of this item's feature
                                        for customers on this plan (e.g. a
                                        credit system's credit_schema).
                                  required:
                                    - feature_id
                                  title: PlanItem
                                  description: >-
                                    Configuration for a feature item in a plan,
                                    including usage limits, pricing, and
                                    rollover settings.
                              remove_items:
                                type: array
                                items:
                                  type: object
                                  properties:
                                    feature_id:
                                      type: string
                                      description: Match items linked to this feature.
                                    billing_method:
                                      enum:
                                        - prepaid
                                        - usage_based
                                      type: string
                                      description: >-
                                        Match items with this billing method
                                        (prepaid or usage_based).
                                    interval:
                                      anyOf:
                                        - enum:
                                            - one_off
                                            - week
                                            - month
                                            - quarter
                                            - semi_annual
                                            - year
                                          type: string
                                        - enum:
                                            - one_off
                                            - minute
                                            - hour
                                            - day
                                            - week
                                            - month
                                            - quarter
                                            - semi_annual
                                            - year
                                          type: string
                                      description: >-
                                        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.
                                    interval_count:
                                      type: integer
                                      minimum: -9007199254740991
                                      maximum: 9007199254740991
                                      exclusiveMinimum: 0
                                      description: >-
                                        Match items with this interval_count.
                                        Disambiguates between items that share
                                        an interval but differ in count.
                                    included:
                                      type: number
                                      maximum: 10000000000000
                                      description: >-
                                        Match items whose grant equals this
                                        included usage. Omitted is a wildcard.
                                  title: PlanItemFilter
                                  description: >-
                                    Filter for matching plan items. All provided
                                    fields must match (AND).
                          - type: 'null'
                      metadata:
                        type: object
                        propertyNames:
                          type: string
                        additionalProperties: {}
                    required:
                      - license_plan_id
                  description: >-
                    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.
                remove_licenses:
                  type: array
                  items:
                    type: object
                    properties:
                      license_plan_id:
                        type: string
                    required:
                      - license_plan_id
                  description: >-
                    License links to drop, keyed by license_plan_id. Parallel to
                    remove_items.
              additionalProperties: false
              description: >-
                The customization that transforms the base plan into this
                variant.
          required:
            - base_plan_id
          description: Details about how this variant relates to its latest base plan.
      required:
        - id
        - name
        - description
        - group
        - version
        - add_on
        - auto_enable
        - price
        - items
        - created_at
        - env
        - archived
        - config
        - metadata
        - base_variant_id
    Balance:
      type: object
      properties:
        feature_id:
          type: string
          description: The feature ID this balance is for.
        feature:
          type: object
          properties:
            id:
              type: string
              description: >-
                The unique identifier for this feature, used in /check and
                /track calls.
            name:
              type: string
              description: Human-readable name displayed in the dashboard and billing UI.
            type:
              enum:
                - boolean
                - metered
                - credit_system
                - ai_credit_system
              type: string
              description: >-
                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.
            consumable:
              type: boolean
              description: >-
                For metered features: true if usage resets periodically (API
                calls, credits), false if allocated persistently (seats,
                storage).
            combine:
              enum:
                - sum
                - max
                - min
              type: string
              description: >-
                How grants of this feature from several plans combine: 'sum'
                adds them up, 'max' / 'min' keep the highest / lowest grant
                among plan items with no price. Omitted when 'sum'.
            event_names:
              type: array
              items:
                type: string
              description: >-
                Event names that trigger this feature's balance. Allows multiple
                features to respond to a single event.
            credit_schema:
              type: array
              items:
                anyOf:
                  - type: object
                    properties:
                      metered_feature_id:
                        type: string
                        minLength: 1
                        description: >-
                          ID of the metered feature that draws from this credit
                          system.
                      billing_units:
                        type: number
                        exclusiveMinimum: 0
                        description: >-
                          Number of metered-feature units priced together.
                          Defaults to one when omitted.
                      dimensions:
                        type: object
                        propertyNames:
                          type: string
                          minLength: 1
                          maxLength: 64
                        additionalProperties:
                          $ref: '#/components/schemas/CreditDimension'
                        description: >-
                          Named rates chosen by event properties. The most
                          specific match sets the rate; with no match the item's
                          own rate applies.
                      multipliers:
                        type: object
                        propertyNames:
                          type: string
                          minLength: 1
                          maxLength: 64
                        additionalProperties:
                          type: object
                          properties:
                            match:
                              type: object
                              propertyNames:
                                type: string
                              additionalProperties:
                                type: string
                              description: >-
                                Event properties this entry applies to. Every
                                key must equal the tracked property, compared as
                                strings.
                            factor:
                              type: number
                              exclusiveMinimum: 0
                              description: >-
                                Multiplies the matched rate. All matching
                                multipliers stack.
                            add:
                              type: number
                              description: >-
                                Added to the rate after every factor is applied,
                                in credits per billing-unit group.
                          required:
                            - match
                          additionalProperties: false
                        description: >-
                          Named adjustments chosen by event properties. Every
                          match applies: factors multiply, then adds are summed.
                      tier_behavior:
                        const: graduated
                      tiers:
                        type: array
                        minItems: 1
                        items:
                          type: object
                          properties:
                            to:
                              anyOf:
                                - type: number
                                  exclusiveMinimum: 0
                                - enum:
                                    - inf
                                  type: string
                              description: >-
                                Inclusive upper usage boundary for this
                                graduated tier. The final tier must be 'inf'.
                            credit_cost:
                              type: number
                              minimum: 0
                              description: >-
                                Credits consumed per billing-unit group within
                                this tier.
                          required:
                            - to
                            - credit_cost
                    required:
                      - metered_feature_id
                      - tier_behavior
                      - tiers
                    additionalProperties: false
                  - type: object
                    properties:
                      metered_feature_id:
                        type: string
                        minLength: 1
                        description: >-
                          ID of the metered feature that draws from this credit
                          system.
                      billing_units:
                        type: number
                        exclusiveMinimum: 0
                        description: >-
                          Number of metered-feature units priced together.
                          Defaults to one when omitted.
                      dimensions:
                        type: object
                        propertyNames:
                          type: string
                          minLength: 1
                          maxLength: 64
                        additionalProperties:
                          $ref: '#/components/schemas/CreditDimension'
                        description: >-
                          Named rates chosen by event properties. The most
                          specific match sets the rate; with no match the item's
                          own rate applies.
                      multipliers:
                        type: object
                        propertyNames:
                          type: string
                          minLength: 1
                          maxLength: 64
                        additionalProperties:
                          type: object
                          properties:
                            match:
                              type: object
                              propertyNames:
                                type: string
                              additionalProperties:
                                type: string
                              description: >-
                                Event properties this entry applies to. Every
                                key must equal the tracked property, compared as
                                strings.
                            factor:
                              type: number
                              exclusiveMinimum: 0
                              description: >-
                                Multiplies the matched rate. All matching
                                multipliers stack.
                            add:
                              type: number
                              description: >-
                                Added to the rate after every factor is applied,
                                in credits per billing-unit group.
                          required:
                            - match
                          additionalProperties: false
                        description: >-
                          Named adjustments chosen by event properties. Every
                          match applies: factors multiply, then adds are summed.
                      credit_cost:
                        type: number
                        minimum: 0
                        description: Credits consumed per billing-unit group.
                    required:
                      - metered_feature_id
                      - credit_cost
                    additionalProperties: false
                  - type: object
                    properties:
                      metered_feature_id:
                        const: ''
                      billing_units:
                        type: number
                        exclusiveMinimum: 0
                        description: >-
                          Number of metered-feature units priced together.
                          Defaults to one when omitted.
                      dimensions:
                        type: object
                        propertyNames:
                          type: string
                          minLength: 1
                          maxLength: 64
                        additionalProperties:
                          $ref: '#/components/schemas/CreditDimension'
                        description: >-
                          Named rates chosen by event properties. The most
                          specific match sets the rate; with no match the item's
                          own rate applies.
                      multipliers:
                        type: object
                        propertyNames:
                          type: string
                          minLength: 1
                          maxLength: 64
                        additionalProperties:
                          type: object
                          properties:
                            match:
                              type: object
                              propertyNames:
                                type: string
                              additionalProperties:
                                type: string
                              description: >-
                                Event properties this entry applies to. Every
                                key must equal the tracked property, compared as
                                strings.
                            factor:
                              type: number
                              exclusiveMinimum: 0
                              description: >-
                                Multiplies the matched rate. All matching
                                multipliers stack.
                            add:
                              type: number
                              description: >-
                                Added to the rate after every factor is applied,
                                in credits per billing-unit group.
                          required:
                            - match
                          additionalProperties: false
                        description: >-
                          Named adjustments chosen by event properties. Every
                          match applies: factors multiply, then adds are summed.
                      credit_cost:
                        type: number
                        minimum: 0
                        description: Credits consumed per billing-unit group.
                    required:
                      - metered_feature_id
                      - credit_cost
                    additionalProperties: false
              description: >-
                For classic credit systems: maps metered features to flat or
                graduated credit costs.
            model_markups:
              anyOf:
                - type: object
                  propertyNames:
                    type: string
                    pattern: .+\/.+
                  additionalProperties:
                    type: object
                    properties:
                      markup:
                        type: number
                        minimum: -100
                      input_cost:
                        type: number
                        minimum: 0
                      output_cost:
                        type: number
                        minimum: 0
                - type: 'null'
              description: Per-model markup overrides for AI credit systems.
            default_markup:
              type: number
              minimum: -100
              description: >-
                Default percentage markup for AI credit systems. Use -100 to
                make usage free.
            provider_markups:
              anyOf:
                - type: object
                  propertyNames:
                    type: string
                  additionalProperties:
                    type: object
                    properties:
                      markup:
                        type: number
                        minimum: -100
                    required:
                      - markup
                - type: 'null'
              description: Per-provider default markup percentages for AI credit systems.
            display:
              type: object
              properties:
                singular:
                  anyOf:
                    - type: string
                    - type: 'null'
                  description: Singular form for UI display (e.g., 'API call', 'seat').
                plural:
                  anyOf:
                    - type: string
                    - type: 'null'
                  description: Plural form for UI display (e.g., 'API calls', 'seats').
              description: >-
                Display names for the feature in billing UI and customer-facing
                components.
            archived:
              type: boolean
              description: Whether the feature is archived and hidden from the dashboard.
            processors:
              type: object
              properties:
                stripe:
                  type: object
                  properties:
                    product_id:
                      type: string
                      description: >-
                        Stripe product ID this feature's usage prices bill
                        under.
                    meter_id:
                      type: string
                      description: >-
                        Stripe meter ID used to create this feature's metered
                        price.
              x-atmn-mapping: true
              description: >-
                Processor mappings for this feature. Present when a Stripe
                product or meter is set.
          required:
            - id
            - name
            - type
            - consumable
            - archived
          description: The full feature object if expanded.
        granted:
          type: number
          description: Total balance granted (included + prepaid).
        remaining:
          type: number
          minimum: 0
          description: Remaining balance available for use.
        usage:
          type: number
          description: Total usage consumed in the current period.
        unlimited:
          type: boolean
          description: Whether this feature has unlimited usage.
        overage_allowed:
          type: boolean
          description: >-
            Whether usage beyond the granted balance is allowed (with overage
            charges).
        max_purchase:
          anyOf:
            - type: number
            - type: 'null'
          description: >-
            Maximum quantity that can be purchased as a top-up, or null for
            unlimited.
        next_reset_at:
          anyOf:
            - type: number
            - type: 'null'
          description: Timestamp when the balance will reset, or null for no reset.
        breakdown:
          type: array
          items:
            type: object
            properties:
              id:
                type: string
                default: ''
                description: The unique identifier for this balance breakdown.
              plan_id:
                anyOf:
                  - type: string
                  - type: 'null'
                description: >-
                  The plan ID this balance originates from, or null for
                  standalone and pooled balances.
              included_grant:
                type: number
                description: Amount granted from the plan's included usage.
              prepaid_grant:
                type: number
                description: Amount granted from prepaid purchases or top-ups.
              remaining:
                type: number
                description: Remaining balance available for use.
              usage:
                type: number
                description: Amount consumed in the current period.
              unlimited:
                type: boolean
                description: Whether this balance has unlimited usage.
              reset:
                anyOf:
                  - type: object
                    properties:
                      interval:
                        anyOf:
                          - enum:
                              - one_off
                              - minute
                              - hour
                              - day
                              - week
                              - month
                              - quarter
                              - semi_annual
                              - year
                            type: string
                          - const: multiple
                        description: >-
                          The reset interval (hour, day, week, month, etc.) or
                          'multiple' if combined from different intervals.
                      interval_count:
                        type: number
                        description: >-
                          Number of intervals between resets (eg. 2 for
                          bi-monthly).
                      resets_at:
                        anyOf:
                          - type: number
                          - type: 'null'
                        description: Timestamp when the balance will next reset.
                    required:
                      - interval
                      - resets_at
                  - type: 'null'
                description: Reset configuration for this balance, or null if no reset.
              price:
                anyOf:
                  - type: object
                    properties:
                      amount:
                        type: number
                        description: The per-unit price amount.
                      tiers:
                        type: array
                        items:
                          type: object
                          properties:
                            to:
                              anyOf:
                                - type: number
                                - const: inf
                            amount:
                              type: number
                            flat_amount:
                              type: number
                          required:
                            - to
                            - amount
                        description: Tiered pricing configuration if applicable.
                      tier_behavior:
                        enum:
                          - graduated
                          - volume
                        type: string
                        description: >-
                          How tiers are applied: graduated (split across bands)
                          or volume (flat rate for the matched tier).
                      billing_units:
                        type: number
                        description: >-
                          The number of units per billing increment (eg. $9 /
                          250 units).
                      billing_method:
                        enum:
                          - prepaid
                          - usage_based
                        type: string
                        description: Whether usage is prepaid or billed pay-per-use.
                      max_purchase:
                        anyOf:
                          - type: number
                          - type: 'null'
                        description: >-
                          Maximum quantity that can be purchased, or null for
                          unlimited.
                    required:
                      - billing_units
                      - billing_method
                      - max_purchase
                  - type: 'null'
                description: Pricing configuration if this balance has usage-based pricing.
              expires_at:
                anyOf:
                  - type: number
                  - type: 'null'
                description: >-
                  Timestamp when this balance expires, or null for no
                  expiration.
              source:
                enum:
                  - customer
                  - entity
                type: string
                readOnly: true
                description: >-
                  Where this row's credits come from: shared at the customer
                  level, or owned by the entity.
              allocation:
                anyOf:
                  - type: object
                    properties:
                      amount:
                        type: number
                        description: The amount allocated to this entity.
                    required:
                      - amount
                  - type: 'null'
                readOnly: true
                description: >-
                  Set when this row's numbers are the entity's allocated share
                  of the customer's credits.
              contributions:
                type: object
                properties:
                  list:
                    type: array
                    items:
                      type: object
                      properties:
                        id:
                          type: string
                        entity_id:
                          anyOf:
                            - type: string
                            - type: 'null'
                          description: >-
                            Entity holding the contributing plan. Null for
                            customer-level plans.
                        entity_name:
                          anyOf:
                            - type: string
                            - type: 'null'
                          description: Display name of the contributing entity.
                        plan_id:
                          type: string
                          description: The plan contributing to the pool.
                        plan_name:
                          anyOf:
                            - type: string
                            - type: 'null'
                          description: Display name of the contributing plan.
                        current_contribution:
                          type: number
                          description: >-
                            Amount this source contributes to the pool this
                            cycle.
                        next_cycle_contribution:
                          type: number
                          description: Amount this source will contribute next cycle.
                        competes:
                          type: boolean
                          description: >-
                            True when this source competes under a 'max' / 'min'
                            feature: only the winning competing share counts,
                            instead of adding up.
                        unlimited:
                          type: boolean
                          description: >-
                            True when this source grants unlimited usage, either
                            as a competing source or as an unlimited share
                            riding a limited pool.
                        created_at:
                          type: number
                      required:
                        - id
                        - entity_id
                        - entity_name
                        - plan_id
                        - plan_name
                        - current_contribution
                        - next_cycle_contribution
                        - competes
                        - unlimited
                        - created_at
                    description: >-
                      The first 10 plans contributing to the pool, competing
                      shares first, then newest.
                  total_count:
                    type: number
                    description: Total number of plans contributing to the pool.
                required:
                  - list
                  - total_count
                description: >-
                  The plans funding this shared pooled balance, usually on the
                  customer's entities, and how much each adds this cycle and
                  next. Present on pooled rows when expand includes
                  `pooled_contributions`.
            required:
              - plan_id
              - included_grant
              - prepaid_grant
              - remaining
              - usage
              - unlimited
              - reset
              - price
              - expires_at
          description: >-
            Detailed breakdown of balance sources when stacking multiple plans
            or grants.
        rollovers:
          type: array
          items:
            type: object
            properties:
              granted:
                type: number
                description: >-
                  Amount originally rolled over from a previous period, before
                  any of it was consumed.
              balance:
                type: number
                description: Amount of balance rolled over from a previous period.
              expires_at:
                type: number
                description: Timestamp when the rollover balance expires.
            required:
              - granted
              - balance
              - expires_at
          description: Rollover balances carried over from previous periods.
        allocated:
          type: number
          readOnly: true
          description: >-
            Shared credits held for entities by allocations; present only when
            the customer allocates this feature.
        unallocated:
          type: number
          readOnly: true
          description: >-
            Remaining shared credits no allocation holds; any entity may use
            them.
      required:
        - feature_id
        - granted
        - remaining
        - usage
        - unlimited
        - overage_allowed
        - max_purchase
        - next_reset_at
      examples:
        - 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
    CreditDimension:
      anyOf:
        - type: object
          properties:
            match:
              type: object
              propertyNames:
                type: string
              additionalProperties:
                type: string
              description: >-
                Event properties this entry applies to. Every key must equal the
                tracked property, compared as strings.
            priority:
              type: integer
              minimum: -9007199254740991
              maximum: 9007199254740991
              description: >-
                Breaks ties between dimensions that match the same number of
                keys. Higher wins.
            tier_behavior:
              const: graduated
            tiers:
              type: array
              minItems: 1
              items:
                type: object
                properties:
                  to:
                    anyOf:
                      - type: number
                        exclusiveMinimum: 0
                      - enum:
                          - inf
                        type: string
                    description: >-
                      Inclusive upper usage boundary for this graduated tier.
                      The final tier must be 'inf'.
                  credit_cost:
                    type: number
                    minimum: 0
                    description: Credits consumed per billing-unit group within this tier.
                required:
                  - to
                  - credit_cost
          required:
            - match
            - tier_behavior
            - tiers
          additionalProperties: false
        - type: object
          properties:
            match:
              type: object
              propertyNames:
                type: string
              additionalProperties:
                type: string
              description: >-
                Event properties this entry applies to. Every key must equal the
                tracked property, compared as strings.
            priority:
              type: integer
              minimum: -9007199254740991
              maximum: 9007199254740991
              description: >-
                Breaks ties between dimensions that match the same number of
                keys. Higher wins.
            credit_cost:
              type: number
              minimum: 0
              description: >-
                Credits consumed per billing-unit group when this dimension
                matches.
          required:
            - match
            - credit_cost
          additionalProperties: false
  securitySchemes:
    secretKey:
      type: http
      scheme: bearer
      bearerFormat: JWT

````

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