Skip to content

Design webhook retries around one business action

A booking platform tells your fulfillment system that an order was paid. Fulfillment creates the shipment request, then times out before the booking platform sees the response. The platform sends the same notification again. Your second shipment request now looks just as valid as the first.

Treat the notification and the business action as separate records. A delivery can repeat. It should still result in one shipment request for that paid order.

Follow a delivery through intake

One event Repeated delivery is expected
  1. Receive Check the sender and event ID
  2. Persist Remember accepted events durably
  3. Process Use one key per shipment request
  4. Confirm Recheck uncertain outcomes before retry
The same intake rules apply whenever the sender delivers the event again.

Record the first delivery before acknowledging it

Verify the notification came from the configured sender, then store the event ID and accepted payload in a durable intake record. Use a unique constraint scoped to the sender and account so simultaneous deliveries cannot both insert a new intake record. Acknowledge accepted events after that write commits. Your worker can continue from that record if it restarts.

Keep processing state separately. When a duplicate arrives while the original is still queued, you can acknowledge the duplicate without scheduling a second job.

Key the side effect separately

If two valid events can both say order 412 is ready to ship, their event IDs will differ. Give the shipment request its own business key, such as the order ID and shipment number. When the destination supports idempotent requests, pass a stable key and reuse it on retries. For an ambiguous timeout without that guarantee, look up the destination record or queue a manual check before issuing another request.

Decide how to handle late updates. A delayed paid event for an order that has since been canceled should trigger a check of current order state.

Test the timeout you are afraid of

Send the same event twice and verify the system acknowledges both deliveries but shows one shipment request. Then simulate a successful destination write followed by a lost response. Put that uncertain action and its evidence on the operator’s screen. The test passes when the operator can resolve the original action without guessing whether they are about to ship twice.

More articles.

  1. Test the API contract your integration relies on

    Use representative fixtures and business assertions to catch changes in field meanings, pagination, and errors before an integration release.

  2. Give every blocked integration a person and a next action

    Monitor overdue business outcomes, route alerts to the right people, and give operators enough evidence to verify recovery.

  3. Make a system-of-record map before you integrate

    Decide which system owns each field, who can change it, and how corrections move between your CRM, order system, and accounting software.

All articles

Want a second opinion on your project?

Book a call and we’ll talk through your options.

JurajCEO, QikBuild

You leave the call with

  • What we would build first
  • A rough price range
  • Whether custom software makes sense for you
Book a 30-minute call

Or write to hello@qikbuild.com