No such price / No such customer (test vs live mode mix-up)
The error
StripeInvalidRequestError: No such price: 'price_...'
Why it happens
Objects created in test mode don't exist in live mode and vice versa. Using a live secret key with test price IDs (or a key from a different account or sandbox) gives 'No such ...' errors.
How to fix it
- Check the key prefix: sk_test_ vs sk_live_.
- Recreate products and prices in live mode (or copy them) and use the live IDs in production env vars.
- Keep price IDs in env vars per environment, not hard-coded.
- Confirm the key and price belong to the same account/sandbox.
Fix prompt (paste into Lovable, Bolt, Cursor, Replit or v0)
Stripe says 'No such price'. Move all Stripe price IDs into env vars (STRIPE_PRICE_...), make sure production uses sk_live_ keys with live-mode price IDs and preview uses test keys with test IDs, and add a startup check that logs (without printing the key) whether the key is test or live.
FAQ
Can I copy test products to live?
Yes, the Dashboard has a 'Copy to live mode' option for products.
Is it a code bug?
Usually not; it's a key/ID mismatch.
Related fixes
- Stripe webhook: No signatures found matching the expected signature
- Payment succeeds but the user isn't upgraded
- Supabase query returns an empty array (no error)
- new row violates row-level security policy for table
Want the full checklist for this area? Get a Fix Kit ($29)
Featured slot available: reach thousands of vibe coders. Sponsor this week →
Get one new fix a week
Free newsletter: the newest breakages in Lovable, Bolt, Cursor, Replit and v0 apps, with paste-in fixes.
We only use your email to send the newsletter. Unsubscribe any time. See privacy.