pub struct TransactionPurpose {
pub account_ids: Vec<i64>,
pub cost_center_id: Option<i64>,
pub id: i64,
pub is_income: bool,
pub meta: MetaDataEntityId,
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>Resolved, distinct ledger account IDs. Can be empty when input IDs could not be resolved. No order is guaranteed.
cost_center_id: 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.
id: i64§is_income: boolTrue for income presets, false for expense presets. Determines which side of a transaction uses purposeAccountId.
meta: MetaDataEntityId§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.