Skip to main content
Polling means asking the API for the same delivery every few seconds to see whether its status changed. It is the simplest way to start, but webhooks are better for production because HaulStow sends an update only when something happens.

One status check

Read these fields from data:
  • status: the current delivery state;
  • updated_at: when the delivery last changed.

A safe polling loop

If your system cannot receive webhooks yet, poll GET /deliveries/{delivery_id} every 10–15 seconds.
  1. Save the last status and updated_at values.
  2. Fetch the event timeline only when either value changes.
  3. Stop polling at delivered, failed, or cancelled.
  4. Add random jitter when polling many deliveries so requests do not synchronize.
Do not repeatedly list the full delivery collection to track one delivery.
Node.js
Do not poll every second. It adds load, uses your rate-limit allowance, and rarely gives a better customer experience.

Rate-limit handling

Every response includes:
  • RateLimit-Limit: maximum requests in the current window
  • RateLimit-Remaining: requests left in the current window
  • RateLimit-Reset: Unix time in seconds when the window resets
On 429 RATE_LIMIT_EXCEEDED, stop making requests for the number of seconds in Retry-After. If that header is absent, wait until the Unix timestamp in RateLimit-Reset. For a temporary 5xx response, increase the delay before each retry and save X-Request-ID for diagnostics.

Paginating a list

Listing endpoints return one page at a time. meta explains whether another page exists: Cursor-based list endpoints return this metadata:
When has_more is true, pass next_cursor back unchanged:
Do not decode or edit a cursor. When has_more is false or next_cursor is null, you reached the final page.