Click or drag to resize

LoyaltyClientGetCardBalance Method

Return the Card Points Balance for the submitted Card Number.

Syntax
C#
public ResultOfCardBalance GetCardBalance(
	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 ignored
  //cardBalance.PointsBalance ignored

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

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

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