pub struct TransactionPurposeCreate {
pub account_ids: Vec<i64>,
pub cost_center_id: Option<Option<i64>>,
pub is_income: bool,
pub name: String,
pub purpose_account_id: i64,
pub sort_key: i64,
pub extra: Map<String, Value>,
}Expand description
A transaction purpose is a reusable preset for simplified bookkeeping. It fixes one ledger account, offers a list of accounts for the other side, and can assign a cost center. isIncome selects an income or expense preset; it is not the free-text note of a bank statement.
Fields§
§account_ids: Vec<i64>Accounts offered for the other side of the posting. Duplicate IDs are collapsed; unknown IDs are currently omitted by the lookup. Supply existing accounts.
cost_center_id: Option<Option<i64>>Optional cost center. Omitted or null removes it, including on update. If supplied, its period must match the fixed account and all resolved accountIds.
None leaves the field out, Some(None) sends null.
is_income: boolTrue for income presets, false for expense presets. Determines which side of a transaction uses purposeAccountId.
name: StringTrimmed display name. Names are not required to be unique.
purpose_account_id: i64Fixed ledger account: the contra account for income, or the account for expenses. Its period must be open.
sort_key: i64Ascending display order. Required in creation and update.
extra: Map<String, Value>Fields not described by the spec, e.g. instance-specific DB fields.