GetCustomersStatement - accountsIQ/API-Wiki GitHub Wiki

The GetCustomersStatement function retrieves a statement for a selection of customers up to a selected date.

Declaration

C#

public WSResult2OfArrayOfCustomerStatement GetCustomersStatement(string token, DateTime upTo, string[] customerCodes, bool showZeros)

Visual Basic

Public Function GetCustomersStatement(ByVal token As String, ByVal upTo As DateTime, ByVal customerCodes As String(), ByVal showZeros As Boolean) As WSResult2OfArrayOfCustomerStatement

Parameter List

Parameter Type Description
token String The session token retrieved during authentication.
upTo DateTime The time up to which the customer statement must be run.
customerCodes String[] The list of customers to retrieve the statement for.
showZeros Boolean If set to true, it indicates that all accounts with or without a balance will appear.

Example

The following example demonstrates how to generate a list of statements for all active customers:

C#

Integration ws = new Integration();

String auth = ws.Login(entityID, partnerKey, userKey);
if( auth != null )
{
  WSResult2OfArrayOfCustomer result = ws.GetActiveCustomerList(auth);
  Assert.IsTrue(result.Result != null);

  Customer[] customers = result.Result;
  List<String> customerCodes = (from customer in customers select customer.Code).ToList();

  WSResult2OfArrayOfCustomerStatement r = ws.GetCustomersStatement(auth, DateTime.Now, customerCodes.ToArray(), true);
  Assert.IsTrue(r.Status == OperationStatus.Success);
  Assert.IsTrue(r.Result != null);

  CustomerStatement[] statements = r.Result;
  // Use the statements
}

Visual Basic

Dim ws As New Integration_1_1

Dim auth As String = ws.Login(entityID, partnerKey, userKey)      
If (Not Me.auth Is Nothing) Then
  WSResult2OfArrayOfCustomer result = this.ws.GetActiveCustomerList(this.auth);
  Assert.IsTrue(result.Result != null);

  WSResult2OfArrayOfCustomerStatement r = this.ws.GetCustomersStatement(this.auth, DateTime.Now, result.Result.Select<Customer, string>(delegate (Customer customer) {
      return customer.Code;
  }).ToList<string>().ToArray(), true);
 Assert.IsTrue(r.Status == OperationStatus.Success);
  Assert.IsTrue(r.Result != null);
  CustomerStatement[] statements = r.Result;
  ' Use the statements
End If
⚠️ **GitHub.com Fallback** ⚠️