> ## Documentation Index
> Fetch the complete documentation index at: https://docs.meum.io/llms.txt
> Use this file to discover all available pages before exploring further.

# Idempotent processing

> Handle duplicate webhook deliveries safely.

## Platform-side deduplication

Events are keyed by `{invoiceId}:{eventType}:{status}`. The platform does not create duplicate event records for the same key.

## Receiver-side deduplication

Store processed event IDs and skip duplicates:

```javascript theme={null}
const eventId = req.headers["x-stablecoin-event-id"];
if (await db.isProcessed(eventId)) {
  return res.status(200).json({ received: true, duplicate: true });
}
await processEvent(req.body);
await db.markProcessed(eventId);
return res.status(200).json({ received: true });
```

The WooCommerce plugin stores the last 50 event IDs in order meta `_stablecoin_processed_events`.

## Related pages

* [Verify signatures](/webhooks/verify-signatures)
* [Event reference](/webhooks/event-reference)
