Skip to main content

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​

The import report. Rows that failed are listed individually with the reason; rows that succeeded were really created.

Response Headers
    Idempotency-Replayed

    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.