Blog

After moving Stripe subscriptions: update API keys, webhooks and price IDs

By Enzo Lanne · Updated · 7 min read

Moving the subscriptions is half the job. Your app still holds the old account’s keys, its price IDs and its webhook secret. Miss one and new customers land on the old account, or the new one sends events nobody listens to.

Short answer: before the switch, set up the new account’s webhook endpoints and customer portal, and map every old price and subscription ID to its new one. At the switch, deploy the new API keys, webhook secret and price IDs together, update the stored subscription IDs, then turn off the old Checkout and Payment Links.

API keys

Every key belongs to one account. Create new keys on the new account, with the narrowest permissions your app needs (restricted keys), and store them where the old ones were. The publishable key in your front end changes too.

If parts of your app run on a schedule or in workers, list every place a key lives: environment variables, CI secrets, serverless functions, third-party tools (analytics, accounting, CRM) connected to Stripe.

Webhooks

The last two points matter most: a migration should be invisible to customers, and your own automations are the most likely thing to make it visible.

Price IDs

Price IDs are new on the new account. Wherever your code or config references a price (plan tables, feature flags, “if price is X then plan is Pro”), use a mapping from old to new, or better, look prices up by a lookup_key that you set to the same value on both accounts. Then the switch is a key change, not a code change.

Stored subscription IDs

Customer IDs stay the same in a Stripe-to-Stripe copy, but subscription IDs don’t. If your database stores a subscription ID per user, update it to the new one. Putting the old ID in the new subscription’s metadata (Submoving does this) makes the mapping easy to rebuild: list the new subscriptions and read their metadata.

Checkout, Payment Links and the customer portal

In what order

  1. Before: new account configured (webhooks, portal, branding, tax), price mapping ready, code able to read both accounts.
  2. At the switch: subscriptions recreated and checked, then the new keys, webhook secret and price IDs deployed together, and stored subscription IDs updated.
  3. Right after: old Payment Links deactivated, old renewals stopped before the first renewal date.
  4. Later: old webhooks removed and old keys rolled, once nothing uses them.

Frequently asked questions

Do I need new Stripe API keys after a migration?

Yes. API keys belong to one account. Your app needs the new account’s secret and publishable keys, and a new signing secret for each webhook endpoint.

Do price IDs stay the same on a new Stripe account?

No. Prices are recreated and get new IDs. Use a mapping, or set the same lookup_key on both accounts and look prices up by it.

Will recreating subscriptions trigger my webhooks?

Yes, the new account sends subscription created events. Make sure your app doesn’t treat them as new signups.

More questions about Stripe migrations

Start with a free dry-run

See what would move and the MRR it carries. Read-only, nothing is written.

Run my dry-run