Stock history
hub_get_stock_historyEvery recorded stock movement for ONE product, newest first — the audit trail behind a count. Answers 'why is the number wrong', 'who changed this', 'when did we last receive these'. Each entry says what happened (SALE, STOCK_RECEIVED, DAMAGE, THEFT, LOSS, RESTOCK_RETURN, INVENTORY_RECOUNT, TRANSFER, BULK_RECOUNT), the signed quantity, the resulting on-hand, the outlet and the employee. Use this when the merchant disputes a number: state what the log shows rather than guessing at a cause. Only changes that were actually applied appear — an adjustment on an untracked line writes no history at all, which is itself the explanation when the log looks empty.
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| actions | No | Limit to these action names, e.g. ["DAMAGE","THEFT"] | |
| endDate | No | ISO date. Pass together with startDate or neither | |
| outletIds | No | Limit to these outlets (ids from get_outlets) | |
| productId | Yes | Product id from get_products | |
| startDate | No | ISO date. Pass together with endDate or neither |