🔧 Unbreak My AppAll fixesFix KitsSponsor

Fixes › Payments

Payment succeeds but the user isn't upgraded

LovableBoltCursor

The error

Stripe shows the payment as succeeded but the app still shows the free plan

Why it happens

The app grants access on the success-page redirect, or no webhook is configured in production. Redirects can be skipped (closed tab), so access should be granted from the checkout.session.completed webhook, matched to the user via client_reference_id or metadata.

How to fix it

  1. Pass client_reference_id (your user id) when creating the Checkout Session.
  2. Add a production webhook endpoint in Stripe for checkout.session.completed (plus customer.subscription.updated/deleted for subscriptions).
  3. In the handler, look up the user by client_reference_id and update their plan with a server-side DB client.
  4. Make the handler idempotent (store the event id).

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

Payments succeed in Stripe but users aren't upgraded. Pass the user id as client_reference_id when creating the Checkout Session, add a verified webhook route that handles checkout.session.completed and customer.subscription.updated/deleted, updates the user's plan in the database using a server-side client, and ignores duplicate events. Tell me which webhook URL and events to register in the Stripe dashboard.

FAQ

Can I trust the success URL?

No. Treat it as a thank-you page only; grant access from the webhook.

Payment Links?

They support client_reference_id via a URL parameter too.

Related fixes

Want the full checklist for this area? Get a Fix Kit ($29)

Get one new fix a week

Free newsletter: the newest breakages in Lovable, Bolt, Cursor, Replit and v0 apps, with paste-in fixes.

We only use your email to send the newsletter. Unsubscribe any time. See privacy.