Purchase order report
distru-report-purchase-order-historyReadPurchase order report: one row per purchase with its dates, vendor, status, owner, amount and amount paid; no line items.
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 | Resolve via distru-search-batches. |
| dueDatetime | object | No | Inclusive. YYYY-MM-DD (whole days, company timezone) or ISO 8601 with a UTC offset. Setting it lifts the orderDatetime default. |
| dueDatetime. | string | No | |
| dueDatetime. | string | No | |
| locationIds | string[] | No | Received into these locations. Resolve via distru-search-locations. |
| orderDatetime | object | No | Inclusive. YYYY-MM-DD (whole days, company timezone) or ISO 8601 with a UTC offset. Defaults to the last 30 days unless dueDatetime is set. |
| orderDatetime. | string | No | |
| orderDatetime. | string | No | |
| paid | object | No | Dollars; sum of non-voided payments, 0 when none. |
| paid. | number | No | Inclusive. |
| paid. | number | No | Inclusive. |
| productIds | string[] | No | Resolve via distru-search-products. |
| search | string | No | Case-insensitive substring of purchase number, closest first. |
| statuses | enum[]PENDINGPROCESSINGDELIVERINGPARTIALLY_RECEIVEDCOMPLETED | No | |
| total | object | No | Dollars. |
| total. | number | No | Inclusive. |
| total. | number | No | Inclusive. |
| vendorIds | string[] | No | Resolve via distru-search-companies. |
| 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 | |
| meta. | object[] | Always | |
| meta. | string | Always | |
| meta. | string | Always | |
| rows | object[] | Always | |
| rows[]. | string | Can be null | |
| rows[]. | string | Can be null | |
| rows[]. | string | Always | |
| rows[]. | string | Always | |
| rows[]. | string | Always | |
| rows[]. | string | Always | |
| rows[]. | enumCOMPLETEDDELIVERINGDRAFTPARTIALLY_RECEIVEDPENDINGPROCESSING | Can be null | |
| rows[]. | string | Always | |
| rows[]. | string | Always | |
| rows[]. | string | Can be null | |
| rows[]. | string | Can be null | |
| rows[]. | object[] | Always | |
| rows[]. | string | Always | |
| rows[]. | string | Always | |
| rows[]. | string | Can be null |
What the AI reads
Purchase order report: one row per purchase with its dates, vendor, status, owner, amount and amount paid; no line items. Draft purchases are always left out. Use to list or total purchases over a date range. For totals per vendor or product use distru-report-purchase-totals; for one purchase's line items use distru-get-purchase-order. paid is the sum of non-voided payments, 0 when there are none. purchaseDate and dueDate are YYYY-MM-DD HH:MM:SS.ffffff with no offset; amount and paid are numeric strings. 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.