Interface CartSetCustomShippingMethodAction

All Superinterfaces:
CartUpdateAction, ResourceUpdateAction<CartUpdateAction>

public interface CartSetCustomShippingMethodAction extends CartUpdateAction

To set the Cart's custom Shipping Method (independent of the ShippingMethods managed through the Shipping Methods API) the Cart must have the Single ShippingMode and a shippingAddress.

To unset a custom Shipping Method on a Cart, use the Set ShippingMethod update action without the shippingMethod field instead.


Example to create an instance using the builder pattern

     CartSetCustomShippingMethodAction cartSetCustomShippingMethodAction = CartSetCustomShippingMethodAction.builder()
             .shippingMethodName("{shippingMethodName}")
             .shippingRate(shippingRateBuilder -> shippingRateBuilder)
             .build()
 
  • Field Details

    • SET_CUSTOM_SHIPPING_METHOD

      static final String SET_CUSTOM_SHIPPING_METHOD
      discriminator value for CartSetCustomShippingMethodAction
      See Also:
  • Method Details

    • getShippingMethodName

      @NotNull @NotNull String getShippingMethodName()

      Name of the custom Shipping Method.

      Returns:
      shippingMethodName
    • getShippingRate

      @NotNull @Valid @NotNull @Valid ShippingRateDraft getShippingRate()

      Determines the shipping price.

      Returns:
      shippingRate
    • getTaxCategory

      @Valid @Valid TaxCategoryResourceIdentifier getTaxCategory()

      Tax Category used to determine the Tax Rate when the Cart has the Platform TaxMode.

      Returns:
      taxCategory
    • getExternalTaxRate

      @Valid @Valid ExternalTaxRateDraft getExternalTaxRate()

      External Tax Rate for the shippingRate to be set if the Cart has the External TaxMode.

      Returns:
      externalTaxRate
    • setShippingMethodName

      void setShippingMethodName(String shippingMethodName)

      Name of the custom Shipping Method.

      Parameters:
      shippingMethodName - value to be set
    • setShippingRate

      void setShippingRate(ShippingRateDraft shippingRate)

      Determines the shipping price.

      Parameters:
      shippingRate - value to be set
    • setTaxCategory

      void setTaxCategory(TaxCategoryResourceIdentifier taxCategory)

      Tax Category used to determine the Tax Rate when the Cart has the Platform TaxMode.

      Parameters:
      taxCategory - value to be set
    • setExternalTaxRate

      void setExternalTaxRate(ExternalTaxRateDraft externalTaxRate)

      External Tax Rate for the shippingRate to be set if the Cart has the External TaxMode.

      Parameters:
      externalTaxRate - value to be set
    • of

      factory method
      Returns:
      instance of CartSetCustomShippingMethodAction
    • of

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

      factory method to create a deep copy of CartSetCustomShippingMethodAction
      Parameters:
      template - instance to be copied
      Returns:
      copy instance
    • builder

      builder factory method for CartSetCustomShippingMethodAction
      Returns:
      builder
    • builder

      create builder for CartSetCustomShippingMethodAction instance
      Parameters:
      template - instance with prefilled values for the builder
      Returns:
      builder
    • withCartSetCustomShippingMethodAction

      default <T> T withCartSetCustomShippingMethodAction(Function<CartSetCustomShippingMethodAction,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<CartSetCustomShippingMethodAction> typeReference()
      gives a TypeReference for usage with Jackson DataBind
      Returns:
      TypeReference