Prompt
How do I get delivery status webhooks from a shipping API?
Latest observation
Nov 4, 2026
OpenAI APIWeb search: off
To get delivery status webhooks from a shipping API, you generally need to do four things:
-
Create a webhook endpoint in your app
- This is a public URL that the shipping provider can call, e.g.
https://yourapp.com/webhooks/shipping - It should accept
POSTrequests.
- This is a public URL that the shipping provider can call, e.g.
-
Register that endpoint with the shipping API
- In the shipping provider’s dashboard or API, subscribe to shipment/tracking events such as:
shipment.createdtracking.updateddeliveredin_transitexception
- Some APIs let you choose specific event types; others send all tracking updates.
- In the shipping provider’s dashboard or API, subscribe to shipment/tracking events such as:
-
Verify and secure incoming webhook requests
- Most shipping APIs sign webhook payloads with a secret.
- Your app should verify the signature to ensure the request really came from the provider.
- Also make sure your endpoint uses HTTPS.
-
Process the event and update your system
- Parse the payload to get tracking number, order ID, status, timestamp, etc.
- Update your database/order status accordingly.
- Respond with a quick
200 OKso the provider knows you received it.
Typical flow
- You create a shipment.
- The shipping API starts tracking it.
- Whenever the status changes, the provider sends a webhook to your endpoint.
- Your system updates the order status in near real time.
Example webhook handler
Here’s a simple example in Node.js/Express:
import express from "express";
const app = express();
app.use(express.json());
app.post("/webhooks/shipping", (req, res) => {
const event = req.body;
// Example: check event type
if (event.status === "delivered") {
console.log("Package delivered:", event.tracking_number);
}
res.sendStatus(200);
});
app.listen(3000);
Important best practices
- Verify webhook signatures
- Use idempotency so duplicate webhook deliveries don’t cause repeated updates
- Return quickly; do heavy work asynchronously
- Log payloads for debugging
- Set up retries because webhook providers usually resend on failure
If you’re using a specific shipping API
The exact steps depend on the provider. Common ones:
- Shippo
- EasyPost
- AfterShip
- FedEx/UPS/DHL APIs
- Shopify shipping/tracking apps
If you tell me which shipping API you’re using, I can give you the exact webhook setup steps and sample code for it.