[{"data":1,"prerenderedAt":7},["ShallowReactive",2],{"docs-entities\u002Fcurrencies\u002Fupdate":3,"docs-tabs-entities\u002Fcurrencies\u002Fupdate":6},{"content":4,"lastmod":5},"\n## Update currency\n\n`PATCH \u002Fv1\u002Fcurrencies\u002F:id`\n\nUpdates currency fields by code. Use it to update the exchange rate.\n\n> `base` and `BASE` are read-only. Including either in an update returns `400 READONLY_FIELD` before calling Bitrix24. Changing the base currency through the API is not supported. Use the Bitrix24 interface.\n\n## Path parameters\n\n| Parameter | Type | Required | Description |\n|----------|-----|:-----:|---------|\n| `id` (path) | string | yes | Currency code, for example `USD`, `EUR`. List: [`GET \u002Fv1\u002Fcurrencies`](\u002Fdocs\u002Fentities\u002Fcurrencies\u002Flist) |\n\n## Request body parameters\n\n| Parameter | Type | Required | Description |\n|----------|-----|:-----:|---------|\n| `amount` | number | no | Exchange rate |\n| `amountCnt` | number | no | Number of units for the rate |\n| `sort` | number | no | Sort order |\n| `fullName` | string | no | Currency name |\n| `formatString` | string | no | Display template, e.g. `# $` |\n| `decimals` | number | no | Number of decimal places |\n| `decPoint` | string | no | Decimal separator |\n| `thousandsSep` | string | no | Thousands separator |\n\n> **Localizable fields can be sent flat.** The API packs `fullName`, `formatString`, `decimals`, `decPoint`, `thousandsSep` into **your** language's localization (the API key's language), so a flat update persists and reads back. A raw `LANG` object in the body is **not** accepted — the field is read-only and returns `400 READONLY_FIELD`. Setting different values for several languages at once via the API is not yet supported.\n\n## Examples\n\n### curl — personal key\n\n```bash\ncurl -X PATCH \"https:\u002F\u002Fvibecode.bitrix24.com\u002Fv1\u002Fcurrencies\u002FUSD\" \\\n  -H \"X-Api-Key: YOUR_API_KEY\" \\\n  -H \"Content-Type: application\u002Fjson\" \\\n  -d '{\"amount\": 94.2}'\n```\n\n### curl — OAuth application\n\n```bash\ncurl -X PATCH \"https:\u002F\u002Fvibecode.bitrix24.com\u002Fv1\u002Fcurrencies\u002FUSD\" \\\n  -H \"X-Api-Key: YOUR_APP_KEY\" \\\n  -H \"Authorization: Bearer USER_SESSION_TOKEN\" \\\n  -H \"Content-Type: application\u002Fjson\" \\\n  -d '{\"amount\": 94.2}'\n```\n\n### JavaScript — personal key\n\n```javascript\nconst res = await fetch('https:\u002F\u002Fvibecode.bitrix24.com\u002Fv1\u002Fcurrencies\u002FUSD', {\n  method: 'PATCH',\n  headers: { 'X-Api-Key': 'YOUR_API_KEY', 'Content-Type': 'application\u002Fjson' },\n  body: JSON.stringify({ amount: 94.2 }),\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\u002Fcurrencies\u002FUSD', {\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({ amount: 94.2 }),\n})\nconst { success, data } = await res.json()\n```\n\n## Response fields\n\n| Field | Type | Description |\n|------|-----|---------|\n| `success` | boolean | Always `true` on success |\n| `data` | object | The currency with all fields after the write |\n| `data.id` | string | Currency code (USD, EUR, …) |\n| `data.amountCnt` | number | Number of units for the rate |\n| `data.amount` | number | Exchange rate |\n| `data.sort` | number | Sort order |\n| `data.base` | boolean | Base currency |\n| `data.fullName` | string | Name (US Dollar, $) |\n| `data.lid` | string | ID of the site the currency is bound to |\n| `data.formatString` | string | Display format |\n| `data.decPoint` | string | Decimal separator |\n| `data.thousandsSep` | string | Thousands separator |\n| `data.decimals` | number | Decimal places |\n| `data.dateUpdate` | datetime | Date of the last update |\n| `data.lang` | object | Per-language display settings — format, name, separators. The object key is the language ID, e.g. `en` |\n\n## Response example\n\nThe `lang` object is trimmed to one language.\n\n```json\n{\n  \"success\": true,\n  \"data\": {\n    \"id\": \"USD\",\n    \"fullName\": \"US Dollar\",\n    \"amount\": 94.2,\n    \"amountCnt\": 1,\n    \"base\": false,\n    \"sort\": 200,\n    \"lid\": \"en\",\n    \"formatString\": \"$#\",\n    \"decimals\": 2,\n    \"decPoint\": \".\",\n    \"thousandsSep\": \",\",\n    \"dateUpdate\": \"2024-11-12T07:20:08.000Z\",\n    \"lang\": {\n      \"en\": {\n        \"FORMAT_STRING\": \"$#\",\n        \"FULL_NAME\": \"US Dollar\",\n        \"DEC_POINT\": \".\",\n        \"THOUSANDS_SEP\": \",\",\n        \"DECIMALS\": \"2\",\n        \"THOUSANDS_VARIANT\": \"C\",\n        \"HIDE_ZERO\": \"Y\"\n      }\n    }\n  }\n}\n```\n\n\n## Error response example\n\n404 — no currency with this code:\n\n```json\n{\n  \"success\": false,\n  \"error\": { \"code\": \"ENTITY_NOT_FOUND\", \"message\": \"Currency is not found\" }\n}\n```\n\n## Errors\n\n| HTTP | Code | Description |\n|------|-----|---------|\n| 404 | `ENTITY_NOT_FOUND` | Currency not found |\n| 400 | `READONLY_FIELD` | The body contains a read-only field, such as `LANG` or `dateUpdate`. The field name is given in `message` |\n| 403 | `SCOPE_DENIED` | API key does not have the `crm` scope |\n| 401 | `MISSING_API_KEY` | The `X-Api-Key` header is missing |\n\nFull list of errors — [Errors](\u002Fdocs\u002Ferrors).\n\n## See also\n\n- [Get currency](\u002Fdocs\u002Fentities\u002Fcurrencies\u002Fget)\n- [Field reference](\u002Fdocs\u002Fentities\u002Fcurrencies\u002Ffields)\n- [Currencies](\u002Fdocs\u002Fentities\u002Fcurrencies)\n","2026-10-13",{},1795415235662]