# Adds the ability to migrate subscriptions to flexible billing mode

## What’s new

The new method on the [Subscription](https://docs.stripe.com/api/subscriptions.md?api-version=2025-05-28.preview) resource, `/v1/subscriptions/:subscription/migrate`, lets you migrate the [billing_mode](https://docs.stripe.com/api/subscriptions/create.md?api-version=2025-04-30.preview#create_subscription-billing_mode) for existing subscriptions from `classic` to `flexible`. You can use the billing mode to control the calculation and orchestration of prorations and invoices for subscriptions.

You can also track the timestamp of your migration with the new `billing_mode_details.updated_at` field on the [Subscription](https://docs.stripe.com/api/subscriptions.md?api-version=2025-05-28.preview) object.

## Impact

To migrate the `billing_mode` of your existing subscriptions, pass in `billing_mode: flexible` when you make the migrate request.

Learn more about how the [billing mode enables flexible behavior](https://docs.stripe.com/billing/subscriptions/billing-mode.md) for subscriptions and the limitations.

## Changes

#### REST API

| Endpoint  | Change | Resource                                                                 |
| --------- | ------ | ------------------------------------------------------------------------ |
| `migrate` | Added  | [Subscription](/api/subscriptions/object?api-version=2025-05-28.preview) |

| Parameter              | Change | Resources or endpoints                                                   |
| ---------------------- | ------ | ------------------------------------------------------------------------ |
| `billing_mode_details` | Added  | [Subscription](/api/subscriptions/object?api-version=2025-05-28.preview) |

#### Ruby

| Method    | Change | Resource                                                                 |
| --------- | ------ | ------------------------------------------------------------------------ |
| `migrate` | Added  | [Subscription](/api/subscriptions/object?api-version=2025-05-28.preview) |

| Parameter              | Change | Resources or methods                                                     |
| ---------------------- | ------ | ------------------------------------------------------------------------ |
| `billing_mode_details` | Added  | [Subscription](/api/subscriptions/object?api-version=2025-05-28.preview) |

#### Python

| Method    | Change | Resource                                                                 |
| --------- | ------ | ------------------------------------------------------------------------ |
| `migrate` | Added  | [Subscription](/api/subscriptions/object?api-version=2025-05-28.preview) |

| Parameter              | Change | Resources or methods                                                     |
| ---------------------- | ------ | ------------------------------------------------------------------------ |
| `billing_mode_details` | Added  | [Subscription](/api/subscriptions/object?api-version=2025-05-28.preview) |

#### PHP

| Method    | Change | Resource                                                                 |
| --------- | ------ | ------------------------------------------------------------------------ |
| `migrate` | Added  | [Subscription](/api/subscriptions/object?api-version=2025-05-28.preview) |

| Parameter              | Change | Resources or methods                                                     |
| ---------------------- | ------ | ------------------------------------------------------------------------ |
| `billing_mode_details` | Added  | [Subscription](/api/subscriptions/object?api-version=2025-05-28.preview) |

#### Java

| Method    | Change | Resource                                                                 |
| --------- | ------ | ------------------------------------------------------------------------ |
| `migrate` | Added  | [Subscription](/api/subscriptions/object?api-version=2025-05-28.preview) |

| Parameter            | Change | Resources or methods                                                     |
| -------------------- | ------ | ------------------------------------------------------------------------ |
| `billingModeDetails` | Added  | [Subscription](/api/subscriptions/object?api-version=2025-05-28.preview) |

#### Node.js

| Method    | Change | Resource                                                                 |
| --------- | ------ | ------------------------------------------------------------------------ |
| `migrate` | Added  | [Subscription](/api/subscriptions/object?api-version=2025-05-28.preview) |

| Parameter              | Change | Resources or methods                                                     |
| ---------------------- | ------ | ------------------------------------------------------------------------ |
| `billing_mode_details` | Added  | [Subscription](/api/subscriptions/object?api-version=2025-05-28.preview) |

#### Go

| Method    | Change | Resource                                                                 |
| --------- | ------ | ------------------------------------------------------------------------ |
| `Migrate` | Added  | [Subscription](/api/subscriptions/object?api-version=2025-05-28.preview) |

| Parameter            | Change | Resources or methods                                                     |
| -------------------- | ------ | ------------------------------------------------------------------------ |
| `BillingModeDetails` | Added  | [Subscription](/api/subscriptions/object?api-version=2025-05-28.preview) |

#### .NET

| Method    | Change | Resource                                                                 |
| --------- | ------ | ------------------------------------------------------------------------ |
| `Migrate` | Added  | [Subscription](/api/subscriptions/object?api-version=2025-05-28.preview) |

| Parameter            | Change | Resources or methods                                                     |
| -------------------- | ------ | ------------------------------------------------------------------------ |
| `BillingModeDetails` | Added  | [Subscription](/api/subscriptions/object?api-version=2025-05-28.preview) |

## 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-05-28.preview`
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-beta.1](https://github.com/stripe/stripe-ruby/releases/tag/v15.3.0-beta.1)
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.0b1](https://github.com/stripe/stripe-python/releases/tag/v12.3.0b1)
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-beta.2](https://github.com/stripe/stripe-php/releases/tag/v17.4.0-beta.2)
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-beta.1](https://github.com/stripe/stripe-java/releases/tag/v29.3.0-beta.1)
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-beta.1](https://github.com/stripe/stripe-node/releases/tag/v18.3.0-beta.1)
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-beta.1](https://github.com/stripe/stripe-go/releases/tag/v82.3.0-beta.1)
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-beta.1](https://github.com/stripe/stripe-dotnet/releases/tag/v48.3.0-beta.1)
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).

## Related changes

- [Adds more flexibility for how you manage subscription end-of-period cancellations](https://docs.stripe.com/changelog/basil/2025-05-28/cancel-at-enums.md)
