Skip to main content

Reopen cancelled shipments

PATCH
/api/v1/shipments/reopen

Undoes a cancellation: each shipment goes back to NEW, ready to be picked up again.

Only CANCELED shipments, and only your own. Ownership is decided by your credentials, never by the request: the sub-accounts you may act on come from the authenticated principal, and a subAccountId in the body is ignored. An API key must be bound to a sub-account — an unbound key is rejected with 403 rather than falling back to everything its owner can reach. Every AWB is checked before anything is written — if one of them is missing, is not cancelled, or falls outside your scope, the whole request is rejected and nothing changes. There are no partial results.

NEW is the only target, because a cancelled parcel has no place in the network any more: nothing is holding it and no branch is expecting it, so the only honest state to reopen it into is one waiting for pickup.

What it writes​

TableWhat lands there
shp_shipmentstatus = NEW, audit_date, last_event = SHIPMENT_REOPENED
shp_shipment_historyone row per AWB, carrying the acting user
shp_shipment_event_historySHIPMENT_REOPENED per AWB
shp_shipment_update_historythe CANCELED → NEW change, attributed to you

What it does NOT do​

The original cancellation stays visible in the shipment's timeline. It is not hidden or removed, because it genuinely happened and was then undone — unlike a delivery recorded in error, which is retracted. A shipment cancelled and reopened reads exactly like that.

Request​

Responses​

200 OK

The AWBs that were reopened

400 Bad Request

An AWB is not cancelled — it was already reopened, or never cancelled.

403 Forbidden

One of the AWBs falls outside the sub-accounts your credentials cover, or the API key used is not bound to a sub-account.

404 Not Found

One of the AWBs does not exist.