Implementing a Webhook Handler
When implementing a webhook endpoint, clients must stick to the following rules to avoid failed event delivery:
-
The endpoint must respond to the webhook event with an HTTP status code in the range 2xx. Any other status code, including redirecting with a 3xx code, is a failure.
-
The endpoint must respond quickly to the webhook event request. Make sure to respond with a 2xx code before starting any slow processes or waiting for asynchronous work to complete.
When a failure occurs, whether due to a network error, a non-2xx status code, or a timeout, Everee tries to deliver the event up to 20 times. Retries are delayed with an increasing backoff.
Attempt n is made roughly n4.5 + 60n seconds after the event, plus up to 60 seconds of random jitter. For example, attempt 8 comes about 3.4 hours after the event, and attempt 19 about 158 hours (6.6 days) after it. Delivery attempts stop after about 6.6 days overall.
Coming soon: reading delivery attemptsReading a webhook's delivery attempts through the API is coming soon.
After the last attempt fails, Everee will stop trying to deliver the webhook event, and information about the relevant object will need to be fetched from the Everee API on demand.
It’s possible to occasionally receive the same webhook event more than once. Clients should ensure their webhook endpoint is idempotent by keeping track of the unique ID of the event (in the payload's id property). If a duplicate event is received, clients should skip processing it and respond with an HTTP status code 2xx.
Updated 17 days ago