Enter the Fraudster Factory™
Enter the Fraudster Factory™
Enter the Fraudster Factory™
Enter the Fraudster Factory™
/
Plateforme et outils
October 26, 2026
Oct 26, 2026

How to Build Reliable Chargeback Webhooks: Idempotency, Retries and Duplicate Events

Logo circulaire blanc comportant, en son centre, des formes entrelacées, entouré de lignes elliptiques qui se chevauchent et ressemblent à des orbites, ainsi que de losanges bleus dispersés.

rétrofacturation?
Ce n'est plus votre problème.

Récupérez 4 fois plus d'rétrofacturation s et PRÉVENTION jusqu'à 90 % des messages entrants, grâce à l'IA et à un réseau mondial de 20 000 commerçants.

Plus de 600 avis
Aucune carte bancaire n'est nécessaire.
How to Build Reliable Chargeback Webhooks: Idempotency, Retries and Duplicate Events

En bref :

  • Verify the signature using the provider’s documented signing construction, persist the event before acknowledging it and process it asynchronously. Deduplicate using a documented immutable event or delivery ID where available, protect downstream actions separately and reconcile local state with the provider API.
  • Design for state convergence, not event order.
Chargement du lecteur AudioNative de synthèse vocale d'Elevenlabs…

Verify the signature using the provider’s documented signing construction, persist the event before acknowledging it and process it asynchronously. Deduplicate using a documented immutable event or delivery ID where available, protect downstream actions separately and reconcile local state with the provider API.

A duplicate dispute event can trigger two evidence jobs, two merchant notifications or two financial entries. A lost event can hide a dispute until its response window is nearly over. Webhook handling therefore belongs in the reliability design, not only the integration controller.

The receiver should be small and predictable. Authentication, durable receipt and acknowledgment happen first. Business processing happens after the event is safely stored.

At a glance

Receipt and processing take separate paths
  1. 1. Authenticate

    Verify the provider signature using its documented signing construction; preserve the request data that verifier requires.

  2. 2. Persist

    Store provider and account scope, documented receipt identity or version, type, protected payload, receipt time and authentication result.

  3. 3. Acknowledge

    Return a successful response after durable receipt, not after all downstream work.

  4. 4. Deduplicate

    Use a documented delivery identity with provider and account scope; define a resource-version fallback when the schema lacks a delivery ID.

Authenticated duplicate already stored → acknowledge without repeating work. New receipt → process asynchronously, retry safely and reconcile provider state.

Controls after durable receipt
Order safely

Use documented resource versions and valid state transitions; retrieve current provider state when ordering is ambiguous.

Retry

Retry transient processing failures with bounded backoff and dead-letter handling.

Reconcile

Compare provider state and local state on a schedule to find missed events.

Assume at-least-once delivery

Webhook providers retry when they do not receive a successful acknowledgment. Networks and proxies can also leave the sender uncertain whether a request completed. HTTP semantics explain why repeating a non-idempotent operation without a safety mechanism can create duplicate effects.

Design the consumer so processing the same event more than once produces the same durable state. A unique event record is the first guard. Idempotency at each downstream action is the second.

Verify the provider signature before business processing

Signature verification should use the raw request body and the correct secret for the environment or platform account. Reject requests outside the accepted timestamp window when the provider includes one. Rotate secrets through an overlap period rather than replacing them without coordination.

For Chargeflow, the documented HMAC construction combines the HTTP method, request path and serialized body, using the API Secret Key. Follow that exact construction rather than assuming a raw-body-only hash. Keep access and signing keys separate and compare signatures in constant time.

Do not log secrets or full payloads indiscriminately. Store enough structured metadata and a protected payload copy to support replay and investigation.

Separate receipt from processing

The HTTP handler should validate, persist and acknowledge quickly. A worker can then resolve the merchant, update the canonical dispute, trigger evidence or notify the merchant. This prevents slow dependencies from causing provider retries and duplicate deliveries. Preserve merchant ownership through the worker and export boundaries.

Use an inbox table or durable queue with event status, attempt count and last error. A transaction should insert the event and enqueue or mark it ready atomically so an accepted event cannot disappear between those operations.

Handle ordering with state rules

Events may arrive out of order, especially after retries or a temporary outage. Do not trust receipt order. Compare source timestamps or versions and apply only valid state transitions. Preserve every event even when it does not change the current projection. Keep the original source alongside the canonical dispute state.

A timestamp alone may not establish a total order. When versions are absent or ordering is ambiguous, retrieve the current provider resource and apply explicit transition rules instead of guessing from arrival time.

Chargeflow regeneration can emit another evidence-ready event for the same evidence ID with a higher file version. Compare evidence versions separately from receipt deduplication; the evidence resource ID alone must not suppress a newer package.

Reconciliation is part of webhook reliability

Even a well-designed webhook consumer can miss an event because of configuration, expired credentials or provider-side failure. A scheduled job should query recent disputes or evidence records and compare them with local state. Financial effects need their own reconciliation and duplicate-posting controls.

Monitor age of the oldest unprocessed event, delivery failures, signature failures, duplicate rate, dead-letter count and time since the last successful event per merchant integration. A silent connector is more dangerous than a visible error.

Implementation sequence

Implementation sequence
1. Capture the raw body

Preserve the request data needed by the provider’s documented signature verifier.

2. Verify authenticity

Verify the provider signature, environment and structure; check a signed timestamp only where supported.

3. Insert the inbox record

Use a documented immutable event or delivery ID with provider and account scope; define a fallback when absent.

4. Acknowledge receipt

Return success after durable storage, including for a known duplicate.

5. Process asynchronously

Resolve tenant, apply transition rules and perform idempotent downstream actions.

6. Retry safely

Use bounded exponential backoff, classify permanent failures and dead-letter exhausted events.

7. Reconcile state

Poll recent provider records on a schedule and repair missing local events.

8. Test replay

Replay saved fixtures and confirm no duplicate notification, evidence job or ledger entry occurs.

Failure modes and controls

Failure modes and controls
Failure modeBusiness consequenceControl
Business work before acknowledgmentSlow dependencies cause provider retries and duplicates.Persist first and process asynchronously.
Deduplicating by dispute IDLegitimate later events for the same dispute are discarded.Deduplicate by provider event ID and version projections separately.
Returning an error for duplicatesThe provider keeps retrying a successfully stored event.Acknowledge known duplicates as successful receipt.
Blind last-write-winsAn old event moves a case backward.Apply source versions and allowed transition rules.
No reconciliation jobA missing event remains invisible until a merchant complains.Compare local and provider state regularly.

Scroll horizontally when all columns do not fit.

Design for state convergence, not event order

Webhook delivery is an alert that something may have changed, not a guaranteed ordered transaction log. A reliable handler converges the local case to the provider’s current state even when events arrive twice, arrive late or arrive out of order.

Design for state convergence, not event order
Authenticate first

Verify the provider signature before queuing business work.

Persist receipt

Store the documented delivery identity or explicit fallback, receipt time and protected payload before acknowledging.

Acknowledge duplicates

Return success for an authenticated event already stored instead of repeating downstream work.

Queue processing

Complete the HTTP response quickly, then process with bounded retries, backoff and jitter.

Retrieve current state

When the provider supports it, fetch the latest dispute object rather than trusting event sequence.

Apply an idempotent transition

Update only when the incoming or fetched state advances the case under explicit state rules.

Quarantine poison events

Move repeatedly failing events to a visible queue with replay controls and an owner.

Reconcile

Periodically compare provider cases with the local store to find events that were never received.

OWASP recommends signature verification, event deduplication and downstream idempotency; Checkout.com also warns that webhook retries can create duplicate deliveries. The operational runbook should therefore test duplicates, delayed events and replay as normal conditions.

Evidence base: OWASP Webhook Security Cheat Sheet; Checkout.com duplicate webhook guidance.

How Chargeflow Connect fits

Chargeflow's platform webhook catalog includes evidence-ready, evidence-error, integration-access-error and dispute-created events. The documentation calls for signature verification and describes versioned evidence events and expiring download URLs.

The current documentation lists dispute.created but no dispute-update event. Later status changes and final outcomes require API reconciliation. The evidence-ready schema exposes account, dispute, evidence and version fields; it does not establish an immutable delivery ID. Confirm the actual event schema before choosing the receipt key.

Platforms should store permanent resource IDs rather than temporary file links, process every event through a durable inbox and monitor integration-access errors as merchant-facing action items.

Current evidence links expire seven days after issue. Store the evidence ID, retrieve a fresh URL when needed and retain the exact downloaded version used for submission.

Build a reliable event-driven dispute workflow with Chargeflow Connect webhooks.

Foire aux questions

Should a webhook endpoint return success before processing finishes?

Yes, after the event has been authenticated and durably stored. Downstream processing should normally be asynchronous.

What is the best idempotency key for a webhook?

Use a documented immutable event or delivery ID with the provider and account namespace when available. If the event schema has no such ID, define deduplication from its documented resource version and guard each downstream action; do not mistake a webhook configuration ID for a unique delivery ID.

How should duplicate webhooks be answered?

Return the normal successful acknowledgment after confirming the event is already stored.

What if events arrive out of order?

Preserve them and update current state only when the source version, time and transition rules allow it.

Are webhooks enough for synchronization?

No. Use periodic reconciliation against the provider API to detect configuration problems and missed events.

Sources

Chargeflow platform webhook events

Chargeflow Platforms quickstart

RFC 9110: HTTP Semantics

OWASP API Security Top 10

Related platform guides

Chargeflow's Products

Add Chargeback Management to Your Platform

Use a platform-first integration to offer chargeback automation across your merchant base.

PARTAGER CET ARTICLE
Logo circulaire blanc comportant, en son centre, des formes entrelacées, entouré de lignes elliptiques qui se chevauchent et ressemblent à des orbites, ainsi que de losanges bleus dispersés.

rétrofacturation?
Ce n'est plus votre problème.

Récupérez 4 fois plus d'rétrofacturation s et PRÉVENTION jusqu'à 90 % des messages entrants, grâce à l'IA et à un réseau mondial de 20 000 commerçants.

Plus de 600 avis
Aucune carte bancaire n'est nécessaire.
s'abonner

Les dernières actualités sur l'rétrofacturation, la fraude et le commerce électronique, directement dans votre boîte mail. Chaque semaine.

Inscrivez-vous dès maintenant pour ne rien manquer des dernières tendances !
En indiquant votre adresse e-mail, vous acceptez nos Conditions d'utilisation et notre Politique de confidentialité
Schéma composé de lignes pointillées et courbes formant des arcs segmentés, mis en évidence par trois repères en forme de losange bleu situés à gauche.Motif abstrait en forme de grille circulaire, avec des repères en forme de losanges bleus sur un fond moitié noir, moitié blanc.