The custom directive is a generic, user-defined directive.
See Custom.
Beancount syntax
2026-01-01 custom "budget" Expenses:Food #monthly 400.00 USDGeneral form: YYYY-MM-DD custom "Type" Value...
Elixir struct
%Beancount.Directives.Custom{
date: ~D[2026-01-01],
type: "budget",
values: [
Beancount.account_value("Expenses:Food"),
Beancount.tag_value("monthly"),
Beancount.amount_value(Decimal.new("400.00"), "USD")
],
metadata: %{}
}Or use Beancount.custom/4:
Beancount.custom(~D[2026-01-01], "budget", [
Beancount.account_value("Expenses:Food"),
Beancount.tag_value("monthly"),
Beancount.amount_value(Decimal.new("400.00"), "USD")
])Plain strings, Decimal, Date, booleans, and atoms are also valid values.
Fields
date-Date.t()the custom entry applies to.type- user-defined directive name (quoted in.beantext).values- ordered list of scalars rendered aftertype. UseBeancount.account_value/1,Beancount.tag_value/1, andBeancount.amount_value/2for typed Beancount tokens.metadata- optional map rendered below the directive.