E-commerce
AfterShip Webhooks
Shipment tracking, returns and shipping labels. Receive tracking status and delivery-date updates, return lifecycle events, and shipping events.
Connecting AfterShip to Hookbase
Create a source in Hookbase first — it gives you an ingest URL to paste into AfterShip. Then:
- 1In your AfterShip admin, open Settings → Webhooks (Tracking: Settings → Notifications → Webhooks) and add your Hookbase ingest URL
- 2Copy the webhook secret into this Hookbase source
- 3Hookbase verifies the base64 signature in whichever of the product's headers is present, deduplicates by event_id (Tracking) or id (Returns), and uses event as the event type
Signature verification
Set the source's provider to aftership and paste the signing secret. Every request is checked before the event is stored, and anything that fails is rejected rather than quietly recorded.
- Algorithm
- HMAC-SHA256 of the raw body, base64-encoded
- Header
- aftership-hmac-sha256
- Where to find the secret
- The webhook secret in your AfterShip admin: Settings → Webhooks (Settings → Notifications in older Tracking accounts). Tracking signs in aftership-hmac-sha256, Returns in as-signature-hmac-sha256, and Shipping (and Returns for organizations created before 2022-10-25) in am-webhook-signature as "hmac-sha256=<signature>"; Hookbase reads whichever is present.
AfterShip event types
11 of the events people route most often. Hookbase accepts every event AfterShip sends, whether or not it is listed here.
tracking_update
Tracking: a shipment changed status (in transit, out for delivery, delivered, exception, ...)
edd_revise
Tracking: the estimated delivery date changed
tracking_pending_time
Tracking: a shipment has been pending longer than your threshold
return.submitted
Returns: a shopper submitted a return
return.approved
Returns: a return was approved
return.rejected
Returns: a return was rejected
return.resolved
Returns: a return was resolved
return.expired
Returns: an approved return expired
return.shipment.updated
Returns: a return shipment's tracking status changed
return.receiving.created
Returns: returned items were received
return.restock.created
Returns: items were restocked
What a AfterShip webhook looks like
A tracking_update payload. Hookbase stores the raw body exactly as it arrived, so this is also what you get back on a replay.
{
"event": "tracking_update",
"event_id": "94dadd60-ed26-46d0-aa52-3ced925a50ff",
"is_tracking_first_tag": true,
"msg": {
"id": "00000000000000000000000000000000",
"slug": "usps",
"tracking_number": "0000000000000000",
"tag": "InTransit",
"subtag": "InTransit_001",
"subtag_message": "In Transit",
"order_number": "1001",
"updated_at": "2021-01-14T10:41:24+00:00"
},
"ts": 1712741696
}Start receiving AfterShip webhooks
Create a source, paste the URL into AfterShip, and watch the first event arrive. The free tier includes 1,000 events a month.
Get Started Free