← All errors · StripeStripe payments & webhook errors
No such price: 'price_...'
Exact error
No such price: 'price_1KYX8OCLVCGN5jA7JNtDRaAx'; a similar object exists in live mode, but a test mode key was used to make this request. code: resource_missing
What it means
Stripe looked up that price ID using the mode of your secret key (test or live) and did not find it. Test mode and live mode are completely separate: products, prices and customers created in one mode do not exist in the other. The second half of the message, when present, tells you which mode the price actually lives in.
Likely causes
- A test-mode price ID is used with a live key (sk_live_), or a live price ID with a test key (sk_test_). Common right after switching a Lovable, Bolt or Next.js app to live payments.
- The price ID is hardcoded in the code or stored in a database column, so updating environment variables did not change it.
- A product ID (prod_...) was passed where Checkout expects a price ID (price_...).
- The price belongs to a different Stripe account than the secret key (for example a teammate's account or an old sandbox).
- The new environment variables were added in Vercel but the app was not redeployed, so the old values are still in use.
How to fix it
Check which key the server is using: test keys start with sk_test_ (or rk_test_), live keys with sk_live_ (or rk_live_). Then open the Stripe Dashboard in that same mode and search for the price ID. If it is not there, it was created in the other mode or account.
If you are going live, recreate the products and prices in live mode (Stripe can copy a test product to live mode from the product page) and use the new live price IDs. Test price IDs never work with live keys.
Make sure you are passing a price ID, not a product ID, in Checkout line items:
const session = await stripe.checkout.sessions.create({ mode: 'subscription', line_items: [{ price: process.env.STRIPE_PRICE_ID, quantity: 1 }], // price_..., not prod_... success_url: 'https://your-app.com/success', cancel_url: 'https://your-app.com/pricing', });Read price IDs from environment variables (or a lookup key) so preview and production can differ, and search the codebase and database for any hardcoded price_ values:
grep -rn "price_" --include=*.{js,ts,tsx} . // or use a lookup key that you set on both the test and live price const prices = await stripe.prices.list({ lookup_keys: ['pro_monthly'] }); const priceId = prices.data[0].id;After changing environment variables in Vercel, redeploy so the new values are built into the deployment. Check the publishable key too: a live Checkout Session opened with a test publishable key (pk_test_) fails in the browser.
Prevent this next time
- Test webhooks locally with `stripe listen` and the Stripe test cards before going live.
- Check webhook delivery attempts in the Stripe Dashboard after each deploy, and keep test and live keys clearly separated per environment.
FAQ
What does "No such price: 'price_...'" mean?
Stripe looked up that price ID using the mode of your secret key (test or live) and did not find it. Test mode and live mode are completely separate: products, prices and customers created in one mode do not exist in the other. The second half of the message, when present, tells you which mode the price actually lives in.
What usually causes it?
A test-mode price ID is used with a live key (sk_live_), or a live price ID with a test key (sk_test_). Common right after switching a Lovable, Bolt or Next.js app to live payments. The price ID is hardcoded in the code or stored in a database column, so updating environment variables did not change it. A product ID (prod_...) was passed where Checkout expects a price ID (price_...). The price belongs to a different Stripe account than the secret key (for example a teammate's account or an old sandbox). The new environment variables were added in Vercel but the app was not redeployed, so the old values are still in use.
How do I fix it?
1. Check which key the server is using: test keys start with sk_test_ (or rk_test_), live keys with sk_live_ (or rk_live_). Then open the Stripe Dashboard in that same mode and search for the price ID. If it is not there, it was created in the other mode or account. 2. If you are going live, recreate the products and prices in live mode (Stripe can copy a test product to live mode from the product page) and use the new live price IDs. Test price IDs never work with live keys. 3. Make sure you are passing a price ID, not a product ID, in Checkout line items: 4. Read price IDs from environment variables (or a lookup key) so preview and production can differ, and search the codebase and database for any hardcoded price_ values: 5. After changing environment variables in Vercel, redeploy so the new values are built into the deployment. Check the publishable key too: a live Checkout Session opened with a test publishable key (pk_test_) fails in the browser.
Last checked against official docs on . Sources: Stripe docs: test and live modes, Stripe docs: API keys.
Related errors
- Invalid API Key provided
- No such customer: 'cus_...'
- No signatures found matching the expected signature for payload
More Stripe errors and fixes →
Get new fixes weekly
No spam. Unsubscribe anytime. Privacy