Interface CartSetCustomShippingMethodAction
- All Superinterfaces:
CartUpdateAction
,ResourceUpdateAction<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 Summary
Modifier and TypeFieldDescriptionstatic final String
discriminator value for CartSetCustomShippingMethodAction -
Method Summary
Modifier and TypeMethodDescriptionbuilder()
builder factory method for CartSetCustomShippingMethodActionbuilder
(CartSetCustomShippingMethodAction template) create builder for CartSetCustomShippingMethodAction instancedeepCopy
(CartSetCustomShippingMethodAction template) factory method to create a deep copy of CartSetCustomShippingMethodAction@Valid ExternalTaxRateDraft
External Tax Rate for theshippingRate
to be set if the Cart has theExternal
TaxMode.@NotNull String
Name of the custom Shipping Method.@NotNull @Valid ShippingRateDraft
Determines the shipping price.Tax Category used to determine the Tax Rate when the Cart has thePlatform
TaxMode.of()
factory methodof
(CartSetCustomShippingMethodAction template) factory method to create a shallow copy CartSetCustomShippingMethodActionvoid
setExternalTaxRate
(ExternalTaxRateDraft externalTaxRate) External Tax Rate for theshippingRate
to be set if the Cart has theExternal
TaxMode.void
setShippingMethodName
(String shippingMethodName) Name of the custom Shipping Method.void
setShippingRate
(ShippingRateDraft shippingRate) Determines the shipping price.void
setTaxCategory
(TaxCategoryResourceIdentifier taxCategory) Tax Category used to determine the Tax Rate when the Cart has thePlatform
TaxMode.static com.fasterxml.jackson.core.type.TypeReference<CartSetCustomShippingMethodAction>
gives a TypeReference for usage with Jackson DataBinddefault <T> T
accessor map functionMethods inherited from interface com.commercetools.api.models.cart.CartUpdateAction
getAction, withCartUpdateAction
Methods inherited from interface com.commercetools.api.models.ResourceUpdateAction
get
-
Field Details
-
SET_CUSTOM_SHIPPING_METHOD
discriminator value for CartSetCustomShippingMethodAction- See Also:
-
-
Method Details
-
getShippingMethodName
Name of the custom Shipping Method.
- Returns:
- shippingMethodName
-
getShippingRate
Determines the shipping price.
- Returns:
- shippingRate
-
getTaxCategory
Tax Category used to determine the Tax Rate when the Cart has the
Platform
TaxMode.- Returns:
- taxCategory
-
getExternalTaxRate
External Tax Rate for the
shippingRate
to be set if the Cart has theExternal
TaxMode.- Returns:
- externalTaxRate
-
setShippingMethodName
Name of the custom Shipping Method.
- Parameters:
shippingMethodName
- value to be set
-
setShippingRate
Determines the shipping price.
- Parameters:
shippingRate
- value to be set
-
setTaxCategory
Tax Category used to determine the Tax Rate when the Cart has the
Platform
TaxMode.- Parameters:
taxCategory
- value to be set
-
setExternalTaxRate
External Tax Rate for the
shippingRate
to be set if the Cart has theExternal
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
@Nullable static CartSetCustomShippingMethodAction deepCopy(@Nullable CartSetCustomShippingMethodAction template) 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
-