For AI agents: markdown of this page — /docs-content-en/entities/catalog-document-elements/update.md documentation index — /llms.txt
Update an inventory document item
PATCH /v1/catalog-document-elements/:id
Changes an inventory document item.
Pass only the fields you change, flat at the JSON root, without a fields wrapper.
Parameters
| Parameter | Type | Required | Description |
|---|---|---|---|
Parameterid (path) |
Typenumber | Requiredyes | DescriptionItem ID. List: GET /v1/catalog-document-elements |
Request fields (body)
| Field | Type | Required | Description |
|---|---|---|---|
Fieldamount |
Typenumber | Requiredno | DescriptionProduct quantity |
FieldpurchasingPrice |
Typenumber | Requiredno | DescriptionPurchase price per unit |
FieldstoreFrom |
Typenumber | Requiredno | DescriptionSource warehouse. List: GET /v1/warehouses. Which warehouse a document needs depends on its type — see inventory document items |
FieldstoreTo |
Typenumber | Requiredno | DescriptionDestination warehouse. List: GET /v1/warehouses |
FielddocId |
Typenumber | Requiredno | DescriptionRO. Set only on creation. List: GET /v1/catalog-documents |
FieldelementId |
Typenumber | Requiredno | DescriptionRO. Set only on creation. List: GET /v1/catalog-products |
Fieldid |
Typenumber | Requiredno | DescriptionRO. The item ID is passed in the path |
Examples
curl — personal key
curl -X PATCH "https://vibecode.bitrix24.com/v1/catalog-document-elements/33" \
-H "X-Api-Key: YOUR_API_KEY" \
-H "Content-Type: application/json" \
-d '{
"amount": 5
}'
curl — OAuth application
curl -X PATCH "https://vibecode.bitrix24.com/v1/catalog-document-elements/33" \
-H "X-Api-Key: YOUR_APP_KEY" \
-H "Authorization: Bearer USER_SESSION_TOKEN" \
-H "Content-Type: application/json" \
-d '{
"amount": 5
}'
JavaScript — personal key
const res = await fetch('https://vibecode.bitrix24.com/v1/catalog-document-elements/33', {
method: 'PATCH',
headers: {
'X-Api-Key': 'YOUR_API_KEY',
'Content-Type': 'application/json',
},
body: JSON.stringify({
amount: 5,
}),
})
const { success, data } = await res.json()
JavaScript — OAuth application
const res = await fetch('https://vibecode.bitrix24.com/v1/catalog-document-elements/33', {
method: 'PATCH',
headers: {
'X-Api-Key': 'YOUR_APP_KEY',
'Authorization': 'Bearer USER_SESSION_TOKEN',
'Content-Type': 'application/json',
},
body: JSON.stringify({
amount: 5,
}),
})
const { success, data } = await res.json()
Response fields
| Field | Type | Description |
|---|---|---|
Fieldsuccess |
Typeboolean | Descriptiontrue on successful update |
Fielddata.id |
Typenumber | DescriptionItem ID |
Fielddata.docId |
Typenumber | DescriptionDocument ID. Document — GET /v1/catalog-documents/:id |
Fielddata.elementId |
Typenumber | DescriptionProduct ID. Product — GET /v1/catalog-products/:id |
Fielddata.amount |
Typenumber | null | DescriptionProduct quantity. null if not set |
Fielddata.purchasingPrice |
Typenumber | null | DescriptionPurchase price per unit. null if not set |
Fielddata.storeFrom |
Typenumber | null | DescriptionSource warehouse. null if not set. Warehouses — GET /v1/warehouses |
Fielddata.storeTo |
Typenumber | null | DescriptionDestination warehouse. null if not set. Warehouses — GET /v1/warehouses |
Fieldmeta.warnings |
Typearray | DescriptionPresent 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. |
Response example
{
"success": true,
"data": {
"amount": 5,
"docId": 299,
"elementId": 6595,
"id": 33,
"purchasingPrice": 11000,
"storeFrom": null,
"storeTo": 11
}
}
Error response example
422 — the item's document is conducted:
{
"success": false,
"error": {
"code": "BITRIX_ERROR",
"message": "Conducted document",
"b24Code": "ERROR_DOCUMENT_STATUS"
}
}
Errors
| HTTP | Code | Description |
|---|---|---|
| HTTP422 | CodeBITRIX_ERROR |
DescriptionThe item's document is conducted. Message Conducted document, b24Code — ERROR_DOCUMENT_STATUS. First cancel conducting |
| HTTP404 | CodeENTITY_NOT_FOUND |
DescriptionNo item with the given id |
| HTTP400 | CodeREADONLY_FIELD |
DescriptionThe body contains docId, elementId, or id. The message names the field: Field 'docId' is read-only and cannot be set |
| HTTP400 | CodeEMPTY_UPDATE_BODY |
DescriptionThe request body is empty |
| HTTP400 | CodeNO_RECOGNIZED_UPDATE_FIELDS |
DescriptionThe body contains no updatable field, for example the fields are wrapped in fields |
| HTTP400 | CodeINVALID_PARAMS |
Descriptionid in the path is not a non-negative integer |
| HTTP400 | CodeINVALID_PARAMS |
DescriptionA 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 |
| HTTP403 | CodeWRITE_BLOCKED_READONLY_KEY |
DescriptionThe key works in read-only mode |
| HTTP403 | CodeSCOPE_DENIED |
DescriptionThe API key does not have the catalog scope |
| HTTP401 | CodeTOKEN_MISSING |
DescriptionThe API key has no configured tokens |
| HTTP401 | CodeMISSING_API_KEY |
DescriptionThe X-Api-Key header was not passed |
| HTTP401 | CodeINVALID_API_KEY |
DescriptionThe passed API key was not found |
Full list of common API errors — Errors.