## 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

```bash
curl "https://vibecode.bitrix24.com/v1/currencies/base" \
  -H "X-Api-Key: YOUR_API_KEY"
```

### curl — OAuth application

```bash
curl "https://vibecode.bitrix24.com/v1/currencies/base" \
  -H "X-Api-Key: YOUR_APP_KEY" \
  -H "Authorization: Bearer USER_SESSION_TOKEN"
```

### JavaScript — personal key

```javascript
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

```javascript
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 |
|------|-----|----------|
| `success` | boolean | Always `true` on success |
| `data` | object | Object with the base currency code |
| `data.currency` | string | Base currency code. Currency details — [Get currency](/docs/entities/currencies/get) |

## Response example

```json
{
  "success": true,
  "data": {
    "currency": "USD"
  }
}
```

## Error response example

403 — the key has no `crm` scope:

```json
{
  "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 |
|------|-----|----------|
| 422 | `BITRIX_ERROR` | Bitrix24 rejected the base currency read |
| 403 | `BITRIX_ACCESS_DENIED` | The user has no permission for the operation in Bitrix24 |
| 403 | `SCOPE_DENIED` | The API key has no `crm` scope |
| 401 | `MISSING_API_KEY` | The `X-Api-Key` header is missing |
| 401 | `TOKEN_MISSING` | The API key has no configured Bitrix24 tokens |
| 502 | `BITRIX_RESPONSE_INVALID` | A response with an unexpected structure was received |
| 502 | `BITRIX_UNAVAILABLE` | Bitrix24 is unavailable |

Full list of common API errors — [Errors](/docs/errors).

## Known specifics

The method only reads settings. Switching the base currency through it is not available.

## See also

- [List currencies](/docs/entities/currencies/list)
- [Get currency](/docs/entities/currencies/get)
- [Get currency localizations](/docs/entities/currencies/localizations/get)
