Skip to main content

Fetch product stock across warehouses

Check real-time inventory for a product, broken down by warehouse location, including supplier stock and next delivery date.

Query

query GetProductStock($productId: Int!) {
product(productId: $productId) {
productId
inventory {
totalQuantity
localQuantity
supplierQuantity
nextDeliveryDate
balance {
quantity
warehouseId
}
}
}
}

Variables

{
"productId": 12345
}

Response

{
"data": {
"product": {
"productId": 12345,
"inventory": {
"totalQuantity": 340,
"localQuantity": 200,
"supplierQuantity": 140,
"nextDeliveryDate": "2026-03-01",
"balance": [
{ "quantity": 120, "warehouseId": 1 },
{ "quantity": 80, "warehouseId": 2 }
]
}
}
}
}

How it works

totalQuantity is the sum of localQuantity (your own warehouses) and supplierQuantity (external suppliers). The balance array breaks stock down per warehouse so you can show regional availability or route orders to the nearest fulfillment location.