ePages-de/epages-docs

Document webhook retry policy

Closed this issue · 3 comments

tswfi commented

In the webhooks section it would be good to document the retry policy for the webhook delivery.

https://developer.epages.com/beyond-docs/#order_events_callback

Draft for public documentation of the retry policy:

Retry policy

If the invocation of the webhook subscription's callbackUri (subsequently referred to as "delivery") returns with a HTTP status code greater or equal 400, it is regarded as failure. The delivery is retried after a few milliseconds. If this fails again, it is retried once again after about two seconds.

Internally, a failure count for the subscription gets incremented. If and only if the failure count is less than three, the delivery will be retried for an event. New events will keep on to be delivered, though.

After a successful delivery, the failure count gets reset.

Known limitations

It is not possible to replay past events. So, once the retry is given up, the events are gone.

Assuming a subscription which always fails, currently, we always keep on delivering the webhook, just without retry. In future, we might automatically deactivate subscriptions with a too high failure rate.

Known issues

If multiple clients have subscriptions on a particular event in one shop, if one delivery fails, it will immediately start with the retry, before processing the other pending deliveries. Once a retry is executed, it will loop over all the subscriptions and attempt to deliver the webhook. This can lead to skipped deliveries in the case of more than two always failing subscriptions. And to duplicate deliveries in case of preceding successful deliveries.

We have reworked our retry policy and have included it in the API documentation:

https://developer.epages.com/beyond-docs/#list_webhook_subscription_failures

Selection_221

TL;DR

We don't do automatic retries. But we provide an endpoint to show previously failed webhook deliveries. And we provide a possibility to retry failed webhook deliveries.