Currencies
Currencies define how monetary values are handled for pricelists — including how VAT amounts are rounded during price calculations.
Currency Properties
| Field | Type | Default | Description |
|---|---|---|---|
code | string | — | ISO 4217 currency code (e.g. SEK, EUR, USD) |
is_active | boolean | true | Whether the currency can be assigned to new pricelists |
vat_precision | integer | 2 | Number of decimal places for rounding VAT amounts (0–4) |
VAT Precision
The vat_precision field controls how many decimal places the VAT amount is rounded to during price calculation. This is independent of final sales price rounding.
For example, with vat_precision: 2 and a 25% VAT rate:
NET mode (price excludes VAT):
- Base price: 99.90
- VAT amount: 99.90 x 0.25 = 24.975 → rounded to 24.98
- Price inc. VAT: 99.90 + 24.98 = 124.88
GROSS mode (price includes VAT):
- Price inc. VAT: 124.88
- VAT amount: 124.88 - (124.88 / 1.25) = 24.976 → rounded to 24.98
- Price exc. VAT: 124.88 - 24.98 = 99.90
Recommended values
| Currency | Recommended vat_precision | Reason |
|---|---|---|
| Most currencies (EUR, SEK, USD, GBP, ...) | 2 | Standard subunit (cents, ören) |
| ISK, JPY, KRW | 0 | No subunit in common use |
Rounding mode is always HALF_UP (standard commercial rounding).
Active vs. Inactive Currencies
Setting a currency to inactive
You can deactivate a currency to prevent it from being used for new pricelists while keeping existing ones functional.
PUT /currency/{code}
{
"is_active": false
}
What happens when a currency is inactive
| Scenario | Behavior |
|---|---|
| Creating a new pricelist with the currency | Blocked — returns a validation error |
| Price calculations on existing pricelists | Still works — existing pricelists are not affected |
| Listing currencies | Inactive currencies are excluded from list results |
| Reactivating the currency | Full functionality is restored immediately |
Note: Deactivating a currency is a soft operation. Existing pricelists and their prices continue to calculate normally. No data is lost or altered.
Managing Currencies
Create or update a currency
PUT /currency/{code}
{
"is_active": true,
"vat_precision": 2
}
New currencies are active by default. If vat_precision is not specified, it defaults to 2.
Get a currency
GET /currency/{code}
List all active currencies
GET /currency
Returns only active currencies.
Deactivate a currency
PUT /currency/{code}
{
"is_active": false
}