Click or drag to resize

LoyaltyClientGetOpeningCardBalance Method

Return the CardPoints Balance for the submitted Card Number.

The Card Points Balance returned is as at 00:00:00 (Start of Business) on the submitted Date.

Syntax
C#
public ResultOfCardBalance GetOpeningCardBalance(
	ManagementGroupRequestOfCardBalance request
)

Parameters

request
Type: LoyaltyServiceManagementGroupRequestOfCardBalance

Return Value

Type: ResultOfCardBalance
Examples
C#
using (var svc = new LoyaltyService.LoyaltyClient())
{
  var request = new LoyaltyService.ManagementGroupRequestOfCardBalance();
  request.Token = "Token";//Required - Token returned from AccountService.ManagementGroupLogin
  request.ManagementGroup = "Management group";//Required - ManagementGroup supplied when calling AccountService.ManagementGroupLogin

  var cardBalance = new LoyaltyService.CardBalance();
  cardBalance.Card_Number = "21000005"; //Required
  cardBalance.Date = DateTime.Now;//Required - only points earned prior to this date are returned
  //cardBalance.PointsBalance ignored

  //add cardBalance to request
  request.Value = cardBalance;

  LoyaltyService.ResultOfCardBalance result = svc.GetOpeningCardBalance(request);

  if (result.FaultCode == 0)
  {
    //Request succeeded
  }
  else
  {
    //Request failed
    throw new Exception(result.FaultDescription);
  }
}
See Also