Skip to content
Create account
or
Sign in
The Stripe Docs logo
/
Ask AI
Create account
Sign in
Get started
Payments
Revenue
Platforms and marketplaces
Money management
Developer resources
Overview
Billing
OverviewAbout the Billing APIs
Subscriptions
    Overview
    How subscriptions work
    Get started
    Quickstart
    Plan an integration
    Build an integration
    Use cases
    About subscriptions
    Enable billing mode
    Configure subscription events
    Entitlements
    Subscription invoices
    Subscription schedules
    Recurring pricing models
    Strong Customer Authentication (SCA)
    Set up subscriptions
    Configure collection methods
    Embed a pricing table
    Set billing cycles
    Manage subscriptions
    Migrate subscriptions to Stripe
    Set product or subscription quantities
    Mixed interval subscriptions
    Backdate subscriptions
    Set trial periods
    Handle subscriptions with deferred payment
    Apply coupons
    Modify subscriptions
    Manage subscription payment methods
    Analytics
    Manage subscriptions on iOS
Invoicing
Usage-based billing
Quotes
Customer management
Billing with other products
Revenue recovery
Automations
Test your integration
Tax
Overview
Use Stripe tax
Manage compliance
Reporting
Overview
Select a report
Configure reports
Reports API
Reports for multiple accounts
Revenue recognition
Data
OverviewSchema
Custom reports
Data Pipeline
Data management
HomeRevenueSubscriptions

Enable increased flexibility for subscriptions

Use flexible billing mode for enhanced functionality and to access additional features.

Subscription prorations

Read our prorations guide to learn how to manage prorations for modified subscriptions and understand their behavior.

Flexible billing mode provides accurate and predictable billing behavior and additional features for managing subscriptions. Setting billing_mode=flexible on a subscription changes how Subscription objects behave throughout their lifecycle and in response to upgrades, downgrades, and cancellations.

Flexible billing mode enables different capabilities for managing subscriptions than classic billing mode does. See Differences between classic and flexible billing mode for details.

To use flexible billing mode, your integration must be on Stripe API version 2025-06-30.basil or later. Learn how to upgrade your API version. You can’t downgrade from flexible billing mode to classic billing mode.

Limitations

Flexible billing mode isn’t compatible with all Stripe Billing features. The following features are incompatible and return a 400 status code when you create and update a subscription with flexible billing mode enabled:

  • Paid trials
  • Legacy usage-based billing
  • Prebilling Private preview
  • The use of the legacy max_occurences parameter

Configure billing mode

Create a new subscription with flexible billing mode

To use flexible billing mode, you must upgrade your API version to 2025-06-30.basil or later.

Specify the billing_mode parameter to be flexible on API requests that create a subscription or create a preview invoice for a subscription. If this parameter isn’t provided, its default value depends on the API version you’re using. For API version 2025-08-27.preview, and any later preview versions, the default is flexible. For all generally available (GA) versions and preview versions prior to 2025-08-27.preview, the default is classic. Here’s an example when using the Subscriptions API:

Here’s the request:

index.php
cURL
Stripe CLI
Ruby
Python
PHP
Java
Node.js
Go
.NET
No results
// Set your secret key. Remember to switch to your live secret key in production. // See your keys here: https://dashboard.stripe.com/apikeys $stripe = new \Stripe\StripeClient([ 'api_key' =>
'sk_test_BQokikJOvBiI2HlWgH4olfQ2'
, 'stripe_version' => '2025-06-30.basil', ]); $subscription = $stripe->subscriptions->create([ 'items' => [['price' =>
'{{PRICE_ID}}'
]], 'customer' =>
'{{CUSTOMER_ID}}'
, 'billing_mode' => ['type' => 'flexible'], 'payment_behavior' => 'default_incomplete', 'payment_settings' => ['save_default_payment_method' => 'on_subscription'], ]);

Here’s the response:

{ "id": "sub_JgRjFjhKbtD2qz", "object": "subscription", "billing_mode": { "type": "flexible", "updated_at": 1751071020 }, "application_fee_percent": null, "automatic_tax": { "disabled_reason": null,

Similarly, you can set billing_mode to flexible when:

  • Creating a subscription through a Checkout Session
  • Creating a subscription through a Subscription Schedule
  • Creating a subscription through a Quote

Migrate existing subscriptions to flexible billing mode

You can migrate your existing subscriptions to flexible billing mode. The flexible behaviors take effect for all new activity on the subscription after migration. However, Stripe doesn’t recalculate any resources created before migration, including pending proration Invoice Items.

To use flexible billing mode, you must upgrade your API version to 2025-06-30.basil or later.

Use the migrate API to set billing_mode to flexible for an existing subscription. After the subscription is migrated to flexible billing mode, the billing_mode.updated_at timestamp reflects when the migration occurred. Here are an example request and response:

Here’s the request:

index.php
cURL
Stripe CLI
Ruby
Python
PHP
Java
Node.js
Go
.NET
No results
// Set your secret key. Remember to switch to your live secret key in production. // See your keys here: https://dashboard.stripe.com/apikeys $stripe = new \Stripe\StripeClient(
'sk_test_BQokikJOvBiI2HlWgH4olfQ2'
); $subscription = $stripe->subscriptions->migrate( 'sub_123', ['billing_mode' => ['type' => 'flexible']] );

Here’s the response:

The response shows the updated subscription with billing_mode set to flexible and the billing_mode_details.updated_at timestamp:

Migrate subscription response
{ "id": "sub_123", "billing_mode": "flexible", "billing_mode_details": { "updated_at": 1716883200 // Example timestamp }, // ... other subscription details }

Billing mode and subscription schedules

When you create a subscription schedule from an existing subscription, don’t set billing_mode if the subscription already has one. The schedule automatically inherits the billing_mode from the original subscription.

If you set billing_mode when using from_subscription, Stripe returns an error. If you need a different billing_mode, make sure it matches the existing subscription or create a new subscription.

Differences between classic and flexible billing mode

The following sections describe how various subscription behaviors differ between the classic and flexible billing modes.

Credit proration calculations

Credit prorations are issued when customers downgrade their subscriptions or cancel subscription items before the end of their billing period. Flexible billing mode calculates credit prorations based on the original amount previously debited to a customer.

For a full overview of credit proration calculations, see Credit prorations.

Classic Flexible
When an update to a subscription generates a credit proration, the credit proration amounts are calculated based on the value of the subscription item’s current price, tax, quantity, and the last discounts used.When an update to a subscription generates a credit proration, these prorations use the original debited amount instead of current subscription values.

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.

Classic Flexible
We distribute discounts evenly across all subscription items.We apply discounts proportionally to each subscription item during proration calculations.

Usage-based pricing

Suppress zero-amount line items when adding usage-based items

Flexible billing mode doesn’t create zero-amount line items when you add usage-based items to a subscription. If the invoice is empty as a result, we don’t generate one.

For example, when adding a monthly usage-based item during subscription creation or update:

Classic Flexible
A 0 USD line item is generated on the invoice for the usage-based item. This also applies when updating a subscription without cycling to add a usage-based item while using proration_behavior=always_invoice.A 0 USD line item isn’t added to the invoice for the usage-based item. If the resulting invoice wouldn’t contain any items, we don’t generate one.

Bill usage-based items based on price at time of reporting

Flexible billing mode charges for usage based on the price that was in effect when the usage was reported, rather than the most recent price.

For example, a customer’s usage is reported as:

  • Usage on January 5: 1000 API calls at 0.1 USD (Price A)
  • Price change on January 15: the price changes to 0.15 USD (Price B)
  • Usage on January 20: 500 API calls
Classic Flexible

Stripe only bills for the usage that was reported since changing to the current price.

  • 500 API calls at Price B (0.15 USD per 100 calls) = 0.75 USD

Total invoice amount = 0.75 USD.

Stripe bills for all usage in the current period at the price effective at the time it’s reported.

  • 1000 API calls at Price A (0.1 USD per 100 calls) = 1 USD
  • 500 API calls at Price B (0.15 USD per 100 calls) = 0.75 USD

Total invoice amount = 1.75 USD.

Bill for unbilled usage when removing usage-based items

Depending on the value of proration_behavior, flexible billing mode might generate an invoice item for unbilled usage when removing a usage-based subscription item. This applies to removals using the API or during schedule phase transitions that occur mid-period. For phase transitions that coincide with any subscription item current_period_end, an invoice gets created with an invoice line item for the removed usage-based subscription item.

Scenario Classic Flexible
Update subscription or schedule using the APINo invoice item or invoice is generated for unbilled usage when removing a usage-based subscription item.An invoice item is generated for unbilled usage when removing a usage-based subscription item.
Schedule phase transitionAn invoice (but no invoice item) is generated for unbilled usage when removing a usage-based subscription item.Depending on the incoming phase’s proration_behavior:
  • create_prorations: an invoice item is created for unbilled usage when removing a usage-based subscription item.
  • always_invoice: an invoice item for unbilled usage is created and immediately invoiced.
  • none: no invoice item is created.

Reset the billing cycle anchor

Flexible billing mode only resets your billing cycle anchor on subscription updates when you explicitly set billing_cycle_anchor to a value other than unchanged.

Classic Flexible
The billing_cycle_anchor is automatically reset to the current date when switching a subscription to a different price with a different recurring interval, from zero-amount prices to non-zero price or moving cancel_at to a date before the next time the subscription renews.The billing_cycle_anchor is never automatically reset.

Consolidated invoicing for subscription schedule phase transitions with usage-based items

Flexible billing mode consistently generates a single invoice when a subscription renews. This change eliminates separate invoices for removed usage-based items and improves billing consistency.

When your subscription with usage-based items transitions between phases:

Classic Flexible
Two invoices are generated.A single consolidated invoice is generated. This invoice includes both usage-based and licensed items, applies discounts from the previous phase to usage-based billing, and uses tax rates from the next phase.

Scheduled subscription cancellation

You can disable prorations for a truncated first billing period (when setting cancel_at on creation) using the proration_behavior parameter.

Classic Flexible
Prorations are applied to the first billing period.Prorations aren’t applied to the first billing period.

Backdate subscriptions

When backdating is consistent with regular billing, flexible billing mode creates separate invoice line items for each billing period within the backdated range. It also automatically aligns the billing cycle anchor to the backdate_start_date when not explicitly set. Backdating isn’t supported if the resulting invoice has more than 250 line items.

For example, a subscription needs to be backdated due to a missed invoice for the past two billing periods. The customer was invoiced for 2 different backdated periods:

  • Billing Period 1 (March 1 - March 31):
    • Usage reported: 100 GB of storage used.
    • Price: 10 USD per 10 GB.

Billing Period 2 (April 1 - April 30):

  • Usage reported: 150 GB of storage used.
  • Price: 10 USD per 10 GB.

The service provider decides to backdate the invoice to cover both billing periods: March 1 to April 30.

Classic Flexible
Charges for the entire backdated period are calculated collectively as a single line item. Total charges:
  • 250 GB = 25 x 10 USD = 250 USD
  • This amount appears as a single line item on the invoice.
Backdated time ranges are split into multiple invoice line items according to billing period boundaries. Total charges:
  • Billing Period 1 (March):
    • 100 GB = 10 x 10 USD = 100 USD (as a separate line item).
  • Billing Period 2 (April):
    • 150 GB = 15 x 10 USD = 150 USD (as a separate line item).

Trials

Update trial start date for subsequent trials

Flexible billing mode uses the most recent trial start date for subscriptions with subsequent trials.

For example, when you have:

  • Trial period from January 1st to February 1st
  • Normal billing period from February 1st to March 1st
  • Trial period from March 1st to April 1st
Classic Flexible
The subscription.trial_start always refers to the first trial a subscription started.The subscription.trial_start refers to the start of the most recent trial of a subscription.

Preserve original trial end date when subscription cancels

Flexible billing mode preserves the trial_end if you modify the cancel_at date.

Classic Flexible
If trial_end date is later than cancel_at, trial_end is set to the cancellation date. If cancel_at is later updated or removed, trial_end isn’t set to its original value.Scheduling a subscription cancellation using cancel_at no longer alters the trial_end date. This ensures that trials run for their intended duration regardless of cancellation date updates.

Standardize trial period line item description

Flexible billing mode uses a consistent description format for both usage-based and licensed items during trial periods.

For example, when you have a monthly coffee subscription (licensed) and alpaca_ai_tokens subscription (usage-based), the subscription description displays as following:

Classic Flexible

Licensed items use the template Trial period for {product name}, while usage-based items use {quantity} x {product name} (Free trial).

  • For licensed items:
    • Trial period for monthly coffee subscription
  • For usage-based items:
    • 10 x monthly alpaca_ai_tokens (Free trial)

The same format, Free trial for {quantity} x {product name}, applies to all item types, which provides a more uniform presentation of trial information. These descriptions are also localized.

  • For licensed items:
    • Free trial for 1 x monthly coffee subscription
  • For usage-based items:
    • Free trial for 10 x monthly alpaca_ai_tokens subscription

Re-bill for trial line items

Flexible billing mode only generates line items for changes made during a trial. Existing items without changes aren’t rebilled.

For example, when you make an update to add another trialing item price_b to a trialing subscription with price_a:

Classic Flexible
Changes during a trial result either in no invoice or in an invoice that restates the entire state of the subscription.Changes during a trial consistently result in line items comparable to changes outside of a trial. For example, if a new price is added to a subscription a line item representing that addition is also added.

Pending invoice items

Consistently include pending invoice items

Flexible billing mode includes all available pending invoice items in invoices generated by a billing cycle anchor reset where proration_behavior = always_invoice.

Classic Flexible
Billing cycle anchor reset invoices include pending items, while always_invoice invoices don’t.Pending invoice items are always included on all invoices a subscription generates.

Mixed intervals on the same subscription

Flexible billing mode allows you to access mixed interval subscriptions. You can bill for multiple recurring prices with different intervals on a single subscription using mixed interval subscriptions. This allows you to combine different pricing structures within a single subscription.

Classic Flexible
Not supported. All items in a subscription must have prices with the same interval and interval count.Create mixed interval subscriptions, where items on a subscription can have recurring prices with different intervals or interval counts. For example, a monthly price and an annual price can exist on the same subscription.
Was this page helpful?
YesNo
  • Need help? Contact Support.
  • Join our early access program.
  • Check out our changelog.
  • Questions? Contact Sales.
  • LLM? Read llms.txt.
  • Powered by Markdoc