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
| Parameter | Data type | Default | Description |
|---|---|---|---|
id | int | Increasing id. Use it to walk the ledger with cursor pagination | |
product_id | int | The product | |
variant_id | int | The variant | |
inventory_location_id | int | The inventory location of the change | |
type | string | Possible values: initial, adjustment, order, invoice, move, production_order, value_adjustment, value_update | |
text | string | NULL | A description of the change |
change | int | The quantity change. Negative when stock is taken out | |
accumulated_stock | int | NULL | The stock of the variant on the inventory location after this change |
booked | boolean | Whether the change has been booked | |
book_date | datetime | NULL | When the change was booked |
stock_date | datetime | NULL | The date the change affects stock from |
batch | string | NULL | The name of the batch. NULL when the quantity is not batch tracked |
order_id | int | NULL | The order that caused the change |
order_invoice_id | int | NULL | The invoice that caused the change |
credit_note_id | int | NULL | The credit note that caused the change |
return_id | int | NULL | The return that caused the change |
production_order_delivery_note_id | int | NULL | The production order delivery note that was received |
order_shipment_delivery_note_id | int | NULL | The shipment delivery note that caused the change |
unit_cost | float | The cost per unit. Only returned when the user has permission to read cost prices | |
total_cost | float | The total cost of the change. Only returned when the user has permission to read cost prices | |
landed_cost_before | float | NULL | The landed cost of the variant before this change. Only returned when the user has permission to read cost prices |
landed_cost_after | float | NULL | The landed cost of the variant after this change. Only returned when the user has permission to read cost prices |
created_at | datetime | ||
updated_at | datetime | ||
inventory_location | If eager loaded | An object inventory location | |
product | If eager loaded | An object product | |
variant | If eager loaded | An object variant |