Click or drag to resize

PointOfSaleClientCreateMemberForInStoreCard Method

Assign an existing Physical Card to a New 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
  • ProgramMembership.Cards and ProgramMembership.Vouchers should not be populated for this method
Syntax
C#
public ResultOfInstoreCard CreateMemberForInStoreCard(
	RequestOfNewInstoreCardMember request
)

Parameters

request
Type: PointOfSaleServiceRequestOfNewInstoreCardMember

Return Value

Type: ResultOfInstoreCard
Examples
C#
using (var svc = new PointOfSaleService.PointOfSaleClient())
{
  var request = new PointOfSaleService.RequestOfNewInstoreCardMember();
  request.Token = "Token";//Required - Token returned from PointOfSaleService.Authenticate

  var newInstoreCardMember = new PointOfSaleService.NewInstoreCardMember();
  //Note: card status must be set to 'PENDINGACTIVATION'
  newInstoreCardMember.CardNumber = "Card number"; //Required
  newInstoreCardMember.AccessCode = "Access code"; //Required - May be optional depending on  configuration
  newInstoreCardMember.SendEmail = true; //Optional - Sends welcome email to new member if true
  newInstoreCardMember.LanguagePreference_KeyCode = "en-nz"; //Optional - If provided must be a value supported by your implementation
  newInstoreCardMember.ReferralCode = "D44WH4PE4"; //Optional - If provided must be a valid referral code

  var profile = new PointOfSaleService.Profile();
  profile.Member_Password = "Password";//Required - Password must be between 8 and 20 characters long and include at least one letter and one number.
  //Name info
  profile.Title = "Mr"; //Required - Valid values are : 'Dr', 'Sir', 'Lady', 'Mr', 'Miss', 'Ms' or 'Mrs' (case sensitive)";
  profile.GivenName = "John"; // Required        
  profile.MiddleName = "David"; // Optional
  profile.FamilyName = "Doe"; // Required
  if (string.IsNullOrEmpty(profile.MiddleName))
  {
    profile.DisplayValue = string.Concat(profile.Title, " ", profile.GivenName, " ", profile.FamilyName).Trim(); //Optional (it is recommended to give this property a value).
  }
  else
  {
    profile.DisplayValue = string.Concat(profile.Title, " ", profile.GivenName, " ", profile.MiddleName, " ", profile.FamilyName).Trim(); //Optional (it is recommended to give this property a value).
  }
  profile.Gender = "MALE"; //Required - Valid values are : 'MALE', 'FEMALE' or 'DONOTKNOW'
  profile.DateOfBirth = new DateTime(1950, 12, 25); // Optional
  profile.CompanyName = "";//Optional - Required if Member_Type set to 'Organisation'
  profile.TradingAs = "";//Optional - only used if Member_Type set to 'Organisation'
  profile.BankAccountHolderName = "J Doe";//Optional
  profile.BankAccountNumberBank = "12";//Optional
  profile.BankAccountNumberBranch = "1234";//Optional
  profile.BankAccountNumberAccount = "1234567";//Optional
  profile.BankAccountNumberSuffix = "123";//Optional
  profile.DefaultPartnerOrganisation_RSN = Guid.Empty;//Optional

  //Contact Info
  //One or more ContactPoint must be provided (Postal Address, Home Phone or Email)
  var shippingContact = new PointOfSaleService.ProfileContact();

  //Postal Address
  var shippingAddress = new PointOfSaleService.Postal();
  shippingAddress.ContactType = "SHIPPING"; // Should always be 'SHIPPING' for AddressContact for this method
  shippingAddress.Line1 = "Level 1, Simplicity Building"; // Required
  shippingAddress.Line2 = "14-22 Triton Drive"; // Optional     
  shippingAddress.Suburb = "Albany"; // Required
  shippingAddress.TownCityState = "Auckland"; // Required
  shippingAddress.PostCode = "0632"; // Required
  shippingAddress.Country = "New Zealand"; // Required     
  shippingContact.AddressContact = new PointOfSaleService.Address[1] { shippingAddress };

  //Home phone
  var homePhone = new PointOfSaleService.Phone();
  homePhone.ContactType = "HOME"; // Should always be 'HOME' for PhoneContact for this method
  homePhone.IDD = "64"; //Optional - Country code (optional)
  homePhone.STD = "9"; //Optional - Entire phone number (excluding IDD) can be placed in Local parameter depending on setup
  homePhone.Local = "926 5400";//Required
  shippingContact.PhoneContact = new PointOfSaleService.Phone[1] { homePhone };

  //Home email
  var homeEmail = new PointOfSaleService.Email();
  homeEmail.ContactType = "HOME"; // Should always be 'HOME' for EmailContact for this method
  homeEmail.Address = "Email address"; //Required - Must be a valid email address;
  shippingContact.EmailContact = new PointOfSaleService.Email[1] { homeEmail };

  //add shippingContact to profile
  profile.Contact = shippingContact; // Required

  //Opt Ins
  var emailOptIn = new PointOfSaleService.ProfileOptIn();
  emailOptIn.OptInType = "EMAIL"; //Required - Valid values are : 'EMAIL', 'MAIL' or 'SMS'
  emailOptIn.OptIn = true; //Required - True for Opt in, False for Opt out

  var mailOptIn = new PointOfSaleService.ProfileOptIn();
  mailOptIn.OptInType = "MAIL"; //Required - Valid values are : 'EMAIL', 'MAIL' or 'SMS'
  mailOptIn.OptIn = false; //Required - True for Opt in, False for Opt out

  var smsOptIn = new PointOfSaleService.ProfileOptIn();
  smsOptIn.OptInType = "SMS"; //Required - Valid values are : 'EMAIL', 'MAIL' or 'SMS'
  smsOptIn.OptIn = true; //Required - True for Opt in, False for Opt out

  //add optIns to profile
  profile.OptIn = new PointOfSaleService.ProfileOptIn[3] { emailOptIn, mailOptIn, smsOptIn };//Optional

  //set member profile
  newInstoreCardMember.Profile = profile; //Required

  var programMembership = new PointOfSaleService.ProgramMembership();
  //programMembership.CustomerAccountRSN ignored
  programMembership.StartDate = DateTime.Now; //Optional
  programMembership.EndDate = programMembership.StartDate.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.DisplayValue should not be supplied
  //programMembership.RSN should not be supplied
  //programMembership.MemberRSN 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 member program membership
  newInstoreCardMember.ProgramMembership = programMembership;//Required

  var customerAccount = new PointOfSaleService.CustomerAccount(); // Optional
  //customerAccount.Member_RSN ignored
  customerAccount.CustomerAccount_RSN = Guid.NewGuid(); // Required
  customerAccount.CustomerAccount_ID = "cust-number-123"; // Required
  customerAccount.Partner_RSN = new Guid("ad410274-e366-4b7c-92d0-e5779610eda2");; // Required - RSN of partner
  customerAccount.DisplayValue = "Simplicity Demo";//Optional - name of partner company
  customerAccount.Category = "Loyalty";//Optional
  customerAccount.SubCategory = "";//Optional

  //set member customer accounts
  newInstoreCardMember.CustomerAccounts = new PointOfSaleService.CustomerAccount[] { customerAccount };// Optional

  //add newInstoreCardMember to request
  request.Value = newInstoreCardMember; //Required

  PointOfSaleService.ResultOfInstoreCard result = svc.CreateMemberForInStoreCard(request);

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