Skip to main content

FinanceSplitTransactionsResource

Struct FinanceSplitTransactionsResource 

Source
pub struct FinanceSplitTransactionsResource<'a> { /* private fields */ }
Expand description

client.finance().split_transactions()

Implementations§

Source§

impl<'a> FinanceSplitTransactionsResource<'a>

Source

pub fn create( &self, body: &SplitTransactionCreate, ) -> Result<Option<SplitTransaction>>

Create new split transaction

POST /finance/splittransactions

Creates a grouped booking from new children or existing standalone booking IDs. Child notes, amounts, accounts and assignments are supplied separately; document date and number come from the parent. New child accounts must allow posting; supplied existing child accounts require period edit permission. Children must meet the shared-account and amount-sum rules. A new child must belong to an open period containing the document date. Generated tax amounts are derived from the gross child inputs. With one child the group is converted to an ordinary booking and HTTP 204 is returned without its ID. For multiple children, returns the split parent with child booking data.

Use Self::create_with to pass query parameters.

§Example
let body = models::SplitTransactionCreate {
    amount: 30000,
    document_date: "2026-09-14".parse()?,
    note: Some("Offering and building fund".into()),
    split_children: vec![models::SplitTransactionChildCreate {
        account_id: 10,
        amount: 7812,
        contra_account_id: 11,
        note: Some("Building fund".into()),
        ..Default::default()
    }],
    ..Default::default()
};
let result = client.finance().split_transactions().create(&body)?;
println!("{:?}", result);
Source

pub fn create_with( &self, query: &PostFinanceSplittransactionsQuery, body: &SplitTransactionCreate, ) -> Result<Option<SplitTransaction>>

Create new split transaction

Like Self::create, with query parameters.

POST /finance/splittransactions

Creates a grouped booking from new children or existing standalone booking IDs. Child notes, amounts, accounts and assignments are supplied separately; document date and number come from the parent. New child accounts must allow posting; supplied existing child accounts require period edit permission. Children must meet the shared-account and amount-sum rules. A new child must belong to an open period containing the document date. Generated tax amounts are derived from the gross child inputs. With one child the group is converted to an ordinary booking and HTTP 204 is returned without its ID. For multiple children, returns the split parent with child booking data.

Source

pub fn delete(&self, id: impl Display) -> Result<()>

Delete split transaction

DELETE /finance/splittransactions/{id}

Deletes the entire split parent, its ordinary and generated tax children, related cancellation group, and attached receipts/files. Related statement movements are reset to open and unlinked. Requires edit permission for every child’s period. Each child must be mutable and its period open. dry_run=true returns HTTP 409 with a deletion assessment without deleting, including when deletion is possible.

Use Self::delete_with to pass query parameters.

§Example
client.finance().split_transactions().delete(1)?;
Source

pub fn delete_with( &self, id: impl Display, query: &DeleteFinanceSplittransactionsIdQuery, ) -> Result<()>

Delete split transaction

Like Self::delete, with query parameters.

DELETE /finance/splittransactions/{id}

Deletes the entire split parent, its ordinary and generated tax children, related cancellation group, and attached receipts/files. Related statement movements are reset to open and unlinked. Requires edit permission for every child’s period. Each child must be mutable and its period open. dry_run=true returns HTTP 409 with a deletion assessment without deleting, including when deletion is possible.

Source

pub fn duplicate( &self, id: impl Display, body: &BTreeMap<String, Value>, ) -> Result<SplitTransaction>

Duplicate split transaction

POST /finance/splittransactions/{id}/duplicate

Creates a new split group from the source children, regenerating tax bookings and copying parent receipts/files. Requires permission to create each child using its source accounts and cost center; periods must be open and dates valid. Copies the original date, notes, donor assignments, waiver and cash discount. Uses the parent number plus -Kopie and numbered child suffixes, without guaranteeing uniqueness. New children are mutable and non-synced. Unlike ordinary duplicate, child donor/spouse consistency is checked during creation.

§Example
let body: std::collections::BTreeMap<String, serde_json::Value> = Default::default();
let split_transaction = client.finance().split_transactions().duplicate(1, &body)?;
println!("{}", split_transaction.id);
Source

pub fn get(&self, id: impl Display) -> Result<SplitTransaction>

Get a split transaction

GET /finance/splittransactions/{id}

Returns a split parent with its ordinary child bookings, including generated tax rows. The caller must be allowed to view every child; one inaccessible child rejects the entire request. Donor details and notes are censored per child according to donor visibility. include[]=bills adds receipts attached to the parent. The parent note is returned independently of the child notes.

Use Self::get_with to pass query parameters.

§Example
let split_transaction = client.finance().split_transactions().get(1)?;
println!("{}", split_transaction.id);
Source

pub fn get_with( &self, id: impl Display, query: &GetFinanceSplittransactionsIdQuery, ) -> Result<SplitTransaction>

Get a split transaction

Like Self::get, with query parameters.

GET /finance/splittransactions/{id}

Returns a split parent with its ordinary child bookings, including generated tax rows. The caller must be allowed to view every child; one inaccessible child rejects the entire request. Donor details and notes are censored per child according to donor visibility. include[]=bills adds receipts attached to the parent. The parent note is returned independently of the child notes.

Source

pub fn update( &self, id: impl Display, body: &SplitTransactionUpdate, ) -> Result<Option<SplitTransaction>>

Update split transaction, or convert to normal transaction, if only one split child is given,

PUT /finance/splittransactions/{id}

Replaces a split parent and its complete child list. Existing children not included in the request are deleted. Child notes, amounts, accounts and assignments are supplied separately; document date and number come from the parent. New child accounts must allow posting; supplied existing child accounts require period edit permission. Children must meet the shared-account and amount-sum rules. A new child must belong to an open period containing the document date. Generated tax amounts are derived from the gross child inputs. With one child the group is converted to an ordinary booking and HTTP 204 is returned without its ID. For multiple children, returns the split parent with child booking data.

Use Self::update_with to pass query parameters.

§Example
let body = models::SplitTransactionUpdate {
    amount: 30000,
    document_date: "2026-09-14".parse()?,
    note: Some("Offering and building fund".into()),
    split_children: vec![models::SplitTransactionChildCreate {
        account_id: 10,
        amount: 7812,
        contra_account_id: 11,
        note: Some("Building fund".into()),
        ..Default::default()
    }],
    ..Default::default()
};
let result = client.finance().split_transactions().update(1, &body)?;
println!("{:?}", result);
Source

pub fn update_with( &self, id: impl Display, query: &PutFinanceSplittransactionsIdQuery, body: &SplitTransactionUpdate, ) -> Result<Option<SplitTransaction>>

Update split transaction, or convert to normal transaction, if only one split child is given,

Like Self::update, with query parameters.

PUT /finance/splittransactions/{id}

Replaces a split parent and its complete child list. Existing children not included in the request are deleted. Child notes, amounts, accounts and assignments are supplied separately; document date and number come from the parent. New child accounts must allow posting; supplied existing child accounts require period edit permission. Children must meet the shared-account and amount-sum rules. A new child must belong to an open period containing the document date. Generated tax amounts are derived from the gross child inputs. With one child the group is converted to an ordinary booking and HTTP 204 is returned without its ID. For multiple children, returns the split parent with child booking data.

Source

pub fn update_storno( &self, id: impl Display, body: &SplitTransactionStornoCreate, ) -> Result<SplitTransaction>

Cancel split transaction

PUT /finance/splittransactions/{id}/storno

Creates and returns one cancellation split parent containing opposite bookings for the original children, including tax bookings. Original records remain and reference their cancellations. Requires edit permission for each child period. Unlike ordinary cancellation, a second cancellation attempt is rejected with 403 if a child already has a cancellation. This operation does not explicitly require an open period. The original document date and amount are retained; the parent document number receives -Storno. The result is one object, not an array.

§Example
let body = models::SplitTransactionStornoCreate {
    note: "Incorrect allocation".into(),
    ..Default::default()
};
let result = client.finance().split_transactions().update_storno(1, &body)?;
println!("{}", result.id);

Trait Implementations§

Source§

impl<'a> Clone for FinanceSplitTransactionsResource<'a>

Source§

fn clone(&self) -> Self

Returns a duplicate of the value. Read more
1.0.0 (const: unstable) · Source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
Source§

impl<'a> Copy for FinanceSplitTransactionsResource<'a>

Auto Trait Implementations§

Blanket Implementations§

Source§

impl<T> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
Source§

impl<T> CloneToUninit for T
where T: Clone,

Source§

unsafe fn clone_to_uninit(&self, dest: *mut u8)

🔬This is a nightly-only experimental API. (clone_to_uninit)
Performs copy-assignment from self to dest. Read more
Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T> Instrument for T

Source§

fn instrument(self, span: Span) -> Instrumented<Self> ⓘ

Instruments this type with the provided Span, returning an Instrumented wrapper. Read more
Source§

fn in_current_span(self) -> Instrumented<Self> ⓘ

Instruments this type with the current Span, returning an Instrumented wrapper. Read more
Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Source§

impl<T> PolicyExt for T
where T: ?Sized,

Source§

fn and<P, B, E>(self, other: P) -> And<T, P>
where T: Sized + Policy<B, E>, P: Policy<B, E>,

Create a new Policy that returns Action::Follow only if self and other return Action::Follow. Read more
Source§

fn or<P, B, E>(self, other: P) -> Or<T, P>
where T: Sized + Policy<B, E>, P: Policy<B, E>,

Create a new Policy that returns Action::Follow if either self or other returns Action::Follow. Read more
Source§

impl<T> ToOwned for T
where T: Clone,

Source§

type Owned = T

The resulting type after obtaining ownership.
Source§

fn to_owned(&self) -> T

Creates owned data from borrowed data, usually by cloning. Read more
Source§

fn clone_into(&self, target: &mut T)

Uses borrowed data to replace owned data, usually by cloning. Read more
Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = !

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, !>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.
Source§

impl<T> WithSubscriber for T

Source§

fn with_subscriber<S>(self, subscriber: S) -> WithDispatch<Self> ⓘ
where S: Into<Dispatch>,

Attaches the provided Subscriber to this type, returning a WithDispatch wrapper. Read more
Source§

fn with_current_subscriber(self) -> WithDispatch<Self> ⓘ

Attaches the current default Subscriber to this type, returning a WithDispatch wrapper. Read more