Get the Purchase Order History report
Changed onRead-only report that returns one row per purchase, each carrying the purchase's order and due dates, vendor, status, owner, and monetary totals (amount paid and purchase total). This is a reporting endpoint: it never changes inventory, compliance state, or any purchase — calling it has no side effects.
Scope and filtering:
• Only purchases visible to the API key's company are included; there are no cross-company rows. • DRAFT purchases are always excluded — a purchase appears here only once it has left draft, so the status of every row is one of PENDING, PROCESSING, DELIVERING, PARTIALLY_RECEIVED, or COMPLETED. • When order_datetime is omitted the report defaults to the most recent 30-day range of purchase (order) dates (from the start of the day 30 days ago through the end of today, in the company's timezone). Because of this default the report always carries an order-date bound — there is no way to fetch every purchase regardless of order date. The other date filters (due_datetime, created_datetime, updated_datetime) have no default — omit one and it simply is not applied. • Different filters combine with AND (a row must satisfy every filter you supply), while multiple values inside a single list filter combine with OR. All date-range bounds are inclusive.
Row shape:
• Every value is returned as it appears in the report's CSV export. Monetary cells (paid, amount) are returned as strings (currency and comma formatting stripped) so they match the rest of the API; dates as ISO8601 timestamps in the company's timezone; everything else as strings. • The column set is dynamic. Companies on a compliance integration get an extra manifest-number column (metrc_manifest_number for Metrc, biotrack_manifest_number for BioTrack), and every Purchase custom field configured for the company is appended as an extra column keyed by its slugified label. Because of this, read meta.columns to discover the exact keys present rather than hardcoding them. • meta also returns the resolved human-readable date range the report covers (after the 30-day default is applied). • Each row also carries the IDs of the records it names — purchase_order_id, vendor_id and purchase_order_owner_id, each right after its name column — so a row can be followed to the purchase, company or user endpoints without a name lookup. The CSV export leaves these ID columns out.
Required permission: reports_permissions_purchase_order_history.
Request
- Base URLhttps://app.distru.com
- AuthHTTP bearer
Query parameters
Keep only purchases whose status is one of the supplied values (OR within the list). Values are SCREAMING_CASE: PENDING, PROCESSING, DELIVERING, PARTIALLY_RECEIVED, COMPLETED. DRAFT is not accepted and never returned — draft purchases are excluded from this report regardless of filters. Omit to include every non-draft status.
Keep only purchases whose order (purchase) date falls in the given range. Format is a comma-separated ISO8601 datetime pair after,before; both bounds are inclusive. Leave either side empty for an open-ended bound (e.g. 2026-01-01T00:00:00Z, for everything from that date onward), but a bare comma with both sides empty (,) is rejected — omit the param entirely to apply no bound. This is the one date filter with a default: when omitted, the report covers the most recent 30-day range of order dates.
Keep only purchases whose due date falls in the given range. Comma-separated ISO8601 datetime pair after,before; both bounds inclusive, either side may be empty for an open-ended bound (a bare , is rejected). No default — omit to skip this filter.
Keep only purchases created in the given range, by the record's creation timestamp. Comma-separated ISO8601 datetime pair after,before; both bounds inclusive, either side may be empty (a bare , is rejected). No default — omit to skip this filter.
Keep only purchases last modified in the given range, by the record's last-updated timestamp. Comma-separated ISO8601 datetime pair after,before; both bounds inclusive, either side may be empty (a bare , is rejected). No default — omit to skip this filter.
Keep only purchases whose total is within the given range. Comma-separated min,max numeric pair; both bounds inclusive. Leave either side empty for an open-ended bound (e.g. 100, for 100 and up). Compares against the same purchase total returned in each row's amount.
Keep only purchases whose paid amount is within the given range. Comma-separated min,max numeric pair; both bounds inclusive, either side may be empty for an open-ended bound. Matches on the sum of the purchase's non-voided payments — the same value returned in each row's paid — so a purchase with no payments counts as 0.
Keep only purchases whose purchase number contains the search term. Case-insensitive partial (substring) match on the purchase number, with matches ordered by closeness to the term. Omit to skip.
Keep only purchases from the given vendors, identified by Distru company-relationship ID (OR within the list). Omit to include every vendor.
Keep only purchases received into the given warehouse locations, by Distru location ID (OR within the list). Omit to include every location.
Keep only purchases owned by the given users, by Distru user ID (OR within the list). Omit to include every owner.
Keep only purchases created by the given users, by Distru user ID (OR within the list). Omit to include every creator.
Keep only purchases that include one of the given batches, by Distru batch ID (OR within the list).
Keep only purchases that include one of the given products, by Distru product ID (OR within the list).
Response
The Purchase Order History report
Changes
- info
added the optional property
//to the response with the status - info
added the required property
//to the response with the status - info
added the required property
//to the response with the status
- info