Get Product Stock Coverage
GET/api/reporting/products/:product/stock-coverage
Daily Average Consumption (DAC) and Days of Stock reconstructed as a 12-month monthly time series for a product. No history is stored for either metric, so both are rebuilt from source ledgers: DAC at each month is gross units sold over the trailing sales-history window divided by that window length; on-hand at each month is the running balance of stock movements up to that month; Days of Stock is on-hand divided by DAC (null when DAC is 0, i.e. coverage is effectively infinite).
Authentication: Requires Bearer token (scope: reports)
Path parameter:
- product: the product ID
Query parameter:
- months: span of the series - an integer count of trailing months (e.g. 12, 24) or 'all' for the product's full ledger history (capped at 60 months). Default: 12.
Response fields:
- buckets: 12 month labels (YYYY-MM), oldest first
- window_days: the trailing DAC window length in days
- dac / units_sold / on_hand / days_of_stock: parallel arrays aligned to buckets (units_sold is the raw units sold that calendar month; dac is the trailing-window daily average) (days_of_stock entries are null where DAC is 0)
- current: the latest bucket's dac, on_hand and days_of_stock
Request
Responses
- 200
- 401
- 403
- 404
- 429
OK
Response Headers
Unauthenticated — the bearer token is missing, revoked, expired, or malformed. Never retry automatically; fix the credential. See the Errors guide.
Forbidden — the token lacks a required scope, the endpoint is not available to API tokens, or the user behind the token lacks the permission. A human must adjust the token scopes or user permissions; do not retry.
Not found — no record with the given identifier (or the route does not exist). Verify the ID before retrying.
Rate limited — platform limit is 1,000 requests/min; individual tokens may carry lower limits. Honor the Retry-After header before retrying. See the Rate Limits guide.