← All errors · StripeStripe payments & webhook errors
You must provide at least one recurring price in `subscription` mode when using prices
Exact error
StripeInvalidRequestError: You must provide at least one recurring price in `subscription` mode when using prices.
What it means
You created a Checkout Session with mode: 'subscription', but every price in line_items is a one-time price. A subscription needs at least one recurring price (one with a billing interval such as month or year). The mirror-image error, "You specified payment mode but passed a recurring price. Either switch to subscription mode or use only one-time prices.", means the opposite: mode is payment but the price is recurring.
Likely causes
- The price ID in your code or environment variable points to a one-time price (for example a "lifetime" or credits price) while the code always sends mode: 'subscription'.
- The price was created in the Dashboard as One-off instead of Recurring, or as a "customer chooses what to pay" price, which is not a fixed recurring price.
- An inline price_data object has no recurring field, so Stripe treats it as a one-time price.
- An AI-generated pricing page reuses one checkout function for monthly, yearly and one-time plans without switching the mode.
How to fix it
Check what kind of price you are passing. A price object has type one_time or recurring, and recurring prices show the interval:
const price = await stripe.prices.retrieve(process.env.STRIPE_PRICE_ID); console.log(price.type, price.recurring); // 'one_time' null -> not valid for subscription mode # or with the Stripe CLI stripe prices retrieve price_123If this plan should bill every month or year, create a recurring price on the product (Dashboard → Product catalog → your product → Add another price → Recurring) and use its new price ID. You cannot change an existing price from one-time to recurring. Inline prices need a recurring field:
line_items: [{ quantity: 1, price_data: { currency: 'usd', unit_amount: 1900, // $19.00 in cents product: 'prod_123', recurring: { interval: 'month' }, }, }],If the plan is a one-time purchase, send mode: 'payment' instead. When one function handles both kinds of plans, pick the mode from the price itself:
const price = await stripe.prices.retrieve(priceId); const session = await stripe.checkout.sessions.create({ mode: price.type === 'recurring' ? 'subscription' : 'payment', line_items: [{ price: priceId, quantity: 1 }], success_url: 'https://your-app.com/success?session_id={CHECKOUT_SESSION_ID}', cancel_url: 'https://your-app.com/pricing', });To charge a one-time setup fee together with a subscription, keep mode: 'subscription' and add the one-time price as an extra line item next to the recurring one. Stripe adds one-time items to the first invoice only.
Update the price ID in your environment variables (Vercel, Supabase Edge Function secrets, or Lovable/Bolt project settings) and redeploy. Test-mode and live-mode prices have different IDs, so recheck this after going live.
Still stuck after trying this? Get it fixed for $49, or you don't pay.
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 "You must provide at least one recurring price in `subscription` mode when using prices" mean?
You created a Checkout Session with mode: 'subscription', but every price in line_items is a one-time price. A subscription needs at least one recurring price (one with a billing interval such as month or year). The mirror-image error, "You specified payment mode but passed a recurring price. Either switch to subscription mode or use only one-time prices.", means the opposite: mode is payment but the price is recurring.
What usually causes it?
The price ID in your code or environment variable points to a one-time price (for example a "lifetime" or credits price) while the code always sends mode: 'subscription'. The price was created in the Dashboard as One-off instead of Recurring, or as a "customer chooses what to pay" price, which is not a fixed recurring price. An inline price_data object has no recurring field, so Stripe treats it as a one-time price. An AI-generated pricing page reuses one checkout function for monthly, yearly and one-time plans without switching the mode.
How do I fix it?
1. Check what kind of price you are passing. A price object has type one_time or recurring, and recurring prices show the interval: 2. If this plan should bill every month or year, create a recurring price on the product (Dashboard → Product catalog → your product → Add another price → Recurring) and use its new price ID. You cannot change an existing price from one-time to recurring. Inline prices need a recurring field: 3. If the plan is a one-time purchase, send mode: 'payment' instead. When one function handles both kinds of plans, pick the mode from the price itself: 4. To charge a one-time setup fee together with a subscription, keep mode: 'subscription' and add the one-time price as an extra line item next to the recurring one. Stripe adds one-time items to the first invoice only. 5. Update the price ID in your environment variables (Vercel, Supabase Edge Function secrets, or Lovable/Bolt project settings) and redeploy. Test-mode and live-mode prices have different IDs, so recheck this after going live.
Last checked against official docs on . Sources: Stripe API: Create a Checkout Session (mode and line_items), Stripe API: The Price object (type, recurring), Stack Overflow: this exact error.
Related errors
- No such price: 'price_...'
- This customer has no attached payment source or default payment method
- Amount must be at least $0.50 usd
More Stripe errors and fixes →
Get new fixes weekly
No spam. Unsubscribe anytime. Privacy