Check a visit in at the gate (CheckInVisit)
POST/visits
Records a tractor and driver passing the gate and the trailers they bring. DirectOnCheckIn creates, per trailer, a move created already CLAIMED by the VISITING_DRIVER (no lease): to the appointment door when it is free, open and flow-compatible, otherwise to the first free spot of the site's parking zones, and a walk-in or an arrival earlier than the appointment tolerance goes to a holding spot (TO_HOLDING). SealCheckAtGate compares each recorded seal with the appointment's expected seal; a mismatch raises SealExceptionRaised and, under the REJECT policy, records a REJECTED visit instead (reason SEAL_MISMATCH). A refused check-in persists nothing: 409 appointment-required, visit-already-open, trailer-already-on-site, door-closed, door-flow-mismatch, no-free-spot, placement-rule-violated, seal-class-too-low (the site yard policy sets minimumSealClass and the seal is of a lower class or has none); 422 invalid-carrier, unknown-appointment (also when the visit names an appointment but does not carry exactly one trailer), invalid-unit-number, invalid-seal-class, invalid-hazmat-class, invalid-un-number, validation. The unit number of a CONTAINER trailer, and of any trailer whose unitNumberScheme is ISO6346, must be an ISO 6346 container number (4 letters: a 3-letter owner code and the category U, J or Z; 6 digits; the check digit), else 422 invalid-unit-number whose detail names the expected check digit; a domestic road trailer keeps a free-form number. A matching seal ends VERIFIED and a different one MISMATCH (ADR 0012). A trailer may declare what it carries: hazmatClass, unNumber, requiresTemperatureControl (ADR 0014). A trailer that declares a hazard class is placed only on a HAZMAT spot (a site with none refuses it, unless the policy sets allowHazmatOnUnclassifiedSpots, then only spots whose kind is unknown); a trailer that requires temperature control only on a REEFER_PLUG spot where the site has any. A site with no suitable free spot answers 409 no-free-spot (all taken) or placement-rule-violated (none exists); doors are exempt; a trailer that declares nothing, and a spot with no known kind, are judged as before. The gate clerk may then record the refusal with POST /visit-rejections. A carrier that dock-scheduling has suspended (the local copy of its registry, ADR 0016) is handled by the site yard policy suspendedCarrierAction: NONE admits the visit as before; FLAG admits it and sets the visit carrierFlag to SUSPENDED; REJECT records a REJECTED visit (reason CARRIER_SUSPENDED, VisitRejected published, no trailer persisted) and answers 409 carrier-suspended, so that turn-away is on record although the call is a 409.
Request
Responses
- 201
- 400
- 409
- 422
- 500
The visit is checked in (or REJECTED under the REJECT seal policy).
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).
Path of the visit, /visits/{visitId}.
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 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.