GetTransactionsBy - accountsIQ/API-Wiki GitHub Wiki
The GetTransactionsBy
method returns a the list of transactions matching a set of other filters specified on the query sent in the request.
The maximum number of records returned per call is 10,000 transactions
- if your query returns more rows you'll need to use the "Skip" parameter to get the next page of results.
Parameter | Type | Description |
---|---|---|
token | String | The session token retrieved during authentication. |
query | WSGetTransactionsByQuery | This contains the filter and details of your query. |
The query itself follows this structure WSGetTransactionsByQuery
with the following members:
Name | Type | Description | Mandatory |
---|---|---|---|
FromDate | DateTime | Any transaction must have a transaction date after to this date if given (inclusive). | No |
ToDate | DateTime | Any transaction must have a transaction date before to this date if given (inclusive). | No |
FromCreationDate | DateTime | Any transaction must have a creation date after to this date if given (inclusive). | No |
ToCreationDate | DateTime | Any transaction must have a creation date before to this date if given (inclusive). | No |
Skip | Integer | Number of rows to skip. | No |
TypesFilter | String[] | Limits the result set to transactions with a type in the provided list. See TransactionTypes for the list of all transaction types. | No |
AccountIDsFilter | Int32[] | Limits the result set to transactions linked to the account IDs (customer or supplier IDs). | No |
TransactionIDsFilter | Int32[] | Limits the result set to transactions linked to the transacion IDs. | No |
DepartmentIDsFilter | String[] | Limits the result set to transactions having at least one line bearing any of the given department IDs. | No |
FromPeriodDate | DateTime | Any transaction must have a period start date after to this date if given (inclusive). | No |
ToPeriodDate | DateTime | Any transaction must have a period end date before to this date if given (inclusive). | No |
ExcludeReconciliationInformation | Boolean | If true won't return transactions related to reconciliation process. | No |
Here is an example of a system requesting all transactions made between the 1st of September 2020 and the 20th of September 2020 with at least one of transaction bearing any of "GENERAL", "OFFICE" department IDs:
Integration ws = new Integration();
String auth = ws.Login(entityID, partnerKey, userKey);
if( auth != null )
{
var query = new WSGetTransactionsByQuery()
{
FromDate = DateTime.Parse("2020-09-1"),
ToDate = DateTime.Parse("2020-09-20"),
DepartmentIDsFilter = new String[]{ "GENERAL", "OFFICE" }
};
var transactions = ws.GetTransactionsBy(auth, query);
if( transactions.Status == OperationStatus.Success )
{
Console.WriteLine(String.Format("Found {0} transactions", transactions.Result));
foreach(var transaction in transactions.Result)
{
Console.WriteLine(String.Format("Transaction [{0}] for Account {1} on the {2} for amount {3}:", transaction.TransactionID, transaction.AccountCode, transaction.TransactionDate, transaction.ControlAmount));
foreach(var line in transaction.LineDetails)
{
Console.WriteLine(String.Format("\t- {0} on {1} with department {2} {3}", line.Amount, line.GLAccountCode, line.DeparmentID, line.IsControlLine ? "[Control]" : line.IsTaxLine ? "[Tax]" : ""));
}
}
}
}