Skip to main content

The inventory change object

Each row is one entry in the inventory ledger of a variant on an inventory location: an adjustment, a shipment, a received production order delivery note, a return, a move between locations and so on. Inventory changes are never deleted, so the ledger is a complete history of how the stock of every variant came to be.

Some fields on an existing change can be updated after it is created, for example booked and book_date when the change is booked. updated_at tells you when a change was last modified.

Inventory change​

ParameterData typeDefaultDescription
idintIncreasing id. Use it to walk the ledger with cursor pagination
product_idintThe product
variant_idintThe variant
inventory_location_idintThe inventory location of the change
typestringPossible values: initial, adjustment, order, invoice, move, production_order, value_adjustment, value_update
textstringNULLA description of the change
changeintThe quantity change. Negative when stock is taken out
accumulated_stockintNULLThe stock of the variant on the inventory location after this change
bookedbooleanWhether the change has been booked
book_datedatetimeNULLWhen the change was booked
stock_datedatetimeNULLThe date the change affects stock from
batchstringNULLThe name of the batch. NULL when the quantity is not batch tracked
order_idintNULLThe order that caused the change
order_invoice_idintNULLThe invoice that caused the change
credit_note_idintNULLThe credit note that caused the change
return_idintNULLThe return that caused the change
production_order_delivery_note_idintNULLThe production order delivery note that was received
order_shipment_delivery_note_idintNULLThe shipment delivery note that caused the change
unit_costfloatThe cost per unit. Only returned when the user has permission to read cost prices
total_costfloatThe total cost of the change. Only returned when the user has permission to read cost prices
landed_cost_beforefloatNULLThe landed cost of the variant before this change. Only returned when the user has permission to read cost prices
landed_cost_afterfloatNULLThe landed cost of the variant after this change. Only returned when the user has permission to read cost prices
created_atdatetime
updated_atdatetime
inventory_locationIf eager loadedAn object inventory location
productIf eager loadedAn object product
variantIf eager loadedAn object variant