DaletGuard supports civilians affected by armed conflict through Families Beyond War. All sides, no political affiliation. About our humanitarian work

Replaying Failed Webhooks Safely

Replaying failed webhooks is how a payment team recovers events that never reached its records, such as refunds or disputes. A provider sends each event to your endpoint, and a missed one can hide a new dispute from your team. However, a careless replay can cause the opposite problem, because the same refund event may then update a record twice. DaletPay checks each signature first, tracks the replay and retry state, and keeps every one of its event handlers idempotent. So your team fixes the cause first, and only then asks the provider to resend each failed webhook event safely.

The goal of a safe event replay when replaying failed webhooks is simple. In short, a replayed event should reach the record once, and only after a valid signature check. That rule applies to all dispute and refund events. Replaying failed webhooks is not hard, but it needs care.

Illustration of eye, receipt, shield for replaying failed webhooks
Key takeaway

Fix the cause before replaying failed webhooks. Every replayed event must pass the webhook signature check before a record changes. A replay rule for each event then stops the same refund from landing twice.

Why a failed webhook can hurt dispute and refund work

Dispute and refund events usually arrive by webhook. A provider posts an event when a case opens or a refund completes. If that failed webhook delivery is never fixed, your record keeps its old state. As a result, support may tell a customer that no refund exists.

Meanwhile, a new dispute can sit unseen while its response window runs. The deadline comes from the network rules in your provider's dispute notice. Therefore, a missed webhook event deserves a daily check, not a monthly one.

In practice, replaying failed webhooks early keeps the dispute clock in view. The chargeback operations guide shows how dispute and refund events feed the wider routine.

How a failed event shows up in the log view

DaletPay groups webhook deliveries by endpoint for each provider. Each delivery shows its status, its attempts, any error text and the time it was processed. A delivery that failed the check is marked failed, and it changed no record. Also, sandbox and live endpoints appear apart, so a test event is not mistaken for a live one.

Check the signature on a replay before a record can change

A replayed event is still an inbound request. Therefore, it must pass the same webhook signature check as the first delivery. Keep this rule in mind when replaying failed webhooks by hand or by script. DaletPay keeps the raw body until the check is finished, since the signature covers the exact bytes sent.

When the signature is valid, the delivery is marked verified and the matching record is updated. In contrast, when the signature is invalid, the delivery is marked failed and no record changes. In that case the endpoint returns a 400 response.

As a result, nothing else runs until a later webhook signature check passes. The webhook event verification page walks through both branches in full. Replaying failed webhooks never skips this step.

Why a parsed copy of the body can fail the check

Parsing can change spacing or field order. However, the provider signed the original bytes, so a rebuilt body will not match. As a result, the webhook signature check must run on the raw body every time.

Each provider uses its own signature scheme. For example, some use a keyed hash with a shared secret, while others send a public key signature. The HMAC method in RFC 2104 (opens in new tab) defines the keyed hash idea in plain technical terms.

Illustration for Replaying Failed Webhooks Safely

Track the replay and retry state of every webhook delivery

Providers retry a delivery that gets no timely answer. The retry carries the same event identifier as the first attempt. DaletPay keeps a record of the processed events for each endpoint. As a result, a repeated identifier is reported as replayed and is not applied again.

This rule is the core of idempotent event handling for replaying failed webhooks. Specifically, a handler that sees the same event twice should change the record once. Without idempotent event handling, replaying failed webhooks would be risky.

In fact, the inbound rule mirrors the idempotency key on your own outbound actions. The idempotency keys article covers that outbound half.

How a retry differs from a replay in the log

A retry is the provider trying the same delivery again. By contrast, a replay is a copy of an event the platform has already processed. The first may still change the record, if no earlier copy passed. The second is shown as a replayed delivery and leaves the record as it was.

Together, these two signals form the webhook retry state you read each day. A webhook replay should never move a record backward. Similarly, they show why safe repeat handling counts most in an outage. Replaying failed webhooks after an outage sends many copies at once, and each one meets the same rule.

Late events need a separate rule of their own too

Providers can also send events out of order. For that reason, compare each event with the record's current state first. If the record already reflects a later event, keep the newer state. Otherwise an old refund update could overwrite a newer one.

A safe routine for replaying failed webhooks at your desk

Every gap in the log needs a clear path back. A missed webhook event is a gap to fix, not a guess to make. Five steps keep the record accurate while you recover a lost event. Use them each time you start replaying failed webhooks.

  1. Read the error and note the attempt count on the delivery.
  2. Confirm the event in the provider's own dashboard before you act on it.
  3. Fix the cause, because a changed signing secret often explains repeat failures.
  4. Ask for a resend through the provider's own option once the cause is fixed.
  5. Check the record and confirm that one verified delivery updated it.

Above all, during failed event recovery, do not edit a record by hand to match the expected outcome. Good failed event recovery lets the provider's data speak.

Instead, let the verified event change it through a safe event replay. The provider's resend option then delivers it again through the same checks.

DaletPay Activity: Read the error screen

Write a short note after you fix a lost event

It names the cause, the fix, the owner and date. Next, link the note to the transaction record that the event changed. That note helps the next person who meets the same failure. Moreover, it gives a later review a clear trail.

What to test in a sandbox before you go live

Run each test once for every provider. Do this well before replaying failed webhooks in live use. After all, each provider signs its events in its own way, so one passing test proves little.

Compare the Adyen HMAC signature guide (opens in new tab) with the PayPal webhooks guide (opens in new tab). The open Standard Webhooks (opens in new tab) specification describes a neutral pattern. DaletPay works with 146 payment services and checks each one's signing scheme.

  • A valid event should update the matching record once.
  • An invalid signature should fail, and nothing should change.
  • A duplicate event should show as a replayed delivery in the log.
  • A late event should leave the newer state on the record.

Next, keep the results with the provider's capability card, and note which dispute and refund events each test covered. Similarly, repeat the tests after any change to an endpoint or secret. The hands-on webhook lab runs the same event replay routine with a trainer. It also covers the webhook signature check and idempotent event handling for dispute and refund events.

Keep every replay slow, checked and written down for review

Replaying failed webhooks is safe when three rules hold. First, the webhook signature check runs before any record changes. Second, idempotent event handling stops a second update from the same event.

Finally, a person fixes the cause and records each recovery. As a result, replaying failed webhooks becomes a calm, routine task. Also, each webhook replay leaves a record that a reviewer can follow. The webhook verification basics article is a good next read.

A diagram of 3 connected steps, each with a small drawing: Webhook signature check, Webhook replay, Safe.

What engineers ask when they replay a webhook that failed

Does a replayed event skip the webhook signature check?

No, a replayed event is still an inbound request, so it passes the same check as the first delivery. DaletPay keeps the raw body until the check ends, because the signature covers the exact bytes the provider sent. An event that fails the check is marked failed, receives a 400 response and changes no record.

Can DaletPay resend failed dispute and refund events from the workspace?

The workspace shows each delivery with its status, attempts and error text, which is where most recoveries start. After the fix, the provider's own resend option delivers the event again.

Why does idempotent event handling matter for dispute and refund events?

Providers retry deliveries that get no timely answer, and each copy carries the same event identifier as the first. DaletPay keeps a record of processed events, so a repeated identifier is reported as replayed and not applied a second time. That rule stops a refund or dispute update from landing twice on one record.

Should we fix a record by hand when dispute and refund events go missing?

No, a hand edit hides the gap that the delivery view and the reconciliation report should show. Confirm the event in the provider's dashboard, fix the cause and ask the provider to send the event again. Then check that the verified delivery updated the record, and note the recovery with its date and owner.

How often should we drill the webhook signature check and replays?

A short sandbox drill each quarter works well, with one wrong signature, one skipped event and one repeated event. Time how long the team takes to find each cause and to write the recovery note. The webhook lab class runs the same drill with signature checks, retry state and idempotent handlers.

See how DaletPay fits the providers your team uses today

Book a short meeting for a walkthrough with your own providers in mind, or join an in-person class to learn the method first.