Skip to main content

Currencies

Currencies define how monetary values are handled for pricelists — including how VAT amounts are rounded during price calculations.

Currency Properties

FieldTypeDefaultDescription
codestringISO 4217 currency code (e.g. SEK, EUR, USD)
is_activebooleantrueWhether the currency can be assigned to new pricelists
vat_precisioninteger2Number 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
CurrencyRecommended vat_precisionReason
Most currencies (EUR, SEK, USD, GBP, ...)2Standard subunit (cents, ören)
ISK, JPY, KRW0No 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.

POST /currency/{code}/active?value=false

Response (200):

{
"active": false
}

Setting a currency to active

POST /currency/{code}/active?value=true

What happens when a currency is inactive

ScenarioBehavior
Creating a new pricelist with the currencyBlocked — returns a validation error
Price calculations on existing pricelistsStill works — existing pricelists are not affected
Reactivating the currencyFull 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

POST /currency
Content-Type: application/json
{
"code": "SEK",
"name": "Swedish Krona",
"is_active": true,
"vat_precision": 2
}

New currencies are active by default. If vat_precision is not specified, it defaults to 2. Returns 202 Accepted on success.

Get a currency

GET /currency/{code}

Response (200):

{
"code": "SEK",
"name": "Swedish Krona",
"vat_precision": 2,
"active": true,
"updated_at": "2025-01-15T10:00:00Z"
}

List all currencies

GET /currency

Returns all currencies (both active and inactive).

Activate or deactivate a currency

POST /currency/{code}/active?value=true
POST /currency/{code}/active?value=false

Returns 200 with {"active": true/false} on success, 404 if the currency is not found.