Click or drag to resize

LoyaltyPartnerClientUpdateLoyaltyPartner Method

Update a Loyalty Detail, from the submitted values.

Syntax
C#
public Result UpdateLoyaltyPartner(
	ManagementGroupRequestOfPartnerProfile request
)

Parameters

request
Type: LoyaltyServiceManagementGroupRequestOfPartnerProfile

Return Value

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

  var parterProfile = new LoyaltyService.PartnerProfile();
  parterProfile.RSN = new Guid("d788d7f3-64e1-40c6-9f49-a814ea6b1a8a");;//Required - RSN of partner
  parterProfile.DisplayValue = "Simplicity Demo Partner";//Optional
  parterProfile.ID = "SDT_ID_123";//Required - must be unique
  parterProfile.DealerCode = "SDT_CODE_123";//Required - must be unique
  parterProfile.Active = true;//Optional
  parterProfile.AllRegions = false;//Optional
  parterProfile.Approved = true;//Optional
  parterProfile.BankAccountHolderName = "J Doe";//Optional
  parterProfile.BankAccountNumberBank = "12";//Optional
  parterProfile.BankAccountNumberBranch = "1234";//Optional
  parterProfile.BankAccountNumberAccount = "1234567";//Optional
  parterProfile.BankAccountNumberSuffix = "123";//Optional
  parterProfile.DealershipSignOff_Email = "demo@simplicitycrm.com";//Optional
  parterProfile.DealershipSignOff_Line1 = "Always buy at simplicity demo";//Optional
  parterProfile.DealershipSignOff_Line2 = "";//Optional
  parterProfile.Email = "demo@simplicitycrm.com";//Optional
  parterProfile.FeatureImage_RSN = new Guid("1E636C7D-EDE2-40E4-99DB-8E9511282061");//Optional
  parterProfile.FullSizeImage_RSN = new Guid("3A55CDE5-EAF0-42F2-93DB-79ECA717DDB3");//Optional
  parterProfile.ThumbNailImage_RSN = new Guid("635328EF-542F-49D0-8F56-82CA6B5A528C");//Optional
  parterProfile.Name = "Simplicity Demo Partner Ltd";//Optional - company name
  parterProfile.PartnerCategory_RSN = new Guid("fe1deb17-0f44-4b4c-9e8f-99b7e75aa59e");;//Optional
  parterProfile.PointsConversionFactor = 0.0m;//Optional
  parterProfile.PrimaryContact_Email = "john.doe@simplicitycrm.com";//Required
  parterProfile.PrimaryContact_Title = "Mr";//Required
  parterProfile.PrimaryContact_GivenName = "John";//Required
  parterProfile.PrimaryContact_FamilyName = "Doe";//Required
  parterProfile.PrimaryContact_Role = "Director";//Optional
  parterProfile.PromotionalPointsConversionFactor = 0.0m;//Optional
  parterProfile.TradingAs = "Simplicity Demo";//Optional
  parterProfile.URL = "www.simplicity-demo-partner.com";//Optional
  parterProfile.Visible = true;//Optional
  //parterProfile.PartnerCategory_DisplayValue should not be supplied
  //parterProfile.Outlets should not be supplied

  var contact = new LoyaltyService.ProfileContact();

  var workPhone = new LoyaltyService.Phone();
  workPhone.ContactType = "CONTACT";//Required - should always be CONTACT
  workPhone.IDD = "64"; //Optional Country code
  workPhone.STD = "9"; //Optional Entire phone number (excluding IDD) can be placed in Local parameter depending on setup
  workPhone.Local = "926 5400";//Optional
  var fax = new LoyaltyService.Phone();
  fax.ContactType = "FAX";//Required - should always be FAX
  fax.IDD = "64"; //Optional Country code
  fax.STD = "9"; //Optional Entire phone number (excluding IDD) can be placed in Local parameter depending on setup
  fax.Local = "926 5400";//Optional
  contact.PhoneContact = new LoyaltyService.Phone[] { workPhone, fax };//Optional

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

  //add contact to partner profile
  parterProfile.Contact = contact;// Required

  var region = new LoyaltyService.PartnerRegion();
  region.Region_RSN = new Guid("b1c0a36b-77d0-4d0c-966f-12c624985595");;//Required - RSN of the region
  //all other region properties ignored
  parterProfile.Regions = new LoyaltyService.PartnerRegion[] { region };//Optional

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

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

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