Inventory transaction history
distru-report-inventory-transaction-historyReadEvery stock movement in a date range: orders, purchases, returns, assemblies, transfers and adjustments.
Inputs
Every tool also takes the common inputs.
| Field | Type | Required | Description |
|---|---|---|---|
| cursor | string | No | nextCursor of the previous call; keep the other arguments unchanged. |
| batchIds | string[] | No | Ignored when packageId is set; overrides productIds. Resolve via distru-search-batches. |
| packageId | string | No | Overrides batchIds and productIds. Resolve via distru-search-packages. |
| productIds | string[] | No | Ignored when packageId or batchIds is set. Resolve via distru-search-products. |
| transactionDatetime | object | No | Inclusive. YYYY-MM-DD (whole days, company timezone) or ISO 8601 with a UTC offset. Defaults to the last 30 days. |
| transactionDatetime. | string | No | |
| transactionDatetime. | string | No | |
| transactionTypes | enum[]22 valuesorderpurchasereturnadjustmentstock_transferassembly-inputassembly-outputundo-assembly-inputteardown-inputteardown-outputbreakdown-inputbreakdown-outputundo-breakdown-inputCOMPLIANCE_PACKAGE_QUANTITY_ADJUSTEDCOMPLIANCE_PACKAGE_ADDED_TO_TRANSFERCOMPLIANCE_PACKAGE_ACCEPTED_BY_TRANSFER_RECEIVERCOMPLIANCE_PACKAGE_REMOVED_FROM_TRANSFERMETRC_PACKAGE_RECEIVEDMETRC_PACKAGE_FINISHEDMETRC_PACKAGE_ACTIVE_AFTER_TRANSFERREDMETRC_PACKAGE_DISCONTINUEDSALES_ORDER_UNMATCHED_FROM_COMPLIANCE_TRANSFER | No | undo-assembly-input / undo-breakdown-input: a deleted assembly or breakdown output returned its inputs to active; the original input rows stay, so to measure what was used request both and sum them. Rows can carry other compliance or cultivation types, which can't be filtered; for cultivation movements use distru-report-cultivation-transaction-history. |
| productCategoryIds | string[] | No | Product category of the rows. ORed with productSubcategoryIds; a listed subcategory of a listed category narrows that category to it. Resolve via distru-search-lookups (type PRODUCT_CATEGORY). |
| productSubcategoryIds | string[] | No | Product subcategory of the rows. See productCategoryIds. Resolve via distru-search-lookups (type PRODUCT_CATEGORY, each row's subcategories). |
| productTagIds | string[] | No | Any of these tags on the product. Resolve via distru-search-lookups (type PRODUCT_TAG). |
| vendorIds | string[] | No | The vendor set on the product, not the company an order was placed with. Resolve via distru-search-companies. |
| brandIds | string[] | No | Product brand of the rows, itself a company. Resolve via distru-search-companies, or read it on a distru-search-products row. |
| productGroupIds | string[] | No | Resolve via distru-search-lookups (type PRODUCT_GROUP). |
| maxRowsLimit | integer | No | Rows per page. Defaults to 500. |
Output
Presence on a nested field assumes its parent exists.
| Field | Type | Presence | Description |
|---|---|---|---|
| nextCursor | string | Can be absent | Pass as cursor to fetch the next page. Present only when meta.truncated. |
| meta | object | Always | |
| meta. | string | Always | |
| meta. | string | Always | |
| meta. | number | Always | |
| meta. | number | Always | |
| meta. | number | Always | |
| meta. | number | Always | |
| meta. | boolean | Always | |
| rows | object[] | Always | |
| rows[]. | string | Always | |
| rows[]. | string | Can be null | |
| rows[]. | string | Always | |
| rows[]. | object | Always | |
| rows[]. | string | Always | |
| rows[]. | string | Always | |
| rows[]. | object | Always | |
| rows[]. | string | Always | |
| rows[]. | object | Can be null | |
| rows[]. | string | Always | |
| rows[]. | string | Can be null | |
| rows[]. | string | Can be null | |
| rows[]. | object | Always | |
| rows[]. | string | Always | |
| rows[]. | object | Can be null | |
| rows[]. | string | Always | |
| rows[]. | string | Can be null | |
| rows[]. | string | Always | |
| rows[]. | string | Can be null | |
| rows[]. | object | Can be null | |
| rows[]. | string | Always | |
| rows[]. | string | Always | |
| rows[]. | enumCANCELEDCOMPLETEDDELIVEREDDELIVERINGMERGEDPENDINGPROCESSINGREADY_TO_SHIP | Can be null | |
| rows[]. | object | Can be null | |
| rows[]. | string | Always | |
| rows[]. | string | Always | |
| rows[]. | object | Can be null | |
| rows[]. | string | Always | |
| rows[]. | string | Always | |
| rows[]. | enumCOMPLETEDDELIVERINGDRAFTPARTIALLY_RECEIVEDPENDINGPROCESSING | Can be null | |
| rows[]. | object | Can be null | |
| rows[]. | string | Always | |
| rows[]. | string | Always | |
| rows[]. | object | Can be null | |
| rows[]. | string | Always | |
| rows[]. | string | Always | |
| rows[]. | enumCOMPLETEDPENDING | Can be null | |
| rows[]. | enumMANUFACTURINGPACKAGE_SPLITTEST_SAMPLESALES_ORDER_REPACKAGE | Can be null | |
| rows[]. | object | Can be null | |
| rows[]. | string | Always | |
| rows[]. | string | Always | |
| rows[]. | enumCOMPLETEDPROCESSINGRECEIVEDSHIPPED | Can be null | |
| rows[]. | object | Can be null | |
| rows[]. | string | Always | |
| rows[]. | string | Always | |
| rows[]. | object | Can be null | |
| rows[]. | string | Always | |
| rows[]. | string | Always | |
| rows[]. | enumCANCELEDCOMPLETEDTRANSIT | Can be null | |
| rows[]. | string | Can be null | |
| rows[]. | string | Can be null | |
| rows[]. | string | Can be null | |
| rows[]. | string | Can be null | |
| rows[]. | string | Can be null | |
| rows[]. | string | Can be null | |
| rows[]. | string | Can be null | |
| rows[]. | string | Can be null | |
| rows[]. | string | Can be null | |
| rows[]. | string | Can be null | |
| rows[]. | string | Can be null | |
| rows[]. | string | Can be null | |
| rows[]. | string | Can be null |
What the AI reads
Inventory movement log: one row per stock transaction (orders, purchases, returns, assemblies, teardowns, breakdowns, stock transfers, stock adjustments, compliance syncs) with its product, package and batch, the sales order (and customer), purchase order (and vendor), assembly, return (and customer) or stock transfer that moved the stock, signed amount and cost. Teardowns, breakdowns, stock adjustments and compliance syncs have no source record: only type and description say what moved the stock. Newest first. Use to audit or trace how stock changed over a period. For a product's production runs, set productIds, transactionTypes [assembly-output] and a transactionDatetime range (default last 30 days). Not for current balances: use distru-report-inventory-valuation (per product), distru-report-inventory-assets (per location, batch or package) or distru-search-packages. amount is negative when stock left, positive when it entered, always in product.unitType, so sum it per product; packageAmount is the same movement in package.unitType, set only when package is. date is a UTC timestamp formatted YYYY-MM-DD HH:MM:SS.ffffffZ; quantity, potency and money are numeric strings. totalCost is the transaction's total, not per unit; null when no unit cost is recorded or the caller cannot view costs. Potency is only filled on package transactions. batch is null unless the product is batch-tracked. assembly.kind: MANUFACTURING is built in the assembly form; PACKAGE_SPLIT, TEST_SAMPLE and SALES_ORDER_REPACKAGE move stock without making anything, so keep only MANUFACTURING to measure what production used; null for other system flows. Returns 500 rows by default (maxRowsLimit, up to 5000). When meta.truncated is true more rows exist: repeat the call with the same filters, any date range made explicit so every page covers the same one, and cursor set to nextCursor — or narrow the filters when you need a summary rather than every row.