Prompt
How do I debug missing tracking events from a shipping webhook?
Latest observation
Here’s a practical way to debug missing tracking events from a shipping webhook.
1) Confirm the event actually happened
Before debugging your system, verify the carrier/shipping platform emitted the event.
- Check the shipment in the carrier dashboard or API
- Confirm the tracking number changed status
- Look for carrier-side logs or webhook delivery logs
- Verify the event type you expect is supported
If the carrier never sent it, the issue is upstream.
2) Inspect webhook delivery logs
If the shipping provider has webhook delivery history, check:
- Was the webhook sent?
- What was the HTTP response from your server?
- Any retries?
- Timestamp of delivery attempts
- Payload body and event type
Common clues:
200 OKbut your app didn’t process it4xxmeans your endpoint rejected it5xxmeans your endpoint may have been down or errored- Timeouts can cause retries or dropped deliveries depending on provider
3) Log every incoming webhook request
On your endpoint, log at least:
- Request timestamp
- Headers
- Raw body
- Signature verification result
- HTTP status returned
- Processing result / event ID / tracking number
Make sure you log the raw request body before parsing, because parsing bugs can hide payload issues.
4) Verify signature/authentication
Many webhook issues are caused by failed verification:
- Wrong signing secret
- Using parsed body instead of raw body for HMAC verification
- Body modified by middleware
- Clock drift if the scheme uses timestamps
- Header name mismatch
If signature verification fails, log the reason and return a clear 401/403.
5) Check whether your endpoint returns a success fast enough
Webhook providers often require a quick 2xx response.
- Respond immediately
- Queue the payload for async processing
- Avoid slow DB calls or downstream API calls before acking the webhook
If you process inline and time out, the provider may retry or mark delivery failed.
6) Look for deduplication or idempotency bugs
Shipping webhooks are often retried, and sometimes events arrive out of order.
Check whether your system is:
- Dropping duplicates based on tracking number only
- Ignoring events with old timestamps
- Overwriting newer statuses with older ones
- Filtering events you think are redundant but are actually important
Store and dedupe using a stable event ID if available.
7) Validate your event filtering logic
You may be receiving the event but intentionally ignoring it due to code rules.
Examples:
- Only accepting certain event types
- Ignoring test mode events
- Filtering by carrier or account
- Expecting a different JSON field name
- Dropping events with null/empty tracking numbers
Compare the real payload to your parser and handlers.
8) Reproduce with a test webhook
Send a known-good payload directly to your endpoint using:
curl- Postman
- a webhook replay tool from the provider
- a locally captured payload
This helps isolate whether the issue is:
- carrier delivery
- network/routing
- auth/signature verification
- app logic
9) Check infrastructure and network path
If webhooks are failing before your app sees them:
- Is the endpoint publicly reachable?
- DNS correct?
- TLS certificate valid?
- Firewall/WAF blocking requests?
- Load balancer/path routing correct?
- Any rate limiting or bot protection interfering?
Sometimes the endpoint works in a browser but blocks webhook POSTs.
10) Compare expected vs actual payload schema
Missing events can be caused by schema mismatch.
Look for:
- Field renamed by provider
- Nested object path changed
- Status values different from your assumptions
- Arrays vs single objects
- Webhook version changes
Use schema validation and alert on unexpected payload shapes.
11) Handle out-of-order and delayed events
Shipping events may arrive:
- late
- duplicated
- out of order
If your app expects a strict sequence, you may “lose” events logically even though they were delivered. Keep a full event history rather than only the latest status.
12) Add alerting and observability
To catch this sooner:
- Alert on webhook delivery failures
- Alert when expected status transitions don’t occur within a time window
- Track webhook success rate
- Monitor queue depth and processing errors
- Keep replay capability
A good debugging checklist
- Confirm carrier emitted the event
- Check provider delivery logs
- Verify your endpoint received it
- Verify signature/auth
- Confirm your app returned
2xxquickly - Inspect raw payload and event parsing
- Check dedupe/filtering logic
- Replay a sample webhook
- Check infra/network blocking
- Add monitoring for future issues
If you want, I can also give you:
- a webhook debugging checklist for a specific provider like Shippo, EasyPost, UPS, FedEx, or AfterShip
- sample logging code
- a Node/Python/Go example for verifying signatures and replaying payloads