The balance directive asserts an account balance at a date.
See Balance Assertions.
Beancount syntax
2026-01-31 balance Assets:Bank 5000 USD
2026-01-31 balance Assets:Bank 1.5 ~ 0.5 USDGeneral form: YYYY-MM-DD balance Account Amount [~ Tolerance] Currency
The check runs at the beginning of date (midnight).
Elixir struct
%Beancount.Directives.Balance{
date: ~D[2026-01-31],
account: "Assets:Bank",
amount: Decimal.new("1.5"),
currency: "USD",
tolerance: Decimal.new("0.5"),
metadata: %{}
}Or use Beancount.balance/5:
Beancount.balance(~D[2026-01-31], "Assets:Bank", Decimal.new("1.5"), "USD",
tolerance: Decimal.new("0.5")
)Fields
date-Date.t()when the assertion is evaluated (start of day).account- account whose balance is checked (may be a parent account).amount- expectedDecimal.t()balance incurrency.currency- commodity symbol being asserted.tolerance- optionalDecimal.t()for explicit local tolerance (amount ~ tolerance currency).niluses inferred tolerance from options.metadata- optional map rendered below the directive.