Currency
Definition
Currency in the System represents the counting unit. It means that currency can be any entity that is counted in the system. It can be fiat currency, electronic money, points, bonuses, etc.
Currencies are unique by their IDs which is generated by the system for each created currency.
Currency entity structure
Attributes
API GET /currencies field name | UI label in Currency list | description | value example |
id | ID | unique UUID, generated by the system for each currency | 4a4917e4-7134-470f-9f89-9d1e26217acd |
currencyCode | Code | can be any code specified by user or ISO currency code for fiat currency | USD |
digitalCode | Digital Code | can be any code specified by user or ISO currency code for fiat currency | 840 |
name | Name | currency name | US Dollar |
symbol | Symbol | currency symbol for representation where it’s required | $ |
fraction | Fraction | currency fraction – how many fractional units contains basic monetary unit, for example USD fraction is 100 which means that 1 dollar contains 100 cents | 100 |
active | Status | status of currency. If active=false all operations for client`s wallets in this currency are forbidden, as well as the creation of new wallets in this currency (for both, Service and Business Users). | true |
snPrefix | SN Prefix | this prefic can be used in the when generating wallet serial number, currently is not used | 840_ |
Currency wallet relation
Each wallet in the system is linked to a particular Currency during wallet creation. A wallet can be linked to one currency.
Currency patterns
Pattern to set currency: [id currencyCode name]: 4a4917e4-7134-470f-9f89-9d1e26217acd USD dollar
UI pattern for other usage: [currencyCode name]: USD dollar
Currency in accounting
Accounting in the system is always performed within one Currency. If several USD are created in the system as different currencies they are considered different currencies because they have different IDs. So, if it is required to move issued electronic money between different Currencies, top-up/withdrawal or exchange operations are used.
For this purpose, the currency exchange rate can be set up as 1.
Another example, if it is required to perform a transfer from wallet 1 in currency USD with ID 1 to wallet 2 in currency USD with id 2, the following operations should be done:
- exchange operation if both wallets belong to the same user
- exchange – transfer – exchange if wallets belong to different users
- or withdraw – top-up if wallets belong to different users