Skip to main content

Query warehouse availabilities

note

The warehouse code and the sku values in the examples are placeholders — use a real warehouse code from your context and your own SKUs.

Use findWarehouse query to retrieve the product and bundle availabilities of a warehouse by code (or warehouse by id). Each availability row carries the on-hand, reserved and available quantities and the time the on-hand quantity was last updated.

findWarehouse returns null when no warehouse matches the code, and fails with a MULTIPLE_RECORD_FOUND error when more than one does (see Errors).

To read the stock of one brand across all its warehouses instead, start from the brand: the findBrand query returns the same availability rows, each with its warehouse, so a single walk covers every warehouse the brand is stocked in. The Get brand products guide documents it with a verified example.

products and bundles are paginated connections: on a real catalog walk the pages with first and after (see Pagination). Availability queries cost significant query complexity points, so budget your polling accordingly.

Response
{
  "data": {
    "findWarehouse": {
      "id": "12",
      "codes": ["MIL"],
      "city": "Milano",
      "products": {
        "pageInfo": {
          "hasNextPage": false,
          "endCursor": "WzUwMV0"
        },
        "nodes": [
          {
            "id": "501",
            "sku": "SKU-1",
            "skuDescription": "Demo product",
            "brand": {
              "id": "31",
              "code": "BRAND_CODE"
            },
            "availabilities": [
              {
                "id": "8001",
                "availableQuantity": 11,
                "onHandQuantity": 12,
                "onHandQuantityUpdatedAt": "2026-07-22T09:30:00Z",
                "reservedQuantity": 1
              }
            ]
          }
        ]
      },
      "bundles": {
        "pageInfo": {
          "hasNextPage": false,
          "endCursor": "WzYwMV0"
        },
        "nodes": [
          {
            "id": "601",
            "sku": "BUNDLE-1",
            "brand": {
              "id": "31",
              "code": "BRAND_CODE"
            },
            "availabilities": [
              {
                "id": "9001",
                "availableQuantity": 3,
                "onHandQuantity": 5,
                "onHandQuantityUpdatedAt": "2026-07-22T09:30:00Z",
                "reservedQuantity": 2
              }
            ]
          }
        ]
      }
    }
  },
  "extensions": {
    "queryComplexity": 474,
    "bucketBalance": 9526,
    "bucketRestoreRate": 100
  }
}

Minimal query: SKUs and quantities​

When all you need is the stock level of each SKU, keep the selection to sku and the quantities: the request below walks the catalog with first / after (here first: 3 to keep the response short — use 20, the maximum page size, on a real catalog) and costs a fraction of the full example above. Every product carries one availability row per warehouse it is stocked in, so a product stocked only in the queried warehouse has exactly one.

Request
query warehouseStock($after: String) {
  findWarehouse(code: "MIL") {
    products(first: 3, after: $after) {
      pageInfo {
        hasNextPage
        endCursor
      }
      nodes {
        sku
        availabilities {
          availableQuantity
          onHandQuantity
          reservedQuantity
          onHandQuantityUpdatedAt
        }
      }
    }
  }
}
Response
{
  "data": {
    "findWarehouse": {
      "products": {
        "pageInfo": {
          "hasNextPage": true,
          "endCursor": "WzUwM10"
        },
        "nodes": [
          {
            "sku": "SKU-1",
            "availabilities": [
              {
                "availableQuantity": 25,
                "onHandQuantity": 25,
                "reservedQuantity": 0,
                "onHandQuantityUpdatedAt": "2026-10-08T22:23:40.982Z"
              }
            ]
          },
          {
            "sku": "SKU-2",
            "availabilities": [
              {
                "availableQuantity": 0,
                "onHandQuantity": 0,
                "reservedQuantity": 0,
                "onHandQuantityUpdatedAt": "2026-10-08T22:23:40.982Z"
              }
            ]
          },
          {
            "sku": "SKU-3",
            "availabilities": [
              {
                "availableQuantity": 11,
                "onHandQuantity": 12,
                "reservedQuantity": 1,
                "onHandQuantityUpdatedAt": "2026-10-09T11:42:26.803Z"
              }
            ]
          }
        ]
      }
    }
  },
  "extensions": {
    "queryComplexity": 24,
    "bucketBalance": 9976,
    "bucketRestoreRate": 100
  }
}

Pass {"after": null} on the first call, then the endCursor of the previous page while hasNextPage is true. onHandQuantity is the physical stock, reservedQuantity the part committed to orders and availableQuantity what is left to sell; onHandQuantityUpdatedAt is when the physical stock was last updated.

Relevant permissions

The operations in this page require the following permissions on the API credentials — they are configured for you by Calicantus.

  • warehouse:query:find_warehouse
  • warehouse:read
  • product:read
  • bundle:read
  • brand:read
  • product_availability:read