Interface ShippingDraft

All Superinterfaces:
Draft<ShippingDraft>, WithKey

public interface ShippingDraft extends WithKey, Draft<ShippingDraft>

Wraps all shipping-related information (such as address, rate, deliveries) per Shipping Method for Carts with multiple Shipping Methods.


Example to create an instance using the builder pattern

     ShippingDraft shippingDraft = ShippingDraft.builder()
             .key("{key}")
             .shippingAddress(shippingAddressBuilder -> shippingAddressBuilder)
             .build()
 
  • Method Details

    • getKey

      @NotNull @NotNull String getKey()

      User-defined unique identifier for the Shipping in a Cart with Multiple ShippingMode.

      Specified by:
      getKey in interface WithKey
      Returns:
      key
    • getShippingMethod

      @Valid @Valid ShippingMethodReference getShippingMethod()

      Shipping Methods added to the Cart with Multiple ShippingMode.

      Returns:
      shippingMethod
    • getShippingAddress

      @NotNull @Valid @NotNull @Valid BaseAddress getShippingAddress()

      Determines the shipping rate and Tax Rate of the associated Line Items.

      Returns:
      shippingAddress
    • getShippingRateInput

      @Valid @Valid ShippingRateInputDraft getShippingRateInput()

      Input used to select a ShippingRatePriceTier. The data type of this field depends on the shippingRateInputType.type configured in the Project:

      • If CartClassification, it must be ClassificationShippingRateInputDraft.
      • If CartScore, it must be ScoreShippingRateInputDraft.
      • If CartValue, it cannot be set.
      Returns:
      shippingRateInput
    • getExternalTaxRate

      @Valid @Valid ExternalTaxRateDraft getExternalTaxRate()

      Tax Rate used for taxing a shipping expense if the Cart has the External TaxMode.

      Returns:
      externalTaxRate
    • getDeliveries

      @Valid @Valid List<DeliveryDraft> getDeliveries()

      Deliveries to be shipped with the Shipping Method.

      Returns:
      deliveries
    • getCustom

      @Valid @Valid CustomFieldsDraft getCustom()

      Custom Fields for Shipping.

      Returns:
      custom
    • setKey

      void setKey(String key)

      User-defined unique identifier for the Shipping in a Cart with Multiple ShippingMode.

      Parameters:
      key - value to be set
    • setShippingMethod

      void setShippingMethod(ShippingMethodReference shippingMethod)

      Shipping Methods added to the Cart with Multiple ShippingMode.

      Parameters:
      shippingMethod - value to be set
    • setShippingAddress

      void setShippingAddress(BaseAddress shippingAddress)

      Determines the shipping rate and Tax Rate of the associated Line Items.

      Parameters:
      shippingAddress - value to be set
    • setShippingRateInput

      void setShippingRateInput(ShippingRateInputDraft shippingRateInput)

      Input used to select a ShippingRatePriceTier. The data type of this field depends on the shippingRateInputType.type configured in the Project:

      • If CartClassification, it must be ClassificationShippingRateInputDraft.
      • If CartScore, it must be ScoreShippingRateInputDraft.
      • If CartValue, it cannot be set.
      Parameters:
      shippingRateInput - value to be set
    • setExternalTaxRate

      void setExternalTaxRate(ExternalTaxRateDraft externalTaxRate)

      Tax Rate used for taxing a shipping expense if the Cart has the External TaxMode.

      Parameters:
      externalTaxRate - value to be set
    • setDeliveries

      void setDeliveries(DeliveryDraft... deliveries)

      Deliveries to be shipped with the Shipping Method.

      Parameters:
      deliveries - values to be set
    • setDeliveries

      void setDeliveries(List<DeliveryDraft> deliveries)

      Deliveries to be shipped with the Shipping Method.

      Parameters:
      deliveries - values to be set
    • setCustom

      void setCustom(CustomFieldsDraft custom)

      Custom Fields for Shipping.

      Parameters:
      custom - value to be set
    • of

      static ShippingDraft of()
      factory method
      Returns:
      instance of ShippingDraft
    • of

      static ShippingDraft of(ShippingDraft template)
      factory method to create a shallow copy ShippingDraft
      Parameters:
      template - instance to be copied
      Returns:
      copy instance
    • deepCopy

      @Nullable static ShippingDraft deepCopy(@Nullable ShippingDraft template)
      factory method to create a deep copy of ShippingDraft
      Parameters:
      template - instance to be copied
      Returns:
      copy instance
    • builder

      static ShippingDraftBuilder builder()
      builder factory method for ShippingDraft
      Returns:
      builder
    • builder

      static ShippingDraftBuilder builder(ShippingDraft template)
      create builder for ShippingDraft instance
      Parameters:
      template - instance with prefilled values for the builder
      Returns:
      builder
    • withShippingDraft

      default <T> T withShippingDraft(Function<ShippingDraft,T> helper)
      accessor map function
      Type Parameters:
      T - mapped type
      Parameters:
      helper - function to map the object
      Returns:
      mapped value
    • typeReference

      static com.fasterxml.jackson.core.type.TypeReference<ShippingDraft> typeReference()
      gives a TypeReference for usage with Jackson DataBind
      Returns:
      TypeReference