---
title: "Comment by Payneteasy on \"Payment webhooks that survive duplicates and disorder\" | Hashnode"
description: "The disorder problem is the sharp edge in practice — most idempotency writeups only cover duplicate delivery, not out-of-order delivery, and those need differen"
url: "https://hashnode.com/posts/mena-payment-webhooks-idempotency-reconciliation/6a980659743b09cd35628b4b/comment/6a998b34777c580a5027ca25"
---

[Discussion](https://hashnode.com/posts/mena-payment-webhooks-idempotency-reconciliation/6a980659743b09cd35628b4b)

Comment [Payment webhooks that survive duplicates and disorder](https://hashnode.com/posts/mena-payment-webhooks-idempotency-reconciliation/6a980659743b09cd35628b4b)

[Payneteasy](https://hashnode.com/@payneteasy)

[Sep 3](https://hashnode.com/posts/mena-payment-webhooks-idempotency-reconciliation/6a980659743b09cd35628b4b/comment/6a998b34777c580a5027ca25)

The disorder problem is the sharp edge in practice — most idempotency writeups only cover duplicate delivery, not out-of-order delivery, and those need different fixes. A dedup key stops the double-credit, but if a 'captured' webhook arrives after a 'refunded' one because of a retry queue, a naive last-write-wins handler still corrupts state. What held up for us was making every webhook carry a monotonic sequence per transaction and rejecting (not just deduping) events older than the current recorded state — cheap to add, easy to miss until a retry storm exposes it in prod.
