n8n
Run an n8n workflow whenever a shipment changes.
Set up
- In n8n, add a Webhook node with method
POST, and copy its production URL. - Register it with Airtrack, choosing the events you want:
bash
curl -X POST https://www.air-cargo.io/api/webhooks/ \
-H "Authorization: Bearer <api-key>" \
-H "Content-Type: application/json" \
-d '{"url": "https://your-n8n.example/webhook/airtrack", "events": ["shipment.exception", "shipment.delivered"]}'- Send a test with
POST /api/webhooks/{id}/testand use it to map fields in the next nodes.
The fields are under $json.body, for example $json.body.shipment.awb, $json.body.shipment.status, $json.body.event.iata_code and $json.body.event.location. See the payload.
Example
[Webhook] → [IF shipment.status = exception] → [Send email to operations]
→ [Post to Slack]Template
Import airtrack-n8n-workflow.json: a webhook node, an exception check and an email alert. Set your SMTP credentials and recipient after importing.
For signature checks in n8n, compute the HMAC-SHA256 of the raw body in a Crypto node and compare it with the X-Webhook-Signature header.