Click or drag to resize

LoyaltyClientUpdateCustomerAccount Method

Update a Customer Account Detail, from the submitted values.

Syntax
C#
public Result UpdateCustomerAccount(
	ManagementGroupRequestOfCustomerAccount request
)

Parameters

request
Type: LoyaltyServiceManagementGroupRequestOfCustomerAccount

Return Value

Type: Result
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 = new Guid("38c196ec-b482-4860-9a17-406556f92408");;//Required - RSN of customer account
  customerAccount.CustomerAccount_ID = "CA_123";//Required
  customerAccount.DisplayValue = "Simplicity Demo";//Required - 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
  customerAccount.CustomFieldValues = customerAccountCustomFields;//Optional
  //all other customer account properties ignored

  //add card to request
  request.Value = customerAccount;//Required

  LoyaltyService.Result result = svc.UpdateCustomerAccount(request);

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