Webhook Overview
This spec describes how AfterShip Returns Center sends webhook events. You can implement your webhook callback endpoint accordingly.
When a "return" is created or updated in the Returns Center (i.e. A customer submitted a return request), the system will emit a corresponding event by sending a HTTP POST payload to the webhook's configured URL. (updates includes only the returns of your own connected stores in AfterShip Returns Center)
Please checkout the detail payload on this page.
How to setup the Webhooks
So far we only support this feature upon request. Please contact support@aftership.com for an integration request. We will need you to provide an HTTPS URL and we will integrate this into our webhook delivery destinations.
After registration, we will provide a webhook secret for you to verify our webhooks delivery.
Securing Webhooks
We currently support either HTTP or HTTPS URLs, so you can have security by using an SSL-enabled URL. But keep in mind that your endpoint is going to be wide-open on the internet, and you might not want others to be able to submit random data to your systems. At this time, aside from trying to keep the URL private, our best advice is to simply include a secret key in the URL that you provide and check the secret GET parameter in your scripts.
Retry Webhooks
The webhook receiver shall responde a 200 status code. In any case that the AfterShip Returns Center did not receive a 200 at its initial delivery, retries will happen. The same POST request will be re-attempted up to 14 times in increasing intervals: 2^(number_of_fail-1) x 30s e.g. If the attempt fail, AfterShip will retry the 2nd attempt 30s later. If the 5th attempts fail, AfterShip retry the 6th attempt 960s later If the 14th attempts fail, AfterShip will not send out that webhook any more.