LoyaltyClientLinkMemberToInStoreCard Method |
Assign an existing Physical Card to an existing Member. The Card Status is set to "ACTIVE.
public ResultOfInstoreCard LinkMemberToInStoreCard( ManagementGroupRequestOfActivateInstoreCardMember request )
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); } }