Margin-by-SKU report (landed cost + sales velocity)

GET /api/v1/inventory/reports/margin-by-sku

Returns per-variant landed cost (latest cost snapshot), current sell price, gross margin, and trailing Shopify sales over the configured lookback window. Powers the Landed COGS 'Truth' tab.

Operation ID: get_margin_by_sku_api_v1_inventory_reports_margin_by_sku_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

lookback_days integer default: 30

Trailing window (days) used to compute revenue + units sold.

limit integer default: 100

Max variants returned (sorted by trailing revenue desc).

Responses

200 Successful Response

rows array · MarginRow MarginRow
16 fields
variant_id string required
product_id string
product_name string
variant_name string
sku string
price_cents integer required
landed_cost_cents integer required
margin_cents integer required
margin_pct number
layers MarginLayerBreakdown requiredMarginLayerBreakdown
units_sold integer
revenue_cents integer
cogs_cents integer
daily_velocity number
snapshot_month string
snapshot_source string
lookback_days integer
totals MarginTotals MarginTotals
4 fields
revenue_cents integer
cogs_cents integer
gross_margin_cents integer
units_sold integer

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