لوكلاء AI: ملف markdown لهذه الصفحة — /docs-content-en/entities/currencies/localizations/set.md فهرس التوثيق — /llms.txt

مقالات التوثيق متاحة حاليًا باللغة الإنجليزية فقط.

Set currency localizations

PUT /v1/currencies/:id/localizations

Creates or changes the currency display settings for the specified languages. Only the languages and fields you pass are updated.

Scope: crm.

Parameters

Parameter Type Required Default Description
Parameterid (path) Typestring Requiredyes Default— DescriptionCurrency code from the currency list. Leading and trailing spaces are stripped, and letters are uppercased

Request fields (body)

Field Type Required Description
Fieldlocalizations Typeobject Requiredyes DescriptionA non-empty map of languages. Other top-level fields are not accepted
Fieldlocalizations.{lang} Typeobject Requiredyes DescriptionA non-empty settings object for the {lang} language, for example en or ru. Pass at least one of the fields below in each object
Fieldlocalizations.{lang}.fullName Typestring Requiredno DescriptionFull currency name
Fieldlocalizations.{lang}.formatString Typestring Requiredno DescriptionAmount display template, # is the placeholder for the number
Fieldlocalizations.{lang}.decPoint Typestring Requiredno DescriptionDecimal separator
Fieldlocalizations.{lang}.thousandsVariant Typestring Requiredno DescriptionThousands separator variant
Fieldlocalizations.{lang}.thousandsSep Typestring | null Requiredno DescriptionThousands separator character. The stored value depends on thousandsVariant
Fieldlocalizations.{lang}.decimals Typenumber Requiredno DescriptionNumber of digits after the decimal separator
Fieldlocalizations.{lang}.hideZero Typeboolean Requiredno DescriptionHide trailing zeros in the fractional part

Examples

curl — personal key

Terminal
curl -X PUT "https://vibecode.bitrix24.com/v1/currencies/QVC/localizations" \
  -H "X-Api-Key: YOUR_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{"localizations":{"en":{"fullName":"Example currency","formatString":"# QVC","decimals":2,"hideZero":false},"ru":{"fullName":"Example currency","formatString":"# QVC","decimals":2,"hideZero":false}}}'

curl — OAuth application

Terminal
curl -X PUT "https://vibecode.bitrix24.com/v1/currencies/QVC/localizations" \
  -H "X-Api-Key: YOUR_APP_KEY" \
  -H "Authorization: Bearer USER_SESSION_TOKEN" \
  -H "Content-Type: application/json" \
  -d '{"localizations":{"en":{"fullName":"Example currency","formatString":"# QVC","decimals":2,"hideZero":false},"ru":{"fullName":"Example currency","formatString":"# QVC","decimals":2,"hideZero":false}}}'

JavaScript — personal key

javascript
const res = await fetch('https://vibecode.bitrix24.com/v1/currencies/QVC/localizations', {
  method: 'PUT',
  headers: {
    'X-Api-Key': 'YOUR_API_KEY',
    'Content-Type': 'application/json',
  },
  body: JSON.stringify({"localizations":{"en":{"fullName":"Example currency","formatString":"# QVC","decimals":2,"hideZero":false},"ru":{"fullName":"Example currency","formatString":"# QVC","decimals":2,"hideZero":false}}}),
})
const { success, data } = await res.json()

JavaScript — OAuth application

javascript
const res = await fetch('https://vibecode.bitrix24.com/v1/currencies/QVC/localizations', {
  method: 'PUT',
  headers: {
    'X-Api-Key': 'YOUR_APP_KEY',
    'Authorization': 'Bearer USER_SESSION_TOKEN',
    'Content-Type': 'application/json',
  },
  body: JSON.stringify({"localizations":{"en":{"fullName":"Example currency","formatString":"# QVC","decimals":2,"hideZero":false},"ru":{"fullName":"Example currency","formatString":"# QVC","decimals":2,"hideZero":false}}}),
})
const { success, data } = await res.json()

Response fields

Field Type Description
Fieldsuccess Typeboolean DescriptionAlways true on success
Fielddata Typeboolean DescriptionAlways true. The result is confirmed by a second read of the localizations

Response example

HTTP 200 OK:

JSON
{
  "success": true,
  "data": true
}

Error response example

422 — the saved values did not match the ones passed. For example, thousandsVariant equals B while a space was passed in thousandsSep:

JSON
{
  "success": false,
  "error": {
    "code": "BITRIX_ERROR",
    "message": "Bitrix24 did not apply the requested currency localizations"
  }
}

Errors

HTTP Code Description
HTTP400 CodeMISSING_REQUIRED_FIELDS Descriptionlocalizations is missing or empty, other top-level fields were passed, a language code is empty, or its settings object is empty
HTTP400 CodeUNKNOWN_FIELD DescriptionAn unknown localization field was passed
HTTP400 CodeINVALID_FIELD_VALUE DescriptionAn object or an array was passed instead of a scalar value
HTTP400 CodeINVALID_ID DescriptionThe currency code is empty after spaces are stripped
HTTP404 CodeENTITY_NOT_FOUND DescriptionNo currency with the specified code was found
HTTP422 CodeBITRIX_ERROR DescriptionBitrix24 rejected the write, reported a failure, or the second read did not confirm the passed values
HTTP403 CodeWRITE_BLOCKED_READONLY_KEY DescriptionThe key is in READONLY mode
HTTP403 CodeBITRIX_ACCESS_DENIED DescriptionThe user has no permission for the operation in Bitrix24
HTTP403 CodeSCOPE_DENIED DescriptionThe API key does not have the crm scope
HTTP401 CodeMISSING_API_KEY DescriptionThe X-Api-Key header is missing
HTTP401 CodeTOKEN_MISSING DescriptionThe API key has no configured Bitrix24 tokens
HTTP502 CodeBITRIX_RESPONSE_INVALID DescriptionA response with an unexpected structure was received
HTTP502 CodeBITRIX_UNAVAILABLE DescriptionBitrix24 is unavailable

Full list of common API errors — Errors.

Known specifics

The write is not transactional: an error does not roll back the values already saved. Before retrying, call Get currency localizations and compare the current settings with the settings you need.

See also