For AI agents: markdown of this page — /docs-content-en/entities/delivery-services/update.md documentation index — /llms.txt
Update a delivery service
PATCH /v1/delivery-services/:id
Partially updates a delivery service by ID, preserving the values of fields omitted from the request.
Pass fields at the JSON root without a fields wrapper.
Parameters
| Parameter | Type | Required | Description |
|---|---|---|---|
Parameterid (path) |
Typeinteger | Requiredyes | DescriptionPositive safe integer ID from the delivery service list |
Request fields (body)
| Field | Type | Required | Description |
|---|---|---|---|
Fieldname |
Typestring | Requiredno | DescriptionService name. Empty strings and "0" are not accepted |
Fieldcurrency |
Typestring | Requiredno | DescriptionCurrency code, for example USD. List currencies |
Fielddescription |
Typestring | Requiredno | DescriptionService description |
Fieldsort |
Typeinteger | Requiredno | DescriptionSort index |
Fieldactive |
Typestring | Requiredno | DescriptionService activity, for example Y or N |
Fieldlogo |
Typestring[] | Requiredno | DescriptionTwo nonempty elements: the file name and its base64 content. The decoded file must be at most 2 MiB |
The body must contain at least one field. The JSON body must be at most 3 MiB.
Set restCode and config only when creating a service.
Examples
curl — personal key
curl -X PATCH "https://vibecode.bitrix24.com/v1/delivery-services/85" \
-H "X-Api-Key: YOUR_API_KEY" \
-H "Content-Type: application/json" \
-d '{
"name": "Courier delivery to an address"
}'
curl — OAuth application
curl -X PATCH "https://vibecode.bitrix24.com/v1/delivery-services/85" \
-H "X-Api-Key: YOUR_APP_KEY" \
-H "Authorization: Bearer USER_SESSION_TOKEN" \
-H "Content-Type: application/json" \
-d '{
"name": "Courier delivery to an address"
}'
JavaScript — personal key
const res = await fetch('https://vibecode.bitrix24.com/v1/delivery-services/85', {
method: 'PATCH',
headers: {
'X-Api-Key': 'YOUR_API_KEY',
'Content-Type': 'application/json',
},
body: JSON.stringify({
name: 'Courier delivery to an address',
}),
})
const { success, data } = await res.json()
console.log(data.id)
JavaScript — OAuth application
const res = await fetch('https://vibecode.bitrix24.com/v1/delivery-services/85', {
method: 'PATCH',
headers: {
'X-Api-Key': 'YOUR_APP_KEY',
'Authorization': 'Bearer USER_SESSION_TOKEN',
'Content-Type': 'application/json',
},
body: JSON.stringify({
name: 'Courier delivery to an address',
}),
})
const { success, data } = await res.json()
console.log(data.id)
Response fields
HTTP status: 200 OK. Returns the updated record.
RO marks read-only fields.
| Field | Type | Description |
|---|---|---|
Fieldsuccess |
Typeboolean | Descriptiontrue on success |
Fielddata |
Typeobject | DescriptionUpdated delivery service |
Fielddata.id |
Typeinteger | DescriptionService ID. RO |
Fielddata.parentId |
Typeinteger | null | DescriptionParent service ID or null. RO |
Fielddata.name |
Typestring | null | DescriptionService name |
Fielddata.active |
Typestring | null | DescriptionService activity |
Fielddata.description |
Typestring | null | DescriptionService description |
Fielddata.currency |
Typestring | null | DescriptionCurrency code |
Fielddata.sort |
Typeinteger | null | DescriptionSort index |
Fielddata.logotype |
Typeinteger | null | DescriptionLogo file ID, not a URL, or null. RO. Use logo to write the file |
Response example
{
"success": true,
"data": {
"id": 85,
"parentId": null,
"name": "Courier delivery to an address",
"active": "N",
"description": "",
"currency": "USD",
"sort": 100,
"logotype": null
}
}
Error response example
400 — the body contains logotype instead of logo:
{
"success": false,
"error": {
"code": "READONLY_FIELD",
"message": "Field 'logotype' is not writable for this operation"
}
}
Errors
| HTTP | error.code |
Description |
|---|---|---|
| HTTP400 | error.codeINVALID_PARAMS |
Descriptionid is not a positive safe integer, a field has an invalid type, or logo contains an invalid file |
| HTTP400 | error.codeMISSING_REQUIRED_FIELDS |
DescriptionThe body is not a nonempty JSON object, or name is an empty string or "0" |
| HTTP400 | error.codeREADONLY_FIELD |
DescriptionThe body contains a field absent from the request field table, including logotype, restCode, or config |
| HTTP404 | error.codeENTITY_NOT_FOUND |
DescriptionThe service with the specified id was not found during the update |
| HTTP404 | error.codeENTITY_NOT_FOUND |
DescriptionAfter a successful write, the updated service was not found when reading the result |
| HTTP413 | error.codePAYLOAD_TOO_LARGE |
DescriptionThe logo file exceeds 2 MiB, or the JSON body exceeds 3 MiB |
| HTTP422 | error.codeBITRIX_ERROR |
DescriptionBitrix24 rejected or did not confirm the update. See error.message for the reason |
| HTTP502 | error.codeBITRIX_RESPONSE_INVALID |
DescriptionThe Bitrix24 update response has an invalid structure |
| HTTP502 | error.codeBITRIX_RESPONSE_INVALID |
DescriptionA valid record could not be read after the update |
| HTTP403 | error.codeBITRIX_ACCESS_DENIED |
DescriptionThe user lacks permission to modify the service, the service was created without a REST handler, or it belongs to another OAuth application |
| HTTP401 | error.codeTOKEN_MISSING |
DescriptionThe API key has no configured Bitrix24 credentials |
| HTTP403 | error.codeSCOPE_DENIED |
DescriptionThe API key lacks the delivery scope |
| HTTP403 | error.codeWRITE_BLOCKED_READONLY_KEY |
DescriptionThe API key is in read-only mode |
For the full list of common API errors, see Errors.
Known specifics
An error while reading the result does not mean the change was not saved. Before retrying, check the service with get by ID.