Webhook idempotency key generator
Payment providers retry webhooks. A stable idempotency key makes your handler process one billing side effect and skip duplicate deliveries safely.
Open the free key builderRecommended pattern
provider:scope:event_name:object_id
Choose the right scope
Use when each provider event object should run once.
Use when renewal side effects should run once per paid invoice.
Use when access writes should be unique per customer or subscription.
Database gate
Persist the key with a unique constraint before sending emails, delivering licenses, granting access, extending renewals, or scheduling cancellations.
create unique index processed_webhooks_idempotency_key_idx
on processed_webhooks (idempotency_key);
FAQ
What should be in a webhook idempotency key?
A practical key should include the provider, uniqueness scope, event name, and stable provider object ID, such as lemonsqueezy:event:order_created:1042.
When should a webhook idempotency key be stored?
Store the idempotency key before running billing side effects. Duplicate deliveries should return success after confirming the key already exists.
Use the free sample before wiring production checkout
Download a public sample pack with fake Lemon Squeezy fixtures, signature tests, contract checks, duplicate replay tests, and CI skeletons. The Pro Kit preview shows the full paid package structure without exposing the private archive.