---
title: "Stripe checkout opens and then errors"
description: "Usually a sandbox price ID used with live keys, mixed keys, or a localhost success URL. How to read Stripe's request log and fix the checkout session."
url: https://whocanfixmyapp.com/problems/stripe-checkout-opens-then-errors
---

[Home](https://whocanfixmyapp.com/) / [Problems](https://whocanfixmyapp.com/problems) / [Payments](https://whocanfixmyapp.com/problems#payments)

# Stripe checkout opens and then errors

VC-34 · Stripe · Next.js · Bolt · Updated October 2026 · By [Nathaniel Kelley](https://whocanfixmyapp.com/authors/nathaniel-kelley)

Quick verdict

Partly fixable yourself. Often a price ID or URL mismatch, some code reading.

- **How serious**: High
- **Fix it yourself?**: Partly, some steps need a developer
- **Typical cost**: $49–$800 one-off check, or €99–$990 for a single fix ([prices](https://whocanfixmyapp.com/pricing))
- **Top rated for Bolt**: [Afterbuild Labs](https://whocanfixmyapp.com/companies/afterbuild-labs) · **10.0**/10

**What you see.** Clicking Buy opens Stripe, or tries to, and then shows Something went wrong, No such price, or a blank page.

## Why it happens

A Checkout Session is created on your server with the secret key, a price ID, a mode, and a `success_url`, and your app sends the customer to the URL Stripe returns. Each piece can be wrong. A price ID copied from the sandbox does not exist in live mode, so Stripe answers `resource_missing`, shown as No such price. Mixing a test secret key with a live price, or the reverse, returns `livemode_mismatch`. Using the publishable key on the server returns `secret_key_required`.

The `success_url` must be a public address, so a `localhost` value left in the code sends the customer to a dead page. Sessions expire after 24 hours by default, so a saved session link fails later. In Bolt and Next.js apps the agent sometimes creates the session in the browser with the secret key, which both fails and leaks the key (see [secret key in the frontend](https://whocanfixmyapp.com/problems/stripe-secret-key-in-the-frontend)).

## Fix it yourself

1. Open **Developers → Logs** in the Stripe dashboard, in the same mode as your keys. The failed request shows the error code and message.
2. `resource_missing`: open **Product catalog** in the same mode, copy the real `price_` ID, and update your code or environment variable.
3. `livemode_mismatch` or `secret_key_required`: check the key in your host's environment is the `sk_` key of the right mode, and that the browser only ever gets the `pk_` key.
4. Search the code for `success_url` and `cancel_url`. Replace `localhost` with your live domain, ideally read from an environment variable.
5. Make sure the session is created in a server route and the browser receives only the session URL to redirect to.
6. Redeploy and test with a real card in live mode, then refund the payment.

## When to get an engineer

Stop when the logs show no request at all, meaning your server code never runs, or when the error is a 500 from your own host. Give the engineer the Stripe request log ID, the host, and the file that creates the session. A single fix at €99–$990 is typical, in 1–2 days. If payments broke right after you added them in Bolt, read [Bolt app broke after adding payments](https://whocanfixmyapp.com/problems/bolt-app-broke-after-adding-payments) first.

## Top-rated companies for Bolt apps

Ranked by our score: published prices, scope of work, AI tools named, timing and a low-risk first step. [How we score](https://whocanfixmyapp.com/methodology#score).

- 1 · [Afterbuild Labs](https://whocanfixmyapp.com/companies/afterbuild-labs) · **10.0**/10 · Best for: A check before launch · Free first step · from $49
- 2 · [Redlab](https://whocanfixmyapp.com/companies/redlab) · **10.0**/10 · Best for: A full rescue by one team that keeps building · Free first step · from $490
- 3 · [Vibe Code Rescue (Lev Arakelyan)](https://whocanfixmyapp.com/companies/vibe-code-rescue-lev-arakelyan) · **9.0**/10 · Best for: A one-off check and a cleanup · From $299

[All 48 Bolt companies, ranked](https://whocanfixmyapp.com/best/bolt-developers)

## Check these

PAY-02 · High

Prices and plans come from the server

If the price or plan ID is sent from the browser, someone can edit it. The server should look it up.

PAY-01 · Critical

Paid accounts are unlocked by a verified payment webhook

Access should change only when your server receives a signed webhook from Stripe or your provider, not when the browser reaches a success page.

DATA-02 · Critical

No secret keys reach the browser

Open your live app, then DevTools, Sources, and search the loaded JavaScript for `sb_secret_`, `sk_live_`, `sk-proj-` and `sk-ant-`. Older Supabase keys are long tokens starting with `eyJ`: decode the middle part of each on your own machine, and if it contains `"role":"service_role"`, your secret key is public. A publishable or anon key in the browser is expected.

OPS-04 · Medium

Secrets live in the host's environment settings

Keys belong in environment variables on the server, not in the repository or in front-end code.

## Questions

### Why does the same button work in the preview?

The preview uses sandbox keys and sandbox prices, which match each other. The live site has live keys and still sends the sandbox price ID, so Stripe cannot find it.

### Do I need my own success page?

Yes, and it must be public so Stripe can redirect to it. Use it to thank the customer, but grant access from the verified webhook, not from the page.

Sources: [Stripe: How Checkout works](https://docs.stripe.com/payments/checkout/how-checkout-works.md?payment-ui=stripe-hosted); [Stripe: Error codes](https://docs.stripe.com/error-codes.md); [Stripe: Checkout quickstart](https://docs.stripe.com/checkout/quickstart.md).

**Bolt guide**

What Bolt builds, where it breaks and how to check it: [Bolt app rescue: moving a Bolt.new project to production](https://whocanfixmyapp.com/guides/bolt).

**Same category**

- [Bolt app broke after I added payments: Stripe, webhooks and what to check](https://whocanfixmyapp.com/problems/bolt-app-broke-after-adding-payments)
- [Customer paid but their account was not upgraded](https://whocanfixmyapp.com/problems/stripe-webhook-not-firing-paid-but-not-upgraded)
- [Stripe is still in test mode on the live site](https://whocanfixmyapp.com/problems/stripe-still-in-test-mode-on-the-live-site)
- [Cancelled subscriptions still have access](https://whocanfixmyapp.com/problems/cancelled-subscriptions-still-have-access)
- [Stripe secret key is in my frontend code](https://whocanfixmyapp.com/problems/stripe-secret-key-in-the-frontend)

[All payments problems](https://whocanfixmyapp.com/problems#payments)

**Run every check**

The [production checklist](https://whocanfixmyapp.com/checklist) has all 24 checks with a verdict.
