inventoryAnalyticsV2
Requires an authenticated session.
Inventory analytics for a date range: valuation, stock-outs, dead stock, oversold items, shrinkage, expiring batches, the mix of movements and the turnover ratio. The range is required and limited to 400 days.
Errors: a failed call returns a GraphQL errors entry, not a field on the result, and data may be null or partial. Read the entry's extensions.code and message; every shape and code is in the Error reference.
Example:
- GraphQL
- cURL
query InventoryAnalyticsV2($range: InventoryRangeInput!) {
inventoryAnalyticsV2(range: $range) {
oversold
stockouts
turnoverRatio
deadStock {
productName
lastMovementAt
productId
quantity
value
variantSku
}
}
}
curl -X POST "https://<api-host>/graphql" \
-H "Content-Type: application/json" \
-H "Authorization: Bearer $ACCESS_TOKEN" \
--data @- <<'EOF'
{
"query": "query InventoryAnalyticsV2($range: InventoryRangeInput!) {\n inventoryAnalyticsV2(range: $range) {\n oversold\n stockouts\n turnoverRatio\n deadStock {\n productName\n lastMovementAt\n productId\n quantity\n value\n variantSku\n }\n }\n}",
"variables": {
"range": {
"from": "2025-01-15T00:00:00Z",
"to": "2025-01-15T00:00:00Z"
}
}
}
EOF
Variables:
{
"range": {
"from": "2025-01-15T00:00:00Z",
"to": "2025-01-15T00:00:00Z"
}
}
Response:
{
"data": {
"inventoryAnalyticsV2": {
"oversold": 0,
"stockouts": 0,
"turnoverRatio": 0,
"deadStock": [
{
"productName": "string",
"lastMovementAt": "2025-01-15T00:00:00Z",
"productId": "id",
"quantity": 0,
"value": 0,
"variantSku": "string"
}
]
}
}
}
inventoryAnalyticsV2(
range: InventoryRangeInput!
): InventoryAnalyticsV2!
Arguments
inventoryAnalyticsV2.range ● InventoryRangeInput! non-null input
The date range and optional warehouse to report on.
Type
InventoryAnalyticsV2 object
Stock figures for the period.