PUT
Arm or move a variant's reorder threshold

Authorizations

Authorization
string
header
required

A secret API key. Publishable keys cannot reach this API. A key may carry an expiry, and an expired key is refused exactly like an unknown one, with a 401 that names no reason; check the key's expires_at in the dashboard rather than inferring it from a response. When a merchant rolls a key's secret they choose a grace window of up to 3 days, and for its duration BOTH the new secret and the one it replaced authenticate, so an integration moves over on its own deploy schedule instead of at the instant the button is pressed. Move before the window closes: after it, the old secret is refused. Nothing else about this contract moves with a roll. The key keeps its id and its scopes, so the only thing an integration updates is the credential itself.

Headers

Idempotency-Key
string
required

A unique key per logical write. Replaying a request with the same key returns the first response byte for byte instead of applying the write twice.

Path Parameters

variantId
string
required

Body

application/json

An UPSERT keyed on the variant in the path: a variant with no threshold gets one, a variant with one has it replaced. The variant is NOT accepted in the body, because a body disagreeing with the path would have to pick one and you could not tell which. IT IS SAFE TO RE-SEND. A threshold that already holds the value you sent is left exactly as it is, so a reconciler that pushes its whole list every night does not re-arm the alert and does not re-mail the merchant. Only a CHANGED value re-evaluates the variant. ARMING AN ALREADY-LOW VARIANT ALERTS IMMEDIATELY, inside this request. The response reports the state AFTER that alert, so notified is true on the way back and you do not need to re-read to discover it. A variant that is not this store's is a 404. Removing a threshold is DELETE on this path and needs write_low_stock:delete as well as write_low_stock.

threshold
integer
required

The total stocked quantity, SUMMED ACROSS EVERY LOCATION, at or below which the store owner is emailed. It is not per location: a per-location threshold would alert on an empty shelf while the warehouse is full. ZERO IS A REAL VALUE and means "tell me only when this variant is actually out". It is not a way to turn the alert off; DELETE is. A negative value is a 400.

Required range: x >= 0

Response

Success

data
object