Invoice

Get invoices

List the company's invoices, newest first (sorted by invoice date, descending), with the given filters applied. All filters combine with AND; each returned invoice matches every filter you pass. This is a read-only operation with no side effects.

Results are paginated. The response carries a next_page URL only while more pages remain; follow it to walk the full result set. Page size is fixed at 500 invoices.

This endpoint returns eventually consistent data: a just-created or just-updated invoice may take up to about 1 second to appear or reflect its latest values here.

Required permission: invoices_permissions_view. Results are further narrowed to only the invoices the authenticated user is allowed to see under their team restrictions, so two API keys on the same company can see different subsets.

get/public/v1/invoices

Query parameters

idsstring[]

Restrict the result to specific invoices by ID (the same ID returned as each invoice's id). Repeat the bracketed key once per ID. Unknown IDs simply match nothing; an empty list is treated as no filter. At most 200 IDs may be given.

due_datetimestring

Filter by the invoice's due datetime. A comma-separated min,max range of ISO8601 UTC datetimes; both bounds are inclusive and either may be omitted. 2022-07-10T00:00:00Z, keeps invoices due on or after that instant, ,2022-07-10T00:00:00Z keeps those due on or before it, and passing both bounds keeps invoices due within the range.

inserted_datetimestring

Filter by the datetime the invoice was created in Distru. A comma-separated min,max range of ISO8601 UTC datetimes; both bounds are inclusive and either may be omitted (see due_datetime for the range semantics).

invoice_datetimestring

Filter by the invoice datetime (the date the invoice is dated for, which is also the sort key). A comma-separated min,max range of ISO8601 UTC datetimes; both bounds are inclusive and either may be omitted (see due_datetime for the range semantics).

invoice_numberstring

Filter to invoices whose invoice number contains this value. This is a case-insensitive substring match, not an exact match — 001 matches INV-0012 and 10015.

statusesstring[]

Filter by payment status. Repeat the bracketed key to pass several statuses; an invoice matches when its status equals any value you supply (OR across values). Values are SCREAMING_CASE: • NOT_PAID — no payments recorded yet • PARTIALLY_PAID — some, but not all, of the total has been paid • FULLY_PAID — paid in full • OVER_PAID — recorded payments exceed the total. Rare and effectively legacy: new overpayments are converted into a customer credit instead of moving an invoice into this status.

order_idsstring[]

Filter to invoices billing any of these sales orders. Repeat the bracketed key to pass several IDs; an invoice matches when its order's id equals any value you supply (OR across values). Empty list is no filter. At most 200 IDs.

order_numbersstring[]

Filter to invoices whose sales order has any of these human-readable order numbers (the SO number shown in the UI, not the order's id). Case-insensitive exact match per value. Repeat the bracketed key per value; empty list is no filter. At most 200 values.

order_statusesstring[]

Filter to invoices whose sales order has any of these statuses (OR across values). SCREAMING_CASE: PENDING, PROCESSING, READY_TO_SHIP, DELIVERING, DELIVERED, COMPLETED, CANCELED. Empty list is no filter. At most 200 values. This is the order's status, distinct from the invoice's payment statuses.

company_idsstring[]

Filter to invoices whose order bills any of these customers (the order's customer, returned as each invoice's company.id). Repeat the bracketed key per ID; unknown IDs match nothing; empty list is no filter. At most 200 IDs.

company_group_idsstring[]

Filter to invoices whose customer belongs to any of these company relationship groups. Repeat the bracketed key per ID; unknown IDs match nothing; empty list is no filter. At most 200 IDs.

owner_idsstring[]

Filter to invoices owned by any of these Distru users (matching each invoice's owner.id). Repeat the bracketed key per ID; unknown IDs match nothing; empty list is no filter. At most 200 IDs.

invoice_numbersstring[]

Filter to invoices whose invoice number is any of these values. Case-sensitive exact match per value (send numbers exactly as they appear in responses) — unlike invoice_number, which is a case-insensitive substring match. Repeat the bracketed key per value; empty list is no filter. At most 200 values.

is_voidedboolean

Filter by whether the invoice is voided. true keeps only voided invoices, false keeps only non-voided ones; omit for both. An invoice is voided automatically when its sales order is canceled. See also voided_datetime.

totalstring

Filter by the invoice total (the value returned as each invoice's total, including line items, charges, discounts, and taxes). Inclusive range written as min,max; either side may be omitted. 100, keeps invoices totaling 100 or more, ,500 keeps those totaling 500 or less, and 100,500 keeps those in between.

remaining_amountstring

Filter by the invoice's outstanding balance (remaining_amount — the total minus recorded payments; negative when over-paid). Inclusive range written as min,max; either side may be omitted (see total for the range semantics). 0,0 keeps fully-paid invoices; 0.01, keeps invoices with a positive balance still owed.

pagestring

Page selector. Page size is fixed by the server; paginate by following the next_page URL in each response rather than building page selectors yourself — it is null on the last page. next_page uses page[after]=<cursor>, an opaque token marking where the next page resumes; pass it back exactly as given, and only to the endpoint that issued it. This is seek-based, so every page stays fast no matter how deep you page.

updated_datetimestring

Filter by the datetime the invoice was last modified in Distru. A comma-separated min,max range of ISO8601 UTC datetimes; both bounds are inclusive and either may be omitted (see due_datetime for the range semantics).

voided_datetimestring

Filter by the datetime the invoice was voided. A comma-separated min,max range of ISO8601 UTC datetimes; both bounds are inclusive and either may be omitted (see due_datetime for the range semantics). Non-voided invoices (null voided_datetime) never match a bound. See also is_voided.

batch_idsstring[]

Filter to invoices that bill a line item drawn from any of these batches (matching the billed order item's batch). Repeat the bracketed key per ID; unknown IDs match nothing; empty list is no filter. At most 200 IDs. When combined with the other item and product filters, a single line item must satisfy all of them together (e.g. the same line is both in the given batch and of the given product).

package_idsstring[]

Filter to invoices that bill a line item drawn from any of these packages (matching the billed order item's package). Repeat the bracketed key per ID; unknown IDs match nothing; empty list is no filter. At most 200 IDs. When combined with the other item and product filters, a single line item must satisfy all of them together (e.g. the same line is both in the given batch and of the given product).

package_compliance_labelsstring[]

Filter to invoices that bill a line item whose package carries any of these compliance labels (the package's Metrc/BioTrack label). Case-sensitive exact match. Repeat the bracketed key per value; empty list is no filter. At most 200 values. When combined with the other item and product filters, a single line item must satisfy all of them together (e.g. the same line is both in the given batch and of the given product).

package_batch_numbersstring[]

Filter to invoices that bill a line item whose package has any of these batch numbers (the batch number stored on the package). Case-sensitive exact match. Repeat the bracketed key per value; empty list is no filter. At most 200 values. When combined with the other item and product filters, a single line item must satisfy all of them together (e.g. the same line is both in the given batch and of the given product).

batch_batch_numbersstring[]

Filter to invoices that bill a line item whose batch has any of these batch numbers (matching the billed order item's batch). Case-sensitive exact match. Repeat the bracketed key per value; empty list is no filter. At most 200 values. When combined with the other item and product filters, a single line item must satisfy all of them together (e.g. the same line is both in the given batch and of the given product).

product_idsstring[]

Filter to invoices that bill a line item of any of these products (matching the billed order item's product). Repeat the bracketed key per ID; unknown IDs match nothing; empty list is no filter. At most 200 IDs. When combined with the other item and product filters, a single line item must satisfy all of them together (e.g. the same line is both in the given batch and of the given product).

product_category_idsstring[]

Filter to invoices that bill a line item whose product belongs to any of these product categories. Repeat the bracketed key per ID; unknown IDs match nothing; empty list is no filter. At most 200 IDs. When combined with the other item and product filters, a single line item must satisfy all of them together (e.g. the same line is both in the given batch and of the given product).

product_subcategory_idsstring[]

Filter to invoices that bill a line item whose product belongs to any of these product subcategories. Repeat the bracketed key per ID; unknown IDs match nothing; empty list is no filter. At most 200 IDs. When combined with the other item and product filters, a single line item must satisfy all of them together (e.g. the same line is both in the given batch and of the given product).

product_group_idsstring[]

Filter to invoices that bill a line item whose product belongs to any of these product groups. Repeat the bracketed key per ID; unknown IDs match nothing; empty list is no filter. At most 200 IDs. When combined with the other item and product filters, a single line item must satisfy all of them together (e.g. the same line is both in the given batch and of the given product).

product_brand_idsstring[]

Filter to invoices that bill a line item whose product has any of these brands. Repeat the bracketed key per ID; unknown IDs match nothing; empty list is no filter. At most 200 IDs. When combined with the other item and product filters, a single line item must satisfy all of them together (e.g. the same line is both in the given batch and of the given product).

product_vendor_idsstring[]

Filter to invoices that bill a line item whose product has any of these vendors (the product's supplier company relationship). Repeat the bracketed key per ID; unknown IDs match nothing; empty list is no filter. At most 200 IDs. When combined with the other item and product filters, a single line item must satisfy all of them together (e.g. the same line is both in the given batch and of the given product).

product_strain_idsstring[]

Filter to invoices that bill a line item whose product has any of these strains. Repeat the bracketed key per ID; unknown IDs match nothing; empty list is no filter. At most 200 IDs. When combined with the other item and product filters, a single line item must satisfy all of them together (e.g. the same line is both in the given batch and of the given product).

product_tag_idsstring[]

Filter to invoices that bill a line item whose product carries any of these tags. Repeat the bracketed key per ID; unknown IDs match nothing; empty list is no filter. At most 200 IDs. When combined with the other item and product filters, a single line item must satisfy all of them together (e.g. the same line is both in the given batch and of the given product).

product_skusstring[]

Filter to invoices that bill a line item whose product has any of these SKUs. Case-insensitive exact match. Repeat the bracketed key per value; empty list is no filter. At most 200 values. When combined with the other item and product filters, a single line item must satisfy all of them together (e.g. the same line is both in the given batch and of the given product).

custom_dataobject

Filter by custom field values, as custom_data[{id}]=value where {id} is a custom field's numeric id. Repeat with different ids to filter on several fields at once; a record must match every one (AND). Matching is case-sensitive exact against the value stored on the record. The id must be a filterable custom field defined on this entity — use GET /public/v1/custom-fields?parent_object=invoice to list the ids, their types, and which are filterable. A non-numeric id, an id not defined on this entity, or an id that isn't filterable returns a 400.

Response

A list of invoices

Changes

No recorded changes to this endpoint across all 2 revisions of this API.