---
title: "Get the Cost of Goods Sold report"
method: GET
path: "/public/v1/reports/cogs"
tags: ["Cogs"]
---

# Get the Cost of Goods Sold report

`GET /public/v1/reports/cogs`

Read-only report. Returns one row per sold sales order line item over the reported date range, each carrying the product's descriptive attributes (name, SKU, brand, category), its package, batch, and Metrc production batch, plus the item's quantity, unit type, unit and total price, and both actual and default cost figures (unit cost, total cost, total profit, profit per unit, and margin). A row is included only when its order has reached COMPLETED status and the line item has not been fully returned; the reported `quantity` is the ordered quantity net of any returns. Rows are grouped by order and line item. Sample line items are omitted when your company is configured to exclude samples from cost reporting, so a completed order's sample lines may not appear here even though the order does.

Every row returned by this endpoint is a sold-item row — `final_input` is always `Final` and `cost_origin` is always null. The per-component cost breakdown that can otherwise appear (input rows) is not exposed here.

Filtering:
• `order_datetime` and `delivery_datetime` each narrow the set by a date range and are combined with AND when both are supplied.
• When neither filter is provided, the report defaults to orders whose order date falls in the last 30 days (up to now) to avoid scanning your entire order history. There is no all-time default — send an explicit range to widen it.

Cost figures (`unit_cost_*`, `total_cost_*`, `total_profits_*`, `profit_unit_*`, `margin_*`) can be null on a row when Distru cannot trace a cost back to the inputs and components that produced the sold inventory; the `*_actual` and `*_default` variants value those inputs at their real cost versus each product's configured unit cost. Margin is also null when the row's total price is 0.

Every cell is returned as it appears in the report's CSV export, with numeric cells returned as strings (currency, thousands, and percent formatting stripped, e.g. `"1234.56"`) so they match the rest of the API; identifiers with a significant leading zero (e.g. an order number like "0042") keep their display string. Companies on the BioTrack compliance integration do not receive the `metrc_production_batch_number` key at all — the column is dropped for them. Report-level information (the generated-at date and the column definitions) is returned under `meta`.

Required permission: `reports_permissions_cogs`.

## Query parameters

- `order_datetime` string
- `delivery_datetime` string

## Response `200`

The Cost of Goods Sold report

## Other responses

- `400` — Invalid parameters
- `401` — Missing or invalid API token
- `403` — The API token lacks the required permission

---

[API](https://skmtc.dev/distru/apis/distru-api.md) · [All operations](https://skmtc.dev/distru/apis/distru-api/llms.txt) · [OpenAPI document](https://skmtc-service-production.skmtc.workers.dev/v1/apis/distru/distru-api/revisions/eb775b7b6ee0/schema)
