PATCH /shipments/{id}/containers/{number}/milestones

Set container milestones

Record a box picked up, delivered or empty returned where the carrier said nothing. Free-time clocks still follow the carrier.

Record what you know about one container that the carrier did not say: when it was picked up, delivered, or its empty returned. An object sets a milestone, null clears it, a key you leave out is untouched. Answers the box as it now reads — the same shape GET /shipments/{id} publishes in container_milestones.

The carrier wins. Where the carrier reported a milestone for this box, its date is the one shown, and setting your own is a 409 carrier_reported. Clearing is always allowed.

Recorded for your team and the API; free-time clocks and alerts still follow the carrier. It never frees a shipment slot and never stops a shipment refreshing.

Nothing can be set before that box reaches its port of discharge, even when others on the shipment have: 409 not_arrived. at may not be more than 10 minutes in the future, nor before the box landed. Picked up, delivered and empty returned may not go backwards — a delivery no earlier than the pickup, a return no earlier than either — and an empty return needs a pickup on that box first (400). note is up to 120 characters. Only shipments this key’s own user added; a view-only key gets 403 read_only. Answers 404 while manual milestones are switched off for this deployment.

Request

PATCH https://traqocontainer.com/api/v1/shipments/{id}/containers/{number}/milestones

Authentication.

Your API key as a Bearer token: Authorization: Bearer YOUR_API_KEY.

Rate limit.Each API key gets 120 requests per minute by default; your key's own budget comes back in the X-RateLimit-* headers.Limits by plan.

Parameters

NameInTypeRequiredDescription
idpathstringYes

The shipment id, or the container / bill-of-lading number you track it by.

numberpathstringYes

The container number on that shipment, e.g. MSCU1234567.

Request body

FieldTypeRequiredDescription
picked_upobject | nullNo

Set picked up, or null to clear it.

deliveredobject | nullNo

Set delivered, or null to clear it.

empty_returnedobject | nullNo

Set empty returned, or null to clear it.

Example request

curl -X PATCH "https://traqocontainer.com/api/v1/shipments/MSCU1234567/containers/MSCU1234567/milestones" \
  -H "Authorization: Bearer YOUR_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{"picked_up":{"at":"2026-11-03T14:20:00Z","note":"Truck 14"}}'

Run it in the sandbox — no key, no account: the same request answers at https://traqocontainer.com/api/v1/sandbox/shipments/{id}/containers/{number}/milestones with a schema-identical reply.

Responses

Example 200 body:

{
  "success": true,
  "shipment_id": "SHP-1000",
  "data": {
    "container_number": "MSCU1234567",
    "picked_up": {
      "at": "2026-11-03T14:20:00Z",
      "source": "manual",
      "note": "Truck 14"
    },
    "delivered": null,
    "empty_returned": null
  }
}
StatusMeaning
200

Saved. The box with every milestone as it now reads.

400

Bad request — check required parameters.

401

Invalid or missing API key.

403

Developer mode not enabled, or the feature is not on your plan.

404

Not a shipment in your account (shipment_not_found), not a container on it (container_not_found), or manual milestones are not switched on.

409

carrier_reported: the carrier already reported that milestone for this box. not_arrived: this box has not reached its port of discharge yet. Nothing was changed.

429

Rate limit exceeded — see the Retry-After header. The body names the plan the limit was computed from (plan, always the ORGANISATION’s plan, not the row your key hangs off) and what would raise it: upgrade with next_plan and next_limit_per_min, or contactUrl when there is no plan above yours. Exactly one of the two is present.

Error bodies and retry advice: Errors.