Skip to main content

PATCH /v1/items/{id}/stock

Scope

write_items

Request parameters

NameInTypeRequiredDescription
idpathstringrequireditem_id
Idempotency-KeyheaderstringrequiredIdempotency key (required). A UUID v4 is recommended. Resending the same key replays the original result, and the response carries Idempotent-Replay: true. Sending a different body with the same key returns 422, so always retry with the identical request.
inventorybodyintegeroptionalSet stock to this absolute value (0-99999). Mutually exclusive with adjustment.
adjustmentbodyintegeroptionalThe amount to add or subtract (negative subtracts). A result below zero or above the maximum returns 422. Mutually exclusive with inventory.
variant_idbodystringoptionalSpecify this to update stock for a single variant. An item that has variants carries null as its own stock, so variant_id is required for such items — omitting it returns 422.

Response example

{
"item_id": "1408",
"variant_id": "1",
"inventory": 0,
"previous_inventory": 0
}

Description

Update item stock, either by setting an absolute value or by applying a delta. The write is applied synchronously under a row lock. (write_items)

Error response example

{
"error": {
"code": "insufficient_scope",
"message": "requires scope 'write_items'",
"request_id": "req_01H..."
}
}

Possible errors: 401 / 403 / 404 / 409 / 422 / 503