TransactionService
public struct TransactionService
Provides access to transaction operations
-
transaction(budgetId:AsynchronoustransactionId: ) Returns a single transaction.
Declaration
Swift
public func transaction( budgetId: String, transactionId: String ) async throws -> (TransactionDetail, ServerKnowledge)Parameters
budgetIdThe id of the budget (last_used can also be used to specify the last used budget).
transactionIdId of the transaction.
Return Value
A tuple containing a single transaction and server knowledge
-
Returns all transactions for a budget.
Declaration
Swift
public func transactions( budgetId: String, sinceDate: Date? = nil, type: TransactionType? = nil, lastKnowledgeOfServer: ServerKnowledge? = nil ) async throws -> ([TransactionDetail], ServerKnowledge)Parameters
budgetIdThe id of the budget (last_used can also be used to specify the last used budget)
sinceDateIf specified, only transactions on or after this date will be included. The date should be ISO formatted (e.g. 2016-12-30).
typeIf specified, only transactions of the specified type will be included.
lastKnowledgeOfServerThe starting server knowledge. If provided, only entities that have changed since
lastKnowledgeOfServerwill be included.Return Value
A tuple containing a list of transactions and server knowledge
-
Returns all transactions for an account.
Declaration
Swift
public func transactions( budgetId: String, accountId: String, sinceDate: Date? = nil, type: TransactionType? = nil, lastKnowledgeOfServer: ServerKnowledge? = nil ) async throws -> ([TransactionDetail], ServerKnowledge)Parameters
budgetIdThe id of the budget (last_used can also be used to specify the last used budget)
accountIdThe id of the account.
sinceDateIf specified, only transactions on or after this date will be included. The date should be ISO formatted (e.g. 2016-12-30).
typeIf specified, only transactions of the specified type will be included.
lastKnowledgeOfServerThe starting server knowledge. If provided, only entities that have changed since
lastKnowledgeOfServerwill be included.Return Value
A tuple containing a list of transactions and server knowledge
-
Returns all transactions for a category.
Declaration
Swift
public func transactions( budgetId: String, categoryId: String, sinceDate: Date? = nil, type: TransactionType? = nil, lastKnowledgeOfServer: ServerKnowledge? = nil ) async throws -> ([HybridTransaction], ServerKnowledge)Parameters
budgetIdThe id of the budget (last_used can also be used to specify the last used budget)
categoryIdThe id of the category.
sinceDateIf specified, only transactions on or after this date will be included. The date should be ISO formatted (e.g. 2016-12-30).
typeIf specified, only transactions of the specified type will be included.
lastKnowledgeOfServerThe starting server knowledge. If provided, only entities that have changed since
lastKnowledgeOfServerwill be included.Return Value
A tuple containing a list of hybrid transactions and server knowledge
-
Returns all transactions for a payee.
Declaration
Swift
public func transactions( budgetId: String, payeeId: String, sinceDate: Date? = nil, type: TransactionType? = nil, lastKnowledgeOfServer: ServerKnowledge? = nil ) async throws -> ([HybridTransaction], ServerKnowledge)Parameters
budgetIdThe id of the budget (last_used can also be used to specify the last used budget)
payeeIdThe id of the payee.
sinceDateIf specified, only transactions on or after this date will be included. The date should be ISO formatted (e.g. 2016-12-30).
typeIf specified, only transactions of the specified type will be included.
lastKnowledgeOfServerThe starting server knowledge. If provided, only entities that have changed since
lastKnowledgeOfServerwill be included.Return Value
A tuple containing a list of hybrid transactions and server knowledge
-
Returns all transactions for a specific month.
Declaration
Swift
public func transactions( budgetId: String, month: Date, sinceDate: Date? = nil, type: TransactionType? = nil, lastKnowledgeOfServer: ServerKnowledge? = nil ) async throws -> ([HybridTransaction], ServerKnowledge)Parameters
budgetIdThe id of the budget (last_used can also be used to specify the last used budget)
monthThe month to filter transactions by.
sinceDateIf specified, only transactions on or after this date will be included. The date should be ISO formatted (e.g. 2016-12-30).
typeIf specified, only transactions of the specified type will be included.
lastKnowledgeOfServerThe starting server knowledge. If provided, only entities that have changed since
lastKnowledgeOfServerwill be included.Return Value
A tuple containing a list of hybrid transactions and server knowledge
-
createTransaction(budgetId:Asynchronoustransaction: ) Creates a single transaction.
Declaration
Swift
public func createTransaction( budgetId: String, transaction: SaveTransactionWithIdOrImportId ) async throws -> (TransactionDetail, ServerKnowledge)Parameters
budgetIdThe id of the budget (last_used can also be used to specify the last used budget)
transactionThe transaction data to create
Return Value
A tuple containing the created transaction, server knowledge, and duplicate import IDs
-
createTransactions(budgetId:Asynchronoustransactions: ) Creates multiple transactions.
Declaration
Swift
public func createTransactions( budgetId: String, transactions: [SaveTransactionWithIdOrImportId] ) async throws -> ([TransactionDetail], ServerKnowledge, [String])Parameters
budgetIdThe id of the budget (last_used can also be used to specify the last used budget)
transactionsAn array of transaction data to create
Return Value
A tuple containing the created transactions, server knowledge, and duplicate import IDs
-
updateTransactions(budgetId:Asynchronoustransactions: ) Updates multiple transactions.
Declaration
Swift
public func updateTransactions( budgetId: String, transactions: [SaveTransactionWithIdOrImportId] ) async throws -> ([TransactionDetail], ServerKnowledge, [String])Parameters
budgetIdThe id of the budget (last_used can also be used to specify the last used budget)
transactionsAn array of transaction data to update
Return Value
A tuple containing the updated transactions, server knowledge, and duplicate import IDs
-
updateTransaction(budgetId:Asynchronoustransaction: ) Updates a single transaction.
Declaration
Swift
public func updateTransaction( budgetId: String, transaction: SaveTransactionWithIdOrImportId ) async throws -> TransactionDetailParameters
budgetIdThe id of the budget (last_used can also be used to specify the last used budget)
transactionThe transaction data to update
Return Value
The updated transaction
-
importTransactions(budgetId:Asynchronous) Imports transactions that have been uploaded via file-based import.
Declaration
Swift
public func importTransactions( budgetId: String ) async throws -> [String]Parameters
budgetIdThe id of the budget (last_used can also be used to specify the last used budget)
Return Value
An array of transaction IDs for the imported transactions
-
deleteTransaction(budgetId:AsynchronoustransactionId: ) Deletes a transaction.
Declaration
Swift
public func deleteTransaction( budgetId: String, transactionId: String ) async throws -> TransactionDetailParameters
budgetIdThe id of the budget (last_used can also be used to specify the last used budget)
transactionIdThe id of the transaction to delete
Return Value
The deleted transaction
View on GitHub