Request labels for an accepted purchase order (RequestLabel)
POST/vendor/shipping-labels
Synchronous (the documented exception to the 202 rule, G31): labels are issued by
shipping-and-tracking (POST /labels, IssueLabel, called with poNumber,
packageNo, assignmentId, orderId and tier that this context holds from
the release) inside this request and returned in the response. Allowed only
once the purchase order is ACCEPTED (ErrLabelBeforeAcceptance). A label
never carries the ship-to address. Re-requesting a label for the same
(poNumber, packageNo) returns the label already issued. When
shipping-and-tracking cannot answer, the answer is 503 upstream-unavailable;
labels already issued stay stored and a retry returns them.
Request
Responses
- 200
- 400
- 404
- 409
- 422
- 429
- 500
- 502
- 503
One label per requested package.
Response Headers
true when this response is a replay of the first response stored for the Idempotency-Key (a 2xx or a final refusal); absent otherwise. A refusal that can pass on a retry is never stored, so it is never replayed.
The Idempotency-Key header is missing (idempotency-key-required) or not 1 to 128
printable ASCII characters (idempotency-key-invalid).
The resource does not exist (not-found; this includes an unknown vendorId on a vendor read or write), or it belongs to another vendor
(ErrNodeNotOwnedByVendor, problem type node-not-owned-by-vendor, 404 so a vendor cannot probe another vendor's nodes).
The write conflicts with the state of the purchase order, the vendor or the aggregate version. Problem types:
already-acknowledged (ErrAlreadyAcknowledged), ack-window-closed
(ErrAckWindowClosed), label-before-acceptance (ErrLabelBeforeAcceptance),
confirm-without-label (ErrConfirmWithoutLabel), vendor-suspended
(ErrVendorSuspended), illegal-transition (a write against a state the model
gives no Err... for) and concurrent-update (optimistic-concurrency
conflict; the caller re-reads and retries) and idempotency-key-reused (the Idempotency-Key was
already used with a different method, path or body).
The request is malformed or breaks a validation rule. Problem types:
validation-failed (an unparsable body, an unknown or mistyped field, trailing data, a NUL character in the query or the body,
a missing or invalid vendorId, createdAfter that is not an RFC 3339 date-time, a failed field rule),
partial-acknowledgement (ErrPartialAcknowledgement) and
ack-window-out-of-range (ErrAckWindowOutOfRange).
Rate limit exceeded (RATE_LIMIT_RPS). Problem type rate-limited.
Response Headers
Seconds to wait before the next call.
An unexpected error. Problem type internal-error; the detail is always the opaque text an unexpected error occurred.
A neighbouring context answered with a refusal this context does not translate. Problem type upstream-refused.
A neighbouring context did not answer. Problem type upstream-unavailable; retry.