[{"data":1,"prerenderedAt":7},["ShallowReactive",2],{"docs-entities\u002Fwarehouses\u002Fstock-totals":3,"docs-tabs-entities\u002Fwarehouses\u002Fstock-totals":6},{"content":4,"lastmod":5},"\n## Aggregated product stock\n\n`GET \u002Fv1\u002Fwarehouses\u002Fstock\u002Ftotals`\n\nSums each product's stock across all warehouses in your Bitrix24 account. For each product, it returns the total quantity, the total reserve, and the list of warehouses where the product is present. Read-only.\n\n## Query parameters\n\n| Parameter | Type | Default | Description |\n|----------|-----|-----------|---------|\n| `productId` | number | — | Aggregate stock for a single product only |\n| `limit` | number | — | How many products to return in the response |\n| `offset` | number | `0` | Offset within the product list |\n\n## Examples\n\n### curl — personal key\n\n```bash\ncurl \"https:\u002F\u002Fvibecode.bitrix24.com\u002Fv1\u002Fwarehouses\u002Fstock\u002Ftotals?productId=200\" \\\n  -H \"X-Api-Key: YOUR_API_KEY\"\n```\n\n### curl — OAuth application\n\n```bash\ncurl \"https:\u002F\u002Fvibecode.bitrix24.com\u002Fv1\u002Fwarehouses\u002Fstock\u002Ftotals?productId=200\" \\\n  -H \"X-Api-Key: YOUR_APP_KEY\" \\\n  -H \"Authorization: Bearer USER_SESSION_TOKEN\"\n```\n\n### JavaScript — personal key\n\n```javascript\nconst res = await fetch('https:\u002F\u002Fvibecode.bitrix24.com\u002Fv1\u002Fwarehouses\u002Fstock\u002Ftotals', {\n  headers: {\n    'X-Api-Key': 'YOUR_API_KEY',\n  },\n})\n\nconst { success, data, meta } = await res.json()\n```\n\n### JavaScript — OAuth application\n\n```javascript\nconst res = await fetch('https:\u002F\u002Fvibecode.bitrix24.com\u002Fv1\u002Fwarehouses\u002Fstock\u002Ftotals', {\n  headers: {\n    'X-Api-Key': 'YOUR_APP_KEY',\n    'Authorization': 'Bearer USER_SESSION_TOKEN',\n  },\n})\n\nconst { success, data, meta } = await res.json()\n```\n\n## Response fields\n\n| Field | Type | Description |\n|------|-----|---------|\n| `success` | boolean | Always `true` on success |\n| `data` | array | Per-product summary |\n| `data[].productId` | number | Product identifier — see [Catalog products](\u002Fdocs\u002Fentities\u002Fcatalog-products) |\n| `data[].amount` | number | Total product quantity across all warehouses |\n| `data[].quantityReserved` | number | Total product reserve across all warehouses |\n| `data[].storeIds` | array | Identifiers of warehouses where the product is present |\n| `meta.total` | number | Total number of products in the summary, before `limit` and `offset` are applied |\n| `meta.rawTotal` | number | Number of source stock rows in the Bitrix24 selection. When `truncated` is `true`, it exceeds the number of rows that made it into the summary |\n| `meta.truncated` | boolean | `true` if there are more than 5000 source stock rows and some did not make it into the summary |\n\n## Response example\n\n```json\n{\n  \"success\": true,\n  \"data\": [\n    {\n      \"productId\": 200,\n      \"amount\": 25,\n      \"quantityReserved\": 30,\n      \"storeIds\": [1, 2, 5]\n    }\n  ],\n  \"meta\": {\n    \"total\": 1,\n    \"truncated\": false,\n    \"rawTotal\": 3\n  }\n}\n```\n\n## Error response example\n\n400 — invalid `productId`:\n\n```json\n{\n  \"success\": false,\n  \"error\": {\n    \"code\": \"INVALID_PARAMS\",\n    \"message\": \"productId must be a positive integer in canonical form — digits only, no leading zero, sign, fraction or exponent\"\n  }\n}\n```\n\n## Errors\n\n| HTTP | Code | Description |\n|------|-----|---------|\n| 400 | `INVALID_PARAMS` | `productId` or `limit` is not a canonical positive integer (`100.9`, `100abc`, `1e2`, `0100` are rejected), or `offset` is negative |\n| 400 | `UNSUPPORTED_FILTER` | a `filter[]` parameter was passed — this endpoint does not support it and does not forward it to Bitrix24 |\n| 401 | `TOKEN_MISSING` | The API key has no configured tokens |\n| 403 | `SCOPE_DENIED` | The API key does not have the `catalog` scope |\n| 502 | `BITRIX_UNAVAILABLE` | Bitrix24 is unavailable |\n\nThe full list of common API errors — [Errors](\u002Fdocs\u002Ferrors).\n\n## Known specifics\n\n**Summing per product.** One product's quantity and reserve are summed across all warehouses where it is present. The list of such warehouses is in `storeIds`. If quantity is not set in a particular warehouse, it is counted as zero when summing.\n\n**Summary limit.** The summary is computed over the first 5000 stock rows. If there are more rows, `meta.truncated` is `true` and the summary is incomplete. In that case, narrow the selection with the `productId` parameter.\n\n## See also\n\n- [Warehouse stock](\u002Fdocs\u002Fentities\u002Fwarehouses\u002Fstock)\n- [List warehouses](\u002Fdocs\u002Fentities\u002Fwarehouses\u002Flist)\n- [Catalog products](\u002Fdocs\u002Fentities\u002Fcatalog-products)\n- [API reference](\u002Fdocs\u002Fapi-reference)\n","2026-09-08",{},1795415325547]