> For the complete documentation index, see [llms.txt](https://teamleader-sdk.mcore-services.dev/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://teamleader-sdk.mcore-services.dev/api-reference/general/currencies.md).

# Currencies

Manage currency exchange rates in Teamleader Focus.

```php
Teamleader::currencies()
```

|                          |                                                            |
| ------------------------ | ---------------------------------------------------------- |
| Class                    | `McoreServices\TeamleaderSDK\Resources\General\Currencies` |
| Create / update / delete | — / — / —                                                  |
| Pagination               | No                                                         |

## Endpoints

* `currencies.exchangeRates`

## Filters

`list()` takes no filters.

## Accepted values

Public constants on the class. Body fields and enum values outside these lists throw before the request is sent.

| Constant     | Values                                                                                                                                                          |
| ------------ | --------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| `CURRENCIES` | `BAM`, `CAD`, `CHF`, `CLP`, `CNY`, `COP`, `CZK`, `DKK`, `EUR`, `GBP`, `INR`, `ISK`, `JPY`, `MAD`, `MXN`, `NOK`, `PEN`, `PLN`, `RON`, `SEK`, `TRY`, `USD`, `ZAR` |

## Methods

### `eurRates()`

```php
eurRates(): array
```

Get exchange rates for EUR (convenience method)

### `exchangeRates()`

```php
exchangeRates(string $baseCurrency): array
```

Get exchange rates for a specific base currency

* `$baseCurrency` — The base currency code (e.g., 'EUR', 'USD')

### `isValidCurrencyCode()`

```php
isValidCurrencyCode(string $currencyCode): bool
```

Check if a currency code is supported

### `getSupportedCurrencyCodes()`

```php
getSupportedCurrencyCodes(): array
```

Get supported currency codes only

### `getSupportedCurrencies()`

```php
getSupportedCurrencies(): array
```

Get all supported currency codes

### `usdRates()`

```php
usdRates(): array
```

Get exchange rates for USD (convenience method)

### `gbpRates()`

```php
gbpRates(): array
```

Get exchange rates for GBP (convenience method)

### `convert()`

```php
convert(float $amount, string $fromCurrency, string $toCurrency): array
```

Convert amount from one currency to another using current exchange rates

### `list()`

```php
list(array $filters = [], array $options = [])
```

Override the list method to prevent confusion (not applicable for currencies)

### `info()`

```php
info($id, $includes = null)
```

Override the info method to prevent confusion (not applicable for currencies)

### `getCommonPairs()`

```php
getCommonPairs(): array
```

Get common currency pairs for quick access

### `getRate()`

```php
getRate(string $baseCurrency, string $targetCurrency): array
```

Get rate for a specific currency pair

### `getCurrencyName()`

```php
getCurrencyName(string $currencyCode): ?string
```

Get currency name by code

## Examples

Get exchange rates for EUR as base currency:

```php
$rates = Teamleader::currencies()->exchangeRates('EUR');
```

Get exchange rates for USD as base currency:

```php
$rates = Teamleader::currencies()->exchangeRates('USD');
```

Get specific currency rate from response:

```php
$rates = Teamleader::currencies()->exchangeRates('EUR');
$usdRate = collect($rates['data'])->firstWhere('code', 'USD')['exchange_rate'] ?? null;
```
