[{"data":1,"prerenderedAt":7},["ShallowReactive",2],{"docs-entities\u002Fcatalog-vat-rates\u002Fupdate":3,"docs-tabs-entities\u002Fcatalog-vat-rates\u002Fupdate":6},{"content":4,"lastmod":5},"## Update a VAT rate\n\n`PATCH \u002Fv1\u002Fcatalog-vat-rates\u002F:id`\n\nPartially updates a VAT rate in the product catalog. Send only the fields to change in a flat body, without a `fields` wrapper.\n\n## Parameters\n\n| Parameter | Type | Required | Description |\n|------|------|------|------|\n| `id` (path) | number | yes | VAT rate identifier, a non-negative integer. List: [`GET \u002Fv1\u002Fcatalog-vat-rates`](\u002Fdocs\u002Fentities\u002Fcatalog-vat-rates\u002Flist). |\n\n## Request body fields\n\n| Field | Type | Required | Description |\n|------|------|------|------|\n| `name` | string | no | VAT rate name. |\n| `rate` | number | no | VAT percentage. Fractional numbers and `0` are accepted. `null` is not accepted. |\n| `active` | string | no | Status: `Y` or `N`. Other values and `null` are rejected. |\n| `sort` | number | no | Sort order, an integer of at least `1`. `null` is not accepted. |\n| `id` | number | no | `RO`. Set only in the path. Passing it in the body returns `400 READONLY_FIELD`. |\n| `timestampX` | string | no | `RO`. The modification time is set by Bitrix24. Passing it in the body returns `400 READONLY_FIELD`. |\n\n## Examples\n\n### curl — personal key\n\n```bash\ncurl -X PATCH \"https:\u002F\u002Fvibecode.bitrix24.com\u002Fv1\u002Fcatalog-vat-rates\u002F25\" \\\n  -H \"X-Api-Key: YOUR_API_KEY\" \\\n  -H \"Content-Type: application\u002Fjson\" \\\n  -d '{\n  \"name\": \"Docs VAT updated 2026-10-08\"\n}'\n```\n\n### curl — OAuth application\n\n```bash\ncurl -X PATCH \"https:\u002F\u002Fvibecode.bitrix24.com\u002Fv1\u002Fcatalog-vat-rates\u002F25\" \\\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\": \"Docs VAT updated 2026-10-08\"\n}'\n```\n\n### JavaScript — personal key\n\n```javascript\nconst res = await fetch('https:\u002F\u002Fvibecode.bitrix24.com\u002Fv1\u002Fcatalog-vat-rates\u002F25', {\n  method: 'PATCH',\n  headers: {\n    'X-Api-Key': 'YOUR_API_KEY',\n    'Content-Type': 'application\u002Fjson',\n  },\n  body: JSON.stringify({\n    \"name\": \"Docs VAT updated 2026-10-08\"\n  }),\n})\n\nconst { success, data } = await res.json()\nconsole.log(data)\n```\n\n### JavaScript — OAuth application\n\n```javascript\nconst res = await fetch('https:\u002F\u002Fvibecode.bitrix24.com\u002Fv1\u002Fcatalog-vat-rates\u002F25', {\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\": \"Docs VAT updated 2026-10-08\"\n  }),\n})\n\nconst { success, data } = await res.json()\nconsole.log(data)\n```\n\n## Response fields\n\nOn success, returns `200` and the complete updated record.\n\n| Field | Type | Description |\n|------|------|------|\n| `success` | boolean | Always `true` on success. |\n| `data` | object | VAT rate object. |\n| `data.id` | number | VAT rate identifier. List: [`GET \u002Fv1\u002Fcatalog-vat-rates`](\u002Fdocs\u002Fentities\u002Fcatalog-vat-rates\u002Flist). Pass it as the product's `vatId`. |\n| `data.name` | string | VAT rate name. |\n| `data.rate` | number \\| null | VAT percentage. For an existing \"No VAT\" rate, this field may be `null`. |\n| `data.active` | string | Rate status: `Y` — active, `N` — inactive. |\n| `data.sort` | number | Sort order. |\n| `data.timestampX` | string | Modification date and time in ISO 8601 format. Set by Bitrix24. |\n| `meta.warnings` | array | For an unknown field name, contains an `UNRECOGNIZED_WRITE_FIELD` warning with `code`, `field`, and `message` keys. 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. |\n\n## Response example\n\n```json\n{\n  \"success\": true,\n  \"data\": {\n    \"active\": \"N\",\n    \"id\": 25,\n    \"name\": \"Docs VAT updated 2026-10-08\",\n    \"rate\": 7.5,\n    \"sort\": 900,\n    \"timestampX\": \"2026-10-08T18:50:04.000Z\"\n  }\n}\n```\n\n## Error response example\n\n422 — `rate` is `null`. The rate is not changed:\n\n```json\n{\n  \"success\": false,\n  \"error\": {\n    \"code\": \"BITRIX_ERROR\",\n    \"message\": \"Required fields: rate\",\n    \"b24Code\": \"0\"\n  }\n}\n```\n\n## Errors\n\n| HTTP | Code | Description |\n|------|------|------|\n| 404 | `ENTITY_NOT_FOUND` | No VAT rate exists with this `id`, including after deletion. |\n| 400 | `INVALID_PARAMS` | `id` is not a non-negative integer, for example `abc`. |\n| 400 | `EMPTY_UPDATE_BODY` | The body is empty or is not a JSON object. Provide at least one field. |\n| 400 | `INVALID_PARAMS` | An invalid field type, `active` outside `Y`\u002F`N`, or a fractional or non-positive `sort`. `active` and `sort` cannot be `null`. |\n| 400 | `READONLY_FIELD` | The body contains `id` or `timestampX`. Remove the field from the request. |\n| 422 | `BITRIX_ERROR` | `rate: null` is rejected with `Required fields: rate`. For other errors returned by Bitrix24, see `error.message` and `error.b24Code`. |\n| 403 | `WRITE_BLOCKED_READONLY_KEY` | Writes are blocked: the key is read-only. |\n| 403 | `SCOPE_DENIED` | The key does not have the `catalog` scope. |\n| 401 | `MISSING_API_KEY` | The `X-Api-Key` header is missing. |\n| 401 | `TOKEN_MISSING` | The key has no configured Bitrix24 tokens. For an OAuth application key, check the user session. |\n\nFor all common API errors, see [Errors](\u002Fdocs\u002Ferrors).\n\n## Known specifics\n\n**A single PATCH does not require repeating `name` and `rate`.** If a field is omitted, Vibecode supplies the rate's current value before updating it. An explicit `null` is not replaced. If an existing rate has `rate: null`, provide a numeric `rate`; otherwise Bitrix24 may reject a change to another field.\n\n**An unknown scalar field may not be saved.** It does not bypass required-field validation. The response may contain `meta.warnings` with `UNRECOGNIZED_WRITE_FIELD`. Check names against [VAT rate fields](\u002Fdocs\u002Fentities\u002Fcatalog-vat-rates\u002Ffields) and verify the values in `data`.\n\n## See also\n\n- [Get a VAT rate](\u002Fdocs\u002Fentities\u002Fcatalog-vat-rates\u002Fget)\n- [Create a VAT rate](\u002Fdocs\u002Fentities\u002Fcatalog-vat-rates\u002Fcreate)\n- [List VAT rates](\u002Fdocs\u002Fentities\u002Fcatalog-vat-rates\u002Flist)\n- [Delete a VAT rate](\u002Fdocs\u002Fentities\u002Fcatalog-vat-rates\u002Fdelete)\n- [VAT rate fields](\u002Fdocs\u002Fentities\u002Fcatalog-vat-rates\u002Ffields)\n- [Batch](\u002Fdocs\u002Fbatch)\n- [Limits and optimization](\u002Fdocs\u002Foptimization)\n","2026-10-15",{},1795415206209]