For AI agents: markdown of this page — /docs-content-en/entities/basket-item-properties/update.md documentation index — /llms.txt
Update a basket item property
PATCH /v1/basket-item-properties/:id
Updates the value and other writable fields of an existing basket item property by its ID.
Parameters
| Parameter | Type | Required | Description |
|---|---|---|---|
Parameterid (path) |
Typenumber | Requiredyes | DescriptionProperty ID. Source: GET /v1/basket-item-properties |
Request body fields
Pass fields at the root of the JSON body, without a fields wrapper.
| Field | Type | Required | Description |
|---|---|---|---|
Fieldname |
Typestring | Requiredno | DescriptionProperty name |
Fieldvalue |
Typestring | null | Requiredno | DescriptionProperty value |
Fieldcode |
Typestring | null | Requiredno | DescriptionProperty symbolic code |
Fieldsort |
Typenumber | Requiredno | DescriptionSort order |
FieldxmlId |
Typestring | null | Requiredno | DescriptionExternal ID |
Fieldid |
Typenumber | Requiredno | DescriptionProperty ID. Source: GET /v1/basket-item-properties. RO. Read-only, assigned by the server. |
FieldbasketId |
Typenumber | Requiredno | DescriptionBasket item ID. Source: GET /v1/basket-items. Create-only. Do not send in PATCH. |
Examples
curl — personal key
curl -X PATCH "https://vibecode.bitrix24.com/v1/basket-item-properties/1037" \
-H "X-Api-Key: YOUR_API_KEY" \
-H "Content-Type: application/json" \
-d '{
"name": "Color",
"code": "COLOR",
"value": "Red",
"sort": 200,
"xmlId": "color-red"
}'
curl — OAuth application
curl -X PATCH "https://vibecode.bitrix24.com/v1/basket-item-properties/1037" \
-H "X-Api-Key: YOUR_APP_KEY" \
-H "Authorization: Bearer USER_SESSION_TOKEN" \
-H "Content-Type: application/json" \
-d '{
"name": "Color",
"code": "COLOR",
"value": "Red",
"sort": 200,
"xmlId": "color-red"
}'
JavaScript — personal key
const res = await fetch('https://vibecode.bitrix24.com/v1/basket-item-properties/1037', {
method: 'PATCH',
headers: {
'X-Api-Key': 'YOUR_API_KEY',
'Content-Type': 'application/json',
},
body: JSON.stringify({
"name": "Color",
"code": "COLOR",
"value": "Red",
"sort": 200,
"xmlId": "color-red"
}),
})
const { success, data } = await res.json()
JavaScript — OAuth application
const res = await fetch('https://vibecode.bitrix24.com/v1/basket-item-properties/1037', {
method: 'PATCH',
headers: {
'X-Api-Key': 'YOUR_APP_KEY',
'Authorization': 'Bearer USER_SESSION_TOKEN',
'Content-Type': 'application/json',
},
body: JSON.stringify({
"name": "Color",
"code": "COLOR",
"value": "Red",
"sort": 200,
"xmlId": "color-red"
}),
})
const { success, data } = await res.json()
Response fields
| Field | Type | Description |
|---|---|---|
Fieldsuccess |
Typeboolean | Descriptiontrue on success. HTTP status: 200 |
Fielddata |
Typeobject | DescriptionUpdated basket item property |
Fielddata.id |
Typenumber | DescriptionProperty ID. Source: GET /v1/basket-item-properties |
Fielddata.basketId |
Typenumber | DescriptionBasket item ID. Source: GET /v1/basket-items |
Fielddata.name |
Typestring | DescriptionProperty name |
Fielddata.value |
Typestring | null | DescriptionProperty value |
Fielddata.code |
Typestring | null | DescriptionProperty symbolic code |
Fielddata.sort |
Typenumber | DescriptionSort order |
Fielddata.xmlId |
Typestring | null | DescriptionExternal ID |
Response example
{
"success": true,
"data": {
"basketId": 1001,
"code": "COLOR",
"id": 1037,
"name": "Color",
"sort": 200,
"value": "Red",
"xmlId": "color-red"
}
}
Error response example
404 — property not found:
{
"success": false,
"error": {
"code": "ENTITY_NOT_FOUND",
"message": "basket property is not exists"
}
}
Errors
| HTTP | Code | Description |
|---|---|---|
| HTTP400 | CodeREADONLY_FIELD |
DescriptionThe request contains id or basketId, which cannot be updated |
| HTTP400 | CodeEMPTY_UPDATE_BODY |
DescriptionThe request body is empty |
| HTTP400 | CodeNO_RECOGNIZED_UPDATE_FIELDS |
DescriptionThe body contains no recognized writable field |
| HTTP400 | CodeINVALID_PARAMS |
DescriptionThe path id is not a non-negative integer |
| HTTP404 | CodeENTITY_NOT_FOUND |
DescriptionNo property exists with this id, or it has already been deleted |
| HTTP422 | CodeBITRIX_ERROR |
DescriptionBitrix24 rejected the operation. The reason is in message |
| HTTP403 | CodeWRITE_BLOCKED_READONLY_KEY |
DescriptionThe key is in read-only mode |
| HTTP403 | CodeSCOPE_DENIED |
DescriptionThe API key does not have the sale scope |
| HTTP401 | CodeMISSING_API_KEY |
DescriptionThe X-Api-Key header is missing |
| HTTP429 | CodeRATE_LIMITED |
DescriptionThe request limit was exceeded |
For the full list of shared API errors, see Error codes.
Known specifics
If name, code or value is omitted, Vibecode reads their current values and supplies them before the write. Updating only value preserves the other fields.