QUICKSTART
API Quick Start
Authentication
SignString
OAuth
Overview
Getting Started
Scope List
Versioning
Rate Limit
Body Envelope
Request Errors
Try API Endpoints
CHANGELOG
Changelog
Migration Guide
REFERENCE
API Overview
Estimated delivery date
Batch prediction for the Estimated Delivery Date
post
Tracking
Get trackings
get
Create a tracking
post
Get a tracking by ID
get
Update a tracking by ID
put
Delete a tracking by ID
delete
Retrack an expired tracking by ID
post
Mark tracking as completed by ID
post
Get a tracking (Legacy)
get
Update a tracking (Legacy)
put
Delete a tracking (Legacy)
delete
Retrack an expired tracking (Legacy)
post
Mark tracking as completed (Legacy)
post
Courier
Get user activated couriers
get
Detect courier
post
Get all couriers
get
Last Checkpoint
Get last checkpoint by tracking ID
get
Get last checkpoint (Legacy)
get
Notification
Get tracking notification by tracking ID
get
Add a notification by tracking ID
post
Remove a notification by tracking ID
post
Get tracking notification (Legacy)
get
Add a notification (Legacy)
post
Remove a notification (Legacy)
post
MODEL
Tracking
Courier
Checkpoint
Notification
ENUM
Additional Tracking Fields
Delivery Statuses
Delivery Sub-statuses
Slug Groups
Webhook
Webhook Overview
Webhook Versioning
Webhook Specifications
Webhook Signature
Webhook OAuth 2.0
Webhook Outgoing IPs
Webhook Changelog
OTHERS
Supported Couriers
CSV Upload & CSV Auto-Fetch
Shipment CSV Export
Order CSV Export
SDK
Android SDK
iOS SDK
Java SDK
Node.js SDK
.NET SDK
Python SDK
Ruby Gem
PHP SDK
Golang SDK
Open Source
phone
email-verifier
Support
Contact Support

Webhook Overview

AfterShip Tracking can send webhook events to notify your system when a particular event has happened. Learn to set up webhooks.


You can enable the webhook from the notifications webhooks settings

  • Select Webhook version, the latest version is preferred
  • Insert Webhook URL, you can create up to 10 Webhook URLs. Your URL port number should be 80,443,8080.
  • (Optional) Add custom headers(up to 5 per URL) to the URL for authentication
  • (Optional) To validate the webhook URL, click on Send test webhook to initiate a test event. It is crucial to ensure that the HTTP response code falls within the range of 200 to 299. If AfterShip does not receive a valid response code within this range, it will be considered as a failed validation.”
  • Click Save to create the webhook destination URL

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 verify the request using the AfterShip webhook signature or verify the request by the basic authentication, verification (bearer) token, or secret key base on the custom headers.

AfterShip Tracking sends event driven data to webhook URL via POST method. In case of an unsuccessful event (HTTP response code NOT between 200 and 299), AfterShip Tracking attempts to deliver your webhooks for up to 14 times with an exponential back off. The attempts are based on your original webhook setting of the first attempt.

The current attempt webhook delay is calculated by this formula: 2^(number of retry) x 30s

# of attempt# of retryDelay (sec) before send outAcc. Delay (sec)
1000
213030
326090
43120210
54240450
65480930
769601890
8719203810
9838407650
109768015330
11101536030690
12113072061410
131261440122850
1413122880245730

For example, If the attempt fails, AfterShip Tracking will retry the 2nd attempt 30s later. If the 7th attempts fail, AfterShip Tracking retry the 8th attempt 960s later If the 14th attempts fail, AfterShip Tracking will not send out that webhook any more.