Interface StagedOrderAddCustomLineItemAction
- All Superinterfaces:
CustomizableDraft<StagedOrderAddCustomLineItemAction>,ResourceUpdateAction<StagedOrderUpdateAction>,StagedOrderUpdateAction
If the Cart already contains a CustomLineItem with the same slug, name, money, taxCategory, state, and Custom Fields, then only the quantity of the existing Custom Line Item is increased. If CustomLineItem shippingDetails are set, they are merged with the targets that already exist on the ItemShippingDetails of the Custom Line Item. In case of overlapping address keys the ItemShippingTarget quantity is summed up.
If the Cart already contains a Custom Line Item with the same slug that is otherwise not identical, an InvalidOperation error is returned.
If the Tax Rate is not set, a MissingTaxRateForCountry error is returned.
Example to create an instance using the builder pattern
StagedOrderAddCustomLineItemAction stagedOrderAddCustomLineItemAction = StagedOrderAddCustomLineItemAction.builder()
.money(moneyBuilder -> moneyBuilder)
.name(nameBuilder -> nameBuilder)
.slug("{slug}")
.build()
-
Field Summary
FieldsModifier and TypeFieldDescriptionstatic final Stringdiscriminator value for StagedOrderAddCustomLineItemAction -
Method Summary
Modifier and TypeMethodDescriptionbuilder()builder factory method for StagedOrderAddCustomLineItemActionbuilder(StagedOrderAddCustomLineItemAction template) create builder for StagedOrderAddCustomLineItemAction instancecopyDeep()deepCopy(StagedOrderAddCustomLineItemAction template) factory method to create a deep copy of StagedOrderAddCustomLineItemAction@Valid CustomFieldsDraftCustom Fields for the Custom Line Item.@Valid ExternalTaxRateDraftAn external Tax Rate can be set if the Cart has theExternalTaxMode.getKey()User-defined unique identifier of the Custom Line Item.@NotNull @Valid MoneygetMoney()Money value of the Custom Line Item.@NotNull @Valid LocalizedStringgetName()Name of the Custom Line Item.IfStandard, Cart Discounts with a matching CartDiscountCustomLineItemsTarget, MultiBuyCustomLineItemsTarget, or CartDiscountPatternTarget are applied to the Custom Line Item. IfExternal, Cart Discounts are not considered on the Custom Line Item.Number of Custom Line Items to add to the Cart.Recurring Order and frequency data.@Valid ItemShippingDetailsDraftContainer for Custom Line Item-specific addresses.@NotNull StringgetSlug()User-defined identifier used in a deep-link URL for the Custom Line Item.Used to select a Tax Rate when a Cart has thePlatformTaxMode.of()factory methodof(StagedOrderAddCustomLineItemAction template) factory method to create a shallow copy StagedOrderAddCustomLineItemActionvoidsetCustom(CustomFieldsDraft custom) Custom Fields for the Custom Line Item.voidsetExternalTaxRate(ExternalTaxRateDraft externalTaxRate) An external Tax Rate can be set if the Cart has theExternalTaxMode.voidUser-defined unique identifier of the Custom Line Item.voidMoney value of the Custom Line Item.voidsetName(LocalizedString name) Name of the Custom Line Item.voidsetPriceMode(CustomLineItemPriceMode priceMode) IfStandard, Cart Discounts with a matching CartDiscountCustomLineItemsTarget, MultiBuyCustomLineItemsTarget, or CartDiscountPatternTarget are applied to the Custom Line Item. IfExternal, Cart Discounts are not considered on the Custom Line Item.voidsetQuantity(Long quantity) Number of Custom Line Items to add to the Cart.voidsetRecurrenceInfo(CustomLineItemRecurrenceInfoDraft recurrenceInfo) Recurring Order and frequency data.voidsetShippingDetails(ItemShippingDetailsDraft shippingDetails) Container for Custom Line Item-specific addresses.voidUser-defined identifier used in a deep-link URL for the Custom Line Item.voidsetTaxCategory(TaxCategoryResourceIdentifier taxCategory) Used to select a Tax Rate when a Cart has thePlatformTaxMode.static com.fasterxml.jackson.core.type.TypeReference<StagedOrderAddCustomLineItemAction>gives a TypeReference for usage with Jackson DataBinddefault <T> Taccessor map functionMethods inherited from interface com.commercetools.api.models.CustomizableDraft
unwrapCustomizableDraftMethods inherited from interface com.commercetools.api.models.ResourceUpdateAction
getMethods inherited from interface com.commercetools.api.models.order.StagedOrderUpdateAction
getAction, withStagedOrderUpdateAction
-
Field Details
-
ADD_CUSTOM_LINE_ITEM
discriminator value for StagedOrderAddCustomLineItemAction- See Also:
-
-
Method Details
-
getMoney
Money value of the Custom Line Item. The value can be negative.
To set the money value in high precision, use HighPrecisionMoneyDraft.
- Returns:
- money
-
getName
Name of the Custom Line Item.
- Returns:
- name
-
getKey
String getKey()User-defined unique identifier of the Custom Line Item.
- Returns:
- key
-
getQuantity
Long getQuantity()Number of Custom Line Items to add to the Cart.
- Returns:
- quantity
-
getSlug
User-defined identifier used in a deep-link URL for the Custom Line Item. It must match the pattern
[a-zA-Z0-9_-]{2,256}.- Returns:
- slug
-
getTaxCategory
Used to select a Tax Rate when a Cart has the
PlatformTaxMode. If TaxMode isPlatform, this field must not be empty.- Returns:
- taxCategory
-
getExternalTaxRate
An external Tax Rate can be set if the Cart has the
ExternalTaxMode.- Returns:
- externalTaxRate
-
getShippingDetails
Container for Custom Line Item-specific addresses.
- Returns:
- shippingDetails
-
getPriceMode
CustomLineItemPriceMode getPriceMode()- If
Standard, Cart Discounts with a matching CartDiscountCustomLineItemsTarget, MultiBuyCustomLineItemsTarget, or CartDiscountPatternTarget are applied to the Custom Line Item. - If
External, Cart Discounts are not considered on the Custom Line Item.
- Returns:
- priceMode
- If
-
getCustom
Custom Fields for the Custom Line Item.
- Specified by:
getCustomin interfaceCustomizableDraft<StagedOrderAddCustomLineItemAction>- Returns:
- custom
-
getRecurrenceInfo
Recurring Order and frequency data.
- Returns:
- recurrenceInfo
-
setMoney
Money value of the Custom Line Item. The value can be negative.
To set the money value in high precision, use HighPrecisionMoneyDraft.
- Parameters:
money- value to be set
-
setName
Name of the Custom Line Item.
- Parameters:
name- value to be set
-
setKey
User-defined unique identifier of the Custom Line Item.
- Parameters:
key- value to be set
-
setQuantity
Number of Custom Line Items to add to the Cart.
- Parameters:
quantity- value to be set
-
setSlug
User-defined identifier used in a deep-link URL for the Custom Line Item. It must match the pattern
[a-zA-Z0-9_-]{2,256}.- Parameters:
slug- value to be set
-
setTaxCategory
Used to select a Tax Rate when a Cart has the
PlatformTaxMode. If TaxMode isPlatform, this field must not be empty.- Parameters:
taxCategory- value to be set
-
setExternalTaxRate
An external Tax Rate can be set if the Cart has the
ExternalTaxMode.- Parameters:
externalTaxRate- value to be set
-
setShippingDetails
Container for Custom Line Item-specific addresses.
- Parameters:
shippingDetails- value to be set
-
setPriceMode
- If
Standard, Cart Discounts with a matching CartDiscountCustomLineItemsTarget, MultiBuyCustomLineItemsTarget, or CartDiscountPatternTarget are applied to the Custom Line Item. - If
External, Cart Discounts are not considered on the Custom Line Item.
- Parameters:
priceMode- value to be set
- If
-
setCustom
Custom Fields for the Custom Line Item.
- Specified by:
setCustomin interfaceCustomizableDraft<StagedOrderAddCustomLineItemAction>- Parameters:
custom- value to be set
-
setRecurrenceInfo
Recurring Order and frequency data.
- Parameters:
recurrenceInfo- value to be set
-
of
factory method- Returns:
- instance of StagedOrderAddCustomLineItemAction
-
of
factory method to create a shallow copy StagedOrderAddCustomLineItemAction- Parameters:
template- instance to be copied- Returns:
- copy instance
-
copyDeep
StagedOrderAddCustomLineItemAction copyDeep()- Specified by:
copyDeepin interfaceStagedOrderUpdateAction
-
deepCopy
@Nullable static StagedOrderAddCustomLineItemAction deepCopy(@Nullable StagedOrderAddCustomLineItemAction template) factory method to create a deep copy of StagedOrderAddCustomLineItemAction- Parameters:
template- instance to be copied- Returns:
- copy instance
-
builder
builder factory method for StagedOrderAddCustomLineItemAction- Returns:
- builder
-
builder
static StagedOrderAddCustomLineItemActionBuilder builder(StagedOrderAddCustomLineItemAction template) create builder for StagedOrderAddCustomLineItemAction instance- Parameters:
template- instance with prefilled values for the builder- Returns:
- builder
-
withStagedOrderAddCustomLineItemAction
default <T> T withStagedOrderAddCustomLineItemAction(Function<StagedOrderAddCustomLineItemAction, 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<StagedOrderAddCustomLineItemAction> typeReference()gives a TypeReference for usage with Jackson DataBind- Returns:
- TypeReference
-