LoyaltyPartnerClientInsertLoyaltyPartnerOutlet Method |
Create a new Loyalty Outlet, from the submitted values.
public Result InsertLoyaltyPartnerOutlet( ManagementGroupRequestOfPartnerOutletProfile request )
using (var svc = new LoyaltyService.LoyaltyPartnerClient()) { var request = new LoyaltyService.ManagementGroupRequestOfPartnerOutletProfile(); request.Token = "Token";//Required - Token returned from AccountService.ManagementGroupLogin request.ManagementGroup = "Management group";//Required - ManagementGroup supplied when calling AccountService.ManagementGroupLogin var parterOutletProfile = new LoyaltyService.PartnerOutletProfile(); parterOutletProfile.RSN = Guid.NewGuid();//Optional - will be generated if not supplied parterOutletProfile.Partner_RSN = new Guid("9cb54cbf-8688-4958-bcd4-41b806dfd0a2");;//Required - RSN of partner parterOutletProfile.DisplayValue = "Simplicity Demo Partner - Albany Branch";//Optional parterOutletProfile.ID = "Partner Outlet ID";//Required - must be unique parterOutletProfile.Active = true;//Optional parterOutletProfile.Approved = true;//Optional parterOutletProfile.BankAccountHolderName = "J Doe";//Optional parterOutletProfile.BankAccountNumberBank = "12";//Optional parterOutletProfile.BankAccountNumberBranch = "1234";//Optional parterOutletProfile.BankAccountNumberAccount = "1234567";//Optional parterOutletProfile.BankAccountNumberSuffix = "123";//Optional parterOutletProfile.DealershipSignOff_Email = "demo@simplicitycrm.com";//Optional parterOutletProfile.DealershipSignOff_Line1 = "Always buy at simplicity demo";//Optional parterOutletProfile.DealershipSignOff_Line2 = "";//Optional parterOutletProfile.Email = "demo@simplicitycrm.com";//Optional parterOutletProfile.FeatureImageRSN = new Guid("1E636C7D-EDE2-40E4-99DB-8E9511282061");//Optional parterOutletProfile.FullSizeImageRSN = new Guid("3A55CDE5-EAF0-42F2-93DB-79ECA717DDB3");//Optional parterOutletProfile.ThumbnailImageRSN = new Guid("635328EF-542F-49D0-8F56-82CA6B5A528C");//Optional parterOutletProfile.Name = "Simplicity Demo Partner Ltd";//Optional - company name parterOutletProfile.PointsConversionFactor = 0.0m;//Optional parterOutletProfile.PrimaryContact_Email = "john.doe@simplicitycrm.com";//Required parterOutletProfile.PrimaryContact_Title = "Mr";//Required parterOutletProfile.PrimaryContact_GivenName = "John";//Required parterOutletProfile.PrimaryContact_FamilyName = "Doe";//Required parterOutletProfile.PrimaryContact_Role = "Director";//Optional parterOutletProfile.PromotionalPointsConversionFactor = 0.0m;//Optional parterOutletProfile.TradingAs = "Simplicity Demo";//Optional parterOutletProfile.URL = "www.simplicity-demo-partner.com";//Optional parterOutletProfile.Visible = true;//Optional parterOutletProfile.DefaultPurchaseOrderNumber = "PO_ALBANY_123";//Optional 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 parterOutletProfile.Contact = contact;// Required var region = new LoyaltyService.PartnerOutletRegion(); region.Region_RSN = new Guid("f4c5cd00-435d-48e0-91d0-f034edb5b30d");;//Required - RSN of the region //all other region properties ignored parterOutletProfile.Regions = new LoyaltyService.PartnerOutletRegion[] { region };//Optional var district = new LoyaltyService.PartnerOutletDistrict(); district.District_RSN = new Guid("69e5d2e8-601a-4ad4-a70b-39897311eef7");;//Required - RSN of the district //all other district properties ignored parterOutletProfile.Districts = new LoyaltyService.PartnerOutletDistrict[] { district };//Optional //add parterProfile to request request.Value = parterOutletProfile;//Required LoyaltyService.Result result = svc.InsertLoyaltyPartnerOutlet(request); if (result.FaultCode == 0) { //Request succeeded } else { //Request failed throw new Exception(result.FaultDescription); } }