Money

Monetary amounts are strings, never JSON numbers, so precision is exact across fiat, crypto, and points — there is no float rounding anywhere on the wire.

The format is <currency_code>:<amount>:

  • Currency code — three or more uppercase letters (USD, JPY, BTC).
  • Amount — a positive decimal. Direction is never expressed with a sign; it comes from the entry's operation (CREDIT or DEBIT, see Transactions).
ExampleMeaning
USD:42.0142 dollars and 1 cent
JPY:1010 yen (no minor units)
BTC:0.00000001one satoshi

Two rules keep amounts correct:

  • Currency must belong to the ledger. Each amount's currency is validated against the ledger's configured currencies; an unknown or mismatched currency is rejected with 400.
  • Respect the currency's precision. Use only as many decimal places as the currency supports (for example a 2-decimal currency like USD accepts USD:42.01, not USD:42.014).

Amounts always appear inside transaction entries. For how those entries pair up — debits, credits, and the rule that every transaction must balance — see Transactions.