Interface CartSetShippingMethodAction

All Superinterfaces:
CartUpdateAction, ResourceUpdateAction<CartUpdateAction>

public interface CartSetShippingMethodAction extends CartUpdateAction

To set the Cart's Shipping Method the Cart must have the Single ShippingMode and a shippingAddress.

This update is not allowed when the Cart is frozen with the HardFreeze FreezeStrategy.


Example to create an instance using the builder pattern

     CartSetShippingMethodAction cartSetShippingMethodAction = CartSetShippingMethodAction.builder()
             .build()
 
  • Field Details

    • SET_SHIPPING_METHOD

      static final String SET_SHIPPING_METHOD
      discriminator value for CartSetShippingMethodAction
      See Also:
  • Method Details

    • getShippingMethod

      @Valid @Valid ShippingMethodResourceIdentifier getShippingMethod()

      Value to set. If empty, any existing value is removed.

      InvalidOperation error is returned in one of the following cases:

      1. If the referenced Shipping Method has a predicate that does not match the Cart.
      2. If the referenced Shipping Method is not active.
      3. If the referenced Shipping Method is associated with a Store that is different from the Cart's Store.
      4. If the referenced Shipping Method is associated with a Store and the Cart is not associated with any Store.
      Returns:
      shippingMethod
    • getExternalTaxRate

      @Valid @Valid ExternalTaxRateDraft getExternalTaxRate()

      An external Tax Rate can be set if the Cart has the External TaxMode.

      Returns:
      externalTaxRate
    • setShippingMethod

      void setShippingMethod(ShippingMethodResourceIdentifier shippingMethod)

      Value to set. If empty, any existing value is removed.

      InvalidOperation error is returned in one of the following cases:

      1. If the referenced Shipping Method has a predicate that does not match the Cart.
      2. If the referenced Shipping Method is not active.
      3. If the referenced Shipping Method is associated with a Store that is different from the Cart's Store.
      4. If the referenced Shipping Method is associated with a Store and the Cart is not associated with any Store.
      Parameters:
      shippingMethod - value to be set
    • setExternalTaxRate

      void setExternalTaxRate(ExternalTaxRateDraft externalTaxRate)

      An external Tax Rate can be set if the Cart has the External TaxMode.

      Parameters:
      externalTaxRate - value to be set
    • of

      factory method
      Returns:
      instance of CartSetShippingMethodAction
    • of

      factory method to create a shallow copy CartSetShippingMethodAction
      Parameters:
      template - instance to be copied
      Returns:
      copy instance
    • copyDeep

      Specified by:
      copyDeep in interface CartUpdateAction
    • deepCopy

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

      builder factory method for CartSetShippingMethodAction
      Returns:
      builder
    • builder

      create builder for CartSetShippingMethodAction instance
      Parameters:
      template - instance with prefilled values for the builder
      Returns:
      builder
    • withCartSetShippingMethodAction

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

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