For AI agents: markdown of this page — /docs-content-en/entities/warehouses/stock.md documentation index — /llms.txt

Warehouse stock

GET /v1/warehouses/:id/stock

Returns product stock in a warehouse — one row per product that is recorded in this warehouse. Read-only: the quantity cannot be changed through this endpoint.

Path parameters

Parameter Type Description
id number Warehouse identifier

Query parameters

Parameter Type Default Description
limit number 50 Number of rows (up to 5000). When limit > 50, the response is automatically assembled from several Bitrix24 pages
offset number 0 Offset from the start of the selection, row-exact: offset=1 starts at the second row. Bitrix24 only moves the selection by a whole page of 50, so Vibecode fetches the covering page and trims the extra rows off the head. When the requested window is not covered by a single page, data arrives empty with hasMore: true and meta.warnings carries OFFSET_BEYOND_FETCHED_PAGE: raise limit

Examples

curl — personal key

Terminal
curl "https://vibecode.bitrix24.com/v1/warehouses/1/stock" \
  -H "X-Api-Key: YOUR_API_KEY"

curl — OAuth application

Terminal
curl "https://vibecode.bitrix24.com/v1/warehouses/1/stock" \
  -H "X-Api-Key: YOUR_APP_KEY" \
  -H "Authorization: Bearer USER_SESSION_TOKEN"

JavaScript — personal key

javascript
const res = await fetch('https://vibecode.bitrix24.com/v1/warehouses/1/stock', {
  headers: {
    'X-Api-Key': 'YOUR_API_KEY',
  },
})

const { success, data, meta } = await res.json()

JavaScript — OAuth application

javascript
const res = await fetch('https://vibecode.bitrix24.com/v1/warehouses/1/stock', {
  headers: {
    'X-Api-Key': 'YOUR_APP_KEY',
    'Authorization': 'Bearer USER_SESSION_TOKEN',
  },
})

const { success, data, meta } = await res.json()

Response fields

Field Type Description
success boolean Always true on success
data array Stock rows in the warehouse
data[].id number Stock row identifier
data[].productId number Product identifier — see Catalog products
data[].storeId number Warehouse identifier
data[].amount number Quantity in the warehouse. May be null — treat as 0
data[].quantityReserved number Reserved quantity. May be null — treat as 0
meta.total number Number of stock rows in the warehouse
meta.hasMore boolean Whether there are rows beyond the current page (offset + data.length < total). When true, raise limit (up to 5000) or move offset

Response example

JSON
{
  "success": true,
  "data": [
    {
      "id": 3,
      "productId": 200,
      "storeId": 1,
      "amount": 15,
      "quantityReserved": 30
    },
    {
      "id": 5,
      "productId": 201,
      "storeId": 1,
      "amount": 54,
      "quantityReserved": null
    },
    {
      "id": 9,
      "productId": 202,
      "storeId": 1,
      "amount": null,
      "quantityReserved": null
    }
  ],
  "meta": {
    "total": 3,
    "hasMore": false
  }
}

Error response example

400 — an invalid warehouse id:

JSON
{
  "success": false,
  "error": {
    "code": "INVALID_PARAMS",
    "message": "id must be a positive integer in canonical form — digits only, no leading zero, sign, fraction or exponent"
  }
}

Errors

HTTP Code Description
400 INVALID_PARAMS id or limit is not a canonical positive integer (12.5, 12abc, 1e2, 007 are rejected before the Bitrix24 call), or offset is negative
400 UNSUPPORTED_FILTER a filter[] parameter was passed — this endpoint does not support it and does not forward it to Bitrix24
401 TOKEN_MISSING The API key has no configured tokens
403 SCOPE_DENIED The API key does not have the catalog scope
502 BITRIX_UNAVAILABLE Bitrix24 is unavailable

The full list of common API errors — Errors.

Known specifics

Empty warehouse. If the warehouse has no products with stock, data is an empty array and meta.total is 0.

See also