GetAllocationsBetweenPaged - accountsIQ/API-Wiki GitHub Wiki

The GetAllocationsBetweenPaged enables third party systems to poll the company for allocations that have happened based on a set of filtering criteria.

The data set can be filtered by account code range and allocation date range. The data can also be paged by supplying a skip and limit values. If you do not wish to using paging it's recommended that you use the [GetAllocationsBetween] endpoint.

Note:
The date parameter is looking at the Transaction Date entered by the User, which can be in the past or future. If you'd like to filter Allocations by the Creation Date set by the system at the moment of the allocation process, please use [GetAllocationsBetweenWithCreationDate].

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 Transaction 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 Transaction 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.
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.
skip Int The number of records to skip before starting to return results. Must be a positive value. Default is zero.
limit Int The maximum number of allocations to return. Must be a positive value. Default is 10,000. Note that this limit applies to the number of allocations, not the number of summaries that will be returned.

Example

C#

Integration ws = new Integration();

String auth = "";// See Authentication page for more
if (auth != null)
{
    // This fetches allocations records where the Transaction Date is within the last five days, for any customer whose code starts
    // between A and E.
    var res = ws.GetAllocationsBetweenPaged(auth, "Sales", DateTime.Now.AddDays(-5), DateTime.Now, "A", "E", 100, 100);
    Assert.NotNull(res.Result);

    foreach (var customerInfo in res.Result) 
    {
        Console.WriteLine("For customer: " + customerInfo.AccountCode);
        foreach (var transactionInfo in customerInfo.Allocations)
        {
            foreach (var allocationInfo in transactionInfo.AllocationEntries)
            {
                Console.WriteLine(String.Format("{0} was allocated from {1}-{2} to {3}-{4}", 
                    allocationInfo.AllocationAmount, 
                    allocationInfo.AllocatedToTransactionType, 
                    allocationInfo.AllocatedToExternalReference, 
                    transactionInfo.TransactionType, 
                    transactionInfo.ExternalReference));
            }
        }
    }
}

See Also

  • [WSAllocationSummaryDTO]
  • [GetAllocationsBetweenWithCreationDatePaged]
  • [GetAllocationsBetween]
  • [GetAllocationsBetweenWithCreationDate]