GetCustomersStatement - accountsIQ/API-Wiki GitHub Wiki
The GetCustomersStatement
function retrieves a statement for a selection of customers up to a selected date.
public WSResult2OfArrayOfCustomerStatement GetCustomersStatement(string token, DateTime upTo, string[] customerCodes, bool showZeros)
Public Function GetCustomersStatement(ByVal token As String, ByVal upTo As DateTime, ByVal customerCodes As String(), ByVal showZeros As Boolean) As WSResult2OfArrayOfCustomerStatement
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. |
The following example demonstrates how to generate a list of statements for all active customers:
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
}
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