public void SetPromotionalSale() { SetPromotionalSaleCall api = new SetPromotionalSaleCall(this.apiContext); api.Site = SiteCodeType.US; PromotionalSaleType promoSaleType = new PromotionalSaleType(); promoSaleType.DiscountType = DiscountCodeType.Price; promoSaleType.DiscountValue = 123.45; promoSaleType.PromotionalSaleStartTime = DateTime.Now.AddDays(3); promoSaleType.PromotionalSaleEndTime = DateTime.Now.AddDays(10); promoSaleType.PromotionalSaleID = 1234567890; promoSaleType.PromotionalSaleName = "Promo Sale"; try { PromotionalSaleStatusCodeType resp = api.SetPromotionalSale(ModifyActionCodeType.Add, promoSaleType); Assert.IsNotNull(resp); Console.WriteLine("T_360_SetPromotionalSaleLibrary: " + resp.ToString()); } catch(ApiException apie) { Console.WriteLine("ApiException: " + apie.Message); } catch(SdkException sdke) { Assert.Fail("SdkException: " + sdke.Message); } }
public void SetPromotionalSale() { SetPromotionalSaleCall api = new SetPromotionalSaleCall(this.apiContext); api.Site = SiteCodeType.US; PromotionalSaleType promoSaleType = new PromotionalSaleType(); promoSaleType.DiscountType = DiscountCodeType.Price; promoSaleType.DiscountValue = 123.45; promoSaleType.PromotionalSaleStartTime = DateTime.Now.AddDays(3); promoSaleType.PromotionalSaleEndTime = DateTime.Now.AddDays(10); promoSaleType.PromotionalSaleID = 1234567890; promoSaleType.PromotionalSaleName = "Promo Sale"; try { PromotionalSaleStatusCodeType resp = api.SetPromotionalSale(ModifyActionCodeType.Add, promoSaleType); Assert.IsNotNull(resp); Console.WriteLine("T_360_SetPromotionalSaleLibrary: " + resp.ToString()); } catch (ApiException apie) { Console.WriteLine("ApiException: " + apie.Message); } catch (SdkException sdke) { Assert.Fail("SdkException: " + sdke.Message); } }
/// <summary> /// Creates or modifies a promotional sale. Promotional sales enable sellers /// to apply discounts and/or free shipping across many listings. /// </summary> /// /// <param name="Action"> /// The seller must include this field and set it to 'Add' to create a new /// promotional sale, or set it to 'Update' to modify an existing promotional sale, /// or set it to 'Delete' to delete a promotional sale. /// </param> /// /// <param name="PromotionalSaleDetails"> /// This container must be included in each <b>SetPromotionalSale</b> call. /// The fields of this container that will be used will depend on whether the seller is /// adding a new promotional sale, updating an existing promotional sale, or deleting an /// existing promotional sale. /// </param> /// public PromotionalSaleStatusCodeType SetPromotionalSale(ModifyActionCodeType Action, PromotionalSaleType PromotionalSaleDetails) { this.Action = Action; this.PromotionalSaleDetails = PromotionalSaleDetails; Execute(); return ApiResponse.Status; }
/// <summary> /// Creates or modifies a promotional sale. Promotional sales enable sellers /// to apply discounts and/or free shipping across many listings. /// </summary> /// /// <param name="Action"> /// The seller must include this field and set it to 'Add' to create a new /// promotional sale, or set it to 'Update' to modify an existing promotional sale, /// or set it to 'Delete' to delete a promotional sale. /// </param> /// /// <param name="PromotionalSaleDetails"> /// This container must be included in each <b>SetPromotionalSale</b> call. /// The fields of this container that will be used will depend on whether the seller is /// adding a new promotional sale, updating an existing promotional sale, or deleting an /// existing promotional sale. /// </param> /// public PromotionalSaleStatusCodeType SetPromotionalSale(ModifyActionCodeType Action, PromotionalSaleType PromotionalSaleDetails) { this.Action = Action; this.PromotionalSaleDetails = PromotionalSaleDetails; Execute(); return(ApiResponse.Status); }