Skip to main content
HomeBlogGuidesHow to Schedule Tracking API Polling by Shipment Status and Age

How to Schedule Tracking API Polling by Shipment Status and Age

17TRACK

Schedule tracking API polls with a policy that considers both a shipment’s latest status and its age: check active shipments more often, slow down when updates are unlikely, and stop routine polling after a terminal outcome is confirmed. Treat the intervals as starting values, not carrier guarantees. Your scheduler should also respect the API provider’s documented limits, handle errors separately from normal polling, and adjust when a new tracking event arrives.

How to Schedule Tracking API Polling by Shipment Status and

For a developer or operations team, the goal is not to poll every shipment as frequently as possible. It is to detect useful changes promptly without spending requests on records that are unlikely to change. That requires a small state model, a request budget, and a clear rule for when each shipment should be checked next.

Build the schedule around events, not just the latest status label

A status such as “in transit” describes a broad phase, not the expected time of the next scan. A parcel scanned an hour ago and one that has shown no movement for eight days may share the same label but need different handling. Store enough information to distinguish them:

  • Shipment age: time since the shipment entered your tracking workflow or another consistently defined starting point.
  • Event age: time since the most recent meaningful carrier event, using the event timestamp when one is available and reliable.
  • Status group: your normalized category for pre-transit, active transit, out for delivery, exception, delivered, or another terminal outcome.
  • Last successful check: when your system last received a valid API response, even if it contained no new event.
  • Next due time: the scheduler’s current decision, which can change after an event, an error, or a notification.

Keep these clocks separate. If you use “time since last poll” as a substitute for event age, every successful request makes a stalled shipment appear fresh. If you use shipment age alone, a parcel with a recent scan may be treated as stale merely because it was created several days earlier.

Normalize provider-specific statuses before applying the schedule, but retain the original status and event history. A broad provider label may hide an exception or a final delivery event in its underlying details. Define what counts as a meaningful change for your application: a new physical scan, a status transition, a changed delivery estimate, or another field that actually affects a customer or an operations workflow.

Start with a policy you can explain and revise

The following intervals are an illustrative application policy, not a 17TRACK requirement, a carrier scan schedule, or a promise of update speed. Use them only if they fit your request allowance and service goals.

  • Pre-transit or label created: check every 4–8 hours at first. If no carrier acceptance event appears after 48 hours, widen the interval to 12–24 hours and consider whether an operations follow-up is needed. Polling alone cannot make an unaccepted parcel move.
  • In transit with a recent event: check approximately every 2 hours during the first 48 hours of tracking, then around every 6 hours as the shipment ages. A newly received event can temporarily move the shipment back into a more attentive window.
  • In transit with no new event for several days: widen routine polling to around 12 hours rather than tightening it indefinitely. Separately flag the shipment for investigation if its inactivity exceeds a threshold appropriate to the route and service. More requests do not resolve a physical delay.
  • Out for delivery: check more frequently, for example every 1–2 hours during the relevant delivery window, if a same-day update will change customer communication or support action. Outside that window, return to a slower interval.
  • Exception or failed delivery attempt: check every 2–4 hours for a limited period if a new event could trigger a useful response. Escalate to a person or workflow when action is required; do not treat repeated polling as the response to an exception.
  • Delivered or another confirmed terminal state: stop routine polling after any final confirmation your workflow needs. If your data source can issue corrections, handle those through its documented notification mechanism or a deliberately bounded reconciliation process rather than polling every completed shipment forever.

These categories are operational choices, not universal definitions. In particular, “exception” may encompass events with very different urgency. Split it into actionable and informational subtypes if that distinction changes what your team does. Similarly, do not classify a shipment as delivered solely because an estimated delivery date has passed; use an actual delivery event or the data source’s confirmed terminal status.

Calculate the next poll, then enforce a request budget

Implement the policy as a function that returns a proposed interval from the normalized status, shipment age, event age, and relevant business context. Apply guardrails before writing next_poll_at: a minimum interval, a maximum interval, a retention cutoff, and any documented account or endpoint limits. Add a small amount of scheduling jitter so thousands of shipments created together do not all become due at once.

A practical decision sequence is:

  1. Read the shipment’s current state and determine whether routine polling should stop.
  2. If it remains eligible, choose the base interval for its status and age.
  3. Adjust for a recent event, an actionable exception, or a time-sensitive delivery window.
  4. Check the resulting demand against the request budget; defer lower-priority work if necessary.
  5. Write the next due time atomically with the state version used for the decision.

Budget the whole population, not one shipment at a time. If 10,000 active shipments were each checked every two hours, that policy would require about 120,000 checks in a 24-hour period before retries or other API calls. This is a hypothetical capacity calculation, not an API quota. Estimate demand by status and age cohort, then reserve headroom for newly registered shipments, error retries, and operational spikes. If the forecast exceeds your available allowance, prioritize checks that can change an immediate decision, such as an out-for-delivery update, over routine checks of older inactive records.

Use a durable queue or due-time index to select eligible shipments. Workers should claim jobs with a lease or equivalent concurrency control so two workers do not poll the same record simultaneously. On completion, update the stored tracking state and next due time only if the job still refers to the current version. This matters when an event notification or another worker updates the shipment while a request is in flight.

Keep error retries separate from normal polling

A failed request does not tell you that the shipment has changed status. Preserve its last known tracking state and schedule a bounded technical retry rather than moving it into a new shipment-status category. Handle failures by cause:

  • Rate limiting: honor a Retry-After value when the response supplies one, and reduce request pressure. HTTP 429 indicates that too many requests have been made; the response may specify how long to wait.
  • Temporary server errors or timeouts: retry with backoff and jitter, subject to a retry cap. Keep these retries in the same overall request budget.
  • Authentication or configuration errors: alert the integration owner. Repeating the same request rapidly is unlikely to repair invalid credentials or a malformed setup.
  • Shipment-specific errors: inspect the provider’s documented error meaning before deciding whether to retry, correct the identifier, or stop. Do not assume every “not found” response is permanent or that every unsuccessful registration is transient.

After a temporary failure is resolved, recalculate the ordinary poll schedule from the shipment’s current state. Do not allow accumulated missed jobs to produce an immediate burst of duplicate requests. HTTP standards describe the general meaning of 429 and Retry-After; your tracking provider’s documentation remains the authority for its own quotas, endpoint behavior, and error codes.

Coordinate polling with webhooks and status updates

If your chosen tracking API supports event notifications, use them to reduce unnecessary checks, but verify their availability and behavior in the documentation for the integration you actually use. A notification can update the shipment record and replace its scheduled poll time. Polling can then serve a narrower purpose, such as a bounded check for shipments that remain active without a recent event.

Make notification handling idempotent. The same event may be delivered or processed more than once, and an older event may arrive after a newer one. Compare event identifiers and timestamps where available, keep the event history, and avoid overwriting a confirmed current state solely because a late message was processed last. The same principle applies to poll responses: a request started before a webhook arrived should not blindly reverse the state established by the newer information.

For a 17TRACK Tracking API integration, check the official API documentation for the endpoints, status meanings, notification options, and applicable request rules before implementing this policy. The Tracking API overview is a starting point for evaluating the integration. The schedule in this guide is application-side logic; it should not be mistaken for a provider-defined polling interval or an assurance that every carrier will publish an event within a particular window.

Test the policy against real operational outcomes

Before deploying broadly, replay a sample of historical shipment timelines through the scheduler. Ask when your system would have noticed each meaningful event, not merely how many requests it would have made. Include shipments that receive no early scans, long periods without movement, delivery attempts, exceptions, and completed shipments. Test duplicate and out-of-order events as well as rate-limit and timeout responses.

Monitor request volume by cohort, the time between a source event and its appearance in your system, the proportion of polls that produce a meaningful change, error and rate-limit rates, and the number of shipments that stop polling as intended. A low change rate does not automatically mean an interval is wrong: a time-sensitive delivery cohort may justify more empty checks than an old pre-transit cohort. Review both the cost of checking and the consequence of learning about a change later.

Set an owner for policy changes. When a team asks for faster updates, identify the affected status, route, or workflow and estimate the additional requests before changing a global interval. When polling seems excessive, look for completed shipments that never exited the queue, retries that bypass the budget, and status mappings that leave records indefinitely “active.” The best schedule is one your team can measure, explain, and adjust without losing control of API demand.

FAQ

Should I poll every active shipment at the same interval?

No. Separate recently updated shipments, long-inactive shipments, out-for-delivery parcels, and actionable exceptions. The value of another check differs across those groups. Use shipment and event age to refine broad status labels, and confirm that the combined schedule fits your request budget.

Should a shipment with no new scans be polled more often?

Usually not solely because it is quiet. A lack of events can indicate a physical or reporting gap that extra requests cannot fix. Consider a slower routine interval plus an investigation threshold. A temporary increase is reasonable only when a new event would prompt an immediate action and the request cost is justified.

When should polling stop after delivery?

Stop routine polling once your workflow has a confirmed terminal outcome and any required final check is complete. Decide separately whether you need a bounded reconciliation process for corrections. Do not leave delivered shipments in the active queue without an explicit reason and end condition.

Can webhooks replace polling entirely?

They may reduce polling substantially if the integration offers the events your workflow needs. First verify what notifications are available and how they are delivered. Some teams retain a limited check for active shipments with no recent event, but its frequency should reflect a specific reliability requirement rather than habit.

How do I choose intervals if I do not know carrier scan patterns?

Begin with conservative intervals that fit the documented API rules and your operational response times. Measure how quickly meaningful events become visible and how many checks produce no change. Refine by status, event age, and workflow impact; avoid treating an illustrative interval or one carrier’s behavior as a universal standard.

Sources