Bulk-import a whole building's layout
POST/location-imports
The bootstrap mechanism: takes a JSON array of fully-specified rows (a site/area/zone/aisle/bay/level/position address plus a LocationType) and loads a real warehouse's layout in one reproducible call, creating the Site, Zone and Aisle structure on first sight. A row naming structure that already exists reuses it and never mutates it, so an import cannot silently redefine a zone's temperature class.
Validation is atomic per row with partial success reported per row: every row is processed, and the report says exactly which rows failed and why. A 500-row export with 3 bad rows still creates the other 497.
This answers 200 OK, not 201: a bulk import is a partial-success report over many rows, not the creation of one addressable resource, so there is no single Location to hand back. Publishes one FacilityLayoutImported carrying the counts, plus the usual per-entity registration events as structure is created.
The import is a batch-job noun (/location-imports, REST API guideline 1.3 e) and is idempotent: a retry with the same Idempotency-Key replays the stored report with Idempotency-Replayed: true instead of importing twice. The only refusal is empty-import (stored); a bad row is reported in the 200 body, never as an error.
An aisle holds at most one active AutomatedStorage slot, and an AsrsPort slot is accepted only in an aisle that holds one (ADR-0048): a row breaking either rule is rejected in the report with that reason, like any other bad row.
Request
Responses
- 200
- 400
- 409
- 500
The import report. Rows that failed are listed individually with the reason; rows that succeeded were really created.
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.
Malformed input: a body that is not valid JSON, a location code that is not seven [A-Z0-9] segments, a missing required identifier, a query parameter outside its documented enum, an invalid limit / cursor or an undeclared query parameter on a paged collection, or a missing / malformed Idempotency-Key on a POST.
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.
An unexpected failure, e.g. the datastore is unavailable.