Interface CartAddDiscountCodeAction
- All Superinterfaces:
CartUpdateAction
,ResourceUpdateAction<CartUpdateAction>
Adds a DiscountCode to the Cart to activate the related Cart Discounts. Adding a Discount Code is only possible if no DirectDiscount has been applied to the Cart. Discount Codes can be added to frozen Carts, but their DiscountCodeState is then DoesNotMatchCart
.
The maximum number of Discount Codes in a Cart is restricted by a limit.
Specific Error Code: MatchingPriceNotFound
Example to create an instance using the builder pattern
CartAddDiscountCodeAction cartAddDiscountCodeAction = CartAddDiscountCodeAction.builder()
.code("{code}")
.build()
-
Field Summary
Modifier and TypeFieldDescriptionstatic final String
discriminator value for CartAddDiscountCodeAction -
Method Summary
Modifier and TypeMethodDescriptionbuilder()
builder factory method for CartAddDiscountCodeActionbuilder
(CartAddDiscountCodeAction template) create builder for CartAddDiscountCodeAction instancestatic CartAddDiscountCodeAction
deepCopy
(CartAddDiscountCodeAction template) factory method to create a deep copy of CartAddDiscountCodeAction@NotNull String
getCode()
code
of a DiscountCode.static CartAddDiscountCodeAction
of()
factory methodstatic CartAddDiscountCodeAction
of
(CartAddDiscountCodeAction template) factory method to create a shallow copy CartAddDiscountCodeActionvoid
code
of a DiscountCode.static com.fasterxml.jackson.core.type.TypeReference<CartAddDiscountCodeAction>
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
-
ADD_DISCOUNT_CODE
discriminator value for CartAddDiscountCodeAction- See Also:
-
-
Method Details
-
getCode
code
of a DiscountCode.- Returns:
- code
-
setCode
code
of a DiscountCode.- Parameters:
code
- value to be set
-
of
factory method- Returns:
- instance of CartAddDiscountCodeAction
-
of
factory method to create a shallow copy CartAddDiscountCodeAction- Parameters:
template
- instance to be copied- Returns:
- copy instance
-
deepCopy
factory method to create a deep copy of CartAddDiscountCodeAction- Parameters:
template
- instance to be copied- Returns:
- copy instance
-
builder
builder factory method for CartAddDiscountCodeAction- Returns:
- builder
-
builder
create builder for CartAddDiscountCodeAction instance- Parameters:
template
- instance with prefilled values for the builder- Returns:
- builder
-
withCartAddDiscountCodeAction
accessor map function- Type Parameters:
T
- mapped type- Parameters:
helper
- function to map the object- Returns:
- mapped value
-
typeReference
gives a TypeReference for usage with Jackson DataBind- Returns:
- TypeReference
-