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
Parameterid Typenumber DescriptionWarehouse identifier from the warehouse list

Query parameters

Parameter Type Default Description
ParameterproductId Typenumber Default- DescriptionProduct identifier from the catalog product list, a canonical positive safe integer. Selects only this product within the requested warehouse
Parameterlimit Typenumber Default50 DescriptionNumber of rows (up to 5000). When limit > 50, the response is automatically assembled from several Bitrix24 pages
Parameteroffset Typenumber Default0 DescriptionOffset 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?productId=200" \
  -H "X-Api-Key: YOUR_API_KEY"

curl — OAuth application

Terminal
curl "https://vibecode.bitrix24.com/v1/warehouses/1/stock?productId=200" \
  -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?productId=200', {
  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?productId=200', {
  headers: {
    'X-Api-Key': 'YOUR_APP_KEY',
    'Authorization': 'Bearer USER_SESSION_TOKEN',
  },
})

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

Response fields

Field Type Description
Fieldsuccess Typeboolean DescriptionAlways true on success
Fielddata Typearray DescriptionStock rows in the warehouse
Fielddata[].id Typenumber DescriptionStock row identifier. Use it to read a single row with Warehouse stock record
Fielddata[].productId Typenumber DescriptionProduct identifier — see the catalog product list
Fielddata[].storeId Typenumber DescriptionWarehouse identifier from the warehouse list, equal to id in the path
Fielddata[].amount Typenumber DescriptionQuantity in the warehouse. May be null — treat as 0
Fielddata[].quantityReserved Typenumber DescriptionReserved quantity. May be null — treat as 0
Fieldmeta.total Typenumber DescriptionNumber of stock rows in the warehouse
Fieldmeta.hasMore Typeboolean DescriptionWhether 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
HTTP400 CodeINVALID_PARAMS Descriptionid, productId or limit is not a canonical positive integer (12.5, 12abc, 1e2, 007 are rejected before the Bitrix24 call), or offset is negative
HTTP400 CodeUNSUPPORTED_FILTER Descriptiona filter[] parameter was passed — this endpoint does not support it and does not forward it to Bitrix24
HTTP401 CodeTOKEN_MISSING DescriptionThe API key has no configured tokens
HTTP403 CodeSCOPE_DENIED DescriptionThe API key does not have the catalog scope
HTTP502 CodeBITRIX_UNAVAILABLE DescriptionBitrix24 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