Skip to main content

Create or revise one Rebalance Policy (idempotent).

PUT 

/v1/rebalance-policies

Upserts the Policy in the body, keyed by its Site + SKU. Idempotent: a PUT carrying exactly the stored policy writes nothing and answers 200 with outcome UNCHANGED. A changed policy bumps the revision (outcome UPDATED); a new one is created at revision 1 (201, outcome CREATED). Optimistic concurrency: send the entry's ETag in If-Match to update only that revision (412 when it moved on); without If-Match the PUT applies to the current revision. Two writers racing on the same revision: one wins, the other gets 409. 400 for a malformed If-Match (invalid-if-match) or a body with an unknown field or malformed JSON (invalid-request). 422 invalid-catalogue-entry for an entry refused on its face (blank Version, Site or SKU, negative quantity or UnitPriority, TargetStock below SafetyStock). 409 concurrent-modification when two writers race. 503 catalogue-unavailable when there is no persistence.

Request​

Responses​

Updated (or unchanged, on an idempotent replay).

Response Headers
    ETag

    The catalogue entry's revision as a strong ETag (send it back in If-Match).

    Example: "2"