Get the Cost of Goods Sold report
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
Restrict the report to orders whose order date falls in this range. Format is two comma-separated ISO8601 UTC datetimes, <after>,<before>, both bounds inclusive. Either side may be left empty for an open-ended range: 2026-01-01T00:00:00Z, keeps only orders on or after Jan 1, and ,2026-02-01T00:00:00Z keeps only orders on or before Feb 1. Both sides empty is rejected. Combined with delivery_datetime (AND) when both are given. When neither this nor delivery_datetime is supplied, the report defaults to the last 30 days by order date.
Restrict the report to orders whose delivery date falls in this range. Same format as order_datetime: two comma-separated ISO8601 UTC datetimes, <after>,<before>, both bounds inclusive, with either side omittable for an open-ended range and both empty rejected. Combined with order_datetime (AND) when both are given. Supplying this filter (with or without order_datetime) suppresses the default 30-day order-date window.
Response
The Cost of Goods Sold report
Changes
No recorded changes to this endpoint across all 1 revision of this API.