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

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

Important: once created, currencies cannot be deleted from the system

Example of including a new currency:

POST /currency

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

Currency query

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

GET /currency

Response example:

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

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.

Important: once created, currencies cannot be deleted from the system

Example of including a new currency:

POST /currency

{
  "code": "usd",
  "description": "us dollar"
}

Currency query

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

GET /currency

Response example:

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

Last updated