Set a product's absolute stock level at one outlet
Loop-safe: the delta is computed server-side from the current level under a row lock, so sending the same on_hand twice writes nothing the second time (changed: false).
-
A supplied
reason_idmust match the computed direction, or leave it out to use the system “Stock set via API” reason. -
Idempotency-Keyis optional here: the write is already idempotent by construction. -
422 REASON_DIRECTION_MISMATCH: the suppliedreason_iddoes not match the computed direction. -
422 REASON_NOT_ALLOWED: the suppliedreason_idis a system reason or is turned off. A reason must be enabled and must not be a system reason. -
422 OUTLET_DELETED: the outlet has been deleted.
unit_cost (integer cents, optional) becomes the average cost for the outlet, whether stock goes up, down or stays the same. Leave it out to keep the current average, or the supply price when there is no average yet.
Requires scope: inventory:write
Authorizations
Section titled “Authorizations”Request Body
Section titled “Request Body”Responses
Section titled “Responses”Set a product’s absolute stock level at one outlet
object
Examplegenerated
{ "data": { "adjustment_id": "2489E9AD-2EE2-8E00-8EC9-32D5F69181C0", "changed": true, "delta": 1, "movement_id": "2489E9AD-2EE2-8E00-8EC9-32D5F69181C0", "on_hand": 1, "previous": 1 }}default
Section titled “default”An error response.
object
object
A machine-readable error code, e.g. VALIDATION_FAILED.
object
A plain-English sentence describing what went wrong.
Example
{ "error": { "code": "UNAUTHORIZED" }}