Click or drag to resize

LoyaltyClientLinkMemberToInStoreCard Method

Assign an existing Physical Card to an existing Member. The Card Status is set to "ACTIVE.

Remarks
  • CardStatus must be "PENDINGACTIVATION"
  • Check the CardStatus using the method: ValidateInStoreCard
  • CardNumber and Access code is validated
  • ProgramMembership.ProgramRSN and ProgramMembership.PointsBalance cannot be modified using this method
  • ProgramMembership.PersonRSN does not need to be populated when using this method
Syntax
C#
public ResultOfInstoreCard LinkMemberToInStoreCard(
	ManagementGroupRequestOfActivateInstoreCardMember request
)

Parameters

request
Type: LoyaltyServiceManagementGroupRequestOfActivateInstoreCardMember

Return Value

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

  var activateInstoreCardMember = new LoyaltyService.ActivateInstoreCardMember();
  //Note: card status must be set to 'PENDINGACTIVATION'
  activateInstoreCardMember.CardNumber = "Card number";//Required
  activateInstoreCardMember.AccessCode = "Access code"; //Required - May be optional depending on configuration
  activateInstoreCardMember.SendEmail = true;//Optional - Sends welcome email to new member if true
  activateInstoreCardMember.CardMergeNotActiveCard_TemplateID = "CARDMERGENOTACTIVECARD_TEMPLATEID"; //Optional - If specified sends an email to the member using the specified template

  var programMembership = new LoyaltyService.ProgramMembership();
  programMembership.MemberRSN = new Guid("b8843759-7683-4225-acc2-5a5891797a0a");;//Required
  programMembership.StartDate = DateTime.Now; //Optional
  programMembership.EndDate = DateTime.Now.AddYears(1); //Optional (leave blank or set to DateTime.Min to have a program membership that does not expire).
  programMembership.BranchName = "Albany Branch"; //Optional
  programMembership.JoiningKeyCode = "";//Optional
  //programMembership.RSN should not be supplied
  //programMembership.ProgramRSN should not be supplied
  //programMembership.PointsBalance should not be supplied
  //programMembership.Cards should not be supplied
  //programMembership.Vouchers should not be supplied
  //programMembership.CustomFieldValues should not be supplied

  //set activateInstoreCardMember program membership
  activateInstoreCardMember.ProgramMembership = programMembership;//Required

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

  LoyaltyService.ResultOfInstoreCard result = svc.LinkMemberToInStoreCard(request);

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