inventoryAnalytics
Requires permission analytics:organization:read.
Inventory analytics for the whole organization or one warehouse: total products and value, low-stock, out-of-stock and excess-stock counts, stock by category, top-moving products, turnover and warehouse utilization. Org-wide stock valuation: needs the organization analytics read permission.
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 InventoryAnalytics {
inventoryAnalytics {
excessStockItems
inventoryTurnover
lowStockItems
outOfStockItems
totalProducts
totalValue
lowStockProducts {
productName
variantName
currentStock
minStockLevel
productId
quantity
}
}
}
curl -X POST "https://<api-host>/graphql" \
-H "Content-Type: application/json" \
-H "Authorization: Bearer $ACCESS_TOKEN" \
--data @- <<'EOF'
{
"query": "query InventoryAnalytics {\n inventoryAnalytics {\n excessStockItems\n inventoryTurnover\n lowStockItems\n outOfStockItems\n totalProducts\n totalValue\n lowStockProducts {\n productName\n variantName\n currentStock\n minStockLevel\n productId\n quantity\n }\n }\n}"
}
EOF
Response:
{
"data": {
"inventoryAnalytics": {
"excessStockItems": 0,
"inventoryTurnover": 0,
"lowStockItems": 0,
"outOfStockItems": 0,
"totalProducts": 0,
"totalValue": 0,
"lowStockProducts": [
{
"productName": "string",
"variantName": "string",
"currentStock": 0,
"minStockLevel": 0,
"productId": "string",
"quantity": 0
}
]
}
}
}
inventoryAnalytics(
warehouseId: String
): InventoryAnalytics!
Arguments
inventoryAnalytics.warehouseId ● String scalar
Only this warehouse. Omit for all warehouses.
Type
InventoryAnalytics object
Stock figures.