Click or drag to resize

LoyaltyCampaignOfferClientUpdateCampaignOffer Method

Update a Campaign Offer Detail, from the submitted values.

Syntax
C#
public Result UpdateCampaignOffer(
	ManagementGroupRequestOfCampaignOffer request
)

Parameters

request
Type: LoyaltyServiceManagementGroupRequestOfCampaignOffer

Return Value

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

  var campaignOffer = new LoyaltyService.CampaignOffer();
  campaignOffer.RSN = new Guid("98144ee4-7763-470e-a73f-2c3ffbb4ae39");;//Required - RSN of campaign offer
  campaignOffer.Partner_RSN = new Guid("29b67b03-8031-45e3-999e-b4d91df88fc5");;//Required - RSN of partner
  campaignOffer.OfferName = "10% off all bags";//Required
  campaignOffer.DisplayValue = "10% off all bags";//Required
  campaignOffer.DisplayOrder = 2;//Optional
  campaignOffer.OfferCode = "OFFER_BAGS10";//Optional
  campaignOffer.Active = true;//Optional
  campaignOffer.ActiveFrom = DateTime.Now;//Optional
  campaignOffer.ActiveTo = DateTime.Now.AddMonths(1);//Optional
  campaignOffer.Visible = true;//Optional
  campaignOffer.VisibleFrom = DateTime.Now;//Optional
  campaignOffer.VisibleTo = DateTime.Now.AddMonths(1);//Optional
  campaignOffer.OfferPrice = 12.34m;//Optional
  campaignOffer.StandardPrice = 56.78m;//Optional
  campaignOffer.OfferDetailHeading = "Get 10% off all bags!";//Optional
  campaignOffer.OfferDetailText = "Wide selection of bags at a 10% discount";//Optional
  campaignOffer.URL = "";//Optional
  campaignOffer.AvailableToAllOutlets = false;//Optional
  campaignOffer.BonusPointsType_KeyCode = "2";//Optional - Valid values are : "1", "2", "3", "4" or "extrapoints"
  campaignOffer.BonusPoints_ExtraPointsValue = 5.00m;//Optional - only used if BonusPointsType_KeyCode set to "extrapoints"
  campaignOffer.PointsPrice = 12.34m;//Optional
  campaignOffer.CostPrice = 8.35m;//Optional
  campaignOffer.UseHomeStoreAsFulfilmentPartner = false;//Optional
  campaignOffer.FreightShippingHandlingRequiredOnOrder = false;//Optional
  campaignOffer.BillTo = new Guid("0c5f2ea5-1ebe-4705-980c-af03ad5964d4");;//Optional - RSN of partner
  campaignOffer.FulfilmentPartner_RSN = new Guid("98b306c8-4d4b-4d05-bdbb-6bc22e4bc464");;//Optional - RSN of partner
  campaignOffer.FulfilmentType = "SHOPPINGCARTPRODUCTOPTIONALWITHSIZEORCOLOUR";//Required - Valid values are : "NONPERSONALISEDOFFER" or "SHOPPINGCARTPRODUCTOPTIONALWITHSIZEORCOLOUR"
  campaignOffer.OfferMakeup = "SINGLEPRODUCTCODE";//Optional - Valid values are : "SINGLEPRODUCTCODE" or "MULTIPLESIZECOLOURS". Required when FulfilmentType set to "SHOPPINGCARTPRODUCTOPTIONALWITHSIZEORCOLOUR"
  campaignOffer.ProductCode = "Product_123";//Optional - only used if OfferMakeup set to "SINGLEPRODUCTCODE"
  campaignOffer.AdminFeeRequiredOnOrder = true;//Optional
  campaignOffer.ParentCampaignOffer_RSN = Guid.Empty;//Optional - RSN of parent campaign offer
  campaignOffer.ProductSize = "";//Optional
  campaignOffer.ProductColour = "";//Optional
  campaignOffer.MaximumMemberOrders = 0;//Optional
  campaignOffer.MaximumStockOrders = 0;//Optional
  campaignOffer.BonusPoints_Combined_TransactionQuantity_Every_RuleActive = false;//Optional
  campaignOffer.BonusPoints_Combined_TransactionQuantity_Every = 0;//Optional
  campaignOffer.BonusPoints_Combined_TransactionQuantity_EqualOrOver_RuleActive = false;//Optional
  campaignOffer.BonusPoints_Combined_TransactionQuantity_EqualOrOver = 0;//Optional
  campaignOffer.BonusPoints_Combined_TransactionValue_Every_RuleActive = false;//Optional
  campaignOffer.BonusPoints_Combined_TransactionValue_Every = 0;//Optional
  campaignOffer.BonusPoints_Combined_TransactionValue_EqualOrOver_RuleActive = false;//Optional
  campaignOffer.BonusPoints_Combined_TransactionValue_EqualOrOver = 0;//Optional
  campaignOffer.AvailableSizeList = new string[] { "S", "M", "L" };
  campaignOffer.AvailableColourList = new string[] { "Black", "Red", "White" };
  campaignOffer.ChildCampaignOfferPriceOverride = true;//Optional

  var galleryImage = new LoyaltyService.GalleryImage();
  galleryImage.Entity_RSN = new Guid("22095e62-833b-4b3c-b2dd-e1677466b436");;//Required - RSN of campaign offer
  galleryImage.DisplayValue = "RedBag.jpg";//Required
  galleryImage.DisplayOrder = 1;//Optional
  galleryImage.FeaturedImage = true;//Optional
  galleryImage.SourceImage_RSN = new Guid("29D8E0A0-58FD-42B5-B857-E1FAC0B8B60D");//Required
  galleryImage.ThumbnailImage_RSN = new Guid("CFF53DB5-2BC1-4FF7-9603-BCAD3E716FA5");//Required
  galleryImage.PrimaryImage_RSN = new Guid("43BB4703-5DC4-478F-B14F-D70C4A86DDCC");//Required
  //galleryImage.RSN ignored
  campaignOffer.GalleryImages = new LoyaltyService.GalleryImage[] { galleryImage };//Optional

  campaignOffer.PartnerOutlet_RSNs = new Guid[] { new Guid("821a6d66-a25f-4486-a69d-37b29cd10e07"); };//Optional - RSNs of partner outlets
  campaignOffer.Category_RSNs = new Guid[] { new Guid("5067e06c-54a6-4c79-9df2-849e051e4b8c"); };//Optional - RSNs of campaign offer categories

  var productStub = new LoyaltyService.ProductStub();
  productStub.RSN = new Guid("06b1f0b1-dc02-4172-abf1-e40925a0e902");;//Required - RSN of product
  //productStub.DisplayValue ignored
  //productStub.ProductCode ignored
  //productStub.ProductName ignored
  campaignOffer.Products = new LoyaltyService.ProductStub[] { };//Optional

  var productCategory = new LoyaltyService.ProductCategory();
  productCategory.RSN = new Guid("933971a8-488c-4da2-8144-b385645c455f");;//Required
  // all other productCategory properties ignored
  campaignOffer.ProductCategories = new LoyaltyService.ProductCategory[] { productCategory };//Optional

  var productDepartment = new LoyaltyService.ProductDepartment();
  productDepartment.RSN = new Guid("a6295110-dbff-4f08-adee-aa9f856d15d1");;//Required
  // all other productDepartment properties ignored
  campaignOffer.ProductDepartments = new LoyaltyService.ProductDepartment[] { productDepartment };//Optional

  var productBrand = new LoyaltyService.ProductBrand();
  productBrand.RSN = new Guid("0da91682-88f6-4a2f-88cc-3e7bb284ce24");;//Required
  // all other productBrand properties ignored
  campaignOffer.ProductBrands = new LoyaltyService.ProductBrand[] { productBrand };//Optional

  var program = new LoyaltyService.ProgramStub();
  program.RSN = new Guid("e46860ea-0151-4bae-ab9e-bae47ca00e48");;//Required
  // all other program properties ignored
  campaignOffer.Programs = new LoyaltyService.ProgramStub[] { program };//Optional

  //add campaignOffer to request
  request.Value = campaignOffer;

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

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