Register a physical facility
POST/sites
Adds a Site to the warehouse map. The site code becomes the first segment of every LocationCode inside the facility, so it must be uppercase alphanumeric and unique across the service. Site code uniqueness is enforced here in the application layer rather than in the aggregate: a single aggregate cannot see its siblings. A newly registered Site is Active, and publishes SiteRegistered.
siteRole (ADR-0037) is optional: omitted means UNSPECIFIED. An unknown role is 422 invalid-site-role. The role never sets the transfer capability (ADR-0035 stays the only writer; see GET /site-roles/transfer-defaults for the per-role defaults).
gln (ADR-0045) is an optional GS1 Global Location Number. It must be 13 digits ending in the GS1 mod-10 check digit (otherwise 422 invalid-gln) and a GLN identifies exactly one location across sites, zones and slots (otherwise 409 gln-already-assigned). A site registered without a gln is exactly as valid as before.
Request
Responses
- 201
- 400
- 409
- 422
- 500
Site 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 Site.
Malformed input, or the Idempotency-Key header is absent (idempotency-key-required) or not 1-128 printable ASCII characters (idempotency-key-invalid) (ADR 0019).
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.
The siteRole is not one of the known site roles (invalid-site-role, ADR-0037), or the gln is not 13 digits with a valid GS1 check digit (invalid-gln, ADR-0045).
An unexpected failure, e.g. the datastore is unavailable.