For AI agents: markdown of this page — /docs-content-en/entities/person-types/update.md documentation index — /llms.txt

Update a payer type

PATCH /v1/person-types/:id

Updates an existing online store payer type used in orders and order properties.

Pass fields at the root of the JSON object, without a fields wrapper.

Parameters

Parameter Type Required Description
Parameterid (path) Typenumber Requiredyes DescriptionPayer type ID, a non-negative integer. List: GET /v1/person-types

Request body fields

Field Type Required Description
Fieldname Typestring Requiredyes DescriptionName. To keep the existing name, read it with GET /v1/person-types/:id
Fieldcode Typestring | null Requiredno DescriptionUnique code. null keeps the existing code
Fieldsort Typenumber Requiredno DescriptionSort order
Fieldactive Typeboolean Requiredno DescriptionWhether the type is active
FieldxmlId Typestring | null Requiredno DescriptionExternal ID. null keeps the existing ID

For the full field list, see GET /v1/person-types/fields.

Examples

curl — personal key

Terminal
curl -X PATCH "https://vibecode.bitrix24.com/v1/person-types/21" \
  -H "X-Api-Key: YOUR_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{
  "name": "Updated documentation payer",
  "sort": 910,
  "active": true
}'

curl — OAuth application

Terminal
curl -X PATCH "https://vibecode.bitrix24.com/v1/person-types/21" \
  -H "X-Api-Key: YOUR_APP_KEY" \
  -H "Authorization: Bearer USER_SESSION_TOKEN" \
  -H "Content-Type: application/json" \
  -d '{
  "name": "Updated documentation payer",
  "sort": 910,
  "active": true
}'

JavaScript — personal key

javascript
const res = await fetch('https://vibecode.bitrix24.com/v1/person-types/21', {
  method: 'PATCH',
  headers: {
    'X-Api-Key': 'YOUR_API_KEY',
    'Content-Type': 'application/json',
  },
  body: JSON.stringify({
    name: 'Updated documentation payer',
    sort: 910,
    active: true,
  }),
})

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

JavaScript — OAuth application

javascript
const res = await fetch('https://vibecode.bitrix24.com/v1/person-types/21', {
  method: 'PATCH',
  headers: {
    'X-Api-Key': 'YOUR_APP_KEY',
    'Authorization': 'Bearer USER_SESSION_TOKEN',
    'Content-Type': 'application/json',
  },
  body: JSON.stringify({
    name: 'Updated documentation payer',
    sort: 910,
    active: true,
  }),
})

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

Response fields

Field Type Description
Fieldsuccess Typeboolean Descriptiontrue on success. The HTTP status is 200
Fielddata Typeobject DescriptionUpdated payer type
Fielddata.id Typenumber DescriptionRO. Payer type ID
Fielddata.name Typestring DescriptionName
Fielddata.code Typestring | null DescriptionUnique code
Fielddata.sort Typenumber DescriptionSort order
Fielddata.active Typeboolean DescriptionWhether the type is active
Fielddata.xmlId Typestring | null DescriptionExternal ID

Response example

JSON
{
  "success": true,
  "data": {
    "active": true,
    "code": "DOCS_PERSON_397F55D8FB1D",
    "id": 21,
    "name": "Updated documentation payer",
    "sort": 910,
    "xmlId": "DOCS_PERSON_397F55D8FB1D"
  }
}

Error response example

422 — active was provided, but name is missing:

JSON
{
  "success": false,
  "error": {
    "code": "BITRIX_ERROR",
    "message": "Required fields: name",
    "b24Code": "0"
  }
}

Errors

HTTP Code Description
HTTP400 CodeEMPTY_UPDATE_BODY DescriptionThe request body is empty
HTTP400 CodeNO_RECOGNIZED_UPDATE_FIELDS DescriptionThe body contains no writable payer type fields
HTTP400 CodeREADONLY_FIELD DescriptionA read-only field was provided: id or lid
HTTP400 CodeINVALID_PARAMS DescriptionA scalar field received an object or array, such as an object in active
HTTP400 CodeINVALID_PARAMS DescriptionThe path id is not a non-negative integer
HTTP404 CodeENTITY_NOT_FOUND DescriptionNo payer type exists with this id. Message: person type is not exists
HTTP422 CodeBITRIX_ERROR DescriptionThe name field is missing. Message: Required fields: name, b24Code: 0
HTTP422 CodeBITRIX_ERROR DescriptionBitrix24 rejected the update for another reason, including a code already in use. The reason is in message
HTTP403 CodeBITRIX_ACCESS_DENIED DescriptionThe key owner lacks permission to modify payer types in Bitrix24
HTTP403 CodeWRITE_BLOCKED_READONLY_KEY DescriptionThe key is in read-only mode
HTTP403 CodeSCOPE_DENIED DescriptionThe API key lacks the sale scope
HTTP401 CodeMISSING_API_KEY DescriptionThe X-Api-Key header is missing
HTTP401 CodeTOKEN_MISSING DescriptionThe API key has no configured tokens

For the full list of common API errors, see Error codes.

See also