Payment webhooks
Verify signatures, idempotency, and background processing for Stripe, Lemon Squeezy, Polar, Creem, and Dodo.
Handler shape
- Read raw body for signature verification.
- Parse event payload.
- Deduplicate by event ID in a store or cache.
- Update entitlements and emit notifications if needed.
Idempotency
Providers may retry delivery. Make handlers safe to run multiple times for the same event ID.
Queues
For slow work (PDF generation, analytics fan-out), enqueue a task and return 200 quickly.
Never process webhooks without verifying signatures using the provider’s documented method.