GetAllocationsBetweenWithCreationDatePaged - accountsIQ/API-Wiki GitHub Wiki

The GetAllocationsBetweenWithCreationDatePaged method serves the same purpose as GetAllocationsBetweenPaged, but filters records based on the Creation Date instead of the Transaction Date.

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 [GetAllocationsBetweenWithCreationDate] endpoint.

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.
fromCreationDate 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.
toCreationDate 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.
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.
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)
{
    // Fetch allocations where the Creation Date is within the last five days,
    // for any customer whose code starts between A and E.
    var res = ws.GetAllocationsBetweenWithCreationDatePaged(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(
                    $"{allocationInfo.AllocationAmount} was allocated from {allocationInfo.AllocatedToTransactionType}-{allocationInfo.AllocatedToExternalReference} to {transactionInfo.TransactionType}-{transactionInfo.ExternalReference}"
                );
            }
        }
    }
}

See Also

  • [WSAllocationSummaryDTO]
  • [GetAllocationsBetweenPaged]
  • [GetAllocationsBetween]
  • [GetAllocationsBetweenWithCreationDate]