Retries
If your endpoint is slow or briefly down, the platform tries again later, after newer messages have already arrived.
Webhooks can arrive late, twice, or in the wrong order. How to stop an old update overwriting a new one, and catch the ones that never arrive.
Webhooks are the quickest way to hear about a change: the platform calls your integration the moment an order is paid, edited, or cancelled. But most platforms don’t promise to deliver them in order, or exactly once. A retried “order paid” message can arrive after “order cancelled”. If the integration simply applies each message as it comes, the cancelled order is switched back to paid and sent to the warehouse.
If your endpoint is slow or briefly down, the platform tries again later, after newer messages have already arrived.
Platforms send many webhooks at once from different servers, so two changes a second apart can arrive either way round.
A message your endpoint received but didn’t acknowledge in time is sent again.
After repeated failures, some platforms give up on a message altogether.
Store the record’s last updated time or version number. Ignore any message older than the one you already hold.
On any webhook, fetch the current record from the platform’s API and apply that. The latest state always wins.
Keep the ID of each processed message, so a duplicate is recognised and skipped.
Reply to the platform at once and process the message from a queue. Fewer timeouts means fewer retries and fewer surprises.
Some changes should only move one way. An order that has been cancelled or dispatched shouldn’t go back to paid because a late message says so. Write down which status changes are allowed, for example paid to dispatched but never cancelled to paid, and reject anything else with a log entry. That rule protects you even when the version check isn’t available.
Out-of-order messages are a nuisance; missing ones are worse, because nothing tells you they’re missing. Run a slower check alongside the webhooks that asks the platform for anything changed recently and fills the gaps. For example: an hourly check for orders changed in the last two hours, processed with the same version rules, catches whatever the webhooks missed. Our guide to choosing polling intervals covers how often to run it.
Tell us which platform sends your webhooks and what goes wrong. A few lines are enough.