How to prevent duplicate digital delivery
Idempotency, reservations, delivery checkpoints, and reconciliation for accounts, items, keys, and top-ups.
Reserve before delivery
When an order selects inventory, reserve it atomically before preparing delivery. Another order must not see the reserved unit as available. A unique reservation or delivery key ties the inventory movement to the external order.
For unique secrets such as accounts or keys, one unit can have only one active delivery owner.
Checkpoint external actions
The system records intent before the external action and confirmation after it. If the network fails between those points, the next worker reconciles the marketplace state instead of blindly retrying.
Messages, images, and delivery payloads each need their own deduplication key because one stage may succeed while another fails.
Never restore stock from an uncertain read
A temporary API or parser failure must not turn a sold item back into available stock. Restocking should require a confirmed cancellation, refund, or an explicit audited manual action.
Append-only inventory events make it possible to reconstruct every reservation, release, delivery, and correction.