Class LineItemBuilder
Example to create an instance using the builder pattern
LineItem lineItem = LineItem.builder()
.id("{id}")
.productId("{productId}")
.name(nameBuilder -> nameBuilder)
.productType(productTypeBuilder -> productTypeBuilder)
.variant(variantBuilder -> variantBuilder)
.price(priceBuilder -> priceBuilder)
.quantity(0.3)
.totalPrice(totalPriceBuilder -> totalPriceBuilder)
.plusDiscountedPricePerQuantity(discountedPricePerQuantityBuilder -> discountedPricePerQuantityBuilder)
.plusTaxedPricePortions(taxedPricePortionsBuilder -> taxedPricePortionsBuilder)
.plusState(stateBuilder -> stateBuilder)
.plusPerMethodTaxRate(perMethodTaxRateBuilder -> perMethodTaxRateBuilder)
.priceMode(LineItemPriceMode.PLATFORM)
.lineItemMode(LineItemMode.STANDARD)
.build()
-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionaddDiscountedPricePerQuantity
(Function<DiscountedLineItemPriceForQuantityBuilder, DiscountedLineItemPriceForQuantity> builder) Discounted price of a single quantity of the Line Item.addedAt
(ZonedDateTime addedAt) Date and time (UTC) the Line Item was added to the Cart.Tax Rate per Shipping Method for a Cart withMultiple
ShippingMode.addState
(Function<ItemStateBuilder, ItemState> builder) State of the Line Item in the Cart or the Order.Total taxed prices based on the quantity of Line Item assigned to each Shipping Method.build()
builds LineItem with checking for non-null required valuesbuilds LineItem without checking for non-null required valuescustom
(CustomFields custom) Custom Fields of the Line Item.custom
(Function<CustomFieldsBuilder, CustomFieldsBuilder> builder) Custom Fields of the Line Item.discountedPricePerQuantity
(DiscountedLineItemPriceForQuantity... discountedPricePerQuantity) Discounted price of a single quantity of the Line Item.discountedPricePerQuantity
(List<DiscountedLineItemPriceForQuantity> discountedPricePerQuantity) Discounted price of a single quantity of the Line Item.distributionChannel
(ChannelReference distributionChannel) Used to select a Product Price.Used to select a Product Price.Date and time (UTC) the Line Item was added to the Cart.Custom Fields of the Line Item.Discounted price of a single quantity of the Line Item.Used to select a Product Price.getId()
Unique identifier of the LineItem.Inventory mode specific to this Line Item only, and valid for the entirequantity
of the Line Item.getKey()
User-defined unique identifier of the LineItem.Date and time (UTC) the Line Item was last updated.Indicates how the Line Item is added to the Cart.getName()
Name of the Product.Tax Rate per Shipping Method for a Cart withMultiple
ShippingMode.getPrice()
Price of a Line Item selected from the Product Variant according to the ProductpriceMode
.Indicates how the Price for the Line Item is set.id
of the Product the Line Item is based on.key
of the Product.slug
of the current version of the Product.Product Type of the Product.Number of Line Items of the given Product Variant present in the Cart or Order.Container for Line Item-specific addresses.getState()
State of the Line Item in the Cart or the Order.Identifies Inventory entries that are reserved.Automatically set aftertaxRate
is set.Total taxed prices based on the quantity of Line Item assigned to each Shipping Method.For a Cart withPlatform
TaxMode, thetaxRate
of Line Items is set automatically once a shipping address is set.Total price of this Line Item equallingprice
multiplied byquantity
.Holds the data of the Product Variant added to the Cart.Unique identifier of the LineItem.inventoryMode
(InventoryMode inventoryMode) Inventory mode specific to this Line Item only, and valid for the entirequantity
of the Line Item.User-defined unique identifier of the LineItem.lastModifiedAt
(ZonedDateTime lastModifiedAt) Date and time (UTC) the Line Item was last updated.lineItemMode
(LineItemMode lineItemMode) Indicates how the Line Item is added to the Cart.name
(LocalizedString name) Name of the Product.Name of the Product.static LineItemBuilder
of()
factory method for an instance of LineItemBuilderstatic LineItemBuilder
create builder for LineItem instanceperMethodTaxRate
(MethodTaxRate... perMethodTaxRate) Tax Rate per Shipping Method for a Cart withMultiple
ShippingMode.perMethodTaxRate
(List<MethodTaxRate> perMethodTaxRate) Tax Rate per Shipping Method for a Cart withMultiple
ShippingMode.plusDiscountedPricePerQuantity
(DiscountedLineItemPriceForQuantity... discountedPricePerQuantity) Discounted price of a single quantity of the Line Item.plusDiscountedPricePerQuantity
(Function<DiscountedLineItemPriceForQuantityBuilder, DiscountedLineItemPriceForQuantityBuilder> builder) Discounted price of a single quantity of the Line Item.plusPerMethodTaxRate
(MethodTaxRate... perMethodTaxRate) Tax Rate per Shipping Method for a Cart withMultiple
ShippingMode.Tax Rate per Shipping Method for a Cart withMultiple
ShippingMode.State of the Line Item in the Cart or the Order.plusState
(Function<ItemStateBuilder, ItemStateBuilder> builder) State of the Line Item in the Cart or the Order.plusTaxedPricePortions
(MethodTaxedPrice... taxedPricePortions) Total taxed prices based on the quantity of Line Item assigned to each Shipping Method.Total taxed prices based on the quantity of Line Item assigned to each Shipping Method.Price of a Line Item selected from the Product Variant according to the ProductpriceMode
.price
(Function<PriceBuilder, PriceBuilder> builder) Price of a Line Item selected from the Product Variant according to the ProductpriceMode
.priceMode
(LineItemPriceMode priceMode) Indicates how the Price for the Line Item is set.id
of the Product the Line Item is based on.productKey
(String productKey) key
of the Product.productSlug
(LocalizedString productSlug) slug
of the current version of the Product.slug
of the current version of the Product.productType
(ProductTypeReference productType) Product Type of the Product.Product Type of the Product.Number of Line Items of the given Product Variant present in the Cart or Order.setDiscountedPricePerQuantity
(Function<DiscountedLineItemPriceForQuantityBuilder, DiscountedLineItemPriceForQuantity> builder) Discounted price of a single quantity of the Line Item.Tax Rate per Shipping Method for a Cart withMultiple
ShippingMode.setState
(Function<ItemStateBuilder, ItemState> builder) State of the Line Item in the Cart or the Order.Total taxed prices based on the quantity of Line Item assigned to each Shipping Method.shippingDetails
(ItemShippingDetails shippingDetails) Container for Line Item-specific addresses.Container for Line Item-specific addresses.State of the Line Item in the Cart or the Order.State of the Line Item in the Cart or the Order.supplyChannel
(ChannelReference supplyChannel) Identifies Inventory entries that are reserved.Identifies Inventory entries that are reserved.taxedPrice
(TaxedItemPrice taxedPrice) Automatically set aftertaxRate
is set.Automatically set aftertaxRate
is set.taxedPricePortions
(MethodTaxedPrice... taxedPricePortions) Total taxed prices based on the quantity of Line Item assigned to each Shipping Method.taxedPricePortions
(List<MethodTaxedPrice> taxedPricePortions) Total taxed prices based on the quantity of Line Item assigned to each Shipping Method.For a Cart withPlatform
TaxMode, thetaxRate
of Line Items is set automatically once a shipping address is set.taxRate
(Function<TaxRateBuilder, TaxRateBuilder> builder) For a Cart withPlatform
TaxMode, thetaxRate
of Line Items is set automatically once a shipping address is set.totalPrice
(CentPrecisionMoney totalPrice) Total price of this Line Item equallingprice
multiplied byquantity
.Total price of this Line Item equallingprice
multiplied byquantity
.variant
(ProductVariant variant) Holds the data of the Product Variant added to the Cart.Holds the data of the Product Variant added to the Cart.withCustom
(Function<CustomFieldsBuilder, CustomFields> builder) Custom Fields of the Line Item.withDiscountedPricePerQuantity
(Function<DiscountedLineItemPriceForQuantityBuilder, DiscountedLineItemPriceForQuantityBuilder> builder) Discounted price of a single quantity of the Line Item.Used to select a Product Price.Name of the Product.Tax Rate per Shipping Method for a Cart withMultiple
ShippingMode.withPrice
(Function<PriceBuilder, Price> builder) Price of a Line Item selected from the Product Variant according to the ProductpriceMode
.slug
of the current version of the Product.Product Type of the Product.Container for Line Item-specific addresses.withState
(Function<ItemStateBuilder, ItemStateBuilder> builder) State of the Line Item in the Cart or the Order.Identifies Inventory entries that are reserved.Automatically set aftertaxRate
is set.Total taxed prices based on the quantity of Line Item assigned to each Shipping Method.withTaxRate
(Function<TaxRateBuilder, TaxRate> builder) For a Cart withPlatform
TaxMode, thetaxRate
of Line Items is set automatically once a shipping address is set.Total price of this Line Item equallingprice
multiplied byquantity
.Holds the data of the Product Variant added to the Cart.
-
Constructor Details
-
LineItemBuilder
public LineItemBuilder()
-
-
Method Details
-
id
Unique identifier of the LineItem.
- Parameters:
id
- value to be set- Returns:
- Builder
-
key
User-defined unique identifier of the LineItem.
- Parameters:
key
- value to be set- Returns:
- Builder
-
productId
id
of the Product the Line Item is based on.- Parameters:
productId
- value to be set- Returns:
- Builder
-
productKey
key
of the Product.This field is only present on:
- Line Items in a Cart when the
key
is available on that specific Product at the time the LineItem was created or updated on the Cart. - Line Items in an Order when the
key
is available on the specific Product at the time the Order was created from the Cart.
Present on resources created or updated after 3 December 2021.
- Parameters:
productKey
- value to be set- Returns:
- Builder
- Line Items in a Cart when the
-
name
Name of the Product.
- Parameters:
builder
- function to build the name value- Returns:
- Builder
-
withName
Name of the Product.
- Parameters:
builder
- function to build the name value- Returns:
- Builder
-
name
Name of the Product.
- Parameters:
name
- value to be set- Returns:
- Builder
-
productSlug
slug
of the current version of the Product. Updated automatically if theslug
changes. Empty if the Product has been deleted. TheproductSlug
field of LineItem is not expanded when using Reference Expansion.- Parameters:
builder
- function to build the productSlug value- Returns:
- Builder
-
withProductSlug
slug
of the current version of the Product. Updated automatically if theslug
changes. Empty if the Product has been deleted. TheproductSlug
field of LineItem is not expanded when using Reference Expansion.- Parameters:
builder
- function to build the productSlug value- Returns:
- Builder
-
productSlug
slug
of the current version of the Product. Updated automatically if theslug
changes. Empty if the Product has been deleted. TheproductSlug
field of LineItem is not expanded when using Reference Expansion.- Parameters:
productSlug
- value to be set- Returns:
- Builder
-
productType
public LineItemBuilder productType(Function<ProductTypeReferenceBuilder, ProductTypeReferenceBuilder> builder) Product Type of the Product.
- Parameters:
builder
- function to build the productType value- Returns:
- Builder
-
withProductType
public LineItemBuilder withProductType(Function<ProductTypeReferenceBuilder, ProductTypeReference> builder) Product Type of the Product.
- Parameters:
builder
- function to build the productType value- Returns:
- Builder
-
productType
Product Type of the Product.
- Parameters:
productType
- value to be set- Returns:
- Builder
-
variant
Holds the data of the Product Variant added to the Cart.
The data is saved at the time the Product Variant is added to the Cart and is not updated automatically when Product Variant data changes. Must be updated using the Recalculate update action.
- Parameters:
builder
- function to build the variant value- Returns:
- Builder
-
withVariant
Holds the data of the Product Variant added to the Cart.
The data is saved at the time the Product Variant is added to the Cart and is not updated automatically when Product Variant data changes. Must be updated using the Recalculate update action.
- Parameters:
builder
- function to build the variant value- Returns:
- Builder
-
variant
Holds the data of the Product Variant added to the Cart.
The data is saved at the time the Product Variant is added to the Cart and is not updated automatically when Product Variant data changes. Must be updated using the Recalculate update action.
- Parameters:
variant
- value to be set- Returns:
- Builder
-
price
Price of a Line Item selected from the Product Variant according to the Product
priceMode
. If thepriceMode
isEmbedded
ProductPriceMode and thevariant
field hasn't been updated, the price may not correspond to a price invariant.prices
.- Parameters:
builder
- function to build the price value- Returns:
- Builder
-
withPrice
Price of a Line Item selected from the Product Variant according to the Product
priceMode
. If thepriceMode
isEmbedded
ProductPriceMode and thevariant
field hasn't been updated, the price may not correspond to a price invariant.prices
.- Parameters:
builder
- function to build the price value- Returns:
- Builder
-
price
Price of a Line Item selected from the Product Variant according to the Product
priceMode
. If thepriceMode
isEmbedded
ProductPriceMode and thevariant
field hasn't been updated, the price may not correspond to a price invariant.prices
.- Parameters:
price
- value to be set- Returns:
- Builder
-
quantity
Number of Line Items of the given Product Variant present in the Cart or Order.
- Parameters:
quantity
- value to be set- Returns:
- Builder
-
totalPrice
public LineItemBuilder totalPrice(Function<CentPrecisionMoneyBuilder, CentPrecisionMoneyBuilder> builder) Total price of this Line Item equalling
price
multiplied byquantity
. If the Line Item is discounted, the total price is thediscountedPricePerQuantity
multiplied byquantity
. Includes taxes if the TaxRateincludedInPrice
istrue
.- Parameters:
builder
- function to build the totalPrice value- Returns:
- Builder
-
withTotalPrice
public LineItemBuilder withTotalPrice(Function<CentPrecisionMoneyBuilder, CentPrecisionMoney> builder) Total price of this Line Item equalling
price
multiplied byquantity
. If the Line Item is discounted, the total price is thediscountedPricePerQuantity
multiplied byquantity
. Includes taxes if the TaxRateincludedInPrice
istrue
.- Parameters:
builder
- function to build the totalPrice value- Returns:
- Builder
-
totalPrice
Total price of this Line Item equalling
price
multiplied byquantity
. If the Line Item is discounted, the total price is thediscountedPricePerQuantity
multiplied byquantity
. Includes taxes if the TaxRateincludedInPrice
istrue
.- Parameters:
totalPrice
- value to be set- Returns:
- Builder
-
discountedPricePerQuantity
public LineItemBuilder discountedPricePerQuantity(DiscountedLineItemPriceForQuantity... discountedPricePerQuantity) Discounted price of a single quantity of the Line Item.
- Parameters:
discountedPricePerQuantity
- value to be set- Returns:
- Builder
-
discountedPricePerQuantity
public LineItemBuilder discountedPricePerQuantity(List<DiscountedLineItemPriceForQuantity> discountedPricePerQuantity) Discounted price of a single quantity of the Line Item.
- Parameters:
discountedPricePerQuantity
- value to be set- Returns:
- Builder
-
plusDiscountedPricePerQuantity
public LineItemBuilder plusDiscountedPricePerQuantity(DiscountedLineItemPriceForQuantity... discountedPricePerQuantity) Discounted price of a single quantity of the Line Item.
- Parameters:
discountedPricePerQuantity
- value to be set- Returns:
- Builder
-
plusDiscountedPricePerQuantity
public LineItemBuilder plusDiscountedPricePerQuantity(Function<DiscountedLineItemPriceForQuantityBuilder, DiscountedLineItemPriceForQuantityBuilder> builder) Discounted price of a single quantity of the Line Item.
- Parameters:
builder
- function to build the discountedPricePerQuantity value- Returns:
- Builder
-
withDiscountedPricePerQuantity
public LineItemBuilder withDiscountedPricePerQuantity(Function<DiscountedLineItemPriceForQuantityBuilder, DiscountedLineItemPriceForQuantityBuilder> builder) Discounted price of a single quantity of the Line Item.
- Parameters:
builder
- function to build the discountedPricePerQuantity value- Returns:
- Builder
-
addDiscountedPricePerQuantity
public LineItemBuilder addDiscountedPricePerQuantity(Function<DiscountedLineItemPriceForQuantityBuilder, DiscountedLineItemPriceForQuantity> builder) Discounted price of a single quantity of the Line Item.
- Parameters:
builder
- function to build the discountedPricePerQuantity value- Returns:
- Builder
-
setDiscountedPricePerQuantity
public LineItemBuilder setDiscountedPricePerQuantity(Function<DiscountedLineItemPriceForQuantityBuilder, DiscountedLineItemPriceForQuantity> builder) Discounted price of a single quantity of the Line Item.
- Parameters:
builder
- function to build the discountedPricePerQuantity value- Returns:
- Builder
-
taxedPrice
Automatically set after
taxRate
is set.- Parameters:
builder
- function to build the taxedPrice value- Returns:
- Builder
-
withTaxedPrice
Automatically set after
taxRate
is set.- Parameters:
builder
- function to build the taxedPrice value- Returns:
- Builder
-
taxedPrice
Automatically set after
taxRate
is set.- Parameters:
taxedPrice
- value to be set- Returns:
- Builder
-
taxedPricePortions
Total taxed prices based on the quantity of Line Item assigned to each Shipping Method. Only applicable for Carts with
Multiple
ShippingMode. Automatically set afterperMethodTaxRate
is set.- Parameters:
taxedPricePortions
- value to be set- Returns:
- Builder
-
taxedPricePortions
Total taxed prices based on the quantity of Line Item assigned to each Shipping Method. Only applicable for Carts with
Multiple
ShippingMode. Automatically set afterperMethodTaxRate
is set.- Parameters:
taxedPricePortions
- value to be set- Returns:
- Builder
-
plusTaxedPricePortions
Total taxed prices based on the quantity of Line Item assigned to each Shipping Method. Only applicable for Carts with
Multiple
ShippingMode. Automatically set afterperMethodTaxRate
is set.- Parameters:
taxedPricePortions
- value to be set- Returns:
- Builder
-
plusTaxedPricePortions
public LineItemBuilder plusTaxedPricePortions(Function<MethodTaxedPriceBuilder, MethodTaxedPriceBuilder> builder) Total taxed prices based on the quantity of Line Item assigned to each Shipping Method. Only applicable for Carts with
Multiple
ShippingMode. Automatically set afterperMethodTaxRate
is set.- Parameters:
builder
- function to build the taxedPricePortions value- Returns:
- Builder
-
withTaxedPricePortions
public LineItemBuilder withTaxedPricePortions(Function<MethodTaxedPriceBuilder, MethodTaxedPriceBuilder> builder) Total taxed prices based on the quantity of Line Item assigned to each Shipping Method. Only applicable for Carts with
Multiple
ShippingMode. Automatically set afterperMethodTaxRate
is set.- Parameters:
builder
- function to build the taxedPricePortions value- Returns:
- Builder
-
addTaxedPricePortions
public LineItemBuilder addTaxedPricePortions(Function<MethodTaxedPriceBuilder, MethodTaxedPrice> builder) Total taxed prices based on the quantity of Line Item assigned to each Shipping Method. Only applicable for Carts with
Multiple
ShippingMode. Automatically set afterperMethodTaxRate
is set.- Parameters:
builder
- function to build the taxedPricePortions value- Returns:
- Builder
-
setTaxedPricePortions
public LineItemBuilder setTaxedPricePortions(Function<MethodTaxedPriceBuilder, MethodTaxedPrice> builder) Total taxed prices based on the quantity of Line Item assigned to each Shipping Method. Only applicable for Carts with
Multiple
ShippingMode. Automatically set afterperMethodTaxRate
is set.- Parameters:
builder
- function to build the taxedPricePortions value- Returns:
- Builder
-
state
State of the Line Item in the Cart or the Order.
- Parameters:
state
- value to be set- Returns:
- Builder
-
state
State of the Line Item in the Cart or the Order.
- Parameters:
state
- value to be set- Returns:
- Builder
-
plusState
State of the Line Item in the Cart or the Order.
- Parameters:
state
- value to be set- Returns:
- Builder
-
plusState
State of the Line Item in the Cart or the Order.
- Parameters:
builder
- function to build the state value- Returns:
- Builder
-
withState
State of the Line Item in the Cart or the Order.
- Parameters:
builder
- function to build the state value- Returns:
- Builder
-
addState
State of the Line Item in the Cart or the Order.
- Parameters:
builder
- function to build the state value- Returns:
- Builder
-
setState
State of the Line Item in the Cart or the Order.
- Parameters:
builder
- function to build the state value- Returns:
- Builder
-
taxRate
- For a Cart with
Platform
TaxMode, thetaxRate
of Line Items is set automatically once a shipping address is set. The rate is based on the TaxCategory that applies for the shipping address. - For a Cart with
External
TaxMode, thetaxRate
of Line Items can be set using ExternalTaxRateDraft.
- Parameters:
builder
- function to build the taxRate value- Returns:
- Builder
- For a Cart with
-
withTaxRate
- For a Cart with
Platform
TaxMode, thetaxRate
of Line Items is set automatically once a shipping address is set. The rate is based on the TaxCategory that applies for the shipping address. - For a Cart with
External
TaxMode, thetaxRate
of Line Items can be set using ExternalTaxRateDraft.
- Parameters:
builder
- function to build the taxRate value- Returns:
- Builder
- For a Cart with
-
taxRate
- For a Cart with
Platform
TaxMode, thetaxRate
of Line Items is set automatically once a shipping address is set. The rate is based on the TaxCategory that applies for the shipping address. - For a Cart with
External
TaxMode, thetaxRate
of Line Items can be set using ExternalTaxRateDraft.
- Parameters:
taxRate
- value to be set- Returns:
- Builder
- For a Cart with
-
perMethodTaxRate
Tax Rate per Shipping Method for a Cart with
Multiple
ShippingMode. For a Cart withPlatform
TaxMode it is automatically set after the Shipping Method is added. For a Cart withExternal
TaxMode, the Tax Rate must be set with ExternalTaxRateDraft.- Parameters:
perMethodTaxRate
- value to be set- Returns:
- Builder
-
perMethodTaxRate
Tax Rate per Shipping Method for a Cart with
Multiple
ShippingMode. For a Cart withPlatform
TaxMode it is automatically set after the Shipping Method is added. For a Cart withExternal
TaxMode, the Tax Rate must be set with ExternalTaxRateDraft.- Parameters:
perMethodTaxRate
- value to be set- Returns:
- Builder
-
plusPerMethodTaxRate
Tax Rate per Shipping Method for a Cart with
Multiple
ShippingMode. For a Cart withPlatform
TaxMode it is automatically set after the Shipping Method is added. For a Cart withExternal
TaxMode, the Tax Rate must be set with ExternalTaxRateDraft.- Parameters:
perMethodTaxRate
- value to be set- Returns:
- Builder
-
plusPerMethodTaxRate
public LineItemBuilder plusPerMethodTaxRate(Function<MethodTaxRateBuilder, MethodTaxRateBuilder> builder) Tax Rate per Shipping Method for a Cart with
Multiple
ShippingMode. For a Cart withPlatform
TaxMode it is automatically set after the Shipping Method is added. For a Cart withExternal
TaxMode, the Tax Rate must be set with ExternalTaxRateDraft.- Parameters:
builder
- function to build the perMethodTaxRate value- Returns:
- Builder
-
withPerMethodTaxRate
public LineItemBuilder withPerMethodTaxRate(Function<MethodTaxRateBuilder, MethodTaxRateBuilder> builder) Tax Rate per Shipping Method for a Cart with
Multiple
ShippingMode. For a Cart withPlatform
TaxMode it is automatically set after the Shipping Method is added. For a Cart withExternal
TaxMode, the Tax Rate must be set with ExternalTaxRateDraft.- Parameters:
builder
- function to build the perMethodTaxRate value- Returns:
- Builder
-
addPerMethodTaxRate
Tax Rate per Shipping Method for a Cart with
Multiple
ShippingMode. For a Cart withPlatform
TaxMode it is automatically set after the Shipping Method is added. For a Cart withExternal
TaxMode, the Tax Rate must be set with ExternalTaxRateDraft.- Parameters:
builder
- function to build the perMethodTaxRate value- Returns:
- Builder
-
setPerMethodTaxRate
Tax Rate per Shipping Method for a Cart with
Multiple
ShippingMode. For a Cart withPlatform
TaxMode it is automatically set after the Shipping Method is added. For a Cart withExternal
TaxMode, the Tax Rate must be set with ExternalTaxRateDraft.- Parameters:
builder
- function to build the perMethodTaxRate value- Returns:
- Builder
-
supplyChannel
public LineItemBuilder supplyChannel(Function<ChannelReferenceBuilder, ChannelReferenceBuilder> builder) Identifies Inventory entries that are reserved. The referenced Channel has the
InventorySupply
ChannelRoleEnum.- Parameters:
builder
- function to build the supplyChannel value- Returns:
- Builder
-
withSupplyChannel
public LineItemBuilder withSupplyChannel(Function<ChannelReferenceBuilder, ChannelReference> builder) Identifies Inventory entries that are reserved. The referenced Channel has the
InventorySupply
ChannelRoleEnum.- Parameters:
builder
- function to build the supplyChannel value- Returns:
- Builder
-
supplyChannel
Identifies Inventory entries that are reserved. The referenced Channel has the
InventorySupply
ChannelRoleEnum.- Parameters:
supplyChannel
- value to be set- Returns:
- Builder
-
distributionChannel
public LineItemBuilder distributionChannel(Function<ChannelReferenceBuilder, ChannelReferenceBuilder> builder) Used to select a Product Price. The referenced Channel has the
ProductDistribution
ChannelRoleEnum.- Parameters:
builder
- function to build the distributionChannel value- Returns:
- Builder
-
withDistributionChannel
public LineItemBuilder withDistributionChannel(Function<ChannelReferenceBuilder, ChannelReference> builder) Used to select a Product Price. The referenced Channel has the
ProductDistribution
ChannelRoleEnum.- Parameters:
builder
- function to build the distributionChannel value- Returns:
- Builder
-
distributionChannel
Used to select a Product Price. The referenced Channel has the
ProductDistribution
ChannelRoleEnum.- Parameters:
distributionChannel
- value to be set- Returns:
- Builder
-
priceMode
Indicates how the Price for the Line Item is set.
- Parameters:
priceMode
- value to be set- Returns:
- Builder
-
lineItemMode
Indicates how the Line Item is added to the Cart.
- Parameters:
lineItemMode
- value to be set- Returns:
- Builder
-
inventoryMode
Inventory mode specific to this Line Item only, and valid for the entire
quantity
of the Line Item. Only present if the inventory mode is different from theinventoryMode
specified on the Cart.- Parameters:
inventoryMode
- value to be set- Returns:
- Builder
-
shippingDetails
public LineItemBuilder shippingDetails(Function<ItemShippingDetailsBuilder, ItemShippingDetailsBuilder> builder) Container for Line Item-specific addresses.
- Parameters:
builder
- function to build the shippingDetails value- Returns:
- Builder
-
withShippingDetails
public LineItemBuilder withShippingDetails(Function<ItemShippingDetailsBuilder, ItemShippingDetails> builder) Container for Line Item-specific addresses.
- Parameters:
builder
- function to build the shippingDetails value- Returns:
- Builder
-
shippingDetails
Container for Line Item-specific addresses.
- Parameters:
shippingDetails
- value to be set- Returns:
- Builder
-
custom
Custom Fields of the Line Item.
- Parameters:
builder
- function to build the custom value- Returns:
- Builder
-
withCustom
Custom Fields of the Line Item.
- Parameters:
builder
- function to build the custom value- Returns:
- Builder
-
custom
Custom Fields of the Line Item.
- Parameters:
custom
- value to be set- Returns:
- Builder
-
addedAt
Date and time (UTC) the Line Item was added to the Cart.
- Parameters:
addedAt
- value to be set- Returns:
- Builder
-
lastModifiedAt
Date and time (UTC) the Line Item was last updated.
- Parameters:
lastModifiedAt
- value to be set- Returns:
- Builder
-
getId
Unique identifier of the LineItem.
- Returns:
- id
-
getKey
User-defined unique identifier of the LineItem.
- Returns:
- key
-
getProductId
id
of the Product the Line Item is based on.- Returns:
- productId
-
getProductKey
key
of the Product.This field is only present on:
- Line Items in a Cart when the
key
is available on that specific Product at the time the LineItem was created or updated on the Cart. - Line Items in an Order when the
key
is available on the specific Product at the time the Order was created from the Cart.
Present on resources created or updated after 3 December 2021.
- Returns:
- productKey
- Line Items in a Cart when the
-
getName
Name of the Product.
- Returns:
- name
-
getProductSlug
slug
of the current version of the Product. Updated automatically if theslug
changes. Empty if the Product has been deleted. TheproductSlug
field of LineItem is not expanded when using Reference Expansion.- Returns:
- productSlug
-
getProductType
Product Type of the Product.
- Returns:
- productType
-
getVariant
Holds the data of the Product Variant added to the Cart.
The data is saved at the time the Product Variant is added to the Cart and is not updated automatically when Product Variant data changes. Must be updated using the Recalculate update action.
- Returns:
- variant
-
getPrice
Price of a Line Item selected from the Product Variant according to the Product
priceMode
. If thepriceMode
isEmbedded
ProductPriceMode and thevariant
field hasn't been updated, the price may not correspond to a price invariant.prices
.- Returns:
- price
-
getQuantity
Number of Line Items of the given Product Variant present in the Cart or Order.
- Returns:
- quantity
-
getTotalPrice
Total price of this Line Item equalling
price
multiplied byquantity
. If the Line Item is discounted, the total price is thediscountedPricePerQuantity
multiplied byquantity
. Includes taxes if the TaxRateincludedInPrice
istrue
.- Returns:
- totalPrice
-
getDiscountedPricePerQuantity
Discounted price of a single quantity of the Line Item.
- Returns:
- discountedPricePerQuantity
-
getTaxedPrice
Automatically set after
taxRate
is set.- Returns:
- taxedPrice
-
getTaxedPricePortions
Total taxed prices based on the quantity of Line Item assigned to each Shipping Method. Only applicable for Carts with
Multiple
ShippingMode. Automatically set afterperMethodTaxRate
is set.- Returns:
- taxedPricePortions
-
getState
State of the Line Item in the Cart or the Order.
- Returns:
- state
-
getTaxRate
- For a Cart with
Platform
TaxMode, thetaxRate
of Line Items is set automatically once a shipping address is set. The rate is based on the TaxCategory that applies for the shipping address. - For a Cart with
External
TaxMode, thetaxRate
of Line Items can be set using ExternalTaxRateDraft.
- Returns:
- taxRate
- For a Cart with
-
getPerMethodTaxRate
Tax Rate per Shipping Method for a Cart with
Multiple
ShippingMode. For a Cart withPlatform
TaxMode it is automatically set after the Shipping Method is added. For a Cart withExternal
TaxMode, the Tax Rate must be set with ExternalTaxRateDraft.- Returns:
- perMethodTaxRate
-
getSupplyChannel
Identifies Inventory entries that are reserved. The referenced Channel has the
InventorySupply
ChannelRoleEnum.- Returns:
- supplyChannel
-
getDistributionChannel
Used to select a Product Price. The referenced Channel has the
ProductDistribution
ChannelRoleEnum.- Returns:
- distributionChannel
-
getPriceMode
Indicates how the Price for the Line Item is set.
- Returns:
- priceMode
-
getLineItemMode
Indicates how the Line Item is added to the Cart.
- Returns:
- lineItemMode
-
getInventoryMode
Inventory mode specific to this Line Item only, and valid for the entire
quantity
of the Line Item. Only present if the inventory mode is different from theinventoryMode
specified on the Cart.- Returns:
- inventoryMode
-
getShippingDetails
Container for Line Item-specific addresses.
- Returns:
- shippingDetails
-
getCustom
Custom Fields of the Line Item.
- Returns:
- custom
-
getAddedAt
Date and time (UTC) the Line Item was added to the Cart.
- Returns:
- addedAt
-
getLastModifiedAt
Date and time (UTC) the Line Item was last updated.
- Returns:
- lastModifiedAt
-
build
builds LineItem with checking for non-null required values -
buildUnchecked
builds LineItem without checking for non-null required values- Returns:
- LineItem
-
of
factory method for an instance of LineItemBuilder- Returns:
- builder
-
of
create builder for LineItem instance- Parameters:
template
- instance with prefilled values for the builder- Returns:
- builder
-