The open directive declares the start of an account's life.
See the Beancount Open directive.
Beancount syntax
2026-01-01 open Assets:Bank USD,EUR "STRICT"
note: "Primary checking"General form: YYYY-MM-DD open Account [Currency,...] ["BookingMethod"]
Elixir struct
%Beancount.Directives.Open{
date: ~D[2026-01-01],
account: "Assets:Bank",
currencies: ["USD", "EUR"],
booking: "STRICT",
metadata: %{"note" => "Primary checking"}
}Prefer Beancount.open/4 when building ledgers programmatically:
Beancount.open(~D[2026-01-01], "Assets:Bank", ["USD", "EUR"],
booking: "STRICT",
metadata: %{"note" => "Primary checking"}
)Fields
date-Date.t()when the account becomes active. Must be on or before the first posting to this account.account- colon-separated account name, e.g."Assets:Bank".currencies- optional list of allowed commodities for postings to this account. Empty list[]means no constraint. Rendered comma-separated in the.beanfile.booking- lot-matching method when a reducing posting is ambiguous. Common values:"STRICT"(default; error on ambiguity),"NONE","FIFO","LIFO","AVERAGE","HIFO".nilomits the booking clause.metadata- optional map of key/value pairs rendered as indented metadata lines below the directive.