لوكلاء AI: ملف markdown لهذه الصفحة — /docs-content-en/entities/currencies/base.md فهرس التوثيق — /llms.txt
مقالات التوثيق متاحة حاليًا باللغة الإنجليزية فقط.
Base currency
GET /v1/currencies/base
Returns the base currency of the Bitrix24 account — exchange rates of all other currencies in CRM are set against it.
Scope: crm. A key in READONLY mode is accepted.
Examples
curl — personal key
curl "https://vibecode.bitrix24.com/v1/currencies/base" \
-H "X-Api-Key: YOUR_API_KEY"
curl — OAuth application
curl "https://vibecode.bitrix24.com/v1/currencies/base" \
-H "X-Api-Key: YOUR_APP_KEY" \
-H "Authorization: Bearer USER_SESSION_TOKEN"
JavaScript — personal key
const res = await fetch('https://vibecode.bitrix24.com/v1/currencies/base', {
headers: {
'X-Api-Key': 'YOUR_API_KEY',
},
})
const { success, data } = await res.json()
JavaScript — OAuth application
const res = await fetch('https://vibecode.bitrix24.com/v1/currencies/base', {
headers: {
'X-Api-Key': 'YOUR_APP_KEY',
'Authorization': 'Bearer USER_SESSION_TOKEN',
},
})
const { success, data } = await res.json()
Response fields
| Field | Type | Description |
|---|---|---|
Fieldsuccess |
Typeboolean | DescriptionAlways true on success |
Fielddata |
Typeobject | DescriptionObject with the base currency code |
Fielddata.currency |
Typestring | DescriptionBase currency code. Currency details — Get currency |
Response example
{
"success": true,
"data": {
"currency": "USD"
}
}
Error response example
403 — the key has no crm scope:
{
"success": false,
"error": {
"code": "SCOPE_DENIED",
"message": "This endpoint requires 'crm' scope",
"hint": "This request needs the 'crm' scope, which the calling key does not carry. Add 'crm' to this key in the developer cabinet (or through the management API), then repeat the call.",
"cause": "key_scope_missing",
"requiredScope": "crm",
"keyScopes": [
"task",
"im"
],
"fix": {
"action": "edit_key_scopes",
"via": "cabinet"
},
"userMessage": "The app's API key lacks the “CRM” permission. You can add it in the key settings in the developer cabinet."
}
}
Errors
| HTTP | Code | Description |
|---|---|---|
| HTTP422 | CodeBITRIX_ERROR |
DescriptionBitrix24 rejected the base currency read |
| HTTP403 | CodeBITRIX_ACCESS_DENIED |
DescriptionThe user has no permission for the operation in Bitrix24 |
| HTTP403 | CodeSCOPE_DENIED |
DescriptionThe API key has no 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 method only reads settings. Switching the base currency through it is not available.