Thomas Osayi

November 22, 2026 · Updated November 27, 2026 · 9 min read · Thomas Osayi

Stripe test mode to live mode (and sandboxes): the go-live checklist

How to switch Stripe between test mode, sandboxes and live mode, then go live safely: new keys, a live webhook secret, products copied over, tax and the customer portal.

In test mode, everything works. The 4242 card goes through, the webhook fires, the user's plan upgrades and the dashboard lights up. Then you flip to live mode, a real customer pays, and nothing happens. Or checkout fails with "No such price". Or the billing portal throws an error nobody has seen before.

Stripe's own go-live checklist says that switching between test and live is mostly a matter of swapping API keys. That is true for the API calls. It leaves out how many other things in a typical app are tied to test mode: webhook endpoints, signing secrets, price IDs, tax settings, the portal configuration. This is the checklist I work through, in order, before an app takes its first real payment.

Why does an app that works in test mode break in live mode?

Because Stripe keeps test and live mode completely separate: different keys, different webhook endpoints and signing secrets, and different products, prices and customers.

Stripe's documentation is explicit that objects in one mode are not accessible in the other. A test price cannot be used in a live payment. A test webhook endpoint does not receive live events. So when an app has a test price ID hardcoded in the pricing page and a test signing secret in its environment variables, swapping only the publishable key gives you a checkout that fails, or a payment that succeeds with no webhook to record it.

AI builders make this worse because they tend to scatter configuration around. It is common for a generated project to keep price IDs in several components and the webhook secret in an edge function's code rather than in secrets. Before changing anything, list every place Stripe is configured: environment variables, constants files, database rows that store price IDs, and serverless functions.

How do I switch between test mode, sandboxes and live mode in Stripe?

Use the account picker in the Stripe Dashboard: choose a sandbox to test, and exit the sandbox to get back to live mode and your live keys.

Stripe now calls its testing environments sandboxes. Every account keeps the original test mode as the legacy test mode sandbox, which cannot be deleted and shares its settings with live mode. On top of it you can create up to five general sandboxes, and Stripe's docs say the legacy one does not count toward that limit. General sandboxes isolate their settings completely and can be deleted, and Stripe recommends them for new integrations.

That difference matters when you go live:

  • If you built in the legacy test mode sandbox, some settings carry over to live mode because they are shared, but products, prices, customers and webhook endpoints still do not.
  • If you built in a general sandbox, assume nothing carries over, and recreate every setting in live mode on purpose.
  • Either way, each environment has its own API keys, so the keys in your production environment variables must come from live mode, not from the sandbox you tested in.

Switching back to test later is the same move in reverse: pick the sandbox in the account picker and use that sandbox's test keys in your local or preview environment only.

Which API keys do I need to change?

Replace the publishable key in the frontend with pk_live_ and the server key with a live restricted or secret key (rk_live_ or sk_live_), stored only in your host's environment variables.

On the API keys page in the Dashboard, toggle from sandbox to live mode to see your live keys. A few things to know from Stripe's docs at the time of writing:

  • The live publishable key starts pk_live_ and is safe in frontend code.
  • Stripe now recommends restricted API keys for server code, with only the permissions your integration needs, over full secret keys.
  • In live mode, a secret key you create yourself is shown once. Copy it straight into your host's environment variables and note where you saved it.
  • Stripe recommends rotating keys before going live, in case test keys were saved somewhere outside your codebase during development, and making sure your code contains no keys at all.

Set the keys per environment. On Vercel, live keys go in the Production environment only, and Preview deployments keep test keys. That way a preview branch can never charge a real card. If you are unsure whether a key belongs in the browser, "API key exposed in your frontend? Which keys are safe and how to fix the rest" sorts them out.

How do I set up webhooks for live mode?

Create a separate webhook endpoint in live mode pointing at your production URL, select the same events as in test, and put its signing secret in your production environment.

Your Stripe account can have both test and live webhook endpoints, and each endpoint has its own signing secret starting whsec_. Three different secrets often get confused:

  • The test endpoint's secret, from the Dashboard in test mode.
  • The Stripe CLI's secret, printed when you run stripe listen locally.
  • The live endpoint's secret, from the Dashboard in live mode.

Only the last one belongs in production. If your handler verifies signatures with the wrong one, every live event fails with a signature verification error and your app never hears about payments. That exact failure, and how to read the logs, is in "Stripe payment went through but your app did not update? Fix the webhook".

When you create the live endpoint, use the real domain, not a preview URL, and subscribe to exactly the events your code handles, typically checkout.session.completed, customer.subscription.updated, customer.subscription.deleted and invoice.payment_failed for a subscription app. Stripe's checklist also asks that your production endpoint handles delayed and duplicate events and does not depend on events arriving in order.

What happens to my products and prices?

They do not exist in live mode until you create them there, and the live prices get new IDs that your code has to use.

Stripe's checklist states that test objects such as products, prices and coupons are not usable in live mode. You have two options. You can recreate each product in live mode by hand, or you can open a product in your sandbox and click "Copy to live mode" in the upper right, which copies the product and its prices. Stripe notes that each copy creates a separate live product, and later changes to the sandbox product do not carry over.

Either way, the live price IDs are new. Swap them in wherever your app references prices. The cleanest pattern is to keep price IDs in environment variables or look them up by a lookup key you set on each price, so the same code works in both modes without edits.

Do not forget the smaller objects: coupons, promotion codes, tax rates, shipping rates and payment links all need live versions if you use them.

What do I need to set up for tax?

Decide whether you need to collect tax, and if you do, configure tax settings and registrations in live mode before the first sale; this is general information, not tax advice.

If you use Stripe Tax, set your origin address and product tax codes, and add registrations for the places where you are registered to collect. Stripe calculates tax only where you have added a registration, so a live account with no registrations collects nothing. If you set automatic tax on Checkout in code, confirm the live account has the settings it needs, or Checkout Session creation can fail.

If you are not using Stripe Tax, make sure any manual tax rates you created in test mode exist in live mode too. Whether you need to collect sales tax, VAT or GST depends on what you sell and where your customers are, so check with an accountant before launch rather than after your first quarter of sales.

How do I set up the customer portal for live mode?

Open the customer portal settings while viewing live mode, choose what customers can change, add your terms and redirect link, and save.

The portal lets subscribers update cards, switch plans, cancel and see invoices without you building any of it. But its configuration is set per mode. If you only saved it in test mode, creating a live portal session can fail with an error telling you to save your customer portal settings in live mode first.

While you are there, check the settings that affect money:

  • Switch plan and Update quantities are off by default. Turn on only what your pricing supports, and make sure the plans you offer in the portal are the live prices.
  • Cancel subscription is on by default. Decide whether cancellation happens immediately or at the period end.
  • Set the headline, terms of service link and default redirect link back to your app.
  • Branding (logo, colors) lives under branding settings and applies to Checkout and emails too.

What else should I check before taking real payments?

Check the API version, error handling, emails and redirect URLs, then make one real purchase with your own card and refund it.

Stripe's checklist covers the developer side: set or pin the API version so webhook payloads match what your code expects, test incomplete, invalid and duplicate data, and handle every error type, showing users a clear message for a declined card (card_error) without exposing backend errors. Also check:

  • Success and cancel URLs for Checkout point at the production domain.
  • Customer emails for receipts and failed payments are switched on in live mode, with your business name and support email in public business details.
  • Your database distinguishes test and live customers. Test customer IDs stored in your users table will fail against live keys.

Then do the real test. Buy your cheapest plan on the live site with your own card. Confirm the webhook arrives with a 200 response in the live endpoint's event log, the user's plan updates in your database, the receipt email arrives and the portal opens. Then refund the payment from the Dashboard.

Here is an illustration with a made-up product: a $19 a month study planner built in Lovable. The founder swaps keys and launches. Checkout works, but subscriptions never activate. The cause: the live webhook endpoint exists, but STRIPE_WEBHOOK_SECRET in production still holds the CLI secret. One environment variable fixes it, but only a real purchase would have caught it before customers did.

For pricing pages with several tiers, check each tier separately. The pricing section on my own SaaS, SQWAD, below, shows three plans; on any page like this, every tier's button has to point at a live price, and testing only the cheapest one proves nothing about the others.

SQWAD pricing tiers: Starter $99/month, Pro $399/month, Scale $999/month plus 1%, first month free
SQWAD pricing tiers: Starter $99/month, Pro $399/month, Scale $999/month plus 1%, first month free

When should I get help with the switch?

Get help if live payments succeed but your app does not react, if you are not sure which secret is wrong, or if subscriptions and the portal need to work on day one.

Going live is mostly careful configuration, and many founders can do it with this list. Where it goes wrong, it tends to go wrong with real customers' money, which is a bad time to learn. I cover the subscription side in more depth in "Setting up Stripe subscriptions for a SaaS MVP: what you actually need".

My Quick Fix starts at $60 for one specific problem, such as a live webhook that is failing, in about two days. Fix Plus Features starts at $200 for up to three fixes plus one small feature. Finish and Launch starts at $600 for apps whose core already works, and taking payments live is one of the things it covers.

The bottom line

Moving from Stripe test mode to live mode means replacing every key, registering a live webhook endpoint with its own signing secret, copying or recreating products so your code uses live price IDs, and configuring tax and the customer portal in live mode. Keep test keys in preview environments and live keys in production only. Then make one real purchase, watch the webhook land and the plan activate, and refund it before you tell anyone the app is open.

Questions, answered in one line

How do I switch Stripe to test mode?

Open the account picker in the Stripe Dashboard and choose a sandbox, or the legacy test mode sandbox, and use its test API keys; to go back, exit the sandbox with the same account picker and use your live keys.

What changes when I switch Stripe from test mode to live mode?

Your API keys, webhook endpoints and signing secrets, and every product, price and coupon ID change, because test and live mode objects are kept completely separate.

Do I need a new webhook signing secret for live mode?

Yes, each webhook endpoint has its own signing secret, so you must register a live endpoint and put its whsec_ secret in your production environment variables.

Can I copy Stripe products from test mode to live mode?

Yes, Stripe has a Copy to live mode button on a product page that copies the product and its prices, but the copies get new IDs your code must use.

Why does my Stripe customer portal fail in live mode?

The portal settings must also be saved while viewing live mode, so a portal that worked in test mode can fail live until you configure and save it there.

Can someone take my Stripe integration live for me?

Thomas Osayi fixes a single Stripe issue from $60 and takes apps whose core already works to launch, including payments, from $600.

Sources

About the author

Thomas Osayi is a full-stack developer in Los Angeles studying computer science at Loyola Marymount University. He founded and built SQWAD, a SaaS platform Shopify brands use to run creator programs, and builds custom Next.js websites, SaaS MVPs and fixes for AI-built apps for businesses and founders.

See his work · Services and prices

Related articles

Fix, finish and launch your AI-built app

Built your app with Lovable, Bolt, v0, Replit or Cursor and got stuck? I fix the bugs, connect auth and payments, clean up the code and deploy it to production.

See the service