Inventory Transactions
Inventory movement ledger tracking all stock transactions and adjustments.
Storage Location
{customer_id}/inventory_trans/{year}/{month}/{yyyymmdd}.jsonDay files are organized by transaction date. One file per calendar day, file replaced when the day is re-exported. A day with no movements has no file. JSON array of movement rows ordered by id.
Fields
| Field | Type | Required | Description |
|---|---|---|---|
id | string | Yes | v1.3. Transaction id (stringified number). |
type | string | Yes | v1.3. Movement type: sale, manual, waste, receive, count_diff, supplement, expenditure, removal_comp or unknown. |
customer_id | number | Yes | v1.3. Customer id. |
item_id | number | No | v1.3. Inventory item id. |
item_name | string | No | v1.3. Inventory item name (denormalized). |
date | datetime | Yes | v1.3. Transaction timestamp (ISO 8601). |
qty | number | No | v1.3. Quantity moved, in the item's base unit (negative for consumption/waste). |
amount | number | No | v1.3. Total amount for the movement. |
unit_price | number | No | v1.3. Unit price used. |
comment | string | No | v1.3. Free-text comment. |
location_id | number | No | v1.3. Inventory location id. |
soid | number | No | v1.3. Sales order id that caused the movement (type sale). |
Movement Types
| Type | Description |
|---|---|
sale | Item consumed/sold (includes soid reference) |
manual | Manual adjustment |
waste | Waste/spoilage |
receive | Goods received from supplier |
count_diff | Inventory count variance |
supplement | Stock supplement/top-up |
expenditure | Item used for operational purposes |
removal_comp | Removal compensation |
unknown | Unknown movement type |
Example
json
[
{
"id": "10001",
"type": "sale",
"customer_id": 10352,
"item_id": 45101,
"item_name": "Espresso Beans",
"date": "2026-01-20T08:15:32",
"qty": -18,
"amount": 4.50,
"unit_price": 0.25,
"location_id": 201,
"soid": 188160255
},
{
"id": "10002",
"type": "waste",
"customer_id": 10352,
"item_id": 45102,
"item_name": "Whole Milk",
"date": "2026-01-20T09:30:00",
"qty": -500,
"amount": 50.00,
"unit_price": 0.10,
"comment": "Expired batch",
"location_id": 201
},
{
"id": "10003",
"type": "receive",
"customer_id": 10352,
"item_id": 45201,
"item_name": "Fresh Salmon Fillet",
"date": "2026-01-20T10:45:00",
"qty": 25,
"amount": 3137.50,
"unit_price": 125.50,
"location_id": 201
}
]