[{"data":1,"prerenderedAt":7},["ShallowReactive",2],{"docs-entities\u002Fperson-types\u002Fupdate":3,"docs-tabs-entities\u002Fperson-types\u002Fupdate":6},{"content":4,"lastmod":5},"## Update a payer type\n\n`PATCH \u002Fv1\u002Fperson-types\u002F:id`\n\nUpdates an existing online store payer type used in orders and order properties.\n\nPass fields at the root of the JSON object, without a `fields` wrapper.\n\n## Parameters\n\n| Parameter | Type | Required | Description |\n|----------|-----|:-----:|---------|\n| `id` (path) | number | yes | Payer type ID, a non-negative integer. List: [`GET \u002Fv1\u002Fperson-types`](.\u002Flist.md) |\n\n## Request body fields\n\n| Field | Type | Required | Description |\n|------|-----|:-----:|---------|\n| `name` | string | yes | Name. To keep the existing name, read it with [`GET \u002Fv1\u002Fperson-types\u002F:id`](.\u002Fget.md) |\n| `code` | string \\| null | no | Unique code. `null` keeps the existing code |\n| `sort` | number | no | Sort order |\n| `active` | boolean | no | Whether the type is active |\n| `xmlId` | string \\| null | no | External ID. `null` keeps the existing ID |\n\nFor the full field list, see [`GET \u002Fv1\u002Fperson-types\u002Ffields`](.\u002Ffields.md).\n\n## Examples\n\n### curl — personal key\n\n```bash\ncurl -X PATCH \"https:\u002F\u002Fvibecode.bitrix24.com\u002Fv1\u002Fperson-types\u002F21\" \\\n  -H \"X-Api-Key: YOUR_API_KEY\" \\\n  -H \"Content-Type: application\u002Fjson\" \\\n  -d '{\n  \"name\": \"Updated documentation payer\",\n  \"sort\": 910,\n  \"active\": true\n}'\n```\n\n### curl — OAuth application\n\n```bash\ncurl -X PATCH \"https:\u002F\u002Fvibecode.bitrix24.com\u002Fv1\u002Fperson-types\u002F21\" \\\n  -H \"X-Api-Key: YOUR_APP_KEY\" \\\n  -H \"Authorization: Bearer USER_SESSION_TOKEN\" \\\n  -H \"Content-Type: application\u002Fjson\" \\\n  -d '{\n  \"name\": \"Updated documentation payer\",\n  \"sort\": 910,\n  \"active\": true\n}'\n```\n\n### JavaScript — personal key\n\n```javascript\nconst res = await fetch('https:\u002F\u002Fvibecode.bitrix24.com\u002Fv1\u002Fperson-types\u002F21', {\n  method: 'PATCH',\n  headers: {\n    'X-Api-Key': 'YOUR_API_KEY',\n    'Content-Type': 'application\u002Fjson',\n  },\n  body: JSON.stringify({\n    name: 'Updated documentation payer',\n    sort: 910,\n    active: true,\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\u002Fperson-types\u002F21', {\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    name: 'Updated documentation payer',\n    sort: 910,\n    active: true,\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 success. The HTTP status is `200` |\n| `data` | object | Updated payer type |\n| `data.id` | number | RO. Payer type ID |\n| `data.name` | string | Name |\n| `data.code` | string \\| null | Unique code |\n| `data.sort` | number | Sort order |\n| `data.active` | boolean | Whether the type is active |\n| `data.xmlId` | string \\| null | External ID |\n\n## Response example\n\n```json\n{\n  \"success\": true,\n  \"data\": {\n    \"active\": true,\n    \"code\": \"DOCS_PERSON_397F55D8FB1D\",\n    \"id\": 21,\n    \"name\": \"Updated documentation payer\",\n    \"sort\": 910,\n    \"xmlId\": \"DOCS_PERSON_397F55D8FB1D\"\n  }\n}\n```\n\n## Error response example\n\n422 — `active` was provided, but `name` is missing:\n\n```json\n{\n  \"success\": false,\n  \"error\": {\n    \"code\": \"BITRIX_ERROR\",\n    \"message\": \"Required fields: name\",\n    \"b24Code\": \"0\"\n  }\n}\n```\n\n## Errors\n\n| HTTP | Code | Description |\n|------|-----|---------|\n| 400 | `EMPTY_UPDATE_BODY` | The request body is empty |\n| 400 | `NO_RECOGNIZED_UPDATE_FIELDS` | The body contains no writable payer type fields |\n| 400 | `READONLY_FIELD` | A read-only field was provided: `id` or `lid` |\n| 400 | `INVALID_PARAMS` | A scalar field received an object or array, such as an object in `active` |\n| 400 | `INVALID_PARAMS` | The path `id` is not a non-negative integer |\n| 404 | `ENTITY_NOT_FOUND` | No payer type exists with this `id`. Message: `person type is not exists` |\n| 422 | `BITRIX_ERROR` | The `name` field is missing. Message: `Required fields: name`, `b24Code`: `0` |\n| 422 | `BITRIX_ERROR` | Bitrix24 rejected the update for another reason, including a `code` already in use. The reason is in `message` |\n| 403 | `BITRIX_ACCESS_DENIED` | The key owner lacks permission to modify payer types in Bitrix24 |\n| 403 | `WRITE_BLOCKED_READONLY_KEY` | The key is in read-only mode |\n| 403 | `SCOPE_DENIED` | The API key lacks the `sale` scope |\n| 401 | `MISSING_API_KEY` | The `X-Api-Key` header is missing |\n| 401 | `TOKEN_MISSING` | The API key has no configured tokens |\n\nFor the full list of common API errors, see [Error codes](\u002Fdocs\u002Ferrors).\n\n## See also\n\n- [Payer types](\u002Fdocs\u002Fentities\u002Fperson-types)\n- [Get a payer type](.\u002Fget.md)\n- [Create a payer type](.\u002Fcreate.md)\n- [Payer type fields](.\u002Ffields.md)\n- [Delete a payer type](.\u002Fdelete.md)\n","2026-10-09",{},1795415279589]