Landed COGS history

GET /api/v1/inventory/cost-history

Return cost snapshots grouped by variant for the last N months. Powers the Landed COGS sparkline + material/freight/processing breakdown.

Operation ID: get_cost_history_api_v1_inventory_cost_history_get · View as markdown · OpenAPI slice

Authentication

Bearer token authentication. Pass your DayZero API token in the Authorization header and the target business UUID in x-business-id.

Parameters

Query

months integer default: 12

Window size in months (default 12).

Responses

200 Successful Response

window_months integer required
variants array · VariantCostHistory requiredVariantCostHistory
8 fields
variant_id string required
variant_name string
variant_sku string
product_id string
product_name string
points array · CostSnapshotPoint
latest_total_per_unit integer
trailing_delta_pct number

Percent change vs. the earliest point in the window. Null if <2 points.

401 Unauthorized - Authentication required

403 Forbidden - Insufficient permissions

422 Validation Error

detail array · ValidationError ValidationError
5 fields
loc array · string | integer required
msg string required
type string required
input object
ctx object