Inventory insights
Base URL: https://api.miridia.io. Read Authentication and Conventions before you call these operations.
| Method | Path | Operation |
|---|---|---|
| GET | /api/v1/insights/inventory/days-of-cover | Get days of cover |
Get days of cover
GET/api/v1/insights/inventory/days-of-cover
Returns the days-of-cover grid for the business: the on-hand quantity, the trailing demand, and the resulting days of cover, for every (product, location) inventory record. Defaults to the current day and a 28-day window when asOf/windowDays are not supplied.
Access. Send a bearer token or an API key. The caller needs the Insights view permission.
Parameters
| Name | In | Type | Required | Description |
|---|---|---|---|---|
asOf | query | string (date-time) | No | |
windowDays | query | integer (int32) | No | Default: 28. |
Response
200. Returns a SingleResult envelope. The data field is DaysOfCoverResponse.
curl -X GET "https://api.miridia.io/api/v1/insights/inventory/days-of-cover" \
-H "Authorization: Bearer $MIRIDIA_TOKEN" \
-H "X-Business-Id: $MIRIDIA_BUSINESS_ID"{
"message": "string",
"messages": [
{
"title": "string",
"message": "string",
"level": "Standard",
"icon": "SyncAlert",
"code": "string"
}
],
"data": {
"asOf": "2026-09-29T08:00:00Z",
"windowDays": 0,
"products": [
{}
],
"locations": [
{}
],
"cells": [
{}
]
},
"statusCode": "OK",
"canRead": true,
"canEdit": true,
"canDelete": true
}Models
The operations on this page use these object types. Select a type to see its fields.
DaysOfCoverCellResponse
One cell of the days-of-cover grid: the on-hand quantity, the trailing demand, and the days of cover for one product at one location.
| Field | Type | Description |
|---|---|---|
productId | string (uuid) | |
locationId | string (uuid) | |
quantityOnHand | number (double) | |
averageDailyDemand | number (double) | Units of the product ordered from this origin location per day, over the trailing window. |
daysOfCover | number (double) | QuantityOnHand divided by AverageDailyDemand. Null when AverageDailyDemand is zero. |
previousDaysOfCover | number (double) | The same calculation with demand from the window directly before the current one, and the same QuantityOnHand. Null when the previous window's demand is zero. |
reorderPoint | number (double) |
DaysOfCoverLocationResponse
One location on the days-of-cover location axis.
| Field | Type | Description |
|---|---|---|
locationId | string (uuid) | |
title | string | |
locationType | enum BusinessLocationType | One of: Office, Warehouse, Storefront, Remote, Other, Headquarters, Factory. |
DaysOfCoverProductResponse
One product on the days-of-cover product axis.
| Field | Type | Description |
|---|---|---|
productId | string (uuid) | |
title | string | |
sku | string |
DaysOfCoverResponse
The days-of-cover projection for a business: the on-hand quantity, the trailing demand, and the resulting days of cover, for every (product, location) inventory record.
| Field | Type | Description |
|---|---|---|
asOf | string (date-time) | |
windowDays | integer (int32) | |
products | DaysOfCoverProductResponse[] | |
locations | DaysOfCoverLocationResponse[] | |
cells | DaysOfCoverCellResponse[] |