HarvestOutputs

Get the Harvest Outputs report

Changed on

Returns one row per line item of every harvest assembly whose creation date falls in the reported date range. Each assembly expands into its inputs (the harvested material consumed), its outputs (the products produced, with their batch and package numbers), and its cost line items — the cost_input_output column identifies which. Every row carries the assembly's date, number, and status, plus the harvest name, strain, location, product, product category, quantity, and unit type. Rows are grouped by assembly (ordered by assembly date, then number), and within each assembly the outputs come first, then inputs, then costs. When no datetime filter is provided, the report defaults to the last 7 days.

This is a read-only report; nothing is created, and no inventory or compliance state changes when you call it. The entire report is returned in one response — there is no pagination, so a wide date range can return a large payload.

The filters narrow which assemblies appear, not which line items. An assembly is included only if it has an input matching every input filter (harvest_name, strain, location_id) AND an output matching every output filter (output_product_name, output_product_category_id); once an assembly qualifies, all of its input, output, and cost rows are returned — including rows that don't themselves match the filter (e.g. filtering by output_product_name still returns that assembly's inputs and costs).

Every value is returned as it appears in the report's CSV export, with numeric cells returned as strings (currency and comma formatting stripped) so they match the rest of the API; a value with a significant leading zero (an identifier such as a batch or package number) keeps its display string so the zero isn't lost. The cost columns (unit_cost_actual, unit_cost_default, total_cost_actual, total_cost_default, cost_type, cost_type_description) are omitted entirely — the keys are absent, not null — for users without permission to view costs, which is a separate permission from the report permission below. Report-level information (the resolved date range and column definitions) is returned under meta.

Each row also carries the IDs of the records it names — batch_id, package_id, location_id and product_id, each right after its name column — so a row can be followed to the batch, package, location or product endpoints without a name lookup. The CSV export leaves these ID columns out.

Required permission: reports_permissions_harvest_outputs.

get/public/v1/reports/harvest-outputs

Request

  • Base URL
    https://app.distru.com
  • Auth
    HTTP bearer

Query parameters

datetimestring

Keep only assemblies whose creation date falls in this range. Two ISO8601 timestamps separated by a comma: after,before. Interpreted in the requesting user's timezone. Either side may be left empty to make the range open-ended (,2026-02-01T00:00:00Z = up to that date; 2026-01-01T00:00:00Z, = from that date on). Defaults to the last 7 days when omitted.

status'PENDING' | 'COMPLETED'

Keep only assemblies with this status. PENDING = not yet completed; COMPLETED = completed. Omit to return assemblies of any status. SCREAMING_CASE.

harvest_namestring

Keep only assemblies that have an input whose harvest name contains this text (case-insensitive substring). Combined with the other input filters using AND.

strainstring

Keep only assemblies that have an input whose harvest strain contains this text (case-insensitive substring). Combined with the other input filters using AND.

location_idstring

Keep only assemblies that have an input at this location. A single Distru location ID; exact match against the input's location. Combined with the other input filters using AND.

output_product_namestring

Keep only assemblies that have an output whose product name contains this text (case-insensitive substring). Combined with output_product_category_id using AND.

output_product_category_idstring

Keep only assemblies that have an output whose product belongs to this category. A single Distru product-category ID; exact match. Combined with output_product_name using AND.

Response

The Harvest Outputs report

Changes

    • info

      added the optional property // to the response with the status

    • info

      added the optional property // to the response with the status

    • info

      added the optional property // to the response with the status

    • info

      added the required property // to the response with the status