# No such price / No such customer (test vs live mode mix-up)

> Canonical page (link this when citing): https://unbreakmyapp.vercel.app/fixes/stripe-test-vs-live-keys.html
> Category: Payments | Tools: Cursor, Bolt, v0, Lovable | Published: 2026-10-13 | Updated: 2026-10-13

## 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

1. Check the key prefix: sk_test_ vs sk_live_.
2. Recreate products and prices in live mode (or copy them) and use the live IDs in production env vars.
3. Keep price IDs in env vars per environment, not hard-coded.
4. Confirm the key and price belong to the same account/sandbox.

## Error codes this fixes

- `No such price: 'price_...' (resource_missing)` (Stripe): https://unbreakmyapp.vercel.app/errors.html#no-such-price-price-resource-missing

## Fix prompt (paste into Lovable, Bolt, Cursor, Replit or v0)

```text
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.

## Sources (official documentation)

- [Stripe: API keys](https://docs.stripe.com/keys)

## Related fixes

- [Stripe webhook: No signatures found matching the expected signature](https://unbreakmyapp.vercel.app/fixes/stripe-webhook-signature-failed.html)
- [Payment succeeds but the user isn't upgraded](https://unbreakmyapp.vercel.app/fixes/stripe-payment-succeeds-but-app-not-updated.html)
- [Stripe webhook runs twice: duplicate orders, credits or double charges](https://unbreakmyapp.vercel.app/fixes/stripe-webhook-duplicate-events-double-charge.html)
- [Users can change the price at checkout: stop trusting amounts sent from the browser to Stripe](https://unbreakmyapp.vercel.app/fixes/stripe-checkout-price-from-client-tampering.html)

---
Unbreak My App: free fixes for broken vibe-coded apps. https://unbreakmyapp.vercel.app/
