TransactionServiceType
public protocol TransactionServiceType : Sendable
Provides access to transaction operations
-
transaction(planId:AsynchronoustransactionId: ) Returns a single transaction.
Declaration
Swift
func transaction( planId: String, transactionId: String ) async throws -> TransactionResponseParameters
planIdThe id of the plan (last_used can also be used to specify the last used plan).
transactionIdId of the transaction.
Return Value
A single transaction and the knowledge of the server
-
transactions(planId:Default implementation, asynchronoussinceDate: type: lastKnowledgeOfServer: ) Returns all transactions for a plan.
Default Implementation
Returns all transactions for a plan, with optional parameters defaulted.
Declaration
Swift
func transactions( planId: String, sinceDate: Date?, type: TransactionType?, lastKnowledgeOfServer: ServerKnowledge? ) async throws -> TransactionsResponseParameters
planIdThe id of the plan (last_used can also be used to specify the last used plan)
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 and the knowledge of the server
-
transactions(planId:Default implementation, asynchronousaccountId: sinceDate: type: lastKnowledgeOfServer: ) Returns all transactions for an account in a plan.
Default Implementation
Returns all transactions for an account in a plan, with optional parameters defaulted.
Declaration
Swift
func transactions( planId: String, accountId: String, sinceDate: Date?, type: TransactionType?, lastKnowledgeOfServer: ServerKnowledge? ) async throws -> TransactionsResponseParameters
planIdThe id of the plan (last_used can also be used to specify the last used plan)
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 and the knowledge of the server
-
transactions(planId:Default implementation, asynchronouscategoryId: sinceDate: type: lastKnowledgeOfServer: ) Returns all transactions for a category in a plan.
Default Implementation
Returns all transactions for a category in a plan, with optional parameters defaulted.
Declaration
Swift
func transactions( planId: String, categoryId: String, sinceDate: Date?, type: TransactionType?, lastKnowledgeOfServer: ServerKnowledge? ) async throws -> HybridTransactionsResponseParameters
planIdThe id of the plan (last_used can also be used to specify the last used plan)
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 hybrid transactions and the optional knowledge of the server
-
transactions(planId:Default implementation, asynchronouspayeeId: sinceDate: type: lastKnowledgeOfServer: ) Returns all transactions for a payee in a plan.
Default Implementation
Returns all transactions for a payee in a plan, with optional parameters defaulted.
Declaration
Swift
func transactions( planId: String, payeeId: String, sinceDate: Date?, type: TransactionType?, lastKnowledgeOfServer: ServerKnowledge? ) async throws -> HybridTransactionsResponseParameters
planIdThe id of the plan (last_used can also be used to specify the last used plan)
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 hybrid transactions and the optional knowledge of the server
-
transactions(planId:Default implementation, asynchronousmonth: sinceDate: type: lastKnowledgeOfServer: ) Returns all transactions for a specific month.
Default Implementation
Returns all transactions for a specific month, with optional parameters defaulted.
Declaration
Swift
func transactions( planId: String, month: Date, sinceDate: Date?, type: TransactionType?, lastKnowledgeOfServer: ServerKnowledge? ) async throws -> TransactionsResponseParameters
planIdThe id of the plan (last_used can also be used to specify the last used plan)
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 list of transactions and the knowledge of the server
-
createTransaction(planId:Asynchronoustransaction: ) Creates a single transaction.
Declaration
Swift
func createTransaction( planId: String, transaction: NewTransaction ) async throws -> SaveTransactionResponseParameters
planIdThe id of the plan (last_used can also be used to specify the last used plan)
transactionThe transaction data to create
Return Value
The created transaction and the knowledge of the server
-
createTransactions(planId:Asynchronoustransactions: ) Creates multiple transactions.
Declaration
Swift
func createTransactions( planId: String, transactions: [NewTransaction] ) async throws -> SaveTransactionsResponseParameters
planIdThe id of the plan (last_used can also be used to specify the last used plan)
transactionsAn array of transaction data to create
Return Value
The created transactions, the knowledge of the server, and duplicate import ids
-
updateTransactions(planId:Asynchronoustransactions: ) Updates multiple transactions.
Declaration
Swift
func updateTransactions( planId: String, transactions: [SaveTransactionWithIdOrImportId] ) async throws -> SaveTransactionsResponseParameters
planIdThe id of the plan (last_used can also be used to specify the last used plan)
transactionsAn array of transaction data to update
Return Value
The updated transactions, the knowledge of the server, and duplicate import ids
-
updateTransaction(planId:AsynchronoustransactionId: transaction: ) Updates a single transaction.
Declaration
Swift
func updateTransaction( planId: String, transactionId: String, transaction: ExistingTransaction ) async throws -> TransactionResponseParameters
planIdThe id of the plan (last_used can also be used to specify the last used plan)
transactionIdThe id of the transaction to update
transactionThe transaction data to update
Return Value
The updated transaction and the knowledge of the server
-
importTransactions(planId:Asynchronous) Imports transactions that have been uploaded via file-based import.
Declaration
Swift
func importTransactions(planId: String) async throws -> [String]Parameters
planIdThe id of the plan (last_used can also be used to specify the last used plan)
Return Value
An array of transaction ids for the imported transactions
-
deleteTransaction(planId:AsynchronoustransactionId: ) Deletes a transaction.
Declaration
Swift
func deleteTransaction( planId: String, transactionId: String ) async throws -> TransactionResponseParameters
planIdThe id of the plan (last_used can also be used to specify the last used plan)
transactionIdThe id of the transaction to delete
Return Value
The deleted transaction and the knowledge of the server
View on GitHub