Register one coded location slot
POST/locations
The core operation of this service. Registering a LocationSlot is a chain-of-custody check, not a bare insert: the Site, Zone and Aisle implied by the LocationCode's segments must all resolve to existing, Active aggregates (404 if any link is missing, 409 if one exists but is no longer Active), and the slot's LocationType must satisfy every PlacementRule applicable to its Zone (422, naming the violated rule, if not). There are no orphan slots, ever.
capacityOverride is optional; omit it to inherit the LocationType's default envelope. The LocationCode is the slot's identity, so re-registering one already in use is a 409 — including when the existing slot is Decommissioned, since decommission is one-way and a retired code is never resurrected by re-registration. Publishes LocationSlotRegistered.
gln (ADR-0045) is an optional GS1 Global Location Number for a dock door or a yard spot: 13 digits with a valid mod-10 check digit (422 invalid-gln), unique across every site, zone and slot (409 gln-already-assigned). spotKind (ADR-0045) classifies a yard spot (PARKING, HOLDING, REEFER_PLUG, HAZMAT, STAGING_LANE) and is only legal when the LocationType's role is Yard: on any other role it is 422 spot-kind-not-allowed; an unknown value is 422 unknown-spot-kind. Neither field can be changed after registration in this version. Omit both and the request behaves exactly as before.
An aisle holds at most one active AutomatedStorage slot (409 automated-storage-already-in-aisle), and an AsrsPort slot is accepted only in an aisle that holds one (422 asrs-port-without-automated-storage) (ADR-0048).
Request
Responses
- 201
- 400
- 404
- 409
- 422
- 500
Location slot registered.
Response Headers
true when this response is the stored answer of an earlier request with the same Idempotency-Key (a 2xx or a refusal that cannot change on a retry); never present on the first execution, and never on a refusal that releases the key.
Path of the newly created LocationSlot.
Malformed input, or the Idempotency-Key header is absent (idempotency-key-required) or not 1-128 printable ASCII characters (idempotency-key-invalid) (ADR 0019).
The named site, zone, aisle, slot, location type or placement rule does not exist.
A state conflict: a code already taken, a GS1 Global Location Number already assigned to another location (gln-already-assigned, ADR-0045), an aisle that already holds an active AutomatedStorage location (automated-storage-already-in-aisle, ADR-0048), a parent that exists but is no longer Active, or a slot already decommissioned. On a POST it is also the answer to an Idempotency-Key reused with a different method, path or body (idempotency-key-reused); the problem type tells the two apart.
Semantically invalid: a placement-rule violation, or an AsrsPort slot in an aisle with no active AutomatedStorage slot (asrs-port-without-automated-storage, ADR-0048).
An unexpected failure, e.g. the datastore is unavailable.