---
title: "Get the Harvest Outputs report"
method: GET
path: "/public/v1/reports/harvest-outputs"
tags: ["HarvestOutputs"]
---

# Get the Harvest Outputs report

`GET /public/v1/reports/harvest-outputs`

## Request

- Base URL: `https://app.distru.com`
- URL: `https://app.distru.com/public/v1/reports/harvest-outputs`
- Auth: HTTP bearer

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`.

## Query parameters

- `datetime` string
- `status` 'PENDING' | 'COMPLETED'
- `harvest_name` string
- `strain` string
- `location_id` string
- `output_product_name` string
- `output_product_category_id` string

## Response `200`

The Harvest Outputs report

- HarvestOutputsReport: The Harvest Outputs report
  - `data` HarvestOutputsReportRow[], required: The report rows
    - `batch_id` string: The output's batch ID — the `id` [GET /public/v1/batches](#get-batches) returns. Populated only on `Output` rows; null on `Input` and `Cost` rows, and on an output with no batch.
    - `cost_input_output` string, required: The line item type: `Input` (harvested material consumed), `Output` (product produced), or `Cost` (a cost line item on an output). Determines which of the type-specific fields below are populated. Always present.
    - `cost_type` string: The cost type name. Populated only on `Cost` rows; null on `Input` and `Output` rows. Omitted entirely (key absent) for users without permission to view costs.
    - `cost_type_description` string: The cost line item's description. Populated only on `Cost` rows; null on `Input` and `Output` rows. Omitted entirely (key absent) for users without permission to view costs.
    - `distru_product` string: The Distru product name — the harvest name on `Input` rows, the output's product on `Output` rows. Null on `Cost` rows.
    - `harvest_assembly_date` string, required: The assembly's creation date, formatted `MM/DD/YYYY` in the requesting user's timezone (e.g. `01/15/2026`). Always present.
    - `harvest_assembly_number` string, required: The assembly's human-readable number. Always present.
    - `harvest_name` string: The harvest name. For an input row this is that input's harvest; for output and cost rows it is the assembly's first input's harvest. Null when the harvest has no name.
    - `line_item_id` string, required: Identifies the specific line item this row represents (the input, output, or cost line item, matching `cost_input_output`). Always present.
    - `location` string: The location name — the input's location on `Input` rows, the output's location on `Output` and `Cost` rows. Null when no location is set.
    - `location_id` string, required: The ID of the location named in `location` — the `id` [GET /public/v1/locations](#get-locations) returns.
    - `output_batch_number` string: The output's batch number. Populated only on `Output` rows; null on `Input` and `Cost` rows.
    - `output_package_number` string: The output package's compliance label (its package tag in the state traceability system — Metrc or BioTrack), falling back to the output's Metrc label. Populated only on `Output` rows; null on `Input` and `Cost` rows, and null on `Output` rows that carry neither a package compliance tag nor a Metrc label.
    - `output_reference_id` string: The ID of the output this cost line item belongs to. Populated only on `Cost` rows; null on `Input` and `Output` rows.
    - `package_id` string: The output's package ID — the `id` [GET /public/v1/packages](#get-packages) returns. Populated only on `Output` rows once the output has a package (a pending assembly's outputs have none yet); null on `Input` and `Cost` rows.
    - `product_category` string: The output product's category. Populated only on `Output` rows; null on `Input` and `Cost` rows.
    - `product_id` string: The output product's ID — the `id` [GET /public/v1/products](#get-products) returns. Populated only on `Output` rows; null on `Input` rows (an input is a harvest, not a product) and on `Cost` rows.
    - `quantity` string, required: The line item's quantity in `unit_type`: the input quantity consumed, the output quantity produced, or the cost line item's quantity. For package-tracked outputs this is the compliance (Metrc) quantity when available, otherwise the output's own quantity. Always present.
    - `status` 'PENDING' | 'COMPLETED', required: The assembly status: `PENDING` (not yet completed) or `COMPLETED`. Same value on every row of the assembly. SCREAMING_CASE. Always present.
    - `strain` string: The strain name (the harvest's Metrc strain). Sourced like `harvest_name`. Null when the harvest has no strain recorded.
    - `total_cost_actual` string: Actual total cost — `unit_cost_actual` multiplied by the row's quantity. Null when no cost is traced for the row. Omitted entirely (key absent) for users without permission to view costs.
    - `total_cost_default` string: Default (standard) total cost — `unit_cost_default` multiplied by the row's quantity. Null when no cost is traced for the row. Omitted entirely (key absent) for users without permission to view costs.
    - `unit_cost_actual` string: Actual cost per unit — the real cost Distru traces to the inputs and components that produced this inventory (purchase prices, assembly costs, stock-adjustment costs, and so on), per unit. Null when no cost is traced for the row. Omitted entirely (key absent) for users without permission to view costs.
    - `unit_cost_default` string: Default (standard) cost per unit — traced the same way as `unit_cost_actual`, but each input/component is valued at its product's configured unit cost instead of its real cost. Null when no cost is traced for the row. Omitted entirely (key absent) for users without permission to view costs.
    - `unit_type` string: The unit of measure for `quantity` (e.g. the harvest's unit on inputs, the product's unit on outputs, the cost type's unit on costs). Null when no unit applies.
  - `meta` HarvestOutputsReportMeta, required: Report-level metadata
    - `columns` HarvestOutputsReportColumn[], required: The report's column definitions, in order, each mapping a `data` row key to its human-readable label. Reflects the columns actually present in `data` — the cost columns are absent for users without permission to view costs. Always present.
      - `key` string, required: The key used for this column in each data row
      - `label` string, required: The human-readable label of the column
    - `date_range` string, required: The resolved date range the report covers, as a human-readable label (reflects the `datetime` filter, or the default last-7-days range when it was omitted). Always present.
    - `report` string, required: The report identifier — always `harvest_outputs`.

## Other responses

- `400`: Invalid parameters
- `401`: Missing or invalid API token
- `403`: The API token lacks the required permission, or team restrictions hide the record

## Changes

- **2026-10-07** `e8639f7dafed`: 4 info
  - added the optional property `data/items/batch_id` to the response with the `200` status
  - added the optional property `data/items/package_id` to the response with the `200` status
  - added the optional property `data/items/product_id` to the response with the `200` status
  - added the required property `data/items/location_id` to the response with the `200` status

[Operation history](https://skmtc.dev/distru/apis/distru-api/changes/public/v1/reports/harvest-outputs/get.md)

---

[API](https://skmtc.dev/distru/apis/distru-api.md) - [All operations](https://skmtc.dev/distru/apis/distru-api/llms.txt) - [OpenAPI document](https://skmtc.dev/distru/apis/distru-api/revisions/9d851a88e82f?raw)
