- Model accepted, processing, successful and failed states separately.
- Retrieve an existing operation before repeating a side-effecting request.
- Set deadlines and give operators a visible recovery path.
Model the operation, not only the HTTP call
A shipping request often starts work which outlasts a single network response. Freightcom documents polling for some long-running requests. Your application should distinguish a request being accepted from the shipping operation being complete.
Create explicit internal states for submitted, processing, ready, failed and review required. These are your application’s labels, not a replacement for the API’s response fields. Map the documented response to a state your customer or operator understands. Store the returned reference immediately so another worker is able to continue the process.
Make polling bounded and deliberate
Poll according to documented behaviour and any limits confirmed for your account. Choose a bounded interval and an overall deadline for your application. Do not allow a browser refresh to launch an unlimited collection of independent polling loops for the same request.
A checkout needs a short, understandable waiting experience. An internal shipping job might have a different operational deadline. Define those policies separately. When the deadline is reached, preserve the request reference and offer a recovery action. A stopped interface timer does not prove the remote operation stopped.
Treat retries according to their side effects
Retrieving a status is different from creating a shipment. Before repeating a booking after a timeout, determine whether the original operation succeeded. Otherwise, a network problem risks becoming a duplicate shipment problem.
Use documented unique identifiers according to their defined semantics. Do not invent an idempotency header or assume two different endpoints share the same retry behaviour. Keep your own job reference and a record of what was submitted. If the result remains uncertain, send the job to review rather than repeatedly submitting it.
Prevent stale results from replacing new ones
A customer changes an address while an earlier request is still processing. The earlier result arrives last. Without a revision check, the checkout might show options for the wrong shipment. Assign a revision to the shipment inputs and only display results matching the current revision.
Apply the same discipline to background jobs. A cancelled or replaced order should not continue through an older fulfilment instruction. Your application needs an authoritative state check before a consequential operation, plus a clear record of why a worker stopped.
Test failures as first-class scenarios
- Connection failure before a request is sent.
- Timeout after the server accepted a request.
- Processing which lasts longer than the interface deadline.
- Validation failure requiring corrected input.
- A worker restarting while a shipment is processing.
For each case, write the expected customer message, operator action and stored record. Log timing, endpoint, status and request references without logging credentials. Count uncertain bookings separately from ordinary validation errors. They need different recovery procedures.
Review recovery with the people shipping orders. A technically safe workflow still fails operationally if staff cannot tell whether to wait, retry a retrieval or ask for help.
Common questions
Does a timeout mean a booking failed?
No. The request might have been accepted. Reconcile the original operation before repeating a booking.
Does this article define Freightcom rate limits?
No. Use the official documentation and account guidance for limits and endpoint-specific behaviour.
References & next steps
This article provides integration planning guidance. Confirm endpoint fields and behaviour in the official documentation before implementation.

