PATCH /shipments/{id}

Correct a shipment

Fix a wrong carrier or type on a shipment your own user added, or set its customer, tags and custom fields. No slot.

Fix a shipment already being tracked: its carrier or its type — then it is re-tracked and the stored document refreshed. Both fields are optional and at least one is required; anything omitted keeps its stored value.

An edit CORRECTS a shipment and never re-points it at another container. reference_number is NOT accepted: sending one is a 400, whatever else the body carries. To track a different number, delete this shipment and add the new one — a quick delete usually refunds the slot.

This is the API equivalent of editing a shipment in the dashboard, and the answer to a shipment that landed on the wrong carrier. Before it existed the only routes were ?sealine= on a first add or /shipments/retry-failed, neither of which can re-point a reference you already track at a carrier you name.

An edit CORRECTS a row rather than adding one: it consumes no shipment slot and is not counted against the same-reference daily re-add limit.

A carrier that returns nothing is not an error — the row is updated to what you asked for, carrier discovery is queued, and the response is 200 with still_failed: true. Poll GET /shipments/{id} from there.

Only shipments this key’s own user added: a teammate’s shipment reads 200 on GET and answers 404 here.

customer sets the shipment’s customer, by name. A customer of your account with that name (trimmed, any letter case, not archived; the oldest when two share it) is used, otherwise one is created with the name alone. The shipment is then assigned to that customer and to no other: the field sets the customer, it does not add one more. null or "" removes it. customer alone is a valid body; with carrier or type, both are applied. Reads carry the result as customers. A view-only key gets 403; a plan without customers gets 403 plan_required; at your account’s customer limit a new name is 422 and nothing changes.

Setting the customer sends nothing. But a customer who already has a contact and alerts on is treated exactly as after a dashboard assignment, and can be emailed about this shipment. A customer created through the API has no contact, so nobody can be emailed until a person adds one in the dashboard.

Request

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

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 to correct, or the container / bill-of-lading number you track it by.

Request body

FieldTypeRequiredDescription
carrierstringNo

The carrier SCAC you know is correct, 2-10 alphanumeric characters.

type"container" | "bl"No

Use this when the number was filed as the wrong kind — a bill of lading tracked as a container, or the reverse.

customerstring | nullNo

The customer, by name: found (trimmed, any case) or created with the name alone, and made the shipment’s only customer. null or "" removes it.

tagsarray | nullNo

The shipment’s tags, by name. SETS the list: a name your account has no tag for becomes one, [] or null removes them all. No commas in a name. Past your plan’s tag limit a new name is 402 tag_limit_reached and nothing changes.

custom_fieldsobjectNo

Values by field key. MERGES: only the keys sent change, null clears one. Each value is checked against its field’s type; an unknown or archived key is a 400.

Example request

curl -X PATCH "https://traqocontainer.com/api/v1/shipments/MSCU1234567" \
  -H "Authorization: Bearer YOUR_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{"carrier":"MAEU"}'

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

Responses

Example 200 body:

{
  "success": true,
  "shipment_id": "SHP-1000",
  "carrier": "MAEU",
  "reference_number": "SBXU1184991",
  "type": "container"
}
StatusMeaning
200

Corrected and re-tracked. unchanged: true when the values sent were already stored; still_failed: true when the carrier returned nothing for the new combination — the row was updated either way.

400

Bad request — check required parameters.

401

Invalid or missing API key.

402

tag_limit_reached: tags named a new tag past your plan’s tag limit (limit and plan in data). Nothing was changed.

403

Developer mode off; or, with customer, tags or custom_fields, a view-only role (read_only); or, with customer, a plan without customers (plan_required). Nothing was changed.

404

Resource not found.

409

That reference is already tracked on another shipment in your account; or, with customer, scope_would_hide_row: the change would move the shipment outside your own access.

422

customer_limit_reached: a new customer name at your account’s customer limit. 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.

503

Live tracking is temporarily unavailable. Nothing was changed; retry.

Error bodies and retry advice: Errors.