XydonTech
Home / Blog / Logistics
Logistics 5 min read

Building Custom Shipment Tracking Software: Beyond the Carrier API

Carrier APIs give you events. Shipment tracking software turns those events into operational visibility. Here's what that build actually involves.

XT
XydonTech Team
November 19, 2026

Every logistics operation depends on knowing where packages are. The obvious assumption is that carrier APIs solve this problem. They don’t — they just provide raw material.

A carrier API gives you events. A shipment tracking system turns those events into something operational: unified visibility across multiple carriers, real-time updates to customers, exception detection, and automated escalation when something goes wrong.

That’s a larger build than most people expect.

What Carrier APIs Actually Provide

Each carrier (FedEx, UPS, DHL, regional carriers) exposes tracking data through its own API. If you’re fortunate, it’s a REST endpoint. More often, it’s SOAP, proprietary XML, or a file dump.

The core output is the same: a sequence of events tied to a tracking number.

Event: "In Transit"
Timestamp: 2026-11-19T14:32:00Z
Location: Chicago Distribution Center

What’s missing from this picture:

  • Delays in delivery. Carrier events lag reality by hours. A package left the facility two hours ago, but the event arrives now.
  • Missing intermediate events. A carrier might report “picked up” and then “delivered,” skipping the entire transit stage. You don’t know if the package is in a truck or sitting on a dock.
  • Inconsistent formats. One carrier uses ISO timestamps, another uses Unix milliseconds. One reports city + state, another uses geographic coordinates. Event names differ (In Transit, On Way, En Route).
  • No anomaly signals in the event stream. A delayed shipment looks identical to a normal one until it’s visibly overdue.

That’s the gap. Carrier APIs aren’t designed to be a tracking system. They’re designed to answer one question: “where is this package?” You need a system that answers a dozen other questions.

Normalising Across Carriers

The first real work is building an abstraction layer that translates carrier-specific event data into your internal model.

This means:

  • Parsing heterogeneous formats. Each carrier’s API response requires its own parser. This is tedious, not hard, but it scales quickly. By the tenth carrier, you’ve written ten parsers.
  • Timestamp reconciliation. Convert everything to a standard timezone and format. Track the event’s occurrence time separately from when you received it.
  • Location normalization. Map “CHICAGO_IL_USA” and “Chicago Distribution Center” and “41.8781° N, 87.6298° W” to the same canonical location.
  • Event type mapping. Create your own event taxonomy. PICKED_UP, IN_TRANSIT, OUT_FOR_DELIVERY, DELIVERED, FAILED_DELIVERY. Map each carrier’s native events to your types.

The result is a unified event model — your internal representation of what happened to a shipment, independent of which carrier moved it.

{
  "trackingNumber": "ABC123XYZ",
  "carrier": "fedex",
  "event": "IN_TRANSIT",
  "occurredAt": "2026-11-19T14:32:00Z",
  "receivedAt": "2026-11-19T14:35:12Z",
  "location": {
    "facility": "CHICAGO_DISTRIBUTION_CENTER",
    "city": "Chicago",
    "state": "IL",
    "country": "US"
  }
}

This normalization is permanent infrastructure. You’ll carry it forward even as you add new carriers or redesign other parts of the system.

Real-Time Push to Customers

Once you have normalized events, the next problem is pushing them to customers fast and reliably.

Polling the carrier API every few minutes works, but it’s slow and expensive. The better approach is event-driven architecture:

  • Webhook ingestion. Many carriers (not all) support pushing events to your webhook. When a carrier’s API detects a status change, it POSTs to your endpoint immediately.
  • Deduplication and idempotency. Webhooks are not guaranteed to arrive once. The same event may arrive multiple times or out of order. Your system must detect duplicates and replay events idempotently.
  • Customer push channels. Once you have an event, push it to the customer through WebSocket (real-time web UI), SMS, email, or push notification. Different channels have different latency and cost profiles.

This layer is where real-time visibility lives. The latency between “package entered facility” and “customer sees update” drops from hours to seconds.

Exception Detection and Alerting

Here’s where tracking becomes operational. A shipment that’s been “In Transit” for seven days is a problem. So is a shipment that hasn’t updated in 48 hours. So is a package that entered the wrong distribution center.

You need:

  • SLA tracking. Define expected delivery timelines by route and carrier. Detect when a shipment falls outside the window.
  • Stuck shipment detection. If the last event is older than a threshold (configurable per shipment type), flag it. Same for shipments that haven’t progressed in X hours.
  • Route anomalies. If a package headed to Los Angeles is scanned in Miami, something’s wrong. Detect geographical inconsistencies.
  • Failed delivery escalation. When a carrier reports “failed to deliver,” automatically escalate. Trigger reattempt requests, notify the merchant, alert the customer.

Each exception type has its own workflow. Some auto-resolve (a stuck shipment’s next event will clear it). Others require immediate human intervention.

Building the Data Foundation

All of this requires careful schema design:

  • Shipment records. One per tracking number, with metadata: merchant, customer, expected delivery date, carrier, current status.
  • Event immutability. Events are append-only. Never update or delete an event. Query history becomes simple: sort by timestamp.
  • Status derivation. Current shipment status is always derived from the latest event, never stored directly. This keeps data consistent.
  • Exception state. Track active exceptions separately: flagged for manual review, reason, timestamp created, timestamp resolved.

This foundation is what makes debugging, reporting, and customer communication possible.

Implementation Considerations

  • Polling strategy: If webhooks aren’t available, batch carriers into groups and poll on a staggered schedule. Aggressive polling (every minute) hits API rate limits fast.
  • Retry logic: Webhook delivery fails. Have automatic retry with exponential backoff and a dead-letter queue for events that fail after N attempts.
  • Time zone handling: Timestamps mean nothing without time zone info. Store everything in UTC, convert to customer/merchant timezone only on display.
  • Testing: Mock carrier APIs thoroughly. Test parsing, deduplication, exception detection, and push logic independently.

The payoff is operational clarity: you know where every package is, what’s going wrong, and what needs immediate attention. That visibility converts directly to lower support costs and higher customer satisfaction.

That’s the build.

#Logistics #shipment tracking #API #real-time #carrier
Ready to automate your operations?

We build custom software that fits how your business actually works.

Start a conversation