GetAccountsWithTransactionsCreatedBetween - accountsIQ/API-Wiki GitHub Wiki

The GetAccountsWithTransactionsCreatedBetween method returns a summary of customers/suppliers activity based on a date range and a transaction type filter. This allows a third party system to check if a set of customers or suppliers has had any transactions of interests created since the last time it was checked for example. This can be run against all customers/suppliers or a selected sub-range.

Parameter List

Parameter Type Description
token String The session token retrieved during authentication.
ledger String Must be either `Sales` (for customers) or `Purchases` (for suppliers). Anything else will be rejected.
since DateTime Start of the filtering date range (inclusive). Use it to limit the number of records returned. Any allocation that has taken place before this date will not be returned to the caller.
until DateTime End of the filtering date range (exclusive). Use it to limit the number of records returned. Any allocation that has taken place after or on this date will not be returned to the caller.
typesFilter String A comma separated list of transaction types used to filter the transactions that will as activity on the account. One only interested in invoices and payments, but not adjustment journals would pass in "SI,SN". Passing a null/blank de-activates this filter.
fromAccountCode String Start of the filtering account range (inclusive). Use it to limit the number of records returned. Any allocation on a customer or supplier whose account code falls before (in latin binary sorting order) this value will not be returned. Can be null.
toAccountCode String End of the filtering account range (inclusive). Use it to limit the number of records returned. Any allocation on a customer or supplier whose account code falls after (in latin binary sorting order) this value will not be returned. Can be null.

Example

C#

Here is an example of a system requesting for the activity on all customers whose code is between A and E during the last 5 days:

Integration ws = new Integration();

String auth = ws.Login(entityID, partnerKey, userKey);
if( auth != null )
{
      var activitySummary = ws.GetAccountsWithTransactionsCreatedBetween(auth, "Sales", DateTime.Now.AddDays(-5), DateTime.Now, "SI,SN", "A", "E");

      foreach(var customerActivity in activitySummary.Result)
      {
            Console.WriteLine(String.Format("The customer {0} had {1} invoices/credit notes for a total amount of {2}", customerActivity.AccountCode, customerActivity.NumberOfTransactions, customerActivity.TotalGrossAmount));
      }
}

See Also

⚠️ **GitHub.com Fallback** ⚠️