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
Constructors -
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 withMultipleShippingMode.addState(Function<ItemStateBuilder, ItemState> builder) Tracks specific quantities of the Line Item within a given State.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 entirequantityof 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 withMultipleShippingMode.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.idof the Product the Line Item is based on.keyof the Product.slugof the current version of the Product.Product Type of the Product.Recurring Order and frequency data.Container for Line Item-specific addresses.getState()Tracks specific quantities of the Line Item within a given State.Identifies Inventory entries that are reserved.Automatically set aftertaxRateis set.Total taxed prices based on the quantity of Line Item assigned to each Shipping Method.For a Cart withPlatformTaxMode, thetaxRateof Line Items is set automatically once a shipping address is set.Total price of this Line Item equallingpricemultiplied 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 entirequantityof 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 LineItemBuilderof()factory method for an instance of LineItemBuilderstatic LineItemBuildercreate builder for LineItem instanceperMethodTaxRate(MethodTaxRate... perMethodTaxRate) Tax Rate per Shipping Method for a Cart withMultipleShippingMode.perMethodTaxRate(List<MethodTaxRate> perMethodTaxRate) Tax Rate per Shipping Method for a Cart withMultipleShippingMode.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 withMultipleShippingMode.Tax Rate per Shipping Method for a Cart withMultipleShippingMode.Tracks specific quantities of the Line Item within a given State.plusState(Function<ItemStateBuilder, ItemStateBuilder> builder) Tracks specific quantities of the Line Item within a given State.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.idof the Product the Line Item is based on.productKey(String productKey) keyof the Product.productSlug(LocalizedString productSlug) slugof the current version of the Product.slugof the current version of the Product.productType(ProductTypeReference productType) Product Type of the Product.Product Type of the Product.recurrenceInfo(LineItemRecurrenceInfo recurrenceInfo) Recurring Order and frequency data.Recurring Order and frequency data.setDiscountedPricePerQuantity(Function<DiscountedLineItemPriceForQuantityBuilder, DiscountedLineItemPriceForQuantity> builder) Discounted price of a single quantity of the Line Item.Tax Rate per Shipping Method for a Cart withMultipleShippingMode.setState(Function<ItemStateBuilder, ItemState> builder) Tracks specific quantities of the Line Item within a given State.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.Tracks specific quantities of the Line Item within a given State.Tracks specific quantities of the Line Item within a given State.supplyChannel(ChannelReference supplyChannel) Identifies Inventory entries that are reserved.Identifies Inventory entries that are reserved.taxedPrice(TaxedItemPrice taxedPrice) Automatically set aftertaxRateis set.Automatically set aftertaxRateis 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 withPlatformTaxMode, thetaxRateof Line Items is set automatically once a shipping address is set.taxRate(Function<TaxRateBuilder, TaxRateBuilder> builder) For a Cart withPlatformTaxMode, thetaxRateof Line Items is set automatically once a shipping address is set.totalPrice(CentPrecisionMoney totalPrice) Total price of this Line Item equallingpricemultiplied byquantity.Total price of this Line Item equallingpricemultiplied 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 withMultipleShippingMode.withPrice(Function<PriceBuilder, Price> builder) Price of a Line Item selected from the Product Variant according to the ProductpriceMode.slugof the current version of the Product.Product Type of the Product.Recurring Order and frequency data.Container for Line Item-specific addresses.withState(Function<ItemStateBuilder, ItemStateBuilder> builder) Tracks specific quantities of the Line Item within a given State.Identifies Inventory entries that are reserved.Automatically set aftertaxRateis set.Total taxed prices based on the quantity of Line Item assigned to each Shipping Method.withTaxRate(Function<TaxRateBuilder, TaxRate> builder) For a Cart withPlatformTaxMode, thetaxRateof Line Items is set automatically once a shipping address is set.Total price of this Line Item equallingpricemultiplied 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
idof the Product the Line Item is based on.- Parameters:
productId- value to be set- Returns:
- Builder
-
productKey
keyof the Product.This field is only present on:
- Line Items in a Cart when the
keyis available on that specific Product at the time the LineItem was created or updated on the Cart. - Line Items in an Order when the
keyis 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
slugof the current version of the Product. Updated automatically if theslugchanges. Empty if the Product has been deleted. TheproductSlugfield of LineItem is not expanded when using Reference Expansion.- Parameters:
builder- function to build the productSlug value- Returns:
- Builder
-
withProductSlug
slugof the current version of the Product. Updated automatically if theslugchanges. Empty if the Product has been deleted. TheproductSlugfield of LineItem is not expanded when using Reference Expansion.- Parameters:
builder- function to build the productSlug value- Returns:
- Builder
-
productSlug
slugof the current version of the Product. Updated automatically if theslugchanges. Empty if the Product has been deleted. TheproductSlugfield 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 thepriceModeisEmbeddedProductPriceMode and thevariantfield 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 thepriceModeisEmbeddedProductPriceMode and thevariantfield 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 thepriceModeisEmbeddedProductPriceMode and thevariantfield hasn't been updated, the price may not correspond to a price invariant.prices.- Parameters:
price- value to be set- Returns:
- Builder
-
quantity
- Parameters:
quantity- value to be set- Returns:
- Builder
-
totalPrice
public LineItemBuilder totalPrice(Function<CentPrecisionMoneyBuilder, CentPrecisionMoneyBuilder> builder) Total price of this Line Item equalling
pricemultiplied byquantity. If the Line Item is discounted, the total price is thediscountedPricePerQuantitymultiplied byquantity. Includes taxes if the TaxRateincludedInPriceistrue.If
ExternalPriceLineItemPriceMode is used with high-precision money, then the total price is rounded by using theHalfEvenrounding mode.- 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
pricemultiplied byquantity. If the Line Item is discounted, the total price is thediscountedPricePerQuantitymultiplied byquantity. Includes taxes if the TaxRateincludedInPriceistrue.If
ExternalPriceLineItemPriceMode is used with high-precision money, then the total price is rounded by using theHalfEvenrounding mode.- Parameters:
builder- function to build the totalPrice value- Returns:
- Builder
-
totalPrice
Total price of this Line Item equalling
pricemultiplied byquantity. If the Line Item is discounted, the total price is thediscountedPricePerQuantitymultiplied byquantity. Includes taxes if the TaxRateincludedInPriceistrue.If
ExternalPriceLineItemPriceMode is used with high-precision money, then the total price is rounded by using theHalfEvenrounding mode.- 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
taxRateis set.- Parameters:
builder- function to build the taxedPrice value- Returns:
- Builder
-
withTaxedPrice
Automatically set after
taxRateis set.- Parameters:
builder- function to build the taxedPrice value- Returns:
- Builder
-
taxedPrice
Automatically set after
taxRateis 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
MultipleShippingMode. Automatically set afterperMethodTaxRateis 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
MultipleShippingMode. Automatically set afterperMethodTaxRateis 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
MultipleShippingMode. Automatically set afterperMethodTaxRateis 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
MultipleShippingMode. Automatically set afterperMethodTaxRateis 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
MultipleShippingMode. Automatically set afterperMethodTaxRateis 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
MultipleShippingMode. Automatically set afterperMethodTaxRateis 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
MultipleShippingMode. Automatically set afterperMethodTaxRateis set.- Parameters:
builder- function to build the taxedPricePortions value- Returns:
- Builder
-
state
Tracks specific quantities of the Line Item within a given State. When a Line Item is added to a Cart, its full quantity is set to the built-in "Initial" state. State transitions for Line Items are managed on the Order.
- Parameters:
state- value to be set- Returns:
- Builder
-
state
Tracks specific quantities of the Line Item within a given State. When a Line Item is added to a Cart, its full quantity is set to the built-in "Initial" state. State transitions for Line Items are managed on the Order.
- Parameters:
state- value to be set- Returns:
- Builder
-
plusState
Tracks specific quantities of the Line Item within a given State. When a Line Item is added to a Cart, its full quantity is set to the built-in "Initial" state. State transitions for Line Items are managed on the Order.
- Parameters:
state- value to be set- Returns:
- Builder
-
plusState
Tracks specific quantities of the Line Item within a given State. When a Line Item is added to a Cart, its full quantity is set to the built-in "Initial" state. State transitions for Line Items are managed on the Order.
- Parameters:
builder- function to build the state value- Returns:
- Builder
-
withState
Tracks specific quantities of the Line Item within a given State. When a Line Item is added to a Cart, its full quantity is set to the built-in "Initial" state. State transitions for Line Items are managed on the Order.
- Parameters:
builder- function to build the state value- Returns:
- Builder
-
addState
Tracks specific quantities of the Line Item within a given State. When a Line Item is added to a Cart, its full quantity is set to the built-in "Initial" state. State transitions for Line Items are managed on the Order.
- Parameters:
builder- function to build the state value- Returns:
- Builder
-
setState
Tracks specific quantities of the Line Item within a given State. When a Line Item is added to a Cart, its full quantity is set to the built-in "Initial" state. State transitions for Line Items are managed on the Order.
- Parameters:
builder- function to build the state value- Returns:
- Builder
-
taxRate
- For a Cart with
PlatformTaxMode, thetaxRateof 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
ExternalTaxMode, thetaxRateof 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
PlatformTaxMode, thetaxRateof 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
ExternalTaxMode, thetaxRateof 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
PlatformTaxMode, thetaxRateof 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
ExternalTaxMode, thetaxRateof 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
MultipleShippingMode. For a Cart withPlatformTaxMode it is automatically set after the Shipping Method is added. For a Cart withExternalTaxMode, 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
MultipleShippingMode. For a Cart withPlatformTaxMode it is automatically set after the Shipping Method is added. For a Cart withExternalTaxMode, 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
MultipleShippingMode. For a Cart withPlatformTaxMode it is automatically set after the Shipping Method is added. For a Cart withExternalTaxMode, 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
MultipleShippingMode. For a Cart withPlatformTaxMode it is automatically set after the Shipping Method is added. For a Cart withExternalTaxMode, 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
MultipleShippingMode. For a Cart withPlatformTaxMode it is automatically set after the Shipping Method is added. For a Cart withExternalTaxMode, 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
MultipleShippingMode. For a Cart withPlatformTaxMode it is automatically set after the Shipping Method is added. For a Cart withExternalTaxMode, 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
MultipleShippingMode. For a Cart withPlatformTaxMode it is automatically set after the Shipping Method is added. For a Cart withExternalTaxMode, 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
InventorySupplyChannelRoleEnum.- 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
InventorySupplyChannelRoleEnum.- Parameters:
builder- function to build the supplyChannel value- Returns:
- Builder
-
supplyChannel
Identifies Inventory entries that are reserved. The referenced Channel has the
InventorySupplyChannelRoleEnum.- 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
ProductDistributionChannelRoleEnum.- 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
ProductDistributionChannelRoleEnum.- Parameters:
builder- function to build the distributionChannel value- Returns:
- Builder
-
distributionChannel
Used to select a Product Price. The referenced Channel has the
ProductDistributionChannelRoleEnum.- 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
quantityof the Line Item. Only present if the inventory mode is different from theinventoryModespecified 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
-
recurrenceInfo
public LineItemBuilder recurrenceInfo(Function<LineItemRecurrenceInfoBuilder, LineItemRecurrenceInfoBuilder> builder) Recurring Order and frequency data.
- Parameters:
builder- function to build the recurrenceInfo value- Returns:
- Builder
-
withRecurrenceInfo
public LineItemBuilder withRecurrenceInfo(Function<LineItemRecurrenceInfoBuilder, LineItemRecurrenceInfo> builder) Recurring Order and frequency data.
- Parameters:
builder- function to build the recurrenceInfo value- Returns:
- Builder
-
recurrenceInfo
Recurring Order and frequency data.
- Parameters:
recurrenceInfo- 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
idof the Product the Line Item is based on.- Returns:
- productId
-
getProductKey
keyof the Product.This field is only present on:
- Line Items in a Cart when the
keyis available on that specific Product at the time the LineItem was created or updated on the Cart. - Line Items in an Order when the
keyis 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
slugof the current version of the Product. Updated automatically if theslugchanges. Empty if the Product has been deleted. TheproductSlugfield 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 thepriceModeisEmbeddedProductPriceMode and thevariantfield hasn't been updated, the price may not correspond to a price invariant.prices.- Returns:
- price
-
getQuantity
- Returns:
- quantity
-
getTotalPrice
Total price of this Line Item equalling
pricemultiplied byquantity. If the Line Item is discounted, the total price is thediscountedPricePerQuantitymultiplied byquantity. Includes taxes if the TaxRateincludedInPriceistrue.If
ExternalPriceLineItemPriceMode is used with high-precision money, then the total price is rounded by using theHalfEvenrounding mode.- Returns:
- totalPrice
-
getDiscountedPricePerQuantity
Discounted price of a single quantity of the Line Item.
- Returns:
- discountedPricePerQuantity
-
getTaxedPrice
Automatically set after
taxRateis set.- Returns:
- taxedPrice
-
getTaxedPricePortions
Total taxed prices based on the quantity of Line Item assigned to each Shipping Method. Only applicable for Carts with
MultipleShippingMode. Automatically set afterperMethodTaxRateis set.- Returns:
- taxedPricePortions
-
getState
Tracks specific quantities of the Line Item within a given State. When a Line Item is added to a Cart, its full quantity is set to the built-in "Initial" state. State transitions for Line Items are managed on the Order.
- Returns:
- state
-
getTaxRate
- For a Cart with
PlatformTaxMode, thetaxRateof 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
ExternalTaxMode, thetaxRateof Line Items can be set using ExternalTaxRateDraft.
- Returns:
- taxRate
- For a Cart with
-
getPerMethodTaxRate
Tax Rate per Shipping Method for a Cart with
MultipleShippingMode. For a Cart withPlatformTaxMode it is automatically set after the Shipping Method is added. For a Cart withExternalTaxMode, the Tax Rate must be set with ExternalTaxRateDraft.- Returns:
- perMethodTaxRate
-
getSupplyChannel
Identifies Inventory entries that are reserved. The referenced Channel has the
InventorySupplyChannelRoleEnum.- Returns:
- supplyChannel
-
getDistributionChannel
Used to select a Product Price. The referenced Channel has the
ProductDistributionChannelRoleEnum.- 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
quantityof the Line Item. Only present if the inventory mode is different from theinventoryModespecified 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
-
getRecurrenceInfo
Recurring Order and frequency data.
- Returns:
- recurrenceInfo
-
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
-