Skip to content

Stripe go-live problemStripe checkout works in test mode but fails in live mode

Everything worked with test cards, then real customers hit an error, or paid and got nothing. Stripe keeps test and live completely separate, so everything set up in the sandbox has to exist again in live mode. Here’s the switch in order, or hand it over at a fixed price.

Short answer

Test mode (Stripe now calls it a sandbox) and live mode have separate API keys, products, prices, customers and webhook endpoints, and nothing created in one exists in the other. Put the live keys in your production app’s settings, recreate your products and prices in live mode and switch their IDs in your code, add a live webhook endpoint with its own signing secret, then redeploy.

What to switch, in order

  1. 01

    The live app still has test keys

    “Each mode has its own set of API keys, and objects in one mode aren't accessible to the other.” Stripe, API keys

    Replace pk_test_ with pk_live_ in the front end, and sk_test_ or rk_test_ with the live secret or restricted key on the server. Change them in your host’s production settings, not only in a preview or your local .env file. Front-end keys are built into the code, so redeploy afterwards.

  2. 02

    Your price IDs are from test mode

    A price_ ID copied from the sandbox doesn’t exist in live mode, so checkout fails with a "No such price" error. Create the products and prices again in live mode and switch the IDs in your code or settings. Customer IDs saved while testing won’t work in live mode either.

  3. 03

    No live webhook endpoint, or the test signing secret

    “If you're using webhooks, make sure you've defined live endpoints in your Stripe account.” Stripe, Go-live checklist

    Webhook endpoints are set up separately in each mode. Add your endpoint again in live mode and put that endpoint’s signing secret on the server. With the test secret, every live event fails verification, so customers pay but their accounts never unlock.

  4. 04

    Don’t test live mode with your own card

    “The Stripe Services Agreement prohibits testing in live mode using real payment method details.” Stripe, Testing

    Test card numbers only work in a sandbox, and Stripe doesn’t allow testing live mode with real card details. Check each step above in the sandbox. Once you’ve switched, open the Dashboard logs and the webhook delivery log when your first real customer pays, and confirm your app unlocked their account. Stripe’s go-live checklist covers the rest.

Checked against the vendor’s docs on : Stripe docs: API keys, sandbox versus live mode; Stripe docs: Go-live checklist; Stripe docs: Testing.

Rather hand it over?

Fixed scope, fixed price, paid upfront. The work happens in writing; no call needed.

Related: Stripe paid but account not upgraded · Stripe webhook signature error · Stripe "No such customer" in test or live mode

Questions

More on this error

Will my test customers and subscriptions move to live mode?

No. Everything created in the sandbox stays there and never charges anyone. Live mode starts empty, so real customers and subscriptions begin with the first real checkout.

Why does the payment go through but the account stays locked?

Check the webhook first. Live events go only to endpoints added in live mode, and each endpoint has its own signing secret. Check the endpoint’s delivery log in the Stripe Dashboard: failed deliveries show the error your server returned.

Can you do the switch for me?

The keys live in your Stripe and hosting accounts, so you add them there. We change the code to read keys and price IDs from settings, set up the live webhook handling, and hand it over as a pull request you review and deploy, with the dashboard steps in order.

Can you fix it for me?

If one bug is the whole problem, the App Fix Ticket covers it: a written diagnosis first, then the fix. If the app has more going on, the Launch Check is a written check of the whole app. Each issue found is rated critical, high, medium or low, with where it is and how it was confirmed. No issues worth fixing, no charge. If the Launch Check finds nothing rated medium or higher, Simon refunds the full $450. You keep the report either way.

A different error?

Describe it and get a written quote

Send the error and what you were doing. You get a written scope, a fixed price and a timeline; we reply by email, usually within one business day.