Update Item Inventory

Beta
PATCH/v1/catalog/items/{id}/inventory

Idempotent with Idempotency-Key header. Learn more

Adjusts or reconciles the quantity of an item you hold.

With operation set to adjust (the behavior when it is omitted), quantity is added to the current quantity; with reconcile, the current quantity is set to exactly quantity. Either way it is the resulting difference that gets written, so a difference of zero moves no stock.

The figure a reconcile measures against is what is on hand net of demand nothing has covered — the same figure available_to_promise is derived from, not the raw on-hand total. Reconciling to the quantity already reported therefore writes nothing.

Stock that arrives is allocated against unfilled demand for the item, so an adjustment can settle a shortfall instead of raising the quantity free to promise. That allocation happens just after the request rather than inside it, because it walks every open issue for the item. The change is recorded in the item's inventory audit trail as a user correction attributed to the caller.

Permissions requiredValues:items:update
The role behind your API key or agent must grant every one of these permissions.
idstring

Item ID.

quantityobject

The quantity to apply, interpreted according to operation.

With adjust it is added to the current quantity and may be negative; with reconcile the current quantity is set to exactly this value. It is recorded in the unit you send it in, and the current quantity a reconcile measures against is read in that same unit, so a reconcile to the figure already reported moves no stock.

valuestring (decimal)

Decimal value, as a string to preserve precision.

unit_idstring

ID of the unit of measure for the value.

operationoptional stringenumValues:adjustreconcile

How quantity is applied.

  • adjust: adds quantity to the current quantity.
  • reconcile: sets the current quantity to exactly quantity.
customer_idoptional string

ID of the customer account that owns the resulting inventory.

Use this for stock you hold but do not own, such as customer-supplied material. It only affects quantity being added: your account stays the holder, the customer becomes the owner, and the current quantity a reconcile measures against is still your account's. Requires edit access to that customer.

location_idoptional string

ID of the location to record the inventory change against.

Must be a location in your account.

lot_numberoptional string

Lot number to record the inventory change against.

The lot is created for the item if it does not already exist.

Responses

200

Successful response for Update Item Inventory