---
title: "Discussion on \"Payment webhooks that survive duplicates and disorder\" | Hashnode"
description: "Discussion on \"Payment webhooks that survive duplicates and disorder\". A production pattern for signatures, fast acknowledgements, idempotency, guarded state changes and reconciliation."
url: "https://hashnode.com/posts/mena-payment-webhooks-idempotency-reconciliation/6a980659743b09cd35628b4b"
---

[Feed](https://hashnode.com/feed) /

Discussion

# [Payment webhooks that survive duplicates and disorder](https://www.sultanbyte.com/mena-payment-webhooks-idempotency-reconciliation?utm_source=hashnode&utm_medium=feed)

A production pattern for signatures, fast acknowledgements, idempotency, guarded state changes and reconciliation.

Sep 2 · 8 min read · sultanbyte.com  
Read the article

-   [#webhooks](https://hashnode.com/tag/webhooks)
-   [#payments](https://hashnode.com/tag/payments)
-   [#system-design](https://hashnode.com/tag/system-design)
-   [#postgresql](https://hashnode.com/tag/postgresql)

## Written by

[Hussain Fakhruddin](https://hashnode.com/@hussainanjar)

@hussainanjar · Dubai, UAE

  
[View profile](https://hashnode.com/@hussainanjar)

Founder & CTO Qualascend.com | Staticforms.dev

I have lead the Engineering for multiple startups in UAE. I also have my own agency qualascend.com.

## Responses 2

Markdown supported · ⌘↵ to post

[Henry Robt](https://hashnode.com/@henryrober)

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

The section on idempotency and reconciliation is especially important for payment webhooks, where duplicate or delayed events can easily cause inconsistent transaction states. Having a clear process for handling retries and reconciling payment records can make integrations much more reliable.

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