Purchase order report

distru-report-purchase-order-historyRead

Purchase 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.

FieldTypeRequiredDescription
cursorstringNonextCursor of the previous call; keep the other arguments unchanged.
batchIdsstring[]NoResolve via distru-search-batches.
dueDatetimeobjectNoInclusive. YYYY-MM-DD (whole days, company timezone) or ISO 8601 with a UTC offset. Setting it lifts the orderDatetime default.
dueDatetime.endstringNo
dueDatetime.startstringNo
locationIdsstring[]NoReceived into these locations. Resolve via distru-search-locations.
orderDatetimeobjectNoInclusive. 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.endstringNo
orderDatetime.startstringNo
paidobjectNoDollars; sum of non-voided payments, 0 when none.
paid.maxnumberNoInclusive.
paid.minnumberNoInclusive.
productIdsstring[]NoResolve via distru-search-products.
searchstringNoCase-insensitive substring of purchase number, closest first.
statusesenum[]
PENDINGPROCESSINGDELIVERINGPARTIALLY_RECEIVEDCOMPLETED
No
totalobjectNoDollars.
total.maxnumberNoInclusive.
total.minnumberNoInclusive.
vendorIdsstring[]NoResolve via distru-search-companies.
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
meta.columnsobject[]Always
meta.columns[].keystringAlways
meta.columns[].labelstringAlways
rowsobject[]Always
rows[].purchaseDatestringCan be null
rows[].dueDatestringCan be null
rows[].purchaseNumberstringAlways
rows[].purchaseOrderIdstringAlways
rows[].vendorstringAlways
rows[].vendorIdstringAlways
rows[].statusenum
COMPLETEDDELIVERINGDRAFTPARTIALLY_RECEIVEDPENDINGPROCESSING
Can be null
rows[].paidstringAlways
rows[].amountstringAlways
rows[].ownerstringCan be null
rows[].purchaseOrderOwnerIdstringCan be null
rows[].customFieldsobject[]Always
rows[].customFields[].keystringAlways
rows[].customFields[].labelstringAlways
rows[].customFields[].valuestringCan 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.