public void SetShippingDiscountProfilesLibrary() { SetShippingDiscountProfilesCall api = new SetShippingDiscountProfilesCall(apiContext); CalculatedHandlingDiscountType calcHandlingDiscount = new CalculatedHandlingDiscountType(); calcHandlingDiscount.DiscountName = HandlingNameCodeType.IndividualHandlingFee; AmountType amount = new AmountType(); amount.Value = 123.45; calcHandlingDiscount.OrderHandlingAmount = amount; FlatShippingDiscountType flatShippingDiscount = new FlatShippingDiscountType(); flatShippingDiscount.DiscountName = DiscountNameCodeType.IndividualItemWeight; // CalculatedShippingDiscountType calcShippingDiscount = new CalculatedShippingDiscountType(); calcShippingDiscount.DiscountName = DiscountNameCodeType.EachAdditionalAmount; ShippingInsuranceType shipInsurType = new ShippingInsuranceType(); shipInsurType.InsuranceOption = InsuranceOptionCodeType.Optional; ShippingInsuranceType internInsurType = shipInsurType; PromotionalShippingDiscountDetailsType promoShippingDiscountDetails = new PromotionalShippingDiscountDetailsType(); promoShippingDiscountDetails.DiscountName = DiscountNameCodeType.MaximumShippingCostPerOrder; try { api.SetShippingDiscountProfiles(CurrencyCodeType.USD, CombinedPaymentPeriodCodeType.Days_14, ModifyActionCodeType.Add, flatShippingDiscount, calcShippingDiscount, calcHandlingDiscount, promoShippingDiscountDetails, shipInsurType, internInsurType); } catch(ApiException apie) { Console.WriteLine("ApiException: " + apie.Message); } catch(SdkException sdke) { Assert.Fail("SdkException: " + sdke.Message); } }
public void SetShippingDiscountProfilesLibrary() { SetShippingDiscountProfilesCall api = new SetShippingDiscountProfilesCall(apiContext); CalculatedHandlingDiscountType calcHandlingDiscount = new CalculatedHandlingDiscountType(); calcHandlingDiscount.DiscountName = HandlingNameCodeType.IndividualHandlingFee; AmountType amount = new AmountType(); amount.Value = 123.45; calcHandlingDiscount.OrderHandlingAmount = amount; FlatShippingDiscountType flatShippingDiscount = new FlatShippingDiscountType(); flatShippingDiscount.DiscountName = DiscountNameCodeType.IndividualItemWeight; // CalculatedShippingDiscountType calcShippingDiscount = new CalculatedShippingDiscountType(); calcShippingDiscount.DiscountName = DiscountNameCodeType.EachAdditionalAmount; ShippingInsuranceType shipInsurType = new ShippingInsuranceType(); shipInsurType.InsuranceOption = InsuranceOptionCodeType.Optional; ShippingInsuranceType internInsurType = shipInsurType; PromotionalShippingDiscountDetailsType promoShippingDiscountDetails = new PromotionalShippingDiscountDetailsType(); promoShippingDiscountDetails.DiscountName = DiscountNameCodeType.MaximumShippingCostPerOrder; try { api.SetShippingDiscountProfiles(CurrencyCodeType.USD, CombinedPaymentPeriodCodeType.Days_14, ModifyActionCodeType.Add, flatShippingDiscount, calcShippingDiscount, calcHandlingDiscount, promoShippingDiscountDetails, shipInsurType, internInsurType); } catch (ApiException apie) { Console.WriteLine("ApiException: " + apie.Message); } catch (SdkException sdke) { Assert.Fail("SdkException: " + sdke.Message); } }
/// <summary> /// Enables a seller to define shipping cost discount profiles for things such as combined /// payments for shipping and handling costs. /// </summary> /// /// <param name="CurrencyID"> /// The ID of the currency to be used for shipping cost discounts and /// insurance for combined payment. A discount profile can only be /// associated with a listing if the currency ID of the profile matches the /// currency ID of the listing. /// /// Required if the user creates flat rate shipping discount profiles, a promotional /// discount, a packaging/handling cost profile based on a variable /// discount rule, or if the user defines shipping insurance range/fee pairs. /// /// Note: There is a currencyID attribute on many elements of SetShippingDiscountProfiles. /// To avoid an error, be sure to use the same value of CurrencyCodeType in each /// occurrence within the same request. /// </param> /// /// <param name="CombinedDuration"> /// Only those items purchased within CombinedDuration days of each other can /// be combined into an order and benefit from any shipping discounts. /// </param> /// /// <param name="ModifyActionCode"> /// Indicates what action to take on the specified flat shipping discount, /// calculated shipping discount or promotional discount. /// If the action is Delete and if a flat rate or calculated shipping discount /// profile is specified, the discount profile identified by /// DiscountProfile.DiscountProfileID is deleted /// (see DiscountProfile.MappedDiscountProfileID for related details). /// </param> /// /// <param name="FlatShippingDiscount"> /// Details of a shipping cost discount profile for flat rate shipping. /// If this is provided, CalculatedShippingDiscount and PromotionalShippingDiscountDetails /// should be omitted. /// </param> /// /// <param name="CalculatedShippingDiscount"> /// Details of a shipping cost discount profile for calculated shipping. /// If this is provided, FlatShippingDiscount and PromotionalShippingDiscountDetails /// should be omitted. /// </param> /// /// <param name="CalculatedHandlingDiscount"> /// The data for the specific packaging/handling cost details for combined payment. /// </param> /// /// <param name="PromotionalShippingDiscountDetails"> /// The data for the promotional shipping discount. /// If this is provided, FlatShippingDiscount and CalculatedShippingDiscount /// should be omitted. /// </param> /// /// <param name="ShippingInsurance"> /// Information establishing what fee to apply for domestic shipping insurance /// for combined payment depending on which range the order item-total price /// falls into. /// </param> /// /// <param name="InternationalShippingInsurance"> /// Information establishing what fee to apply for international shipping /// insurance for combined payment depending on which range the order item-total /// price falls into. /// </param> /// public void SetShippingDiscountProfiles(CurrencyCodeType CurrencyID, CombinedPaymentPeriodCodeType CombinedDuration, ModifyActionCodeType ModifyActionCode, FlatShippingDiscountType FlatShippingDiscount, CalculatedShippingDiscountType CalculatedShippingDiscount, CalculatedHandlingDiscountType CalculatedHandlingDiscount, PromotionalShippingDiscountDetailsType PromotionalShippingDiscountDetails, ShippingInsuranceType ShippingInsurance, ShippingInsuranceType InternationalShippingInsurance) { this.CurrencyID = CurrencyID; this.CombinedDuration = CombinedDuration; this.ModifyActionCode = ModifyActionCode; this.FlatShippingDiscount = FlatShippingDiscount; this.CalculatedShippingDiscount = CalculatedShippingDiscount; this.CalculatedHandlingDiscount = CalculatedHandlingDiscount; this.PromotionalShippingDiscountDetails = PromotionalShippingDiscountDetails; this.ShippingInsurance = ShippingInsurance; this.InternationalShippingInsurance = InternationalShippingInsurance; Execute(); }
/// <summary> /// Enables a seller to define shipping cost discount profiles for things such as combined /// payments for shipping and handling costs. /// </summary> /// /// <param name="CurrencyID"> /// The three-digit code of the currency to be used for shipping cost discounts and /// insurance for combined payment orders. A discount profile can only be associated /// with a listing if the <b>CurrencyID</b> value of the profile matches the /// <b>Item.Currency</b> value specified in a listing. /// /// Required if the user creates flat rate shipping discount profiles, a promotional /// discount, a packaging/handling cost profile based on a variable /// discount rule, or if the user defines shipping insurance range/fee pairs. /// /// Note: There is a currencyID attribute on many elements of SetShippingDiscountProfiles. /// To avoid an error, be sure to use the same <b>CurrencyID</b> value /// in each occurrence within the same request. /// </param> /// /// <param name="CombinedDuration"> /// This field is used to specify the number of days after the sale of an /// item in which the buyer or seller can combine multiple and mutual order /// line items into one Combined Payment order. In a Combined Payment order, /// the buyer makes one payment for all order line items, hence only unpaid /// order line items can be combined into a Combined Payment order. /// </param> /// /// <param name="ModifyActionCode"> /// Indicates what action to take on the specified flat shipping discount, /// calculated shipping discount or promotional discount. /// If the action is Delete and if a flat rate or calculated shipping discount /// profile is specified, the discount profile identified by /// DiscountProfile.DiscountProfileID is deleted /// (see DiscountProfile.MappedDiscountProfileID for related details). /// </param> /// /// <param name="FlatShippingDiscount"> /// Details of a shipping cost discount profile for flat rate shipping. /// If this is provided, CalculatedShippingDiscount and PromotionalShippingDiscountDetails /// should be omitted. /// </param> /// /// <param name="CalculatedShippingDiscount"> /// Details of a shipping cost discount profile for calculated shipping. /// If this is provided, FlatShippingDiscount and PromotionalShippingDiscountDetails /// should be omitted. /// </param> /// /// <param name="CalculatedHandlingDiscount"> /// This container is used by the seller to specify/modify packaging and handling discounts that are applied /// for combined payment orders. /// </param> /// /// <param name="PromotionalShippingDiscountDetails"> /// The data for the promotional shipping discount. /// If this is provided, FlatShippingDiscount and CalculatedShippingDiscount /// should be omitted. /// </param> /// /// <param name="ShippingInsurance"> /// Information establishing what fee to apply for domestic shipping insurance /// for combined payment depending on which range the order item-total price /// falls into. /// </param> /// /// <param name="InternationalShippingInsurance"> /// Information establishing what fee to apply for international shipping /// insurance for combined payment depending on which range the order item-total /// price falls into. /// </param> /// public void SetShippingDiscountProfiles(CurrencyCodeType CurrencyID, CombinedPaymentPeriodCodeType CombinedDuration, ModifyActionCodeType ModifyActionCode, FlatShippingDiscountType FlatShippingDiscount, CalculatedShippingDiscountType CalculatedShippingDiscount, CalculatedHandlingDiscountType CalculatedHandlingDiscount, PromotionalShippingDiscountDetailsType PromotionalShippingDiscountDetails, ShippingInsuranceType ShippingInsurance, ShippingInsuranceType InternationalShippingInsurance) { this.CurrencyID = CurrencyID; this.CombinedDuration = CombinedDuration; this.ModifyActionCode = ModifyActionCode; this.FlatShippingDiscount = FlatShippingDiscount; this.CalculatedShippingDiscount = CalculatedShippingDiscount; this.CalculatedHandlingDiscount = CalculatedHandlingDiscount; this.PromotionalShippingDiscountDetails = PromotionalShippingDiscountDetails; this.ShippingInsurance = ShippingInsurance; this.InternationalShippingInsurance = InternationalShippingInsurance; Execute(); }