Invoice report

distru-report-invoice-historyRead

Invoice report: one row per invoice with its dates, sales order, customer, payment status, money totals and tax, charge and discount summaries; 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.
customerIdsstring[]NoResolve via distru-search-companies.
dueDatetimeobjectNoInclusive. YYYY-MM-DD (whole days, company timezone) or ISO 8601 with a UTC offset. Setting it lifts the invoiceDatetime default; for overdue or outstanding balances filter on this alone.
dueDatetime.endstringNo
dueDatetime.startstringNo
invoiceDatetimeobjectNoInclusive. YYYY-MM-DD (whole days, company timezone) or ISO 8601 with a UTC offset. Defaults to the last 30 days unless dueDatetime is set. If no rows match, check when the last invoice was with distru-search-invoices (sortBy INVOICE_DATE DESC, limit 1) before concluding none were issued.
invoiceDatetime.endstringNo
invoiceDatetime.startstringNo
orderStatusesenum[]
PENDINGPROCESSINGREADY_TO_SHIPDELIVERINGDELIVEREDCOMPLETEDCANCELEDMERGED
NoThe invoice's sales order status.
paidobjectNoDollars; nothing paid counts as 0.
paid.maxnumberNoInclusive.
paid.minnumberNoInclusive.
productIdsstring[]NoResolve via distru-search-products.
searchstringNoCase-insensitive substring of invoice number. Ranks closest match first.
shippedFromLicenseIdsstring[]NoSales order shipped from these licenses, or line items came from a location on one. Resolve via distru-search-licenses.
statusesenum[]
NOT_PAIDPARTIALLY_PAIDFULLY_PAIDOVER_PAID
No
totalobjectNoGrand total, in dollars.
total.maxnumberNoInclusive.
total.minnumberNoInclusive.
voidStatusenum
NOT_VOIDEDANYVOIDED
NoVoided invoices (sales order canceled) are no longer owed. Default NOT_VOIDED.
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[].invoiceDatestringAlways
rows[].invoiceNumberstringCan be null
rows[].invoiceIdstringAlways
rows[].dueDatestringCan be null
rows[].salesOrderstringAlways
rows[].salesOrderIdstringAlways
rows[].customerstringAlways
rows[].customerIdstringAlways
rows[].statusenum
FULLY_PAIDNOT_PAIDOVER_PAIDPARTIALLY_PAID
Can be null
rows[].paidstringAlways
rows[].outstandingstringAlways
rows[].lineItemSubtotalstringAlways
rows[].totalTaxesstringAlways
rows[].taxSummarystringCan be null
rows[].totalChargesstringAlways
rows[].chargeSummarystringCan be null
rows[].totalDiscountsstringAlways
rows[].discountSummarystringCan be null
rows[].totalstringAlways
rows[].ownerstringCan be null
rows[].invoiceOwnerIdstringCan be null
rows[].customFieldsobject[]Always
rows[].customFields[].keystringAlways
rows[].customFields[].labelstringAlways
rows[].customFields[].valuestringCan be null
What the AI reads

Invoice report: one row per invoice with its dates, sales order, customer, payment status, money totals and tax, charge and discount summaries; no line items. Use for invoice history, payment status, outstanding balances and receivables. For order-level totals use distru-report-sales-orders with rowsPer ORDER; for one invoice's line items and charges use distru-get-invoice. outstanding is total minus paid, negative when overpaid. A voided invoice keeps its totals and payment status but is no longer owed; voidStatus leaves them out by default. totalDiscounts is negative. The money columns are 0, never null, when nothing applies; taxSummary, chargeSummary and discountSummary are null when the invoice has none. Rows come by invoice number, highest first, unless search is set. invoiceDate and dueDate are YYYY-MM-DD in the company's timezone; the money columns 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.