# Currency

Currency API allows merchants to get some information about fiat currencies, that may be used during invoice creation

## Entities

### Currency

`Currency` entity represents single fiat currency

{% tabs %}
{% tab title="TypeScript" %}
Type may be imported as:

```typescript
import type { Currency } from '@simplepay-ai/api-client';
```

Type definition:

```typescript
interface Currency {
    /**
     * Currency ID
     *
     * @example '5e091838-d7bb-4365-a395-84d82d1ac7c2'
     */
    id: string;

    /**
     * Currency symbol (ISO 4217 alphabetic code)
     *
     * @example 'USD'
     * @see https://en.wikipedia.org/wiki/ISO_4217
     */
    symbol: string;

    /**
     * Currency code (ISO 4217 numeric code)
     *
     * @example 840
     * @see https://en.wikipedia.org/wiki/ISO_4217
     */
    code: number;
}
```

{% endtab %}
{% endtabs %}

## Methods

### List currencies

{% tabs %}
{% tab title="TypeScript" %}

```typescript
import type { HttpError } from '@simplepay-ai/api-client';

try {
    const currencies = await api.currency.list();

    console.debug(currencies);
} catch (e) {
    if (e instanceof HttpError) {
        const error = e as HttpError;

        console.error(error.code);
    }
}
```

{% endtab %}
{% endtabs %}

{% hint style="info" %}
If you require currency that is not in list, we will be glad to help you, feel free to [Request Currency](mailto:info@simplepay.ai?subject=Currency%20Request\&body=I%27m%20interested%20in%20...%20currency)
{% endhint %}
