GetAllocationsBetweenWithCreationDate - accountsIQ/API-Wiki GitHub Wiki

The GetAllocationsBetweenWithCreationDate has the same purpose as GetAllocationsBetween but this will filter the dates based on the Creation Date instead of Transaction Date.

The data set can be filtered by account code range and allocation date range. The maximum number of records returned is 10,000.

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 to the caller.
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 to the caller.
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#

Integration ws = new Integration();

String auth = ws.Login(entityID, partnerKey, userKey);
if( auth != null )
{
    // This fetches allocations records where the Creation Date is within the last five days, for any customer whose code starts
    // between A and E.
    var res = ws.GetAllocationsBetweenWithCreationDate(auth, "Sales", DateTime.Now.AddDays(-5), DateTime.Now, "A", "E");
    Assert.NotNull(res.Result);

    foreach(var customerInfo in result.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

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