Inventory transaction history

distru-report-inventory-transaction-historyRead

Every stock movement in a date range: orders, purchases, returns, assemblies, transfers and adjustments.

Inputs

Every tool also takes the common inputs.

FieldTypeRequiredDescription
cursorstringNonextCursor of the previous call; keep the other arguments unchanged.
batchIdsstring[]NoIgnored when packageId is set; overrides productIds. Resolve via distru-search-batches.
packageIdstringNoOverrides batchIds and productIds. Resolve via distru-search-packages.
productIdsstring[]NoIgnored when packageId or batchIds is set. Resolve via distru-search-products.
transactionDatetimeobjectNoInclusive. YYYY-MM-DD (whole days, company timezone) or ISO 8601 with a UTC offset. Defaults to the last 30 days.
transactionDatetime.endstringNo
transactionDatetime.startstringNo
transactionTypesenum[]
22 values
orderpurchasereturnadjustmentstock_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
Noundo-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.
productCategoryIdsstring[]NoProduct 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).
productSubcategoryIdsstring[]NoProduct subcategory of the rows. See productCategoryIds. Resolve via distru-search-lookups (type PRODUCT_CATEGORY, each row's subcategories).
productTagIdsstring[]NoAny of these tags on the product. Resolve via distru-search-lookups (type PRODUCT_TAG).
vendorIdsstring[]NoThe vendor set on the product, not the company an order was placed with. Resolve via distru-search-companies.
brandIdsstring[]NoProduct brand of the rows, itself a company. Resolve via distru-search-companies, or read it on a distru-search-products row.
productGroupIdsstring[]NoResolve via distru-search-lookups (type PRODUCT_GROUP).
maxRowsLimitintegerNoRows per page. Defaults to 500.

Output

Presence on a nested field assumes its parent exists.

FieldTypePresenceDescription
nextCursorstringCan be absentPass as cursor to fetch the next page. Present only when meta.truncated.
metaobjectAlways
meta.reportstringAlways
meta.dateRangestringAlways
meta.rowLimitnumberAlways
meta.offsetnumberAlways
meta.rowCountnumberAlways
meta.totalRowCountnumberAlways
meta.truncatedbooleanAlways
rowsobject[]Always
rows[].datestringAlways
rows[].typestringCan be null
rows[].descriptionstringAlways
rows[].productobjectAlways
rows[].product.idstringAlways
rows[].product.namestringAlways
rows[].product.unitTypeobjectAlways
rows[].product.unitType.namestringAlways
rows[].packageobjectCan be null
rows[].package.idstringAlways
rows[].package.batchNumberstringCan be null
rows[].package.metrcLabelstringCan be null
rows[].package.unitTypeobjectAlways
rows[].package.unitType.namestringAlways
rows[].batchobjectCan be null
rows[].batch.idstringAlways
rows[].batch.batchNumberstringCan be null
rows[].amountstringAlways
rows[].packageAmountstringCan be null
rows[].salesOrderobjectCan be null
rows[].salesOrder.idstringAlways
rows[].salesOrder.numberstringAlways
rows[].salesOrder.statusenum
CANCELEDCOMPLETEDDELIVEREDDELIVERINGMERGEDPENDINGPROCESSINGREADY_TO_SHIP
Can be null
rows[].salesOrder.customerobjectCan be null
rows[].salesOrder.customer.idstringAlways
rows[].salesOrder.customer.namestringAlways
rows[].purchaseOrderobjectCan be null
rows[].purchaseOrder.idstringAlways
rows[].purchaseOrder.numberstringAlways
rows[].purchaseOrder.statusenum
COMPLETEDDELIVERINGDRAFTPARTIALLY_RECEIVEDPENDINGPROCESSING
Can be null
rows[].purchaseOrder.vendorobjectCan be null
rows[].purchaseOrder.vendor.idstringAlways
rows[].purchaseOrder.vendor.namestringAlways
rows[].assemblyobjectCan be null
rows[].assembly.idstringAlways
rows[].assembly.numberstringAlways
rows[].assembly.statusenum
COMPLETEDPENDING
Can be null
rows[].assembly.kindenum
MANUFACTURINGPACKAGE_SPLITTEST_SAMPLESALES_ORDER_REPACKAGE
Can be null
rows[].returnobjectCan be null
rows[].return.idstringAlways
rows[].return.numberstringAlways
rows[].return.statusenum
COMPLETEDPROCESSINGRECEIVEDSHIPPED
Can be null
rows[].return.customerobjectCan be null
rows[].return.customer.idstringAlways
rows[].return.customer.namestringAlways
rows[].stockTransferobjectCan be null
rows[].stockTransfer.idstringAlways
rows[].stockTransfer.numberstringAlways
rows[].stockTransfer.statusenum
CANCELEDCOMPLETEDTRANSIT
Can be null
rows[].thcstringCan be null
rows[].totalThcstringCan be null
rows[].thcMgGstringCan be null
rows[].thcMgMlstringCan be null
rows[].totalThcMgGstringCan be null
rows[].totalThcMgMlstringCan be null
rows[].cbdstringCan be null
rows[].totalCbdstringCan be null
rows[].cbdMgGstringCan be null
rows[].cbdMgMlstringCan be null
rows[].totalCbdMgGstringCan be null
rows[].totalCbdMgMlstringCan be null
rows[].totalCoststringCan 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.