Simulacrum

Payment webhooks

Verify signatures, idempotency, and background processing for Stripe, Lemon Squeezy, Polar, Creem, and Dodo.

Handler shape

  1. Read raw body for signature verification.
  2. Parse event payload.
  3. Deduplicate by event ID in a store or cache.
  4. 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.