The svix-id Header
Every webhook request includes asvix-id header. This ID is:
- Unique per message - Each distinct event gets a unique ID
- Consistent across retries - The same ID is used when retrying a failed delivery
Rarely, storekit itself can create the same event twice, for example when an internal retry follows a timeout. Those copies are separate messages with different
svix-id values. If a duplicate would cause harm, also deduplicate one-off events on the event and the order, for example order.created.v2 plus the order id. Don’t do this for events that can legitimately repeat for the same order, such as order.refund.* (an order can have several refunds, even of the same amount) or order.rating.updated. Rely on svix-id for those. The order.refund.* payload has no refund ID, so if a rare duplicate refund event matters to you, reconcile against the order’s refunds in your storekit dashboard rather than matching on amount or reason.Implementing Deduplication
To ensure you only process each event once, store thesvix-id and check it before processing:
When to Use Deduplication
Deduplication is especially important for:- Payment processing - Avoid charging customers twice
- Order creation - Prevent duplicate orders
- Inventory updates - Ensure accurate stock counts
- Notification sending - Don’t spam users with duplicate messages
Storage Options
You can store processed webhook IDs in:Even without deduplication, designing your webhook handlers to be idempotent (producing the same result when called multiple times) is a good practice.