TransactionService
public class TransactionService
Provides access to transaction operations
-
getTransaction(budgetId:AsynchronoustransactionId: ) Returns a single transaction.
Declaration
Swift
public func getTransaction( budgetId: String, transactionId: String ) async throws -> TransactionDetailParameters
budgetIdThe id of the budget (last_used can also be used to specify the last used budget).
transactionIdId 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: ServerKnowledge? = nil ) async throws -> [TransactionDetail]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 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: ServerKnowledge? = nil ) async throws -> [TransactionDetail]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 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: ServerKnowledge? = nil ) async throws -> [HybridTransaction]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 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: ServerKnowledge? = nil ) async throws -> [HybridTransaction]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 list of transactions
-
saveTransaction(budgetId:Asynchronoustransaction: ) Creates a new transactions.
Declaration
Swift
public func saveTransaction( budgetId: String, transaction: NewTransaction ) async throws -> TransactionDetailParameters
budgetIdThe id of the budget (last_used can also be used to specify the last used budget)
transactionNew transaction
Return Value
The newly created transaction
-
saveTransactions(budgetId:Asynchronoustransactions: ) Creates several new transactions.
Declaration
Swift
public func saveTransactions( budgetId: String, transactions: [NewTransaction] ) async throws -> ( transactions: [TransactionDetail], transactionIds: [String], duplicateImportIds: [String] )Parameters
budgetIdThe id of the budget (last_used can also be used to specify the last used budget)
transactionsNew transactions
Return Value
The newly created transactions
-
updateTransaction(budgetId:Asynchronoustransaction: ) Updates a single transaction.
Declaration
Swift
public func updateTransaction( budgetId: String, transaction: UpdateTransaction ) async throws -> TransactionDetailParameters
budgetIdThe id of the budget (last_used can also be used to specify the last used budget)
transactionTransaction to be updated
Return Value
The updated transaction
-
updateTransactions(budgetId:Asynchronoustransactions: ) Updates several transactions.
Declaration
Swift
public func updateTransactions( budgetId: String, transactions: [UpdateTransaction] ) async throws -> ( transactions: [TransactionDetail], transactionIds: [String], duplicateImportIds: [String] )Parameters
budgetIdThe id of the budget (last_used can also be used to specify the last used budget)
transactionsUpdated transactions
Return Value
The updated transactions
-
deleteTransaction(budgetId:AsynchronoustransactionId: ) Delete a single 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)
transactionIdId of the rransaction to be deleted
Return Value
The updated transaction
View on GitHub
TransactionService Class Reference