Skip to main content

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:
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.