Stripe works in test mode but not in live mode: how to fix it
Everything worked with the 4242 test card. Then you switched to real payments and checkout breaks, or people pay and never get access. Stripe keeps test and live mode completely separate, so anything you set up in test mode has to be set up again in live mode.
1. Read the exact error
The most common one is No such price: 'price_...'; a similar object exists in test mode, but a live mode key was used to make this request. It means your app is using a live key with a price ID you created in test mode. Find the error in your server logs, or in the Stripe dashboard under Developers, then Logs (make sure the dashboard is in live mode).
2. Swap every key, not just one
Live keys start with sk_live_ (secret, server only) and pk_live_ (publishable, browser). A mix of test and live keys fails in confusing ways. Update both in your host's production env variables and redeploy, because most hosts only read env variables at build or start time. Never put the sk_ key in browser code.
3. Recreate products and prices in live mode
Products, prices, coupons and payment links made in test mode don't exist in live mode. Create them again with the live toggle on, then copy the new price_ IDs into your app or env variables. AI tools often hard-code test price IDs in the code, so search your codebase for price_.
4. Add a live webhook endpoint with its own secret
Webhooks are per mode too. In live mode, add your production URL (for example https://yourapp.com/api/stripe-webhook), choose the same events, and copy the new signing secret (whsec_...) into production. The test secret won't verify live events, so the webhook fails and paid users never get unlocked.
5. Check the account can take live payments
If Stripe still needs business details or bank details, it may restrict live charges or payouts. Check the dashboard home page for any banner asking you to finish setting up the account.
6. Test with one real payment
Buy your cheapest plan with a real card, check the webhook shows as delivered in Stripe, check the user got access, then refund yourself from the dashboard.
Quick checklist
- Both live keys set in production and redeployed
- Products and prices recreated in live mode, new IDs in the app
- No test
price_IDs left in the code - Live webhook endpoint added with its own
whsec_secret - Account fully activated
- One real payment tested and refunded
Still stuck?
Mendlark fixes this kind of problem for a fixed €49 (launch price, normally €79). We agree the problem first, test the fix and send it as a pull request, so nothing changes in your app until you merge it. If we can't fix it, you don't pay. Get the €49 fix, or start with a free scan.
Not sure what else is wrong? Paste your app link into the free instant check and get a plain-English list of problems in seconds.