# Adds billing mode for more flexible subscriptions behavior ## What’s new We’re introducing a new `billing_mode` parameter that enables more flexible subscription behaviour. You can enable it by setting `billing_mode[type]=flexible` when you create [subscriptions](https://docs.stripe.com/api/subscriptions/create.md?api-version=2025-06-30.basil), [invoice previews](https://docs.stripe.com/api/invoices/create_preview.md?api-version=2025-06-30.basil), [Checkout Sessions](https://docs.stripe.com/api/checkout/sessions/create.md?api-version=2025-06-30.basil), [quotes](https://docs.stripe.com/api/quotes/create.md?api-version=2025-06-30.basil), or [subscription schedules](https://docs.stripe.com/api/subscription_schedules/create.md?api-version=2025-06-30.basil). The default, `classic` mode, preserves existing behaviour. You can also migrate existing subscriptions using the new [billing mode migration endpoint](https://docs.stripe.com/api/subscriptions/migrate.md?api-version=2025-06-30.basil). We’ll refer to the existing billing behaviour as `classic` going forward. See the summary of the new behaviours with flexible billing mode below. Learn more about the differences between [classic and flexible billing modes](https://docs.stripe.com/billing/subscriptions/billing-mode.md). | **Area of Impact** | **New Behaviours** | | -------------------------- | ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | | **Proration** | **Accurate credit proration calculation.** Flexible billing mode consistently uses the original debited amount, accurately accounting for historical taxes, discounts, and billing cycles. **Proportional discount application for prorations.** We apply discounts proportionally to each subscription item during proration calculations instead of distributing them evenly. This results in more prorations, especially when invoicing on a per-item basis or canceling items with unevenly distributed discounts. | | **Metered pricing** | **Suppresses zero-amount line items when adding metered items.** Flexible billing mode doesn’t create zero-amount line items when you add metered items to a subscription. If the invoice is empty as a result, we don’t generate one. **Bills metered usage based on the price at the time of reporting.** Flexible billing mode bills for usage based on the price at the time you report it. If a metered item’s price changes during a period, only usage reported after the price change is billed at the new price. **Bills for unbilled usage when removing metered items.** Flexible billing mode generates an invoice item for unbilled usage when you remove a metered subscription item. This applies to removals using the API or during schedule phase transitions. **Consolidates invoices for phase transitions with metered items.** Flexible billing mode consistently generates a single invoice when a subscription cycles, eliminating separate invoices for removed metered items. | | **Billing cycle anchor** | **Eliminates implicit billing cycle anchor resets.** With flexible billing mode, the `billing_cycle_anchor` remains unchanged during operations that previously caused it to reset, such as setting a `cancel_at` date or switching to a non-zero price. | | **Scheduled cancellation** | **Configurable proration behaviour for `cancel_at`.** You can now disable prorations for a truncated first subscription period (when setting `cancel_at` on creation) using the `proration_behavior` parameter. | | **Backdating** | **Splits backdated time range into multiple invoice items.** Flexible billing mode creates separate invoice line items for each billing period within the backdated range. It automatically aligns the billing cycle anchor to the `backdate_start_date` if you don’t set it explicitly. | | **Trials** | **Updates the trial start date for subsequent trials.** When you add a second trial to a trialling subscription, flexible billing mode uses the most recent trial’s start date. **Preserves the original trial end date when the cancellation date changes.** Flexible billing mode preserves the `trial_end` if you modify the `cancel_at` date to occur before the trial ends. **Standardises the trial period line item description.** With flexible billing mode, both metered and licensed items use a consistent description format – “Free trial for {quantity} x {product name}” – for a more uniform presentation of trial information. **Generates line items for changes made during a trial.** In flexible billing mode, items that haven’t changed aren’t re-billed. This ensures that customers are only billed for the adjustments they make during their trial. | | **Pending Invoice Items** | **Consistently includes pending invoice items.** All available pending invoice items are now included when generating invoices for updates. Previously, this depended on the specific reason for the invoice update. | Flexible billing mode isn’t compatible with all Stripe Billing features. The following features are currently incompatible and return a `400` error code when you create and update a subscription with flexible mode enabled: - Prebilling (Preview) - [Billing thresholds](https://docs.stripe.com/billing/subscriptions/usage-based/thresholds.md) - [Legacy Usage-based billing](https://docs.stripe.com/billing/subscriptions/usage-based-legacy.md) - Legacy 3P tax integrations using `pay_immediately=false` (for example [Avalara](https://support.stripe.com/questions/calculate-tax-with-avalara)) - The legacy `max_occurrences` parameter - Subscription specific `retry_settings` (Preview) ## Impact By default, this update has no impact on existing or new subscriptions. You can opt in by setting `billing_mode[type]=flexible` on the following API methods: - [Create a subscription](https://docs.stripe.com/api/subscriptions/create.md?api-version=2025-06-30.basil) - [Create an invoice preview](https://docs.stripe.com/api/invoices/create_preview.md?api-version=2025-06-30.basil) - [Create a checkout session](https://docs.stripe.com/api/checkout/sessions/create.md?api-version=2025-06-30.basil#create_checkout_session-subscription_data-billing_mode) - [Create a subscription schedule](https://docs.stripe.com/api/subscription_schedules/create.md?api-version=2025-06-30.basil) - [Create a quote](https://docs.stripe.com/api/quotes/create.md?api-version=2025-06-30.basil) You can migrate existing subscriptions from classic to flexible by passing `billing_mode[type]=flexible` in the [billing mode migration endpoint](https://docs.stripe.com/api/subscriptions/migrate.md?api-version=2025-06-30.basil). Switching to flexible billing mode is a one-way update: you can’t revert a subscription to classic mode after migration. ## Changes #### REST API #### Ruby #### Python #### PHP #### Java #### Node.js #### Go #### .NET ## Upgrade #### REST API 1. [View your current API version](https://docs.stripe.com/upgrades.md#view-your-api-version-and-the-latest-available-upgrade-in-workbench) in Workbench. 1. If you use an SDK, upgrade to the corresponding SDK version for this API version. - If you don’t use an SDK, update your [API requests](https://docs.stripe.com/api/versioning.md) to include `Stripe-Version: 2025-06-30.basil` 1. Upgrade the API version used for [webhook endpoints](https://docs.stripe.com/webhooks/versioning.md). 1. [Test your integration](https://docs.stripe.com/testing.md) against the new version. 1. If you use Connect, [test your Connect integration](https://docs.stripe.com/connect/testing.md). 1. In Workbench, [perform the upgrade](https://docs.stripe.com/upgrades.md#perform-the-upgrade). You can [roll back the version](https://docs.stripe.com/upgrades.md#roll-back-your-api-version) for 72 hours. Learn more about [Stripe API upgrades](https://docs.stripe.com/upgrades.md). #### Ruby 1. [View your current API version](https://docs.stripe.com/upgrades.md#view-your-api-version-and-the-latest-available-upgrade-in-workbench) in Workbench. 1. Upgrade your Ruby SDK to [v15.3.0](https://github.com/stripe/stripe-ruby/releases/tag/v15.3.0) 1. Upgrade the API version used for [webhook endpoints](https://docs.stripe.com/webhooks/versioning.md). 1. [Test your integration](https://docs.stripe.com/testing.md) against the new version. 1. If you use Connect, [test your Connect integration](https://docs.stripe.com/connect/testing.md). 1. In Workbench, [perform the upgrade](https://docs.stripe.com/upgrades.md#perform-the-upgrade). You can [roll back the version](https://docs.stripe.com/upgrades.md#roll-back-your-api-version) for 72 hours. Learn more about [Stripe API upgrades](https://docs.stripe.com/upgrades.md). #### Python 1. [View your current API version](https://docs.stripe.com/upgrades.md#view-your-api-version-and-the-latest-available-upgrade-in-workbench) in Workbench. 1. Upgrade your Python SDK to [v12.3.0](https://github.com/stripe/stripe-python/releases/tag/v12.3.0) 1. Upgrade the API version used for [webhook endpoints](https://docs.stripe.com/webhooks/versioning.md). 1. [Test your integration](https://docs.stripe.com/testing.md) against the new version. 1. If you use Connect, [test your Connect integration](https://docs.stripe.com/connect/testing.md). 1. In Workbench, [perform the upgrade](https://docs.stripe.com/upgrades.md#perform-the-upgrade). You can [roll back the version](https://docs.stripe.com/upgrades.md#roll-back-your-api-version) for 72 hours. Learn more about [Stripe API upgrades](https://docs.stripe.com/upgrades.md). #### PHP 1. [View your current API version](https://docs.stripe.com/upgrades.md#view-your-api-version-and-the-latest-available-upgrade-in-workbench) in Workbench. 1. Upgrade your PHP SDK to [v17.4.0](https://github.com/stripe/stripe-php/releases/tag/v17.4.0) 1. Upgrade the API version used for [webhook endpoints](https://docs.stripe.com/webhooks/versioning.md). 1. [Test your integration](https://docs.stripe.com/testing.md) against the new version. 1. If you use Connect, [test your Connect integration](https://docs.stripe.com/connect/testing.md). 1. In Workbench, [perform the upgrade](https://docs.stripe.com/upgrades.md#perform-the-upgrade). You can [roll back the version](https://docs.stripe.com/upgrades.md#roll-back-your-api-version) for 72 hours. Learn more about [Stripe API upgrades](https://docs.stripe.com/upgrades.md). #### Java 1. [View your current API version](https://docs.stripe.com/upgrades.md#view-your-api-version-and-the-latest-available-upgrade-in-workbench) in Workbench. 1. Upgrade your Java SDK to [v29.3.0](https://github.com/stripe/stripe-java/releases/tag/v29.3.0) 1. Upgrade the API version used for [webhook endpoints](https://docs.stripe.com/webhooks/versioning.md). 1. [Test your integration](https://docs.stripe.com/testing.md) against the new version. 1. If you use Connect, [test your Connect integration](https://docs.stripe.com/connect/testing.md). 1. In Workbench, [perform the upgrade](https://docs.stripe.com/upgrades.md#perform-the-upgrade). You can [roll back the version](https://docs.stripe.com/upgrades.md#roll-back-your-api-version) for 72 hours. Learn more about [Stripe API upgrades](https://docs.stripe.com/upgrades.md). #### Node.js 1. [View your current API version](https://docs.stripe.com/upgrades.md#view-your-api-version-and-the-latest-available-upgrade-in-workbench) in Workbench. 1. Upgrade your Node SDK to [v18.3.0](https://github.com/stripe/stripe-node/releases/tag/v18.3.0) 1. Upgrade the API version used for [webhook endpoints](https://docs.stripe.com/webhooks/versioning.md). 1. [Test your integration](https://docs.stripe.com/testing.md) against the new version. 1. If you use Connect, [test your Connect integration](https://docs.stripe.com/connect/testing.md). 1. In Workbench, [perform the upgrade](https://docs.stripe.com/upgrades.md#perform-the-upgrade). You can [roll back the version](https://docs.stripe.com/upgrades.md#roll-back-your-api-version) for 72 hours. Learn more about [Stripe API upgrades](https://docs.stripe.com/upgrades.md). #### Go 1. [View your current API version](https://docs.stripe.com/upgrades.md#view-your-api-version-and-the-latest-available-upgrade-in-workbench) in Workbench. 1. Upgrade your Go SDK to [v82.3.0](https://github.com/stripe/stripe-go/releases/tag/v82.3.0) 1. Upgrade the API version used for [webhook endpoints](https://docs.stripe.com/webhooks/versioning.md). 1. [Test your integration](https://docs.stripe.com/testing.md) against the new version. 1. If you use Connect, [test your Connect integration](https://docs.stripe.com/connect/testing.md). 1. In Workbench, [perform the upgrade](https://docs.stripe.com/upgrades.md#perform-the-upgrade). You can [roll back the version](https://docs.stripe.com/upgrades.md#roll-back-your-api-version) for 72 hours. Learn more about [Stripe API upgrades](https://docs.stripe.com/upgrades.md). #### .NET 1. [View your current API version](https://docs.stripe.com/upgrades.md#view-your-api-version-and-the-latest-available-upgrade-in-workbench) in Workbench. 1. Upgrade your .NET SDK to [v48.3.0](https://github.com/stripe/stripe-dotnet/releases/tag/v48.3.0) 1. Upgrade the API version used for [webhook endpoints](https://docs.stripe.com/webhooks/versioning.md). 1. [Test your integration](https://docs.stripe.com/testing.md) against the new version. 1. If you use Connect, [test your Connect integration](https://docs.stripe.com/connect/testing.md). 1. In Workbench, [perform the upgrade](https://docs.stripe.com/upgrades.md#perform-the-upgrade). You can [roll back the version](https://docs.stripe.com/upgrades.md#roll-back-your-api-version) for 72 hours. Learn more about [Stripe API upgrades](https://docs.stripe.com/upgrades.md).