APIInvoice history

Get the Invoice History report

GET
/public/v1/reports/invoice-history

Read-only report: returns one row per invoice with its dates, sales order, customer, payment status, and monetary totals (paid, outstanding, line item subtotal, taxes, charges, discounts, and grand total) along with the per-tax, per-charge, and per-discount summary strings. This endpoint only reads — it never mutates invoices, inventory, payments, or compliance state.

Scope and date defaulting:

• Results are scoped to the company that owns the API key, and further to the invoices the key's user is allowed to view. • Filtering on invoice_datetime is optional; when you omit it the report covers the last 30 days (from the start of the day 30 days ago through the end of today, resolved in the API key user's timezone). No other filter has a default. due_datetime has no implicit range. • The resolved invoice-date window (whether you passed it or it defaulted) is echoed back as a human-readable string in meta.date_range.

Row shape and value formatting:

• Rows always come back ordered by invoice number, descending. This endpoint exposes no sort parameter — the order is fixed regardless of which filters (including search) you pass. • Monetary cells (paid, outstanding, line_item_subtotal, total_taxes, total_charges, total_discounts, total) are returned as strings (currency and comma formatting stripped) so they match the rest of the API, already coalesced to "0" when the invoice has no matching payments/taxes/charges/discounts — they are never null. • The summary cells (tax_summary, charge_summary, discount_summary) are human-readable breakdown strings and are null when the invoice has no taxes, no positive charges, or no negative charges (discounts) respectively. • status is a SCREAMING_CASE payment-status token (see the values below). • Each row also carries the IDs of the records it names — invoice_id, sales_order_id, customer_id and invoice_owner_id, each right after its name column — so a row can be followed to the invoice, order, company or user endpoints without a name lookup. The CSV export leaves these ID columns out.

Extra columns:

• Companies on a compliance integration get two additional columns — the transfer manifest number and the shipped-from license number. They are labelled by system (Metrc vs BioTrack) but carry the same data. • Any Invoice custom fields configured for the company are appended as additional columns, keyed by a slug of the field label.

Because the set of columns varies by company (compliance integration and custom fields), read meta.columns to discover the exact keys present in each data row rather than hard-coding them.

Required permission: view the invoice history report.

Authorization

Bearer
headerAuthorizationBearer <token>

API token generated in Distru (Settings → Distru API). Send it on every request as Authorization: Bearer YOUR_API_TOKEN.

Query Parameters

status[]?array<>

Filter by invoice payment status. Repeat the key to pass several values; an invoice matches if its status is any of them (OR). Values are SCREAMING_CASE: NOT_PAID, PARTIALLY_PAID, FULLY_PAID, OVER_PAID (OVER_PAID only occurs on legacy invoices). Omit to include every status.

order_status[]?array<>

Filter by the status of the sales order each invoice belongs to. Repeat the key to pass several values; matches any (OR). Values are SCREAMING_CASE: PENDING, PROCESSING, READY_TO_SHIP, DELIVERING, DELIVERED, COMPLETED, CANCELED. Omit to include orders in any status.

invoice_datetime?string

Filter by invoice date, as a comma-separated ISO8601 datetime range from,to. Either side may be left empty for an open-ended range (2026-01-01T00:00:00Z, = on or after that instant; ,2026-02-01T00:00:00Z = on or before it); both sides empty is rejected. When this filter is omitted entirely the report defaults to the last 30 days, and the resolved window is reflected in meta.date_range.

due_datetime?string

Filter by invoice due date, as a comma-separated ISO8601 datetime range from,to. Either side may be empty for an open-ended range. Unlike invoice_datetime this has no default — omit it to apply no due-date filter.

total?string

Filter by the invoice grand total, as a comma-separated min,max numeric range. Bounds are inclusive; omit a side to leave it unbounded.

paid?string

Filter by the amount paid on the invoice, as a comma-separated min,max numeric range. Bounds are inclusive; omit a side to leave it unbounded.

search?string

Case-insensitive substring match on the invoice number. Combines with the other filters (AND); does not change the result ordering, which is always invoice number descending. Omit to skip the invoice-number search.

company_ids[]?array<string>

Filter by customer. Each value is a company ID, the id GET /public/v1/companies returns. Repeat the key to pass several; matches any (OR).

shipped_from_license_ids[]?array<string>

Filter by the license the order shipped from. Each value is a Distru license id. Repeat the key to pass several; matches any (OR).

batch_ids[]?array<string>

Filter to invoices whose line items reference any of these batches. Each value is a Distru batch id. Repeat the key to pass several; matches any (OR).

product_ids[]?array<string>

Filter to invoices whose line items reference any of these products. Each value is a Distru product id. Repeat the key to pass several; matches any (OR).

Response Body

The Invoice History report

*/*
  1. response

The Invoice History report

data*array<>

The report rows

meta*

Report-level metadata

Example Request
curl -X GET 'https://app.distru.com/public/v1/reports/invoice-history?invoice_datetime=2026-06-01T00%3A00%3A00Z%2C2026-08-01T00%3A00%3A00Z'
Example Response
{  "data": [    {      "charge_summary": null,      "customer": "Company 27",      "customer_id": "81035b11-21f6-4190-b90b-ea2365b63b4a",      "discount_summary": null,      "due_date": "2026-08-24",      "invoice_date": "2026-07-01",      "invoice_id": "bcfaf35e-847f-41a1-b73b-83e4a3194212",      "invoice_number": "INV-2",      "invoice_owner_id": "85977a96-4a9f-4e9f-ac68-1d660e75187d",      "line_item_subtotal": "0.00",      "outstanding": "500.00",      "owner": "FirstName74 LastName75",      "paid": "0.00",      "sales_order": "SO-2",      "sales_order_id": "603c3486-b250-4063-bce1-e893701d7540",      "status": "NOT_PAID",      "tax_summary": null,      "total": "500.00",      "total_charges": "0.00",      "total_discounts": "0.00",      "total_taxes": "0.00"    },    {      "charge_summary": null,      "customer": "Company 20",      "customer_id": "82a3ef87-798b-4954-96ca-6b26f6aa2f24",      "discount_summary": null,      "due_date": "2026-08-24",      "invoice_date": "2026-07-01",      "invoice_id": "d7efd0f4-cd9f-4389-9827-a2d44f7ae35e",      "invoice_number": "INV-1",      "invoice_owner_id": "b1c2bf65-50ff-46fb-90ab-5351c5bb7e4a",      "line_item_subtotal": "0.00",      "outstanding": "1000.00",      "owner": "FirstName38 LastName39",      "paid": "0.00",      "sales_order": "SO-0",      "sales_order_id": "83270267-2a74-4b5d-8836-73368e5b7f5b",      "status": "FULLY_PAID",      "tax_summary": null,      "total": "1000.00",      "total_charges": "0.00",      "total_discounts": "0.00",      "total_taxes": "0.00"    }  ],  "meta": {    "columns": [      {        "key": "invoice_date",        "label": "Invoice Date"      },      {        "key": "invoice_number",        "label": "Invoice Number"      },      {        "key": "invoice_id",        "label": "Invoice ID"      },      {        "key": "due_date",        "label": "Due Date"      },      {        "key": "sales_order",        "label": "Sales Order"      },      {        "key": "sales_order_id",        "label": "Sales Order ID"      },      {        "key": "customer",        "label": "Customer"      },      {        "key": "customer_id",        "label": "Customer ID"      },      {        "key": "status",        "label": "Status"      },      {        "key": "paid",        "label": "Paid"      },      {        "key": "outstanding",        "label": "Outstanding"      },      {        "key": "line_item_subtotal",        "label": "Line Item Subtotal"      },      {        "key": "total_taxes",        "label": "Total Taxes"      },      {        "key": "tax_summary",        "label": "Tax Summary"      },      {        "key": "total_charges",        "label": "Total Charges"      },      {        "key": "charge_summary",        "label": "Charge Summary"      },      {        "key": "total_discounts",        "label": "Total Discounts"      },      {        "key": "discount_summary",        "label": "Discount Summary"      },      {        "key": "total",        "label": "Total"      },      {        "key": "owner",        "label": "Owner"      },      {        "key": "invoice_owner_id",        "label": "Invoice Owner ID"      }    ],    "date_range": "May 31, 2026 to Jul 31, 2026",    "report": "invoice_history"  }}