Declare or change a replenishment policy
PUT/policies/:siteId/:sku
Declares the MIN_MAX policy of a site and SKU. Without If-Match it
creates the policy at version 1 and answers 409 policy-already-exists
when one exists. With If-Match: <version> it replaces the policy only
when that is the current version (the new version is current + 1); a stale
value is a 409 concurrent-modification. The values must satisfy
0 <= minQty < maxQty and multiple >= 1 (multiple defaults to 1). A
request quantity is always rounded down to a multiple of multiple.
With source: PACK_DERIVED the multiple is not sent: it is taken from the
SKU's active CASE pack level (units per case) in the local copy of
product-master's pack levels, and re-derived when that level is superseded;
a SKU with no active CASE level is a 422 no-active-case-level.
With kind: DEMAND_COVER (ADR 0015) the body carries no minQty, maxQty
or multiple: the policy holds targetDaysOfCover (default 3) and
demandWindowDays (default 7) and sizes requests from the site and SKU's
rolling demand rate instead of explicit bounds. A redeclaration replaces
the rule wholesale, whatever kind the current policy is.
Publishes ReplenishmentPolicyDeclared on the analytics topic. The
response carries the new version as ETag.
Request
Responses
- 200
- 400
- 409
- 422
- 500
The policy is declared (created at version 1, or replaced).
Response Headers
The policy version after this change.
Malformed JSON body, an unknown field, or an invalid path, query or header parameter.
The resource is in the wrong state for the command, another request changed it first, or the Idempotency-Key was already used with a different request (idempotency-key-reused).
The request is well-formed but the current state does not allow it.
Unexpected server error.