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.
This update is not allowed when the Cart is frozen with the HardFreeze FreezeStrategy.
Example to create an instance using the builder pattern
CartSetCustomShippingMethodAction cartSetCustomShippingMethodAction = CartSetCustomShippingMethodAction.builder()
.shippingMethodName("{shippingMethodName}")
.shippingRate(shippingRateBuilder -> shippingRateBuilder)
.build()
-
Field Summary
FieldsModifier and TypeFieldDescriptionstatic final Stringdiscriminator value for CartSetCustomShippingMethodAction -
Method Summary
Modifier and TypeMethodDescriptionbuilder()builder factory method for CartSetCustomShippingMethodActionbuilder(CartSetCustomShippingMethodAction template) create builder for CartSetCustomShippingMethodAction instancecopyDeep()deepCopy(CartSetCustomShippingMethodAction template) factory method to create a deep copy of CartSetCustomShippingMethodAction@Valid CustomFieldsDraftCustom Fields for the custom Shipping Method.@Valid ExternalTaxRateDraft@NotNull StringName of the custom Shipping Method.@NotNull @Valid ShippingRateDraftDetermines the shipping price.Tax Category used to determine the Tax Rate when the Cart has thePlatformTaxMode.of()factory methodof(CartSetCustomShippingMethodAction template) factory method to create a shallow copy CartSetCustomShippingMethodActionvoidsetCustom(CustomFieldsDraft custom) Custom Fields for the custom Shipping Method.voidsetExternalTaxRate(ExternalTaxRateDraft externalTaxRate) voidsetShippingMethodName(String shippingMethodName) Name of the custom Shipping Method.voidsetShippingRate(ShippingRateDraft shippingRate) Determines the shipping price.voidsetTaxCategory(TaxCategoryResourceIdentifier taxCategory) Tax Category used to determine the Tax Rate when the Cart has thePlatformTaxMode.static com.fasterxml.jackson.core.type.TypeReference<CartSetCustomShippingMethodAction>gives a TypeReference for usage with Jackson DataBinddefault <T> Taccessor map functionMethods inherited from interface com.commercetools.api.models.cart.CartUpdateAction
getAction, withCartUpdateActionMethods 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
PlatformTaxMode.- Returns:
- taxCategory
-
getExternalTaxRate
External Tax Rate for the
shippingRateto be set if the Cart has theExternalTaxMode.- Returns:
- externalTaxRate
-
getCustom
Custom Fields for the custom Shipping Method.
- Returns:
- custom
-
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
PlatformTaxMode.- Parameters:
taxCategory- value to be set
-
setExternalTaxRate
External Tax Rate for the
shippingRateto be set if the Cart has theExternalTaxMode.- Parameters:
externalTaxRate- value to be set
-
setCustom
Custom Fields for the custom Shipping Method.
- Parameters:
custom- 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
-
copyDeep
CartSetCustomShippingMethodAction copyDeep()- Specified by:
copyDeepin interfaceCartUpdateAction
-
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
-