The webhook that arrived twice
A customer bought one month of credits. Their account shows two months. Your dashboard shows one payment.
This answers: Why did my Stripe webhook run twice? No coding needed. 3 quick decisions.
- Payments and webhooks
- Where your data lives
- Debugging without panic
Checking your access…
Why did my Stripe webhook run twice?
delivers at least once and retries when your endpoint is slow or fails, so the same event id can arrive twice. Record each processed event id in a table with a unique key and skip repeats, and always verify the signature against the raw request body.
Breaks at Your server: Same event processed twice
How it works
- 0sStripeSends evt_1Q8: 'checkout completed'
- 0–31sYour serverAdds one month of credits… but replies slowly
- 31sStripeNo reply in time, so it sends evt_1Q8 again
- 31sYour serverAdds a second month of credits
Why AI tools write this bug
Generated handlers usually process every delivery as new. When signature verification fails because the body was parsed as JSON, AI fixes often remove the verification instead of reading the raw body.
How to fix it
- Verify the Stripe-Signature header against the raw request body.
3 more steps, and a prompt that checks your own app for this bug. Part of Pro.
UnlockCommon questions
- Why does Stripe signature verification keep failing?
- Usually because the body was parsed as JSON before verification. Verify against the exact raw text Stripe sent.