Interface StagedOrderAddLineItemAction
- All Superinterfaces:
CustomizableDraft<StagedOrderAddLineItemAction>
,ResourceUpdateAction<StagedOrderUpdateAction>
,StagedOrderUpdateAction
If the Cart contains a LineItem for a Product Variant with the same LineItemMode, Custom Fields, supply and distribution channel, then only the quantity of the existing Line Item is increased. If LineItem shippingDetails
is set, it is merged. All addresses will be present afterwards and, for address keys present in both shipping details, the quantity will be summed up. A new Line Item is added when the externalPrice
or externalTotalPrice
is set in this update action. The LineItem price is set as described in Line Item price selection.
If the Tax Rate is not set, a MissingTaxRateForCountry error is returned.
If the Line Items do not have a Price according to the Product priceMode
value for a selected currency and/or country, Customer Group, or Channel, a MatchingPriceNotFound error is returned.
Example to create an instance using the builder pattern
StagedOrderAddLineItemAction stagedOrderAddLineItemAction = StagedOrderAddLineItemAction.builder()
.build()
-
Field Summary
FieldsModifier and TypeFieldDescriptionstatic final String
discriminator value for StagedOrderAddLineItemAction -
Method Summary
Modifier and TypeMethodDescriptionbuilder()
builder factory method for StagedOrderAddLineItemActionbuilder
(StagedOrderAddLineItemAction template) create builder for StagedOrderAddLineItemAction instancestatic StagedOrderAddLineItemAction
deepCopy
(StagedOrderAddLineItemAction template) factory method to create a deep copy of StagedOrderAddLineItemActionDate and time (UTC) the Product Variant is added to the Cart.@Valid CustomFieldsDraft
Custom Fields for the Line Item.@Valid ChannelResourceIdentifier
Used to select a Product Price.@Valid Money
Sets the LineItemprice
value, and thepriceMode
toExternalPrice
LineItemPriceMode.@Valid ExternalTaxRateDraft
Sets the external Tax Rate for the Line Item, if the Cart has theExternal
TaxMode.@Valid ExternalLineItemTotalPrice
Sets the LineItemprice
andtotalPrice
values, and thepriceMode
toExternalTotal
LineItemPriceMode.Inventory mode specific to the Line Item only, and valid for the entirequantity
of the Line Item.getKey()
User-defined unique identifier of the LineItem.id
of the published Product.Quantity of the Product Variant to add to the Cart.@Valid ItemShippingDetailsDraft
Container for Line Item-specific addresses.getSku()
SKU of the ProductVariant.@Valid ChannelResourceIdentifier
Used to identify Inventory entries that must be reserved.id
of the ProductVariant in the Product.static StagedOrderAddLineItemAction
of()
factory methodstatic StagedOrderAddLineItemAction
of
(StagedOrderAddLineItemAction template) factory method to create a shallow copy StagedOrderAddLineItemActionvoid
setAddedAt
(ZonedDateTime addedAt) Date and time (UTC) the Product Variant is added to the Cart.void
setCustom
(CustomFieldsDraft custom) Custom Fields for the Line Item.void
setDistributionChannel
(ChannelResourceIdentifier distributionChannel) Used to select a Product Price.void
setExternalPrice
(Money externalPrice) Sets the LineItemprice
value, and thepriceMode
toExternalPrice
LineItemPriceMode.void
setExternalTaxRate
(ExternalTaxRateDraft externalTaxRate) Sets the external Tax Rate for the Line Item, if the Cart has theExternal
TaxMode.void
setExternalTotalPrice
(ExternalLineItemTotalPrice externalTotalPrice) Sets the LineItemprice
andtotalPrice
values, and thepriceMode
toExternalTotal
LineItemPriceMode.void
setInventoryMode
(InventoryMode inventoryMode) Inventory mode specific to the Line Item only, and valid for the entirequantity
of the Line Item.void
User-defined unique identifier of the LineItem.void
setProductId
(String productId) id
of the published Product.void
setQuantity
(Long quantity) Quantity of the Product Variant to add to the Cart.void
setShippingDetails
(ItemShippingDetailsDraft shippingDetails) Container for Line Item-specific addresses.void
SKU of the ProductVariant.void
setSupplyChannel
(ChannelResourceIdentifier supplyChannel) Used to identify Inventory entries that must be reserved.void
setVariantId
(Long variantId) id
of the ProductVariant in the Product.static com.fasterxml.jackson.core.type.TypeReference<StagedOrderAddLineItemAction>
gives a TypeReference for usage with Jackson DataBinddefault <T> T
accessor map functionMethods inherited from interface com.commercetools.api.models.CustomizableDraft
unwrapCustomizableDraft
Methods inherited from interface com.commercetools.api.models.ResourceUpdateAction
get
Methods inherited from interface com.commercetools.api.models.order.StagedOrderUpdateAction
getAction, withStagedOrderUpdateAction
-
Field Details
-
ADD_LINE_ITEM
discriminator value for StagedOrderAddLineItemAction- See Also:
-
-
Method Details
-
getKey
String getKey()User-defined unique identifier of the LineItem.
- Returns:
- key
-
getProductId
String getProductId()id
of the published Product.Either the
productId
andvariantId
, orsku
must be provided.- Returns:
- productId
-
getVariantId
Long getVariantId()id
of the ProductVariant in the Product. If not provided, the Master Variant is used.Either the
productId
andvariantId
, orsku
must be provided.- Returns:
- variantId
-
getSku
String getSku()SKU of the ProductVariant.
Either the
productId
andvariantId
, orsku
must be provided.- Returns:
- sku
-
getQuantity
Long getQuantity()Quantity of the Product Variant to add to the Cart.
- Returns:
- quantity
-
getAddedAt
ZonedDateTime getAddedAt()Date and time (UTC) the Product Variant is added to the Cart. If not set, it defaults to the current date and time.
Optional for backwards compatibility reasons.
- Returns:
- addedAt
-
getDistributionChannel
Used to select a Product Price. The Channel must have the
ProductDistribution
ChannelRoleEnum. If the Cart is bound to a Store withdistributionChannels
set, the Channel must match one of the Store's distribution channels.- Returns:
- distributionChannel
-
getSupplyChannel
Used to identify Inventory entries that must be reserved. The Channel must have the
InventorySupply
ChannelRoleEnum.- Returns:
- supplyChannel
-
getExternalPrice
Sets the LineItem
price
value, and thepriceMode
toExternalPrice
LineItemPriceMode.- Returns:
- externalPrice
-
getExternalTotalPrice
Sets the LineItem
price
andtotalPrice
values, and thepriceMode
toExternalTotal
LineItemPriceMode.- Returns:
- externalTotalPrice
-
getExternalTaxRate
Sets the external Tax Rate for the Line Item, if the Cart has the
External
TaxMode. If the Cart hasMultiple
ShippingMode, the Tax Rate is accepted but ignored.- Returns:
- externalTaxRate
-
getInventoryMode
InventoryMode getInventoryMode()Inventory mode specific to the Line Item only, and valid for the entire
quantity
of the Line Item. Set only if the inventory mode should be different from theinventoryMode
specified on the Cart.- Returns:
- inventoryMode
-
getShippingDetails
Container for Line Item-specific addresses.
- Returns:
- shippingDetails
-
getCustom
Custom Fields for the Line Item.
- Specified by:
getCustom
in interfaceCustomizableDraft<StagedOrderAddLineItemAction>
- Returns:
- custom
-
setKey
User-defined unique identifier of the LineItem.
- Parameters:
key
- value to be set
-
setProductId
id
of the published Product.Either the
productId
andvariantId
, orsku
must be provided.- Parameters:
productId
- value to be set
-
setVariantId
id
of the ProductVariant in the Product. If not provided, the Master Variant is used.Either the
productId
andvariantId
, orsku
must be provided.- Parameters:
variantId
- value to be set
-
setSku
SKU of the ProductVariant.
Either the
productId
andvariantId
, orsku
must be provided.- Parameters:
sku
- value to be set
-
setQuantity
Quantity of the Product Variant to add to the Cart.
- Parameters:
quantity
- value to be set
-
setAddedAt
Date and time (UTC) the Product Variant is added to the Cart. If not set, it defaults to the current date and time.
Optional for backwards compatibility reasons.
- Parameters:
addedAt
- value to be set
-
setDistributionChannel
Used to select a Product Price. The Channel must have the
ProductDistribution
ChannelRoleEnum. If the Cart is bound to a Store withdistributionChannels
set, the Channel must match one of the Store's distribution channels.- Parameters:
distributionChannel
- value to be set
-
setSupplyChannel
Used to identify Inventory entries that must be reserved. The Channel must have the
InventorySupply
ChannelRoleEnum.- Parameters:
supplyChannel
- value to be set
-
setExternalPrice
Sets the LineItem
price
value, and thepriceMode
toExternalPrice
LineItemPriceMode.- Parameters:
externalPrice
- value to be set
-
setExternalTotalPrice
Sets the LineItem
price
andtotalPrice
values, and thepriceMode
toExternalTotal
LineItemPriceMode.- Parameters:
externalTotalPrice
- value to be set
-
setExternalTaxRate
Sets the external Tax Rate for the Line Item, if the Cart has the
External
TaxMode. If the Cart hasMultiple
ShippingMode, the Tax Rate is accepted but ignored.- Parameters:
externalTaxRate
- value to be set
-
setInventoryMode
Inventory mode specific to the Line Item only, and valid for the entire
quantity
of the Line Item. Set only if the inventory mode should be different from theinventoryMode
specified on the Cart.- Parameters:
inventoryMode
- value to be set
-
setShippingDetails
Container for Line Item-specific addresses.
- Parameters:
shippingDetails
- value to be set
-
setCustom
Custom Fields for the Line Item.
- Specified by:
setCustom
in interfaceCustomizableDraft<StagedOrderAddLineItemAction>
- Parameters:
custom
- value to be set
-
of
factory method- Returns:
- instance of StagedOrderAddLineItemAction
-
of
factory method to create a shallow copy StagedOrderAddLineItemAction- Parameters:
template
- instance to be copied- Returns:
- copy instance
-
deepCopy
@Nullable static StagedOrderAddLineItemAction deepCopy(@Nullable StagedOrderAddLineItemAction template) factory method to create a deep copy of StagedOrderAddLineItemAction- Parameters:
template
- instance to be copied- Returns:
- copy instance
-
builder
builder factory method for StagedOrderAddLineItemAction- Returns:
- builder
-
builder
create builder for StagedOrderAddLineItemAction instance- Parameters:
template
- instance with prefilled values for the builder- Returns:
- builder
-
withStagedOrderAddLineItemAction
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
-