Migrate subscriptions to Stripe Billing using Stripe APIs
Learn how to migrate your existing subscriptions to Stripe using Stripe APIs.
Learn how to migrate your existing subscriptions from a third-party, an in-house system, or an existing Stripe account to Stripe Billing using Stripe APIs.
Before you begin
- If you haven’t already, review the migration stages.
- Set up a Stripe Billing integration. This prerequisite is only required once before importing subscriptions to Stripe, and you don’t need to repeat it for future migrations.
- Request a PAN data import from your current processor. If you’re attempting a Stripe-to-Stripe migration, this prerequisite isn’t necessary because you’re already using Stripe for payment processing.
Manage legacy products and prices
If you have legacy pricing models that you need to continue supporting in Stripe, create a placeholder product, such as Legacy plan
. Here’s an example:
When you need to update subscriptions with legacy plans, pass in the prices as needed using items.
. This overrides any existing legacy price. To learn more, see variable pricing.
Import your subscriptions
After you import your customers and create a pricing model, you can start importing your subscriptions. You should be able to export subscription data from third-party systems through their UI or API. Contact your subscriptions processor if they don’t provide this option through either interface.
To import subscriptions, use your list of customers to create the appropriate subscription for each one. For example, if a subscriber has a monthly Basic
subscription plan in your old model, use the monthly recurring price associated with that level when you create their subscription in Stripe.
Make source data Stripe-compatible
Before you start importing subscriptions into Stripe, make sure that all of your source data is compatible with our expected format.
Important fields for migrating subscriptions
If you use relevant subscription data in your custom integration that Stripe doesn’t also use, you can apply your data to the metadata
field of the subscriptions you create in Stripe. The following table describes other important fields to consider when importing subscriptions.
Field | Description |
---|---|
customer | Make sure that you’ve properly mapped the customer ID from your source data to the new customer ID in Stripe. |
phases.items.price | Make sure that you’ve mapped the price ID from your source data to the new price ID in Stripe. |
current_phase.start_date | Make sure that the subscription schedule you define in Stripe lines up with and maintains continuity from your original source data. For example, if a customer has 6 months left on a yearly subscription in your source system, make sure that billing_ and start_ reflect the correct mid-cycle term. |
Third-party metadata | Import any additional data fields from your source data, which might include product names, plan names, and third-party application IDs. |
Tax settings | Include any tax IDs, VAT IDs, or other tax information. |
Prepare legacy prices
If you created placeholders for legacy prices, you need to map those prices to the subscriptions and customers you’re importing. For each subscription with a legacy price, use the price_data parameter of the Subscriptions API to pass in information about the price and subscription. The required fields are:
Parameter | Description |
---|---|
currency | Currency of the price, in three-letter ISO format. |
product | ID of the placeholder product. You can use this for all of the legacy prices. |
recurring | Information about the amount and frequency of the recurring price. |
recurring.interval | Frequency of the interval-day , week , month , or year . |
recurring.interval_count | Number of intervals between billings. For example, setting interval=day and interval_ means that you bill the customer every 30 days. The maximum interval is 1 year (1 year, 12 months, or 52 weeks). |
recurring.unit_amount_decimal | Same as unit_amount, but allows you to specify more granular decimal amounts in cents, up to 12 decimals. You can only set one of unit_ and unit_ . |
Import subscription data into Stripe
After you’ve prepared your source data, you can start importing subscriptions into Stripe.
Test mode
Use test mode to run through the pricing model import process at least once before running the import in live mode. You need to remap your script:
- If you wipe the data in test mode and rerun the import.
- When you move to live mode, because the price IDs are different in test mode and live mode.
In test mode, you can use test clocks to simulate subscriptions advancing through time. This allows you to see how the migrated subscriptions work in production.
Create subscriptions
While you can use the Subscription API to create subscriptions, we recommend using the Subscription Schedules API. With this API, you can schedule subscriptions to start in the future. For example, it’s the only way to start monthly subscriptions more than 30 days in advance. The ability to start subscriptions in the future also allows you to review the import before you start to bill your customers in production.
Additionally, the Subscription Schedules API provides phases
, which provide much more flexibility in defining settings such as tax behavior, collection method, and coupon usage within more granular intervals. You can also define different behavior for different intervals. For example, you could apply a coupon only for the first 3 months of a yearly subscription.
Here’s how to create subscriptions that start on .
Confirm your migration
After you’ve imported your subscriptions, use the API to confirm that the subscriptions exist in Stripe.
Use the list Subscriptions API to view all of the Subscriptions in Stripe. You can pass the created parameter to filter for recently created Subscriptions.