[{"data":1,"prerenderedAt":14},["ShallowReactive",2],{"docs-entities\u002Fcatalog-document-elements":3,"docs-tabs-entities\u002Fcatalog-document-elements":6},{"content":4,"lastmod":5},"# Inventory document items\n\nProduct lines of [inventory documents](.\u002Fcatalog-documents.md): which product moves, in what quantity, at what purchase price, and between which warehouses. One document can have several items. Items can be changed until the document is conducted.\n\nBitrix24 API: `catalog.document.element.*`\nScope: `catalog`\n\n## Operations\n\n- [Create an item](.\u002Fcatalog-document-elements\u002Fcreate.md) — `POST \u002Fv1\u002Fcatalog-document-elements`\n- [List items](.\u002Fcatalog-document-elements\u002Flist.md) — `GET \u002Fv1\u002Fcatalog-document-elements`\n- [Get an item](.\u002Fcatalog-document-elements\u002Fget.md) — `GET \u002Fv1\u002Fcatalog-document-elements\u002F:id`\n- [Update an item](.\u002Fcatalog-document-elements\u002Fupdate.md) — `PATCH \u002Fv1\u002Fcatalog-document-elements\u002F:id`\n- [Delete an item](.\u002Fcatalog-document-elements\u002Fdelete.md) — `DELETE \u002Fv1\u002Fcatalog-document-elements\u002F:id`\n- [Search items](.\u002Fcatalog-document-elements\u002Fsearch.md) — `POST \u002Fv1\u002Fcatalog-document-elements\u002Fsearch`\n- [Item fields](.\u002Fcatalog-document-elements\u002Ffields.md) — `GET \u002Fv1\u002Fcatalog-document-elements\u002Ffields`\n\n## Key fields\n\n| Field | Type | Description |\n|------|-----|---------|\n| `id` | number | Item ID (read-only) |\n| `docId` | number | Document — an ID from [`GET \u002Fv1\u002Fcatalog-documents`](\u002Fdocs\u002Fentities\u002Fcatalog-documents\u002Flist). Set only on create |\n| `elementId` | number | Product — an ID from [`GET \u002Fv1\u002Fcatalog-products`](\u002Fdocs\u002Fentities\u002Fcatalog-products\u002Flist). Set only on create |\n| `amount` | number | Product quantity |\n| `purchasingPrice` | number | Purchase price per unit |\n| `storeFrom` | number | Source warehouse — an ID from [`GET \u002Fv1\u002Fwarehouses`](\u002Fdocs\u002Fentities\u002Fwarehouses\u002Flist) |\n| `storeTo` | number | Destination warehouse — an ID from [`GET \u002Fv1\u002Fwarehouses`](\u002Fdocs\u002Fentities\u002Fwarehouses\u002Flist) |\n\nFull field list — [`GET \u002Fv1\u002Fcatalog-document-elements\u002Ffields`](.\u002Fcatalog-document-elements\u002Ffields.md).\n\n## Before you start\n\n1. **The request body is flat.** On create and update, pass fields directly at the JSON root: `{\"docId\": 42, \"elementId\": 6595, \"amount\": 3}`. No `fields` wrapper is needed.\n2. **`docId` and `elementId` are required on create.** Neither field can be changed after creation: an update request that includes them returns `400 READONLY_FIELD`. To move a product to another document or replace the product, delete the item and create a new one.\n3. **Warehouses depend on the document type.** A goods receipt (`A`), a stock adjustment (`S`) and a return (`R`) need the destination warehouse `storeTo`, a write-off (`D`) needs the source warehouse `storeFrom`, and a transfer (`M`) needs both. An item with unsuitable warehouses is created without an error, but conducting the document is rejected with `422 BITRIX_ERROR` and the name of the product that has no warehouse set.\n4. **Items of a conducted document cannot be changed.** Adding an item to a conducted document, updating its items, and deleting them are rejected with `422 BITRIX_ERROR`. First, [cancel conducting the document](\u002Fdocs\u002Fentities\u002Fcatalog-documents\u002Fcancel).\n5. **Items are deleted together with the document.** You do not need to delete them separately before [deleting the document](\u002Fdocs\u002Fentities\u002Fcatalog-documents\u002Fdelete). After deletion, requesting an item by its `id` returns `404 ENTITY_NOT_FOUND`.\n\n## Related entities\n\n| Entity | Endpoint | Purpose |\n|----------|----------|-----------|\n| Inventory documents | [`GET \u002Fv1\u002Fcatalog-documents`](\u002Fdocs\u002Fentities\u002Fcatalog-documents\u002Flist) | The document the item belongs to — the `docId` value. The document type determines which warehouses the item needs. |\n| Catalog products | [`GET \u002Fv1\u002Fcatalog-products`](\u002Fdocs\u002Fentities\u002Fcatalog-products\u002Flist) | Products for the `elementId` field. |\n| Warehouses | [`GET \u002Fv1\u002Fwarehouses`](\u002Fdocs\u002Fentities\u002Fwarehouses\u002Flist) | Warehouses for the `storeFrom` and `storeTo` fields. Stock after conducting — [`GET \u002Fv1\u002Fwarehouses\u002F:id\u002Fstock`](\u002Fdocs\u002Fentities\u002Fwarehouses\u002Fstock). |\n\n## Typical scenario\n\nFilling a document with products before conducting it:\n\n1. Find the document: [`GET \u002Fv1\u002Fcatalog-documents`](\u002Fdocs\u002Fentities\u002Fcatalog-documents\u002Flist) — take `id` and `docType`.\n2. View its items: [`GET \u002Fv1\u002Fcatalog-document-elements?filter[docId]=:id`](.\u002Fcatalog-document-elements\u002Flist.md).\n3. Add a product: [`POST \u002Fv1\u002Fcatalog-document-elements`](.\u002Fcatalog-document-elements\u002Fcreate.md) with `docId`, `elementId`, `amount`, and the warehouses the document type requires.\n4. Correct the quantity or price: [`PATCH \u002Fv1\u002Fcatalog-document-elements\u002F:id`](.\u002Fcatalog-document-elements\u002Fupdate.md).\n5. Conduct the document: [`POST \u002Fv1\u002Fcatalog-documents\u002F:id\u002Fconduct`](\u002Fdocs\u002Fentities\u002Fcatalog-documents\u002Fconduct).\n\n## Limits\n\n| Limit | Value |\n|-------|----------|\n| Maximum records per request | 5000 (`limit ≤ 5000`) |\n| Automatic pagination | enabled when `limit > 50` |\n| `offset` on large result sets | `limit ≤ 500` recommended when `offset ≥ 2500` |\n| Batch requests | up to 50 operations in [`POST \u002Fv1\u002Fbatch`](\u002Fdocs\u002Fbatch) |\n| Request rate | shared across the Vibecode API — see [Limits and optimization](\u002Fdocs\u002Foptimization) |\n\n## See also\n\n- [Inventory documents](.\u002Fcatalog-documents.md)\n- [Warehouses](.\u002Fwarehouses.md)\n- [Catalog products](.\u002Fcatalog-products.md)\n- [Filtering syntax](\u002Fdocs\u002Ffiltering)\n- [Batch](\u002Fdocs\u002Fbatch)\n- [API reference](\u002Fdocs\u002Fapi-reference)\n","2026-10-13",{"catalog-document-elements\u002Fcreate.md":7,"catalog-document-elements\u002Flist.md":8,"catalog-document-elements\u002Fget.md":9,"catalog-document-elements\u002Fupdate.md":10,"catalog-document-elements\u002Fdelete.md":11,"catalog-document-elements\u002Fsearch.md":12,"catalog-document-elements\u002Ffields.md":13},"## Create an inventory document item\n\n`POST \u002Fv1\u002Fcatalog-document-elements`\n\nAdds an item to an inventory document.\n\nPass fields flat at the JSON root, without a `fields` wrapper.\n\n## Request fields (body)\n\n| Field | Type | Required | Description |\n|------|-----|:-----:|---------|\n| `docId` | number | yes | Document ID. List: [`GET \u002Fv1\u002Fcatalog-documents`](\u002Fdocs\u002Fentities\u002Fcatalog-documents\u002Flist). Cannot be changed after creation |\n| `elementId` | number | yes | Product ID. List: [`GET \u002Fv1\u002Fcatalog-products`](\u002Fdocs\u002Fentities\u002Fcatalog-products\u002Flist). Cannot be changed after creation |\n| `amount` | number | no | Product quantity |\n| `purchasingPrice` | number | no | Purchase price per unit |\n| `storeFrom` | number | no | Source warehouse. List: [`GET \u002Fv1\u002Fwarehouses`](\u002Fdocs\u002Fentities\u002Fwarehouses\u002Flist). Which warehouse a document needs depends on its type — see [inventory document items](\u002Fdocs\u002Fentities\u002Fcatalog-document-elements) |\n| `storeTo` | number | no | Destination warehouse. List: [`GET \u002Fv1\u002Fwarehouses`](\u002Fdocs\u002Fentities\u002Fwarehouses\u002Flist) |\n\n## Examples\n\n### curl — personal key\n\n```bash\ncurl -X POST \"https:\u002F\u002Fvibecode.bitrix24.com\u002Fv1\u002Fcatalog-document-elements\" \\\n  -H \"X-Api-Key: YOUR_API_KEY\" \\\n  -H \"Content-Type: application\u002Fjson\" \\\n  -d '{\n    \"docId\": 299,\n    \"elementId\": 6595,\n    \"amount\": 3,\n    \"purchasingPrice\": 11000,\n    \"storeTo\": 11\n  }'\n```\n\n### curl — OAuth application\n\n```bash\ncurl -X POST \"https:\u002F\u002Fvibecode.bitrix24.com\u002Fv1\u002Fcatalog-document-elements\" \\\n  -H \"X-Api-Key: YOUR_APP_KEY\" \\\n  -H \"Authorization: Bearer USER_SESSION_TOKEN\" \\\n  -H \"Content-Type: application\u002Fjson\" \\\n  -d '{\n    \"docId\": 299,\n    \"elementId\": 6595,\n    \"amount\": 3,\n    \"purchasingPrice\": 11000,\n    \"storeTo\": 11\n  }'\n```\n\n### JavaScript — personal key\n\n```javascript\nconst res = await fetch('https:\u002F\u002Fvibecode.bitrix24.com\u002Fv1\u002Fcatalog-document-elements', {\n  method: 'POST',\n  headers: {\n    'X-Api-Key': 'YOUR_API_KEY',\n    'Content-Type': 'application\u002Fjson',\n  },\n  body: JSON.stringify({\n    docId: 299,\n    elementId: 6595,\n    amount: 3,\n    purchasingPrice: 11000,\n    storeTo: 11,\n  }),\n})\n\nconst { success, data } = await res.json()\nconsole.log('Position ID:', data.id)\n```\n\n### JavaScript — OAuth application\n\n```javascript\nconst res = await fetch('https:\u002F\u002Fvibecode.bitrix24.com\u002Fv1\u002Fcatalog-document-elements', {\n  method: 'POST',\n  headers: {\n    'X-Api-Key': 'YOUR_APP_KEY',\n    'Authorization': 'Bearer USER_SESSION_TOKEN',\n    'Content-Type': 'application\u002Fjson',\n  },\n  body: JSON.stringify({\n    docId: 299,\n    elementId: 6595,\n    amount: 3,\n    purchasingPrice: 11000,\n    storeTo: 11,\n  }),\n})\n\nconst { success, data } = await res.json()\n```\n\n## Response fields\n\nHTTP status `201 Created`.\n\n| Field | Type | Description |\n|------|-----|---------|\n| `success` | boolean | `true` on successful creation |\n| `data.id` | number | ID of the created item |\n| `data.docId` | number | Document ID. Document — [`GET \u002Fv1\u002Fcatalog-documents\u002F:id`](\u002Fdocs\u002Fentities\u002Fcatalog-documents\u002Fget) |\n| `data.elementId` | number | Product ID. Product — [`GET \u002Fv1\u002Fcatalog-products\u002F:id`](\u002Fdocs\u002Fentities\u002Fcatalog-products\u002Fget) |\n| `data.amount` | number \\| null | Product quantity. `null` if not passed |\n| `data.purchasingPrice` | number \\| null | Purchase price per unit. `null` if not passed |\n| `data.storeFrom` | number \\| null | Source warehouse. `null` if not passed. Warehouses — [`GET \u002Fv1\u002Fwarehouses`](\u002Fdocs\u002Fentities\u002Fwarehouses\u002Flist) |\n| `data.storeTo` | number \\| null | Destination warehouse. `null` if not passed. Warehouses — [`GET \u002Fv1\u002Fwarehouses`](\u002Fdocs\u002Fentities\u002Fwarehouses\u002Flist) |\n| `meta.warnings` | array | Present only if the body contains a field that is not among the item fields. Each element has `code: \"UNRECOGNIZED_WRITE_FIELD\"`, `field` with the field name, and `message`. On a route that wraps the field map itself, an object under `fields` is rejected with `400 NESTED_FIELDS_ENVELOPE` when the schema does not declare `fields`; pass fields flat at the JSON root. |\n\n## Response example\n\n```json\n{\n  \"success\": true,\n  \"data\": {\n    \"amount\": 3,\n    \"docId\": 299,\n    \"elementId\": 6595,\n    \"id\": 33,\n    \"purchasingPrice\": 11000,\n    \"storeFrom\": null,\n    \"storeTo\": 11\n  }\n}\n```\n\n## Error response example\n\n404 — no document with the given `docId`:\n\n```json\n{\n  \"success\": false,\n  \"error\": {\n    \"code\": \"ENTITY_NOT_FOUND\",\n    \"message\": \"Document not found\"\n  }\n}\n```\n\n## Errors\n\n| HTTP | Code | Description |\n|------|-----|---------|\n| 404 | `ENTITY_NOT_FOUND` | No document with the given `docId`. Message — `Document not found` |\n| 400 | `MISSING_REQUIRED_FIELDS` | A required field was not passed. The message names it: `Body field \"elementId\" is required to create catalogDocumentElement.` |\n| 400 | `READONLY_FIELD` | The body contains `id`, a read-only field |\n| 400 | `INVALID_PARAMS` | A field value has the wrong type: a non-numeric string in a numeric field, for example `\"amount\": \"abc\"`, or an object or array instead of a number or string. The field name is in `error.message` |\n| 422 | `BITRIX_ERROR` | The document is conducted. Message `Conducted document`, `b24Code` — `ERROR_DOCUMENT_STATUS`. First [cancel conducting](\u002Fdocs\u002Fentities\u002Fcatalog-documents\u002Fcancel) |\n| 403 | `WRITE_BLOCKED_READONLY_KEY` | The key works in read-only mode |\n| 403 | `SCOPE_DENIED` | The API key does not have the `catalog` scope |\n| 401 | `TOKEN_MISSING` | The API key has no configured tokens |\n| 401 | `MISSING_API_KEY` | The `X-Api-Key` header was not passed |\n| 401 | `INVALID_API_KEY` | The passed API key was not found |\n\nFull list of common API errors — [Errors](\u002Fdocs\u002Ferrors).\n\n## See also\n\n- [List items](\u002Fdocs\u002Fentities\u002Fcatalog-document-elements\u002Flist)\n- [Update an item](\u002Fdocs\u002Fentities\u002Fcatalog-document-elements\u002Fupdate)\n- [Delete an item](\u002Fdocs\u002Fentities\u002Fcatalog-document-elements\u002Fdelete)\n- [Item fields](\u002Fdocs\u002Fentities\u002Fcatalog-document-elements\u002Ffields)\n- [Create an inventory document](\u002Fdocs\u002Fentities\u002Fcatalog-documents\u002Fcreate)\n- [Conduct a document](\u002Fdocs\u002Fentities\u002Fcatalog-documents\u002Fconduct)\n- [Batch](\u002Fdocs\u002Fbatch)\n","## List inventory document items\n\n`GET \u002Fv1\u002Fcatalog-document-elements`\n\nReturns inventory document items with filtering, sorting, and pagination.\n\n## Parameters\n\n| Parameter | Type | Default | Description |\n|----------|-----|-----------|---------|\n| `filter` (query) | object | — | Filter by fields from `GET \u002Fv1\u002Fcatalog-document-elements\u002Ffields`.\u003Cbr>[Filtering syntax](\u002Fdocs\u002Ffiltering). Example: `?filter[docId]=299` — items of one document, `docId` comes from [`GET \u002Fv1\u002Fcatalog-documents`](\u002Fdocs\u002Fentities\u002Fcatalog-documents\u002Flist) |\n| `select` (query) | string | — | Comma-separated response fields: `?select=id,elementId,amount`. The `id` field is always returned. Names come from [`GET \u002Fv1\u002Fcatalog-document-elements\u002Ffields`](\u002Fdocs\u002Fentities\u002Fcatalog-document-elements\u002Ffields) |\n| `order` (query) | object | — | Sorting: `?order[amount]=desc`. Short form — `?sort=-amount`, a minus means descending. Fields are the same as in the filter |\n| `limit` (query) | number | `50` | Number of records, up to 5000 |\n| `offset` (query) | number | `0` | Number of records to skip from the start of the result set |\n| `withTotal` (query) | string | — | `true` or `false`. The exact value `false` omits `meta.total`, but Bitrix24 still counts the items, so this option does not make the request cheaper. Without it or with `true`, the existing counted behavior applies |\n\n**Pagination.** When `limit` is greater than 50, Vibecode assembles the response from several pages automatically. Request the next page with `offset` while `meta.hasMore` is `true`.\n\n## Examples\n\n### curl — personal key\n\n```bash\ncurl -g \"https:\u002F\u002Fvibecode.bitrix24.com\u002Fv1\u002Fcatalog-document-elements?filter[docId]=299\" \\\n  -H \"X-Api-Key: YOUR_API_KEY\"\n```\n\n### curl — OAuth application\n\n```bash\ncurl -g \"https:\u002F\u002Fvibecode.bitrix24.com\u002Fv1\u002Fcatalog-document-elements?filter[docId]=299\" \\\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\u002Fcatalog-document-elements?filter[docId]=299', {\n  headers: {\n    'X-Api-Key': 'YOUR_API_KEY',\n  },\n})\n\nconst { success, data, meta } = await res.json()\nconsole.log(`Items in the document: ${meta.total}`)\n```\n\n### JavaScript — OAuth application\n\n```javascript\nconst res = await fetch('https:\u002F\u002Fvibecode.bitrix24.com\u002Fv1\u002Fcatalog-document-elements?filter[docId]=299', {\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 | Array of items |\n| `data[].id` | number | Item ID |\n| `data[].docId` | number | Inventory document ID. Document — [`GET \u002Fv1\u002Fcatalog-documents\u002F:id`](\u002Fdocs\u002Fentities\u002Fcatalog-documents\u002Fget) |\n| `data[].elementId` | number | Product ID. Product — [`GET \u002Fv1\u002Fcatalog-products\u002F:id`](\u002Fdocs\u002Fentities\u002Fcatalog-products\u002Fget) |\n| `data[].amount` | number \\| null | Product quantity, `null` — not set |\n| `data[].purchasingPrice` | number \\| null | Purchase price per unit, `null` — not set |\n| `data[].storeFrom` | number \\| null | Source warehouse, `null` — no warehouse set. Warehouses — [`GET \u002Fv1\u002Fwarehouses`](\u002Fdocs\u002Fentities\u002Fwarehouses\u002Flist) |\n| `data[].storeTo` | number \\| null | Destination warehouse, `null` — no warehouse set. Warehouses — [`GET \u002Fv1\u002Fwarehouses`](\u002Fdocs\u002Fentities\u002Fwarehouses\u002Flist) |\n| `meta.total` | number | Total number of items matching the filter. Optional: absent when `withTotal=false` |\n| `meta.hasMore` | boolean | Whether there are more items beyond `limit` |\n| `meta.warnings` | array | Request warnings, each with the fields `code`, `message`, `field`. Returned when `select` contains a name that is not in the schema — code `UNKNOWN_SELECT_FIELD` |\n\n## Response example\n\n```json\n{\n  \"success\": true,\n  \"data\": [\n    {\n      \"amount\": 3,\n      \"docId\": 299,\n      \"elementId\": 6595,\n      \"id\": 33,\n      \"purchasingPrice\": 11000,\n      \"storeFrom\": null,\n      \"storeTo\": 11\n    }\n  ],\n  \"meta\": {\n    \"total\": 1,\n    \"hasMore\": false\n  }\n}\n```\n\n## Error response example\n\n400 — filter by a field that is not in the item schema:\n\n```json\n{\n  \"success\": false,\n  \"error\": {\n    \"code\": \"UNKNOWN_FILTER_FIELD\",\n    \"message\": \"Unknown filter field 'bogus' for entity 'catalog-document-elements'. Available: id, docId, elementId, amount, purchasingPrice, storeFrom, storeTo\"\n  }\n}\n```\n\n## Errors\n\n| HTTP | Code | Description |\n|------|-----|---------|\n| 400 | `UNKNOWN_FILTER_FIELD` | Filter by a field that is not in the schema. The message lists the allowed fields |\n| 400 | `UNKNOWN_SORT_FIELD` | Sorting by a field that is not in the schema. The message lists the allowed fields |\n| 400 | `INVALID_FILTER` | The `filter` value is not recognized: pass it in bracket notation `?filter[docId]=299` or as a JSON object `?filter={\"docId\":299}`. Using both notations in one request is also rejected |\n| 400 | `INVALID_FILTER_OPERATOR` | The filter contains an unsupported operator. The message lists the supported ones |\n| 401 | `MISSING_API_KEY` | The `X-Api-Key` header is missing |\n| 401 | `INVALID_API_KEY` | The API key passed was not found |\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| 429 | `RATE_LIMITED` | Rate limit exceeded: 300 requests per minute per portal, all API keys of the portal share one limit. The effective value is in the `x-ratelimit-limit` header. Retry after the delay in the `Retry-After` header |\n\nFull list of common API errors — [Errors](\u002Fdocs\u002Ferrors).\n\n## Known specifics\n\n**No filter — items of all documents.** A request without `filter[docId]` returns items of all inventory documents of the Bitrix24 account in one list. To tell items of different documents apart, check the `docId` of each item.\n\n**Nonexistent document — empty list.** A filter by the `docId` of a document that does not exist or was deleted returns `200` with an empty `data`, not an error. Without `withTotal=false`, `meta.total` is `0`; with `withTotal=false`, the key is absent. To check that the document exists, use [`GET \u002Fv1\u002Fcatalog-documents\u002F:id`](\u002Fdocs\u002Fentities\u002Fcatalog-documents\u002Fget).\n\n## See also\n\n- [Get an item](\u002Fdocs\u002Fentities\u002Fcatalog-document-elements\u002Fget)\n- [Search items](\u002Fdocs\u002Fentities\u002Fcatalog-document-elements\u002Fsearch)\n- [Item fields](\u002Fdocs\u002Fentities\u002Fcatalog-document-elements\u002Ffields)\n- [Inventory document items](\u002Fdocs\u002Fentities\u002Fcatalog-document-elements)\n- [Inventory documents](\u002Fdocs\u002Fentities\u002Fcatalog-documents)\n- [Filtering syntax](\u002Fdocs\u002Ffiltering)\n- [Limits and optimization](\u002Fdocs\u002Foptimization)\n","## Get an inventory document item\n\n`GET \u002Fv1\u002Fcatalog-document-elements\u002F:id`\n\nReturns one inventory document item by ID.\n\n## Parameters\n\n| Parameter | Type | Required | Description |\n|----------|-----|:-----:|---------|\n| `id` (path) | number | yes | Item ID. List of a document's items — [`GET \u002Fv1\u002Fcatalog-document-elements?filter[docId]=:docId`](\u002Fdocs\u002Fentities\u002Fcatalog-document-elements\u002Flist) |\n| `select` (query) | string | no | Comma-separated response fields: `?select=id,elementId,amount`. The `id` field is always returned. Names come from [`GET \u002Fv1\u002Fcatalog-document-elements\u002Ffields`](\u002Fdocs\u002Fentities\u002Fcatalog-document-elements\u002Ffields) |\n\n## Examples\n\n### curl — personal key\n\n```bash\ncurl \"https:\u002F\u002Fvibecode.bitrix24.com\u002Fv1\u002Fcatalog-document-elements\u002F33\" \\\n  -H \"X-Api-Key: YOUR_API_KEY\"\n```\n\n### curl — OAuth application\n\n```bash\ncurl \"https:\u002F\u002Fvibecode.bitrix24.com\u002Fv1\u002Fcatalog-document-elements\u002F33\" \\\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\u002Fcatalog-document-elements\u002F33', {\n  headers: {\n    'X-Api-Key': 'YOUR_API_KEY',\n  },\n})\n\nconst { success, data } = await res.json()\nconsole.log('Product:', data.elementId, 'quantity:', data.amount)\n```\n\n### JavaScript — OAuth application\n\n```javascript\nconst res = await fetch('https:\u002F\u002Fvibecode.bitrix24.com\u002Fv1\u002Fcatalog-document-elements\u002F33', {\n  headers: {\n    'X-Api-Key': 'YOUR_APP_KEY',\n    'Authorization': 'Bearer USER_SESSION_TOKEN',\n  },\n})\n\nconst { success, data } = await res.json()\n```\n\n## Response fields\n\n| Field | Type | Description |\n|------|-----|---------|\n| `success` | boolean | Always `true` on success |\n| `data.id` | number | Item ID |\n| `data.docId` | number | Inventory document ID. Document — [`GET \u002Fv1\u002Fcatalog-documents\u002F:id`](\u002Fdocs\u002Fentities\u002Fcatalog-documents\u002Fget) |\n| `data.elementId` | number | Product ID. Product — [`GET \u002Fv1\u002Fcatalog-products\u002F:id`](\u002Fdocs\u002Fentities\u002Fcatalog-products\u002Fget) |\n| `data.amount` | number \\| null | Product quantity, `null` — not set |\n| `data.purchasingPrice` | number \\| null | Purchase price per unit, `null` — not set |\n| `data.storeFrom` | number \\| null | Source warehouse, `null` — no warehouse set. Warehouses — [`GET \u002Fv1\u002Fwarehouses`](\u002Fdocs\u002Fentities\u002Fwarehouses\u002Flist) |\n| `data.storeTo` | number \\| null | Destination warehouse, `null` — no warehouse set. Warehouses — [`GET \u002Fv1\u002Fwarehouses`](\u002Fdocs\u002Fentities\u002Fwarehouses\u002Flist) |\n\n## Response example\n\n```json\n{\n  \"success\": true,\n  \"data\": {\n    \"amount\": 3,\n    \"docId\": 299,\n    \"elementId\": 6595,\n    \"id\": 33,\n    \"purchasingPrice\": 11000,\n    \"storeFrom\": null,\n    \"storeTo\": 11\n  }\n}\n```\n\n## Error response example\n\n404 — item not found:\n\n```json\n{\n  \"success\": false,\n  \"error\": {\n    \"code\": \"ENTITY_NOT_FOUND\",\n    \"message\": \"catalogDocumentElement 999999999 not found\"\n  }\n}\n```\n\n## Errors\n\n| HTTP | Code | Description |\n|------|-----|---------|\n| 404 | `ENTITY_NOT_FOUND` | No item with this `id` exists, including after its document was deleted |\n| 400 | `INVALID_PARAMS` | `id` is not a non-negative integer |\n| 401 | `MISSING_API_KEY` | The `X-Api-Key` header is missing |\n| 401 | `INVALID_API_KEY` | The API key passed was not found |\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\nFull list of common API errors — [Errors](\u002Fdocs\u002Ferrors).\n\n## See also\n\n- [List items](\u002Fdocs\u002Fentities\u002Fcatalog-document-elements\u002Flist)\n- [Update an item](\u002Fdocs\u002Fentities\u002Fcatalog-document-elements\u002Fupdate)\n- [Delete an item](\u002Fdocs\u002Fentities\u002Fcatalog-document-elements\u002Fdelete)\n- [Item fields](\u002Fdocs\u002Fentities\u002Fcatalog-document-elements\u002Ffields)\n- [Get an inventory document](\u002Fdocs\u002Fentities\u002Fcatalog-documents\u002Fget)\n- [Limits and optimization](\u002Fdocs\u002Foptimization)\n","## Update an inventory document item\n\n`PATCH \u002Fv1\u002Fcatalog-document-elements\u002F:id`\n\nChanges an inventory document item.\n\nPass only the fields you change, flat at the JSON root, without a `fields` wrapper.\n\n## Parameters\n\n| Parameter | Type | Required | Description |\n|----------|-----|:-----:|---------|\n| `id` (path) | number | yes | Item ID. List: [`GET \u002Fv1\u002Fcatalog-document-elements`](\u002Fdocs\u002Fentities\u002Fcatalog-document-elements\u002Flist) |\n\n## Request fields (body)\n\n| Field | Type | Required | Description |\n|------|-----|:-----:|---------|\n| `amount` | number | no | Product quantity |\n| `purchasingPrice` | number | no | Purchase price per unit |\n| `storeFrom` | number | no | Source warehouse. List: [`GET \u002Fv1\u002Fwarehouses`](\u002Fdocs\u002Fentities\u002Fwarehouses\u002Flist). Which warehouse a document needs depends on its type — see [inventory document items](\u002Fdocs\u002Fentities\u002Fcatalog-document-elements) |\n| `storeTo` | number | no | Destination warehouse. List: [`GET \u002Fv1\u002Fwarehouses`](\u002Fdocs\u002Fentities\u002Fwarehouses\u002Flist) |\n| `docId` | number | no | RO. Set only on creation. List: [`GET \u002Fv1\u002Fcatalog-documents`](\u002Fdocs\u002Fentities\u002Fcatalog-documents\u002Flist) |\n| `elementId` | number | no | RO. Set only on creation. List: [`GET \u002Fv1\u002Fcatalog-products`](\u002Fdocs\u002Fentities\u002Fcatalog-products\u002Flist) |\n| `id` | number | no | RO. The item ID is passed in the path |\n\n## Examples\n\n### curl — personal key\n\n```bash\ncurl -X PATCH \"https:\u002F\u002Fvibecode.bitrix24.com\u002Fv1\u002Fcatalog-document-elements\u002F33\" \\\n  -H \"X-Api-Key: YOUR_API_KEY\" \\\n  -H \"Content-Type: application\u002Fjson\" \\\n  -d '{\n    \"amount\": 5\n  }'\n```\n\n### curl — OAuth application\n\n```bash\ncurl -X PATCH \"https:\u002F\u002Fvibecode.bitrix24.com\u002Fv1\u002Fcatalog-document-elements\u002F33\" \\\n  -H \"X-Api-Key: YOUR_APP_KEY\" \\\n  -H \"Authorization: Bearer USER_SESSION_TOKEN\" \\\n  -H \"Content-Type: application\u002Fjson\" \\\n  -d '{\n    \"amount\": 5\n  }'\n```\n\n### JavaScript — personal key\n\n```javascript\nconst res = await fetch('https:\u002F\u002Fvibecode.bitrix24.com\u002Fv1\u002Fcatalog-document-elements\u002F33', {\n  method: 'PATCH',\n  headers: {\n    'X-Api-Key': 'YOUR_API_KEY',\n    'Content-Type': 'application\u002Fjson',\n  },\n  body: JSON.stringify({\n    amount: 5,\n  }),\n})\n\nconst { success, data } = await res.json()\n```\n\n### JavaScript — OAuth application\n\n```javascript\nconst res = await fetch('https:\u002F\u002Fvibecode.bitrix24.com\u002Fv1\u002Fcatalog-document-elements\u002F33', {\n  method: 'PATCH',\n  headers: {\n    'X-Api-Key': 'YOUR_APP_KEY',\n    'Authorization': 'Bearer USER_SESSION_TOKEN',\n    'Content-Type': 'application\u002Fjson',\n  },\n  body: JSON.stringify({\n    amount: 5,\n  }),\n})\n\nconst { success, data } = await res.json()\n```\n\n## Response fields\n\n| Field | Type | Description |\n|------|-----|---------|\n| `success` | boolean | `true` on successful update |\n| `data.id` | number | Item ID |\n| `data.docId` | number | Document ID. Document — [`GET \u002Fv1\u002Fcatalog-documents\u002F:id`](\u002Fdocs\u002Fentities\u002Fcatalog-documents\u002Fget) |\n| `data.elementId` | number | Product ID. Product — [`GET \u002Fv1\u002Fcatalog-products\u002F:id`](\u002Fdocs\u002Fentities\u002Fcatalog-products\u002Fget) |\n| `data.amount` | number \\| null | Product quantity. `null` if not set |\n| `data.purchasingPrice` | number \\| null | Purchase price per unit. `null` if not set |\n| `data.storeFrom` | number \\| null | Source warehouse. `null` if not set. Warehouses — [`GET \u002Fv1\u002Fwarehouses`](\u002Fdocs\u002Fentities\u002Fwarehouses\u002Flist) |\n| `data.storeTo` | number \\| null | Destination warehouse. `null` if not set. Warehouses — [`GET \u002Fv1\u002Fwarehouses`](\u002Fdocs\u002Fentities\u002Fwarehouses\u002Flist) |\n| `meta.warnings` | array | Present only if the body contains a field that is not among the item fields. Each element contains `code: \"UNRECOGNIZED_WRITE_FIELD\"`, `field` with the field name, and `message`. On a route that wraps the field map itself, an object under `fields` is rejected with `400 NESTED_FIELDS_ENVELOPE` when the schema does not declare `fields`; pass fields flat at the JSON root. |\n\n## Response example\n\n```json\n{\n  \"success\": true,\n  \"data\": {\n    \"amount\": 5,\n    \"docId\": 299,\n    \"elementId\": 6595,\n    \"id\": 33,\n    \"purchasingPrice\": 11000,\n    \"storeFrom\": null,\n    \"storeTo\": 11\n  }\n}\n```\n\n## Error response example\n\n422 — the item's document is conducted:\n\n```json\n{\n  \"success\": false,\n  \"error\": {\n    \"code\": \"BITRIX_ERROR\",\n    \"message\": \"Conducted document\",\n    \"b24Code\": \"ERROR_DOCUMENT_STATUS\"\n  }\n}\n```\n\n## Errors\n\n| HTTP | Code | Description |\n|------|-----|---------|\n| 422 | `BITRIX_ERROR` | The item's document is conducted. Message `Conducted document`, `b24Code` — `ERROR_DOCUMENT_STATUS`. First [cancel conducting](\u002Fdocs\u002Fentities\u002Fcatalog-documents\u002Fcancel) |\n| 404 | `ENTITY_NOT_FOUND` | No item with the given `id` |\n| 400 | `READONLY_FIELD` | The body contains `docId`, `elementId`, or `id`. The message names the field: `Field 'docId' is read-only and cannot be set` |\n| 400 | `EMPTY_UPDATE_BODY` | The request body is empty |\n| 400 | `NO_RECOGNIZED_UPDATE_FIELDS` | The body contains no updatable field, for example the fields are wrapped in `fields` |\n| 400 | `INVALID_PARAMS` | `id` in the path is not a non-negative integer |\n| 400 | `INVALID_PARAMS` | A field value has the wrong type: a non-numeric string in a numeric field, for example `\"amount\": \"abc\"`, or an object or array instead of a number or string. The field name is in `error.message` |\n| 403 | `WRITE_BLOCKED_READONLY_KEY` | The key works in read-only mode |\n| 403 | `SCOPE_DENIED` | The API key does not have the `catalog` scope |\n| 401 | `TOKEN_MISSING` | The API key has no configured tokens |\n| 401 | `MISSING_API_KEY` | The `X-Api-Key` header was not passed |\n| 401 | `INVALID_API_KEY` | The passed API key was not found |\n\nFull list of common API errors — [Errors](\u002Fdocs\u002Ferrors).\n\n## See also\n\n- [Get an item](\u002Fdocs\u002Fentities\u002Fcatalog-document-elements\u002Fget)\n- [Create an item](\u002Fdocs\u002Fentities\u002Fcatalog-document-elements\u002Fcreate)\n- [Delete an item](\u002Fdocs\u002Fentities\u002Fcatalog-document-elements\u002Fdelete)\n- [Item fields](\u002Fdocs\u002Fentities\u002Fcatalog-document-elements\u002Ffields)\n- [Cancel conducting](\u002Fdocs\u002Fentities\u002Fcatalog-documents\u002Fcancel)\n- [Batch](\u002Fdocs\u002Fbatch)\n","## Delete an inventory document item\n\n`DELETE \u002Fv1\u002Fcatalog-document-elements\u002F:id`\n\nDeletes an item from an inventory document by its ID. A deleted item cannot be restored through the API — create a new one if needed.\n\n## Parameters\n\n| Parameter | Type | Required | Description |\n|----------|-----|:-----:|---------|\n| `id` (path) | number | yes | Item ID. List: [`GET \u002Fv1\u002Fcatalog-document-elements`](\u002Fdocs\u002Fentities\u002Fcatalog-document-elements\u002Flist) |\n\n## Examples\n\n### curl — personal key\n\n```bash\ncurl -X DELETE \"https:\u002F\u002Fvibecode.bitrix24.com\u002Fv1\u002Fcatalog-document-elements\u002F35\" \\\n  -H \"X-Api-Key: YOUR_API_KEY\"\n```\n\n### curl — OAuth application\n\n```bash\ncurl -X DELETE \"https:\u002F\u002Fvibecode.bitrix24.com\u002Fv1\u002Fcatalog-document-elements\u002F35\" \\\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\u002Fcatalog-document-elements\u002F35', {\n  method: 'DELETE',\n  headers: {\n    'X-Api-Key': 'YOUR_API_KEY',\n  },\n})\n\nif (res.status === 204) {\n  console.log('Item deleted')\n}\n```\n\n### JavaScript — OAuth application\n\n```javascript\nconst res = await fetch('https:\u002F\u002Fvibecode.bitrix24.com\u002Fv1\u002Fcatalog-document-elements\u002F35', {\n  method: 'DELETE',\n  headers: {\n    'X-Api-Key': 'YOUR_APP_KEY',\n    'Authorization': 'Bearer USER_SESSION_TOKEN',\n  },\n})\n\nif (res.status === 204) {\n  console.log('Item deleted')\n}\n```\n\n## Response\n\nOn successful deletion the API returns HTTP status `204 No Content` with an empty body. Success is indicated by the status code, not by the content.\n\n## Response example\n\n```http\nHTTP\u002F1.1 204 No Content\n```\n\n## Error response example\n\n404 — no item with the given `id`:\n\n```json\n{\n  \"success\": false,\n  \"error\": {\n    \"code\": \"ENTITY_NOT_FOUND\",\n    \"message\": \"Document not found\"\n  }\n}\n```\n\n## Errors\n\n| HTTP | Code | Description |\n|------|-----|---------|\n| 404 | `ENTITY_NOT_FOUND` | No item with the given `id`, including on a repeated deletion. Message — `Document not found` |\n| 422 | `BITRIX_ERROR` | The item's document is conducted. Message `Conducted document`, `b24Code` — `ERROR_DOCUMENT_STATUS`. First [cancel conducting](\u002Fdocs\u002Fentities\u002Fcatalog-documents\u002Fcancel) |\n| 400 | `INVALID_PARAMS` | `id` in the path is not a non-negative integer |\n| 403 | `WRITE_BLOCKED_READONLY_KEY` | The key works in read-only mode |\n| 403 | `SCOPE_DENIED` | The API key does not have the `catalog` scope |\n| 401 | `TOKEN_MISSING` | The API key has no configured tokens |\n| 401 | `MISSING_API_KEY` | The `X-Api-Key` header was not passed |\n| 401 | `INVALID_API_KEY` | The passed API key was not found |\n\nFull list of common API errors — [Errors](\u002Fdocs\u002Ferrors).\n\n## See also\n\n- [List items](\u002Fdocs\u002Fentities\u002Fcatalog-document-elements\u002Flist)\n- [Create an item](\u002Fdocs\u002Fentities\u002Fcatalog-document-elements\u002Fcreate)\n- [Delete an inventory document](\u002Fdocs\u002Fentities\u002Fcatalog-documents\u002Fdelete)\n- [Cancel conducting](\u002Fdocs\u002Fentities\u002Fcatalog-documents\u002Fcancel)\n- [Batch](\u002Fdocs\u002Fbatch)\n","## Search inventory document items\n\n`POST \u002Fv1\u002Fcatalog-document-elements\u002Fsearch`\n\nSearches inventory document items using conditions passed in the request body.\n\nReturns the same records as [`GET \u002Fv1\u002Fcatalog-document-elements`](\u002Fdocs\u002Fentities\u002Fcatalog-document-elements\u002Flist), but conditions are passed as a JSON object rather than a query string: lists of values with `$in`, ranges with `$gte` and `$lte`, and several conditions at once.\n\n## Request fields (body)\n\n| Field | Type | Default | Description |\n|------|-----|-----------|---------|\n| `filter` | object | — | Filter by fields from `GET \u002Fv1\u002Fcatalog-document-elements\u002Ffields`.\u003Cbr>[Filtering syntax](\u002Fdocs\u002Ffiltering). Example: `{\"docId\": {\"$in\": [75, 79]}}` — items of two documents, `docId` comes from [`GET \u002Fv1\u002Fcatalog-documents`](\u002Fdocs\u002Fentities\u002Fcatalog-documents\u002Flist) |\n| `select` | string[] | — | Response fields: `[\"id\", \"docId\", \"amount\"]`. A comma-separated string is also accepted: `\"id,docId,amount\"`. The `id` field is always returned. Names come from [`GET \u002Fv1\u002Fcatalog-document-elements\u002Ffields`](\u002Fdocs\u002Fentities\u002Fcatalog-document-elements\u002Ffields) |\n| `sort` | string \\| object \\| string[] | — | Sorting: `\"-id\"` — descending, `\"amount\"` — ascending. An object `{\"amount\": \"desc\"}` and an array of strings `[\"-amount\", \"id\"]` are also accepted, as is the field name `order` instead of `sort` |\n| `limit` | number | `50` | Number of records, from 1 to 5000 |\n| `offset` | number | `0` | Number of records to skip from the start of the result set |\n\nWhen `limit` is greater than 50, Vibecode assembles the response from several pages automatically. Request the next page with `offset` while `meta.hasMore` is `true`.\n\n## Examples\n\n### curl — personal key\n\n```bash\ncurl -X POST \"https:\u002F\u002Fvibecode.bitrix24.com\u002Fv1\u002Fcatalog-document-elements\u002Fsearch\" \\\n  -H \"X-Api-Key: YOUR_API_KEY\" \\\n  -H \"Content-Type: application\u002Fjson\" \\\n  -d '{\n    \"filter\": { \"docId\": { \"$in\": [75, 79] } },\n    \"select\": [\"id\", \"docId\", \"elementId\", \"amount\", \"storeTo\"],\n    \"sort\": \"-id\",\n    \"limit\": 10\n  }'\n```\n\n### curl — OAuth application\n\n```bash\ncurl -X POST \"https:\u002F\u002Fvibecode.bitrix24.com\u002Fv1\u002Fcatalog-document-elements\u002Fsearch\" \\\n  -H \"X-Api-Key: YOUR_APP_KEY\" \\\n  -H \"Authorization: Bearer USER_SESSION_TOKEN\" \\\n  -H \"Content-Type: application\u002Fjson\" \\\n  -d '{\n    \"filter\": { \"docId\": { \"$in\": [75, 79] } },\n    \"select\": [\"id\", \"docId\", \"elementId\", \"amount\", \"storeTo\"],\n    \"sort\": \"-id\",\n    \"limit\": 10\n  }'\n```\n\n### JavaScript — personal key\n\n```javascript\nconst res = await fetch('https:\u002F\u002Fvibecode.bitrix24.com\u002Fv1\u002Fcatalog-document-elements\u002Fsearch', {\n  method: 'POST',\n  headers: {\n    'X-Api-Key': 'YOUR_API_KEY',\n    'Content-Type': 'application\u002Fjson',\n  },\n  body: JSON.stringify({\n    filter: { docId: { $in: [75, 79] } },\n    select: ['id', 'docId', 'elementId', 'amount', 'storeTo'],\n    sort: '-id',\n    limit: 10,\n  }),\n})\n\nconst { success, data, meta } = await res.json()\nconsole.log('Items found:', meta.total)\n```\n\n### JavaScript — OAuth application\n\n```javascript\nconst res = await fetch('https:\u002F\u002Fvibecode.bitrix24.com\u002Fv1\u002Fcatalog-document-elements\u002Fsearch', {\n  method: 'POST',\n  headers: {\n    'X-Api-Key': 'YOUR_APP_KEY',\n    'Authorization': 'Bearer USER_SESSION_TOKEN',\n    'Content-Type': 'application\u002Fjson',\n  },\n  body: JSON.stringify({\n    filter: { docId: { $in: [75, 79] } },\n    select: ['id', 'docId', 'elementId', 'amount', 'storeTo'],\n    sort: '-id',\n    limit: 10,\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 | Array of items. With `select` set — only the listed fields and `id` |\n| `data[].id` | number | Item ID |\n| `data[].docId` | number | Inventory document ID. Document — [`GET \u002Fv1\u002Fcatalog-documents\u002F:id`](\u002Fdocs\u002Fentities\u002Fcatalog-documents\u002Fget) |\n| `data[].elementId` | number | Product ID. Product — [`GET \u002Fv1\u002Fcatalog-products\u002F:id`](\u002Fdocs\u002Fentities\u002Fcatalog-products\u002Fget) |\n| `data[].amount` | number \\| null | Product quantity, `null` — not set |\n| `data[].purchasingPrice` | number \\| null | Purchase price per unit, `null` — not set |\n| `data[].storeFrom` | number \\| null | Source warehouse, `null` — no warehouse set. Warehouses — [`GET \u002Fv1\u002Fwarehouses`](\u002Fdocs\u002Fentities\u002Fwarehouses\u002Flist) |\n| `data[].storeTo` | number \\| null | Destination warehouse, `null` — no warehouse set. Warehouses — [`GET \u002Fv1\u002Fwarehouses`](\u002Fdocs\u002Fentities\u002Fwarehouses\u002Flist) |\n| `meta.total` | number | Total number of items matching the filter |\n| `meta.hasMore` | boolean | Whether there are more items beyond `limit` |\n| `meta.durationMs` | number | Request duration in milliseconds |\n| `meta.warnings` | array | Request warnings, each with the fields `code`, `message`, `field`. Returned when `select` contains a name that is not in the schema — code `UNKNOWN_SELECT_FIELD` |\n\n## Response example\n\n```json\n{\n  \"success\": true,\n  \"data\": [\n    {\n      \"id\": 27,\n      \"docId\": 75,\n      \"elementId\": 6907,\n      \"amount\": 5,\n      \"storeTo\": 1\n    },\n    {\n      \"id\": 21,\n      \"docId\": 79,\n      \"elementId\": 6907,\n      \"amount\": 5,\n      \"storeTo\": 3\n    }\n  ],\n  \"meta\": {\n    \"total\": 2,\n    \"hasMore\": false,\n    \"durationMs\": 138\n  }\n}\n```\n\n## Error response example\n\n400 — filter by a field that is not in the item schema:\n\n```json\n{\n  \"success\": false,\n  \"error\": {\n    \"code\": \"UNKNOWN_FILTER_FIELD\",\n    \"message\": \"Unknown filter field 'bogus' for entity 'catalog-document-elements'. Available: id, docId, elementId, amount, purchasingPrice, storeFrom, storeTo\"\n  }\n}\n```\n\n## Errors\n\n| HTTP | Code | Description |\n|------|-----|---------|\n| 400 | `UNKNOWN_FILTER_FIELD` | Filter by a field that is not in the schema. The message lists the allowed fields |\n| 400 | `UNKNOWN_SORT_FIELD` | Sorting by a field that is not in the schema. The message lists the allowed fields |\n| 400 | `INVALID_FILTER_OPERATOR` | The filter contains an unsupported operator. The message lists the supported ones |\n| 400 | `INVALID_LIMIT` | `limit` is not a number, for example the string `\"abc\"` |\n| 400 | `INVALID_SELECT_TYPE` | `select` is neither a string nor an array of strings |\n| 400 | `INVALID_SORT_TYPE` | `sort` is not a string, an object, or an array of strings |\n| 400 | `INVALID_REQUEST` | The request body is not a JSON object, for example an array |\n| 401 | `MISSING_API_KEY` | The `X-Api-Key` header is missing |\n| 401 | `INVALID_API_KEY` | The API key passed was not found |\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| 429 | `RATE_LIMITED` | Rate limit exceeded: 300 requests per minute per portal, all API keys of the portal share one limit. The effective value is in the `x-ratelimit-limit` header. Retry after the delay in the `Retry-After` header |\n\nFull list of common API errors — [Errors](\u002Fdocs\u002Ferrors).\n\n## See also\n\n- [List items](\u002Fdocs\u002Fentities\u002Fcatalog-document-elements\u002Flist)\n- [Get an item](\u002Fdocs\u002Fentities\u002Fcatalog-document-elements\u002Fget)\n- [Item fields](\u002Fdocs\u002Fentities\u002Fcatalog-document-elements\u002Ffields)\n- [Inventory document items](\u002Fdocs\u002Fentities\u002Fcatalog-document-elements)\n- [Search inventory documents](\u002Fdocs\u002Fentities\u002Fcatalog-documents\u002Fsearch)\n- [Filtering syntax](\u002Fdocs\u002Ffiltering)\n- [Limits and optimization](\u002Fdocs\u002Foptimization)\n","## Inventory document item fields\n\n`GET \u002Fv1\u002Fcatalog-document-elements\u002Ffields`\n\nReturns the schema of all inventory document item fields. Helps build the request body for creating and updating an item.\n\n## Parameters\n\n| Parameter | Type | Default | Description |\n|----------|-----|-----------|---------|\n| `refresh` (query) | string | `false` | Pass `true` to get the schema bypassing the cache. Example: `?refresh=true` |\n\n## Examples\n\n### curl — personal key\n\n```bash\ncurl \"https:\u002F\u002Fvibecode.bitrix24.com\u002Fv1\u002Fcatalog-document-elements\u002Ffields\" \\\n  -H \"X-Api-Key: YOUR_API_KEY\"\n```\n\n### curl — OAuth application\n\n```bash\ncurl \"https:\u002F\u002Fvibecode.bitrix24.com\u002Fv1\u002Fcatalog-document-elements\u002Ffields\" \\\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\u002Fcatalog-document-elements\u002Ffields', {\n  headers: {\n    'X-Api-Key': 'YOUR_API_KEY',\n  },\n})\n\nconst { success, data } = await res.json()\nconst createOnly = Object.entries(data.fields)\n  .filter(([, field]) => field.createOnly)\n  .map(([name]) => name)\nconsole.log('Set only on creation:', createOnly)\n```\n\n### JavaScript — OAuth application\n\n```javascript\nconst res = await fetch('https:\u002F\u002Fvibecode.bitrix24.com\u002Fv1\u002Fcatalog-document-elements\u002Ffields', {\n  headers: {\n    'X-Api-Key': 'YOUR_APP_KEY',\n    'Authorization': 'Bearer USER_SESSION_TOKEN',\n  },\n})\n\nconst { success, data } = await res.json()\nconst createOnly = Object.entries(data.fields)\n  .filter(([, field]) => field.createOnly)\n  .map(([name]) => name)\nconsole.log('Set only on creation:', createOnly)\n```\n\n## Response fields\n\n| Field | Type | Description |\n|------|-----|---------|\n| `success` | boolean | Always `true` on success |\n| `data.fields` | object | Map of item fields: the key is the field name, the value is its description |\n| `data.fields.\u003Cfield>.type` | string | Value type |\n| `data.fields.\u003Cfield>.readonly` | boolean | `true` — the field is filled by the system and is not accepted on creation or update |\n| `data.fields.\u003Cfield>.createOnly` | boolean | Present with the value `true` on fields that are set only on creation. On update such a field is rejected with `400 READONLY_FIELD` |\n| `data.fields.\u003Cfield>.required` | boolean | Present with the value `true` on fields required on creation |\n| `data.fields.\u003Cfield>.label` | string | Field caption |\n| `data.fields.\u003Cfield>.description` | string | Field description |\n| `data.batch` | string[] | Operations available in bulk mode through [Batch](\u002Fdocs\u002Fbatch): `create`, `update`, `delete` |\n| `meta.warnings` | array | Present only if the field schema could not be fully retrieved from Bitrix24. Contains an object with the code `fields_partial` and a `message` text: the response holds only the fields from the Vibecode schema, and some captions may be missing. Retry the request |\n\nThe `label` and `description` values contain the field name itself.\n\nItem fields:\n\n| Field | Type | RO | Description |\n|------|-----|:--:|---------|\n| `id` | number | yes | Item ID |\n| `docId` | number | | Inventory document the item belongs to. Required on creation, set only on creation. List: [`GET \u002Fv1\u002Fcatalog-documents`](\u002Fdocs\u002Fentities\u002Fcatalog-documents\u002Flist) |\n| `elementId` | number | | Product. Required on creation, set only on creation. List: [`GET \u002Fv1\u002Fcatalog-products`](\u002Fdocs\u002Fentities\u002Fcatalog-products\u002Flist) |\n| `amount` | number | | Product quantity |\n| `purchasingPrice` | number | | Purchase price per unit |\n| `storeFrom` | number | | Source warehouse. `null` if not set. List: [`GET \u002Fv1\u002Fwarehouses`](\u002Fdocs\u002Fentities\u002Fwarehouses\u002Flist) |\n| `storeTo` | number | | Destination warehouse. `null` if not set. List: [`GET \u002Fv1\u002Fwarehouses`](\u002Fdocs\u002Fentities\u002Fwarehouses\u002Flist) |\n\nWhich warehouses an item needs depends on the document type — see [inventory document items](\u002Fdocs\u002Fentities\u002Fcatalog-document-elements).\n\n## Response example\n\n```json\n{\n  \"success\": true,\n  \"data\": {\n    \"fields\": {\n      \"id\": {\n        \"type\": \"number\",\n        \"readonly\": true,\n        \"label\": \"id\",\n        \"description\": \"id\"\n      },\n      \"docId\": {\n        \"type\": \"number\",\n        \"readonly\": false,\n        \"createOnly\": true,\n        \"required\": true,\n        \"label\": \"docId\",\n        \"description\": \"docId\"\n      },\n      \"elementId\": {\n        \"type\": \"number\",\n        \"readonly\": false,\n        \"createOnly\": true,\n        \"required\": true,\n        \"label\": \"elementId\",\n        \"description\": \"elementId\"\n      },\n      \"amount\": {\n        \"type\": \"number\",\n        \"readonly\": false,\n        \"label\": \"amount\",\n        \"description\": \"amount\"\n      },\n      \"purchasingPrice\": {\n        \"type\": \"number\",\n        \"readonly\": false,\n        \"label\": \"purchasingPrice\",\n        \"description\": \"purchasingPrice\"\n      },\n      \"storeFrom\": {\n        \"type\": \"number\",\n        \"readonly\": false,\n        \"label\": \"storeFrom\",\n        \"description\": \"storeFrom\"\n      },\n      \"storeTo\": {\n        \"type\": \"number\",\n        \"readonly\": false,\n        \"label\": \"storeTo\",\n        \"description\": \"storeTo\"\n      }\n    },\n    \"batch\": [\n      \"create\",\n      \"update\",\n      \"delete\"\n    ]\n  }\n}\n```\n\n## Error response example\n\n401 — the API key was not passed:\n\n```json\n{\n  \"success\": false,\n  \"error\": {\n    \"code\": \"MISSING_API_KEY\",\n    \"message\": \"API key required. Pass via X-Api-Key header.\"\n  }\n}\n```\n\n## Errors\n\n| HTTP | Code | Description |\n|------|-----|---------|\n| 401 | `MISSING_API_KEY` | The `X-Api-Key` header was not passed |\n| 401 | `INVALID_API_KEY` | The passed API key was not found |\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| 429 | `RATE_LIMITED` | Rate limit exceeded: 300 requests per minute per portal, all API keys of the portal share one limit. The effective value is in the `x-ratelimit-limit` header. Retry after the delay in the `Retry-After` header |\n\nFull list of common API errors — [Errors](\u002Fdocs\u002Ferrors).\n\n## See also\n\n- [Create an item](\u002Fdocs\u002Fentities\u002Fcatalog-document-elements\u002Fcreate)\n- [Update an item](\u002Fdocs\u002Fentities\u002Fcatalog-document-elements\u002Fupdate)\n- [Inventory document items](\u002Fdocs\u002Fentities\u002Fcatalog-document-elements)\n- [Inventory document fields](\u002Fdocs\u002Fentities\u002Fcatalog-documents\u002Ffields)\n- [Entity reference](\u002Fdocs\u002Fentity-api)\n",1794739325072]