inventorySummary
Requires permission inventory:stock_level:read.
Returns headline stock figures: total products and variants, total and available quantity, and the number of low-stock, out-of-stock and overstock items. Pass warehouseId or productId to narrow it. Needs the stock level 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 InventorySummary {
inventorySummary {
lowStockItems
outOfStockItems
overstockItems
totalAvailable
totalProducts
totalQuantity
recentMovements {
type
count
quantity
value
}
}
}
curl -X POST "https://<api-host>/graphql" \
-H "Content-Type: application/json" \
-H "Authorization: Bearer $ACCESS_TOKEN" \
--data @- <<'EOF'
{
"query": "query InventorySummary {\n inventorySummary {\n lowStockItems\n outOfStockItems\n overstockItems\n totalAvailable\n totalProducts\n totalQuantity\n recentMovements {\n type\n count\n quantity\n value\n }\n }\n}"
}
EOF
Response:
{
"data": {
"inventorySummary": {
"lowStockItems": 0,
"outOfStockItems": 0,
"overstockItems": 0,
"totalAvailable": 0,
"totalProducts": 0,
"totalQuantity": 0,
"recentMovements": [
{
"type": "ADJUSTMENT",
"count": 0,
"quantity": 0,
"value": 0
}
]
}
}
}
inventorySummary(
productId: ID
warehouseId: ID
): InventorySummary!
Arguments
inventorySummary.productId ● ID scalar
Only this product.
inventorySummary.warehouseId ● ID scalar
Only this warehouse.
Type
InventorySummary object
Headline stock figures for the inventory dashboard.