Complete an inspection (CompleteInspection)
POST/inspections/:inspectionId/completions
Completes an OPEN inspection, once and for good. Every REQUIRED item needs a result first (409 required-item-pending). The outcome is FAILED when any required item failed, PASSED otherwise. A FAILED inspection places a hold on the trailer in the SAME transaction, with the reason of its most severe failed item (the template item says which: SECURITY, SEAL_BROKEN, DAMAGED, NOT_FOUND or QUALITY, the default), unless the trailer already carries a hold; releasing it stays the existing human action (POST /trailers/{trailerId}/hold-releases), and a re-inspection can then be opened. conditionGrade is an optional record of the equipment, never the verdict. Raises InspectionCompleted and, for a FAILED inspection, InspectionFailed (and TrailerHeld when it held the trailer). Completing again is 409 inspection-closed.
Request
Responses
- 200
- 400
- 404
- 409
- 422
- 500
The completed inspection, PASSED or FAILED.
Response Headers
Present, with the value true, only when the answer is a replay of the stored answer of an earlier request with the same Idempotency-Key (a success or a refusal that cannot change; a refusal the same request could pass later is never stored).
Malformed JSON body, an unknown field, a NUL byte, a missing or invalid Idempotency-Key, or an invalid path or query parameter (on the list operations an unknown query parameter, limit, cursor or filter value; on the reports the from/to window; on the yard policy an If-Match that is not an entity tag).
The addressed resource does not exist, or the path carries a NUL character (resource-not-found).
The request conflicts with the state of the yard (an occupied place, an open move, an illegal transition) or reuses an Idempotency-Key. On every POST and PUT except the two sweeps it is also the answer when another request changed the same aggregate first (concurrent-modification); read the resource again and retry with a new Idempotency-Key.
A value or reference rule failed (unknown location, appointment or inspection template, unknown inspection item, invalid carrier, invalid unit number, seal class, hazmat class or UN number, unexplained destination, validation).
Unexpected failure; the detail never leaks internals.