Cursor·FixpaymentsStripeintermediate

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.

Quick Fix Summary

Most likely causeCursor 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 fixVerify the Stripe price ID and mode
Use this page ifStripe 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

1

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.

2

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
3

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