Update a shipment (before pickup)
Updates a shipment the caller owns, across the three tables it spans: shp_shipment (including cash, the COD amount), shp_shipment_details (including the recipient of record and an optional proof-of-item-value file) and shp_consignees (the recipient destination). Only the fields present in the body are written.
Allowed only BEFORE pickup. The shipment must still be NEW or AWAITING_PICKUP; any later status is rejected with 400. Once a runner has collected the parcel it has been sorted, labelled and routed against the address as it stood, so the sender can no longer change it unilaterally — an operator has to.
Destination: send districtId only. The city, governorate and serving branch are derived from the district, and a moved district re-routes the delivery branch and re-prices the shipment automatically. cityId / governorateId are deprecated: they are still accepted, but are cross-checked against the district and a mismatch is a 400.
A settled shipment can additionally no longer be re-weighed or re-measured. The sub-account is taken from the API key or from the caller memberships — never from the body.
Returns the saved shipment, in the same shape as GET /shipments/{awb}, so the details page can re-render without a follow-up fetch. Read the derived fields back from it rather than assuming what you sent: a district change also re-derives the city and governorate, may move the delivery branch, and re-prices absFees.
Request
Responses
200 OK
Shipment updated. The body is the saved shipment, identical in shape to GET /shipments/{awb}.
400 Bad Request
The shipment is past pickup, the payload is empty, the district does not exist, or a sent cityId/governorateId contradicts the district.
403 Forbidden
The shipment belongs to a sub-account outside the caller scope.
404 Not Found
No shipment with that AWB.