Cursor·Fix

Fix: Stripe Webhooks Not Receiving Events

Quick Answer

How do I fix "Stripe webhooks failing" in Cursor?

Check that your webhook endpoint URL is correct in Stripe Dashboard > Developers > Webhooks, and that you're using the correct webhook signing secret (not the API key).

Fix signals

What this answers
How to fix stripe webhooks failing in Cursor.
Fastest move
Verify the webhook URL
Use this page if
Stripe dashboard shows failed webhook deliveries

If this keeps happening

Open the next decision if the same bug class keeps coming back

Use these when the troubleshooting page named the failure, but the higher-leverage move is changing the stack choice, support layer, or production workflow.

Quick Fix Summary

IssueStripe webhooks failing
Fastest fixVerify the webhook URL
Use this page ifStripe dashboard shows failed webhook deliveries

Symptoms

  • !Stripe dashboard shows failed webhook deliveries
  • !Webhook endpoint returns 400 or 500 errors
  • !Payments succeed but app doesn't update
  • !Webhook signature verification fails

Step-by-Step Fix

1

Verify the webhook URL

In Stripe Dashboard > Developers > Webhooks, check that the endpoint URL is your production URL (not localhost). It must be HTTPS.

2

Use the correct signing secret

Each webhook endpoint has its own signing secret (whsec_...). This is different from your Stripe API key. Find it in Stripe Dashboard > Webhooks > your endpoint > Signing secret.

3

Handle the raw request body

Stripe signature verification requires the raw request body, not parsed JSON. In Next.js, export const config = { api: { bodyParser: false } }; in your webhook route.

4

Test locally with Stripe CLI

Install Stripe CLI and run 'stripe listen --forward-to localhost:3000/api/webhooks/stripe' to test webhooks locally.

5

Check event types

Make sure your webhook is subscribed to the events you need (checkout.session.completed, customer.subscription.updated, etc.).

Frequently Asked Questions

Usually because: (1) you're using the API key instead of the webhook signing secret, or (2) the request body was parsed before verification.

Yes, use the Stripe CLI to forward events to localhost. Run: stripe listen --forward-to localhost:3000/api/webhooks/stripe

Related