Click or drag to resize

LoyaltyClientInsertCustomerAccount Method

Create a new Customer Account linking to the submitted Partner and Member.

Syntax
C#
public ResultOfguid InsertCustomerAccount(
	ManagementGroupRequestOfCustomerAccount request
)

Parameters

request
Type: LoyaltyServiceManagementGroupRequestOfCustomerAccount

Return Value

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

  var customerAccount = new LoyaltyService.CustomerAccount();
  //customerAccount.CustomerAccount_RSN ignored
  customerAccount.Member_RSN = new Guid("e2c9fe1f-11ed-43ed-802f-0272a5831b8b");;//Required
  customerAccount.CustomerAccount_ID = "CA_123"; // Required
  customerAccount.Partner_RSN = new Guid("8d9de129-b983-477a-b418-777d23b957ea");; // Required - RSN of partner
  customerAccount.DisplayValue = "Simplicity Demo";//Optional - name of partner company
  customerAccount.Category = "Loyalty";//Optional
  customerAccount.SubCategory = "";//Optional

  var customerAccountCustomFields = new LoyaltyService.ProfileCustomFieldValues();
  customerAccountCustomFields.CustomText_1 = string.Empty; //Optional CustomText_2 - CustomText_15 available
  customerAccountCustomFields.CustomBoolean_1 = false; //Optional CustomBoolean_2 - CustomBoolean_20 available
  customerAccountCustomFields.CustomDate_1 = DateTime.MinValue; //Optional CustomDate_2 - CustomDate_15 available
  customerAccountCustomFields.CustomDecimal_1 = 0.0M; //Optional CustomDecimal_2 - CustomDecimal_5 available
  customerAccountCustomFields.CustomInteger_1 = 0; //Optional CustomInteger_2 - CustomInteger_10 available
  //add custom fields to program membership
  customerAccount.CustomFieldValues = customerAccountCustomFields;//Optional

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

  LoyaltyService.ResultOfguid result = svc.InsertCustomerAccount(request);

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