Run the SLAM weigh-check on a sealed package
POST/packages/:id/slam-runs
SLAM = Scan, Label, Apply, Manifest. Weighs a sealed package: if |actualWeight - expectedWeight| is within tolerance (0.05, same unit as the two weights — e.g. kilograms), a shipping label is applied (LabelApplied); otherwise the package is diverted (WeightDiscrepancyDetected + PackageDiverted) rather than shipped with a wrong manifest. Idempotent in effect once processed: a repeat call on an already-labeled-or-diverted package returns 409 rather than re-processing it.
Request
Responses
- 204
- 400
- 404
- 409
- 500
Weigh-check recorded (label applied or the package diverted — both are successful outcomes of this call). No response body; read GET /packages/{id} afterwards to see which outcome occurred (status LABELED or DIVERTED, see ADR-0033).
Response Headers
Present, with the value true, ONLY when this answer is the stored replay of an earlier request that used the same Idempotency-Key (the handler did not run again). The first execution never carries it.
The Idempotency-Key header is missing (idempotency-key-required) or not 1-128 printable ASCII characters (idempotency-key-invalid) on a POST, or the request body could not be read or contains a NUL character (malformed-request-body), or the request body is malformed JSON, a required field is missing or empty, or a field value is invalid (e.g. a task type outside the TaskType enum).
No package exists with this id.
The package already had a label applied or was already diverted (package-already-processed), or it has not been sealed yet and is still Open (package-not-sealed). The same Idempotency-Key reused with a different method, path or body is also a 409, problem type idempotency-key-reused.
An unexpected server-side failure (e.g. a repository or event-publisher error).