StripePayments

Stripe: No such price

No such price: 'price_1ABCDEFghijklmnopqrstuvwx'

In short: The Price (or Customer) ID in your code or database does not exist in the Stripe account and mode (test or live) that your current secret key belongs to.

Why it happens

Every Stripe object ID is scoped to one account and one mode. price_… created in the Dashboard's test mode is invisible to a live secret key, and the other way around. The same error appears if the price was created in a different Stripe account (a teammate's, or a leftover test account), or if it was archived or deleted. AI tools often hard-code a price_… from the first successful test Checkout and then you switch STRIPE_SECRET_KEY to live, or you copy the test price ID into a production env var. This is related to using a test key with live mode, but the message here is No such price (or No such customer) even when the key itself is valid for its mode.

How to fix it

  1. In the Stripe Dashboard, check the Test / Live toggle in the top right. Open Product catalog and find the price. The ID in the URL or the price detail must match the string in your env or code exactly.
  2. Confirm STRIPE_SECRET_KEY (and the publishable key) are from the same account and the same mode as that price. A live key starts with sk_live_; a test key starts with sk_test_.
  3. If you are going live, create the product and price again in live mode and put the new price_… in the production environment. Don't expect the test ID to start working with a live key. Do the same for any cus_… or sub_… IDs you stored during testing.
  4. If you have more than one Stripe account, open the account switcher and make sure the Dashboard you copied from is the one that issued the secret key on the host.
  5. Redeploy or restart after changing env vars, then start a Checkout session again and read the new session's price ID in the Stripe logs.

Example

// Use a price ID that exists in the SAME mode as this secret key.
const session = await stripe.checkout.sessions.create({
  mode: "payment",
  line_items: [{ price: process.env.STRIPE_PRICE_ID, quantity: 1 }],
  success_url: `${process.env.SITE_URL}/success`,
  cancel_url: `${process.env.SITE_URL}/cancel`,
});
Don't: Don't paste a live secret key into the browser to 'try the live price', and don't reuse test customer or subscription IDs in production. Create live objects under live keys.

Copy-paste fix prompt

3 · The fix promptPaste into Cursor, Claude Code, Codex, Lovable, Bolt, Replit or v0
I'm getting this error in my app:

No such price: 'price_1ABCDEFghijklmnopqrstuvwx'

[Paste the full error, stack trace, and the file it points to here]

Likely cause: The Price (or Customer) ID in your code or database does not exist in the Stripe account and mode (test or live) that your current secret key belongs to.

Task: Stripe returns No such price (or No such customer). List every price, customer, and subscription ID the app uses and match each one to the Stripe account and test/live mode of the secret key in that environment. Create new live objects for production instead of reusing test IDs. Don't put the secret key in client code.

Rules:
- First explain the root cause in 2 sentences and list the files you'll change.
- Make the smallest change that fixes it. Don't refactor unrelated code.
- Don't disable security or checks (RLS, auth, signature verification, type checking, CORS allow-all) to make the error disappear.
- Never print or hard-code secret keys.
- Finish by telling me exactly how to verify the fix.

Common with: Lovable, Bolt, Cursor, v0. Last reviewed 2026-11-15.

Related fixes

← All fixes · Still stuck? Use the diagnose-first prompt