# Currencies

The system allows the creation of currencies according to the user's choice. Once created, currencies cannot be deleted from the system. Created currencies are validated at the time creating balances.

Currencies have a _decimals_ propriety that describes how many precision characters will exist after the floating point, once all amounts persisted in the balances will be in an integer type. Example: a currency created with 2 decimals will return the amount 150000 as 1500.00.

## Adding a new currency <a href="#adding-a-new-currency" id="adding-a-new-currency"></a>

To add a new currency, use POST /currency method.

{% hint style="danger" %}
<mark style="color:red;">**Important:**</mark> <mark style="color:red;"></mark><mark style="color:red;">once created, currencies cannot be deleted from the system</mark>
{% endhint %}

Example of including a new currency:

```json
POST /currency

{
  "code": "usd",
  "name": "us dollar",
  "decimals": 2
}
```

## Currency query <a href="#currency-query" id="currency-query"></a>

Querying the list of currencies is performed using GET /currency method.

```json
GET /currency
```

Response example:

```json
{
  "data": [
    {
      "code": "usd",
      "name": "us dollar",
      "decimals": 2
    }
  ]
}
```

&#x20;

\
















The system allows the creation of currencies according to the user's choice. Once created, currencies cannot be deleted from the system. Created currencies are validated at the time creating accounts balances.

## Adding a new currency

To add a new currency, use POST /currency method.

{% hint style="danger" %}
<mark style="color:red;">**Important:**</mark> <mark style="color:red;"></mark><mark style="color:red;">once created, currencies cannot be deleted from the system</mark>
{% endhint %}

Example of including a new currency:

<pre class="language-json"><code class="lang-json"><strong>POST /currency
</strong>
{
  "code": "usd",
  "description": "us dollar"
}
</code></pre>

## Currency query

Querying the list of currencies is performed using GET /currency method.

<pre class="language-json"><code class="lang-json"><strong>GET /currency
</strong></code></pre>

Response example:

```json
{
  [
    {
      "code": "usd",
      "description": "us dollar"      
    }
  ]
}
```
