TransactionService

public class TransactionService

Provides access to transaction operations

  • Returns a single transaction.

    Declaration

    Swift

    public func getTransaction(
        budgetId: String,
        transactionId: String
    ) async throws -> TransactionDetail

    Parameters

    budgetId

    The id of the budget (last_used can also be used to specify the last used budget).

    transactionId

    Id of the transaction.

    Return Value

    A single transaction

  • Returns all transactions for a budget.

    Declaration

    Swift

    public func getTransactions(
        budgetId: String,
        sinceDate: Date? = nil,
        type: TransactionType? = nil,
        lastKnowledgeOfServer: Int? = nil
    ) async throws -> [TransactionDetail]

    Parameters

    budgetId

    The id of the budget (last_used can also be used to specify the last used budget)

    sinceDate

    If specified, only transactions on or after this date will be included. The date should be ISO formatted (e.g. 2016-12-30).

    type

    If specified, only transactions of the specified type will be included.

    lastKnowledgeOfServer

    The starting server knowledge. If provided, only entities that have changed since lastKnowledgeOfServer will be included.

    Return Value

    A list of transactions

  • Returns all transactions for an account.

    Declaration

    Swift

    public func getTransactions(
        budgetId: String,
        accountId: String,
        sinceDate: Date? = nil,
        type: TransactionType? = nil,
        lastKnowledgeOfServer: Int? = nil
    ) async throws -> [TransactionDetail]

    Parameters

    budgetId

    The id of the budget (last_used can also be used to specify the last used budget)

    accountId

    The id of the account.

    sinceDate

    If specified, only transactions on or after this date will be included. The date should be ISO formatted (e.g. 2016-12-30).

    type

    If specified, only transactions of the specified type will be included.

    lastKnowledgeOfServer

    The starting server knowledge. If provided, only entities that have changed since lastKnowledgeOfServer will be included.

    Return Value

    A list of transactions

  • Returns all transactions for a category.

    Declaration

    Swift

    public func getTransactions(
        budgetId: String,
        categoryId: String,
        sinceDate: Date? = nil,
        type: TransactionType? = nil,
        lastKnowledgeOfServer: Int? = nil
    ) async throws -> [HybridTransaction]

    Parameters

    budgetId

    The id of the budget (last_used can also be used to specify the last used budget)

    categoryId

    The id of the category.

    sinceDate

    If specified, only transactions on or after this date will be included. The date should be ISO formatted (e.g. 2016-12-30).

    type

    If specified, only transactions of the specified type will be included.

    lastKnowledgeOfServer

    The starting server knowledge. If provided, only entities that have changed since lastKnowledgeOfServer will be included.

    Return Value

    A list of transactions

  • Returns all transactions for a payee.

    Declaration

    Swift

    public func getTransactions(
        budgetId: String,
        payeeId: String,
        sinceDate: Date? = nil,
        type: TransactionType? = nil,
        lastKnowledgeOfServer: Int? = nil
    ) async throws -> [HybridTransaction]

    Parameters

    budgetId

    The id of the budget (last_used can also be used to specify the last used budget)

    payeeId

    The id of the payee.

    sinceDate

    If specified, only transactions on or after this date will be included. The date should be ISO formatted (e.g. 2016-12-30).

    type

    If specified, only transactions of the specified type will be included.

    lastKnowledgeOfServer

    The starting server knowledge. If provided, only entities that have changed since lastKnowledgeOfServer will be included.

    Return Value

    A list of transactions

  • Creates a new transactions.

    Declaration

    Swift

    public func saveTransaction(
        budgetId: String,
        transaction: NewTransaction
    ) async throws -> TransactionDetail

    Parameters

    budgetId

    The id of the budget (last_used can also be used to specify the last used budget)

    transaction

    New transaction

    Return Value

    The newly created transaction

  • Creates several new transactions.

    Declaration

    Swift

    public func saveTransactions(
        budgetId: String,
        transactions: [NewTransaction]
    ) async throws
        -> (
            transactions: [TransactionDetail],
            transactionIds: [String],
            duplicateImportIds: [String]
        )

    Parameters

    budgetId

    The id of the budget (last_used can also be used to specify the last used budget)

    transactions

    New transactions

    Return Value

    The newly created transactions

  • Updates a single transaction.

    Declaration

    Swift

    public func updateTransaction(
        budgetId: String,
        transaction: UpdateTransaction
    ) async throws -> TransactionDetail

    Parameters

    budgetId

    The id of the budget (last_used can also be used to specify the last used budget)

    transaction

    Transaction to be updated

    Return Value

    The updated transaction

  • Updates several transactions.

    Declaration

    Swift

    public func updateTransactions(
        budgetId: String,
        transactions: [UpdateTransaction]
    ) async throws
        -> (
            transactions: [TransactionDetail],
            transactionIds: [String],
            duplicateImportIds: [String]
        )

    Parameters

    budgetId

    The id of the budget (last_used can also be used to specify the last used budget)

    transactions

    Updated transactions

    Return Value

    The updated transactions

  • Delete a single transaction.

    Declaration

    Swift

    public func deleteTransaction(
        budgetId: String,
        transactionId: String
    ) async throws -> TransactionDetail

    Parameters

    budgetId

    The id of the budget (last_used can also be used to specify the last used budget)

    transactionId

    Id of the rransaction to be deleted

    Return Value

    The updated transaction