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(CREDITorDEBIT, see Transactions).
| Example | Meaning |
|---|---|
USD:42.01 | 42 dollars and 1 cent |
JPY:10 | 10 yen (no minor units) |
BTC:0.00000001 | one 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
USDacceptsUSD:42.01, notUSD: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.