LovableStripe

How to Fix Stripe Webhooks Not Firing in Lovable Apps

Lovable Stripe integrations break in production because of a few specific webhook issues. The exact fixes, in order.

TL;DR

Lovable's auto-generated Stripe webhook handler usually works in test mode but breaks in production for one of three reasons: missing webhook signing secret, wrong endpoint URL after deployment, or webhook events not subscribed in the Stripe dashboard.

What is actually happening

Lovable scaffolds a Stripe webhook handler that runs as a Supabase Edge Function. The handler verifies the request signature against a STRIPE_WEBHOOK_SECRET environment variable. When something breaks between Stripe and your app, the webhook is almost always the failure point because every other piece of the flow is synchronous and visible.

The fix, in order

Try these in sequence. Most apps are fixed by the first or second step.

  1. 1

    Confirm the webhook signing secret is set in production

    In the Supabase dashboard, go to Edge Functions then your Stripe webhook function then Secrets. Make sure STRIPE_WEBHOOK_SECRET is set and matches the signing secret from your Stripe webhook endpoint (not the API key). The secret starts with whsec_. If it is missing or wrong, the handler returns 400 and Stripe stops retrying after 3 days.

  2. 2

    Verify the webhook endpoint URL in Stripe matches your deploy

    In Stripe Dashboard go to Developers then Webhooks. The endpoint URL should be your production Supabase function URL, not localhost or a stale staging URL. Format: https://[your-project].supabase.co/functions/v1/stripe-webhook. If the URL is wrong, no events ever reach your app.

  3. 3

    Check that the right events are subscribed

    On the same Stripe webhook detail page, click 'Listening to'. Make sure you are subscribed to the events your app actually needs: checkout.session.completed for one-time payments, customer.subscription.created and customer.subscription.updated and customer.subscription.deleted for subscriptions, invoice.payment_succeeded and invoice.payment_failed for billing. If your app handles an event that is not subscribed, it will never fire.

  4. 4

    Look at the recent deliveries log in Stripe

    Stripe shows the last 30 days of webhook deliveries with HTTP response codes. If you see 200s, the webhook is firing fine and your bug is downstream. If you see 4xxs, the problem is signing or endpoint. If you see 5xxs, your function is crashing. Click into a failed delivery to see the actual response body, which usually has the error.

  5. 5

    Test with the Stripe CLI before going live

    Install the Stripe CLI and run: stripe listen --forward-to https://[your-project].supabase.co/functions/v1/stripe-webhook --events checkout.session.completed. This sends a test event and shows you the exact response from your handler. Faster than waiting for real events.

When to stop debugging and get help

If your webhook is firing (Stripe shows 200s) but the database is not updating, the bug is in the function code itself. AI-generated webhook code often has subtle issues with idempotency, race conditions, or missing await keywords that are not obvious without reading the code closely.

Stuck after trying these?

We do a $100 Quick Audit that pinpoints exactly what is wrong, why, and what it will take to fix. No sales call gating, no fluff.

Start a $100 Audit

Related fixes

Not sure exactly what is broken? Run a free scan and get a diagnosis in under 2 minutes.