Close a loading load (create a closure)
POST/loads/:loadId/closures
Moves a LOADING load to CLOSED and publishes LoadClosed with
the package and short-shipped counts. A load closes only when every
assigned package is loaded or short-shipped with a reason: any
package still outstanding is 409 packages-outstanding
(ErrPackagesOutstanding). Short-ships are recorded in the same
command, each with its reason; an entry without a package_id or a
reason is 400 bad-request and nothing is changed. A package the
diversion policy already short-shipped is recorded once: with the
reason of the entry that names it, else DIVERTED.
Request
Responses
- 200
- 400
- 404
- 409
- 500
The load is CLOSED.
Response Headers
True when this response was replayed from a stored idempotent execution (R5).
Malformed body or a missing/invalid required field (bad-request).
No such load (load-not-found).
Load refusal: packages-outstanding, trailer-not-docked,
load-not-closed, load-confirmed, duplicate-open-load,
load-state, load-has-packages (cancel of a PLANNED load that
has packages), or idempotency-key-reused.
Unexpected failure (internal-error).