Cursor Stripe Checkout Session Returning 400
Quick Answer
How do I fix Cursor Stripe Checkout Session Returning 400?
Cursor is sending Stripe a malformed Checkout request. The most common causes are the wrong price ID, using subscription mode for a one-time price, or passing relative success and cancel URLs instead of absolute URLs. Start with "Verify the Stripe price ID and mode" before making broader code changes.
Fix signals
- What this answers
- Why cursor stripe checkout session returning 400 happens and what to change first.
- Fastest move
- Verify the Stripe price ID and mode
- Use this page if
- Stripe checkout creation fails with a 400 error
If this keeps happening
Open the next decision, not just the patch
Use these when the current fix is helpful, but the real answer is a better tool choice, a cleaner workflow layer, or a more trustworthy launch path.
Cursor review
Open this when the issue is making you decide whether a more code-first workflow is still the right long-term move.
Open this next →
Lovable reviews
Open this when the bug is making you reconsider whether a faster generated path would reduce the operational overhead.
Open this next →
Deploy hub
Open this when the fix is exposing a broader production handoff problem, not just one bug in the code.
Open this next →
Tool picker
Open this when repeated failures are pushing the decision back up to the stack level.
Open this next →
Firecrawl review
Open this when the app also needs live web data and the bigger stack question is no longer just about the coding tool.
Open this next →
Quick Fix Summary
| Most likely cause | Cursor is sending Stripe a malformed Checkout request. The most common causes are the wrong price ID, using subscription mode for a one-time price, or passing relative success and cancel URLs instead of absolute URLs. |
| Fastest fix | Verify the Stripe price ID and mode |
| Use this page if | Stripe checkout creation fails with a 400 error |
You're in the right place if...
- !Stripe checkout creation fails with a 400 error
- !The buy button spins and never redirects
- !Stripe logs show an invalid price, mode, or URL
Why this happens
Cursor is sending Stripe a malformed Checkout request. The most common causes are the wrong price ID, using subscription mode for a one-time price, or passing relative success and cancel URLs instead of absolute URLs.
Fix
Verify the Stripe price ID and mode
Check that the price ID exists in the same Stripe mode you are testing and that the Checkout session mode matches the product type.
Make Cursor regenerate the server-side checkout function
Use a precise prompt instead of trying to patch the Stripe call manually.
Copy this prompt
Stripe checkout is returning a 400 error. Please rebuild the checkout session server function so it: 1. uses the correct Stripe price ID 2. uses mode 'payment' for one-time purchases or 'subscription' for recurring plans 3. sends absolute success and cancel URLs 4. returns the Stripe checkout URL cleanly to the frontend
Check the redirect URLs
Stripe requires absolute URLs in production. Do not send '/success' or '/pricing' by themselves.
success_url: `${process.env.NEXT_PUBLIC_APP_URL}/payment-success?session_id={CHECKOUT_SESSION_ID}`,
cancel_url: `${process.env.NEXT_PUBLIC_APP_URL}/pricing`Prevent this next time
Keep Stripe price IDs in one configuration file or table. Hardcoding different values in multiple places is the fastest way to create 400 errors.
Frequently Asked Questions
Checkout sessions require absolute return URLs so Stripe knows exactly where to send the user after payment.
No. Test and live mode objects are completely separate in Stripe.
Related fixes
Cursor Stripe Webhook Not Updating Access
Cursor Stripe Billing Portal Return URL Broken
Cursor Not Understanding My Codebase
Cursor Changing Files I Didn't Ask It To
Cursor Says Context Limit Reached
Cursor Generating Pages Router Instead of App Router