Webhook Specifications
Learn how AfterShip Shipping verifies and secures all the webhook requests.
| Method | Description |
|---|---|
| POST application/json | When the send request to AfterShip Shipping and webhook is set, we make a POST request to the callback URL you defined on the webhook page. The post body contains a JSON string of the below data. |
Event
| Event_type | Description |
|---|---|
| calculate_rates | When POST /rates API is done |
| create_a_label | When POST /labels API is done |
| cancel_a_label | When POST /cancel-labels API is done |
| manifest_a_label | When POST /manifests API is done |
Header
host: webhook.example.com
content-length: 12345
accept: application/json
am-webhook-signature: xxxxxxxxxxxxxxxx
content-type: application/json
user-agent: xxxxxx
accept-encoding: gzipBody
{ "meta": { "code": 200, "message": "OK", "details": [] }, "data": { "id": "00000000-0000-0000-0000-000000000000", "status": "created", "ship_date": "2022-02-11", "created_at": "2022-02-11T08:10:47+00:00", "updated_at": "2022-02-11T08:10:56+00:00", "tracking_numbers": [ "0000000000" ], "files": { "label": { "paper_size": "4x6", "url": "https://production-download.postmen.com/label/2022-02-11/00000000-0000-0000-0000-000000000000-1644567055796052.pdf", "file_type": "pdf" }, "qr_code": null, "invoice": { "paper_size": "a4", "url": "https://production-download.postmen.com/invoice/2022-02-11/00000000-0000-0000-0000-000000000000-1644567056211077.pdf", "file_type": "pdf" }, "customs_declaration": null, "manifest": null }, "rate": { "shipper_account": { "id": "00000000-0000-0000-0000-000000000000", "slug": "fedex", "description": "[FedEx] AfterShip Shipping Testing Account" }, "service_type": "fedex_international_priority", "service_name": "Fedex International Priority", "pickup_deadline": null, "booking_cut_off": null, "delivery_date": null, "transit_time": null, "error_message": null, "info_message": "No rate quotes returned from carrier.", "charge_weight": null, "total_charge": null, "detailed_charges": [] }, "references": [ "references1" ], "service_type": "fedex_international_priority", "shipper_account": { "id": "00000000-0000-0000-0000-000000000000", "slug": "fedex" }, "service_options": [], "order_number": "references1", "custom_fields": { "ship_code": "01" } }, "event_type": "create_a_label", "date_time": "2022-02-11T08:10:56+00:00" }