Class LineItemBuilder

java.lang.Object
com.commercetools.api.models.cart.LineItemBuilder
All Implemented Interfaces:
Builder<LineItem>

public class LineItemBuilder extends Object implements Builder<LineItem>
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 Details

    • LineItemBuilder

      public LineItemBuilder()
  • Method Details

    • id

      public LineItemBuilder id(String id)

      Unique identifier of the LineItem.

      Parameters:
      id - value to be set
      Returns:
      Builder
    • key

      public LineItemBuilder key(@Nullable String key)

      User-defined unique identifier of the LineItem.

      Parameters:
      key - value to be set
      Returns:
      Builder
    • productId

      public LineItemBuilder productId(String productId)

      id of the Product the Line Item is based on.

      Parameters:
      productId - value to be set
      Returns:
      Builder
    • productKey

      public LineItemBuilder productKey(@Nullable String 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
    • 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

      public LineItemBuilder name(LocalizedString 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 the slug changes. Empty if the Product has been deleted. The productSlug 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 the slug changes. Empty if the Product has been deleted. The productSlug field of LineItem is not expanded when using Reference Expansion.

      Parameters:
      builder - function to build the productSlug value
      Returns:
      Builder
    • productSlug

      public LineItemBuilder productSlug(@Nullable LocalizedString productSlug)

      slug of the current version of the Product. Updated automatically if the slug changes. Empty if the Product has been deleted. The productSlug field of LineItem is not expanded when using Reference Expansion.

      Parameters:
      productSlug - value to be set
      Returns:
      Builder
    • productType

      Product Type of the Product.

      Parameters:
      builder - function to build the productType value
      Returns:
      Builder
    • withProductType

      Product Type of the Product.

      Parameters:
      builder - function to build the productType value
      Returns:
      Builder
    • productType

      public LineItemBuilder productType(ProductTypeReference 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

      public LineItemBuilder variant(ProductVariant 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 the priceMode is Embedded ProductPriceMode and the variant field hasn't been updated, the price may not correspond to a price in variant.prices.

      Parameters:
      builder - function to build the price value
      Returns:
      Builder
    • withPrice

      public LineItemBuilder withPrice(Function<PriceBuilder,Price> builder)

      Price of a Line Item selected from the Product Variant according to the Product priceMode. If the priceMode is Embedded ProductPriceMode and the variant field hasn't been updated, the price may not correspond to a price in variant.prices.

      Parameters:
      builder - function to build the price value
      Returns:
      Builder
    • price

      public LineItemBuilder price(Price price)

      Price of a Line Item selected from the Product Variant according to the Product priceMode. If the priceMode is Embedded ProductPriceMode and the variant field hasn't been updated, the price may not correspond to a price in variant.prices.

      Parameters:
      price - value to be set
      Returns:
      Builder
    • quantity

      public LineItemBuilder quantity(Long 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

      Total price of this Line Item equalling price multiplied by quantity. If the Line Item is discounted, the total price is the discountedPricePerQuantity multiplied by quantity. Includes taxes if the TaxRate includedInPrice is true.

      Parameters:
      builder - function to build the totalPrice value
      Returns:
      Builder
    • withTotalPrice

      Total price of this Line Item equalling price multiplied by quantity. If the Line Item is discounted, the total price is the discountedPricePerQuantity multiplied by quantity. Includes taxes if the TaxRate includedInPrice is true.

      Parameters:
      builder - function to build the totalPrice value
      Returns:
      Builder
    • totalPrice

      public LineItemBuilder totalPrice(CentPrecisionMoney totalPrice)

      Total price of this Line Item equalling price multiplied by quantity. If the Line Item is discounted, the total price is the discountedPricePerQuantity multiplied by quantity. Includes taxes if the TaxRate includedInPrice is true.

      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

      Discounted price of a single quantity of the Line Item.

      Parameters:
      builder - function to build the discountedPricePerQuantity value
      Returns:
      Builder
    • withDiscountedPricePerQuantity

      Discounted price of a single quantity of the Line Item.

      Parameters:
      builder - function to build the discountedPricePerQuantity value
      Returns:
      Builder
    • addDiscountedPricePerQuantity

      Discounted price of a single quantity of the Line Item.

      Parameters:
      builder - function to build the discountedPricePerQuantity value
      Returns:
      Builder
    • setDiscountedPricePerQuantity

      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

      public LineItemBuilder taxedPrice(@Nullable TaxedItemPrice taxedPrice)

      Automatically set after taxRate is set.

      Parameters:
      taxedPrice - value to be set
      Returns:
      Builder
    • taxedPricePortions

      public LineItemBuilder taxedPricePortions(MethodTaxedPrice... 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 after perMethodTaxRate is set.

      Parameters:
      taxedPricePortions - value to be set
      Returns:
      Builder
    • taxedPricePortions

      public LineItemBuilder taxedPricePortions(List<MethodTaxedPrice> 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 after perMethodTaxRate is set.

      Parameters:
      taxedPricePortions - value to be set
      Returns:
      Builder
    • plusTaxedPricePortions

      public LineItemBuilder plusTaxedPricePortions(MethodTaxedPrice... 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 after perMethodTaxRate 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 after perMethodTaxRate 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 after perMethodTaxRate 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 after perMethodTaxRate 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 after perMethodTaxRate is set.

      Parameters:
      builder - function to build the taxedPricePortions value
      Returns:
      Builder
    • state

      public LineItemBuilder state(ItemState... state)

      State of the Line Item in the Cart or the Order.

      Parameters:
      state - value to be set
      Returns:
      Builder
    • state

      public LineItemBuilder state(List<ItemState> state)

      State of the Line Item in the Cart or the Order.

      Parameters:
      state - value to be set
      Returns:
      Builder
    • plusState

      public LineItemBuilder plusState(ItemState... 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:
      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

      public LineItemBuilder addState(Function<ItemStateBuilder,ItemState> builder)

      State of the Line Item in the Cart or the Order.

      Parameters:
      builder - function to build the state value
      Returns:
      Builder
    • setState

      public LineItemBuilder setState(Function<ItemStateBuilder,ItemState> builder)

      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, the taxRate 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, the taxRate of Line Items can be set using ExternalTaxRateDraft.
      Parameters:
      builder - function to build the taxRate value
      Returns:
      Builder
    • withTaxRate

      public LineItemBuilder withTaxRate(Function<TaxRateBuilder,TaxRate> builder)
      • For a Cart with Platform TaxMode, the taxRate 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, the taxRate of Line Items can be set using ExternalTaxRateDraft.
      Parameters:
      builder - function to build the taxRate value
      Returns:
      Builder
    • taxRate

      public LineItemBuilder taxRate(@Nullable TaxRate taxRate)
      • For a Cart with Platform TaxMode, the taxRate 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, the taxRate of Line Items can be set using ExternalTaxRateDraft.
      Parameters:
      taxRate - value to be set
      Returns:
      Builder
    • perMethodTaxRate

      public LineItemBuilder perMethodTaxRate(MethodTaxRate... perMethodTaxRate)

      Tax Rate per Shipping Method for a Cart with Multiple ShippingMode. For a Cart with Platform TaxMode it is automatically set after the Shipping Method is added. For a Cart with External TaxMode, the Tax Rate must be set with ExternalTaxRateDraft.

      Parameters:
      perMethodTaxRate - value to be set
      Returns:
      Builder
    • perMethodTaxRate

      public LineItemBuilder perMethodTaxRate(List<MethodTaxRate> perMethodTaxRate)

      Tax Rate per Shipping Method for a Cart with Multiple ShippingMode. For a Cart with Platform TaxMode it is automatically set after the Shipping Method is added. For a Cart with External TaxMode, the Tax Rate must be set with ExternalTaxRateDraft.

      Parameters:
      perMethodTaxRate - value to be set
      Returns:
      Builder
    • plusPerMethodTaxRate

      public LineItemBuilder plusPerMethodTaxRate(MethodTaxRate... perMethodTaxRate)

      Tax Rate per Shipping Method for a Cart with Multiple ShippingMode. For a Cart with Platform TaxMode it is automatically set after the Shipping Method is added. For a Cart with External 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 with Platform TaxMode it is automatically set after the Shipping Method is added. For a Cart with External 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 with Platform TaxMode it is automatically set after the Shipping Method is added. For a Cart with External TaxMode, the Tax Rate must be set with ExternalTaxRateDraft.

      Parameters:
      builder - function to build the perMethodTaxRate value
      Returns:
      Builder
    • addPerMethodTaxRate

      public LineItemBuilder addPerMethodTaxRate(Function<MethodTaxRateBuilder,MethodTaxRate> builder)

      Tax Rate per Shipping Method for a Cart with Multiple ShippingMode. For a Cart with Platform TaxMode it is automatically set after the Shipping Method is added. For a Cart with External TaxMode, the Tax Rate must be set with ExternalTaxRateDraft.

      Parameters:
      builder - function to build the perMethodTaxRate value
      Returns:
      Builder
    • setPerMethodTaxRate

      public LineItemBuilder setPerMethodTaxRate(Function<MethodTaxRateBuilder,MethodTaxRate> builder)

      Tax Rate per Shipping Method for a Cart with Multiple ShippingMode. For a Cart with Platform TaxMode it is automatically set after the Shipping Method is added. For a Cart with External TaxMode, the Tax Rate must be set with ExternalTaxRateDraft.

      Parameters:
      builder - function to build the perMethodTaxRate value
      Returns:
      Builder
    • supplyChannel

      Identifies Inventory entries that are reserved. The referenced Channel has the InventorySupply ChannelRoleEnum.

      Parameters:
      builder - function to build the supplyChannel value
      Returns:
      Builder
    • withSupplyChannel

      Identifies Inventory entries that are reserved. The referenced Channel has the InventorySupply ChannelRoleEnum.

      Parameters:
      builder - function to build the supplyChannel value
      Returns:
      Builder
    • supplyChannel

      public LineItemBuilder supplyChannel(@Nullable ChannelReference supplyChannel)

      Identifies Inventory entries that are reserved. The referenced Channel has the InventorySupply ChannelRoleEnum.

      Parameters:
      supplyChannel - value to be set
      Returns:
      Builder
    • distributionChannel

      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

      public LineItemBuilder distributionChannel(@Nullable ChannelReference distributionChannel)

      Used to select a Product Price. The referenced Channel has the ProductDistribution ChannelRoleEnum.

      Parameters:
      distributionChannel - value to be set
      Returns:
      Builder
    • priceMode

      public LineItemBuilder priceMode(LineItemPriceMode priceMode)

      Indicates how the Price for the Line Item is set.

      Parameters:
      priceMode - value to be set
      Returns:
      Builder
    • lineItemMode

      public LineItemBuilder lineItemMode(LineItemMode lineItemMode)

      Indicates how the Line Item is added to the Cart.

      Parameters:
      lineItemMode - value to be set
      Returns:
      Builder
    • inventoryMode

      public LineItemBuilder inventoryMode(@Nullable InventoryMode 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 the inventoryMode specified on the Cart.

      Parameters:
      inventoryMode - value to be set
      Returns:
      Builder
    • shippingDetails

      Container for Line Item-specific addresses.

      Parameters:
      builder - function to build the shippingDetails value
      Returns:
      Builder
    • withShippingDetails

      Container for Line Item-specific addresses.

      Parameters:
      builder - function to build the shippingDetails value
      Returns:
      Builder
    • shippingDetails

      public LineItemBuilder shippingDetails(@Nullable ItemShippingDetails 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

      public LineItemBuilder custom(@Nullable CustomFields custom)

      Custom Fields of the Line Item.

      Parameters:
      custom - value to be set
      Returns:
      Builder
    • addedAt

      public LineItemBuilder addedAt(@Nullable ZonedDateTime addedAt)

      Date and time (UTC) the Line Item was added to the Cart.

      Parameters:
      addedAt - value to be set
      Returns:
      Builder
    • lastModifiedAt

      public LineItemBuilder lastModifiedAt(@Nullable ZonedDateTime lastModifiedAt)

      Date and time (UTC) the Line Item was last updated.

      Parameters:
      lastModifiedAt - value to be set
      Returns:
      Builder
    • getId

      public String getId()

      Unique identifier of the LineItem.

      Returns:
      id
    • getKey

      @Nullable public String getKey()

      User-defined unique identifier of the LineItem.

      Returns:
      key
    • getProductId

      public String getProductId()

      id of the Product the Line Item is based on.

      Returns:
      productId
    • getProductKey

      @Nullable public String 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
    • getName

      public LocalizedString getName()

      Name of the Product.

      Returns:
      name
    • getProductSlug

      @Nullable public LocalizedString getProductSlug()

      slug of the current version of the Product. Updated automatically if the slug changes. Empty if the Product has been deleted. The productSlug field of LineItem is not expanded when using Reference Expansion.

      Returns:
      productSlug
    • getProductType

      public ProductTypeReference getProductType()

      Product Type of the Product.

      Returns:
      productType
    • getVariant

      public ProductVariant 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

      public Price getPrice()

      Price of a Line Item selected from the Product Variant according to the Product priceMode. If the priceMode is Embedded ProductPriceMode and the variant field hasn't been updated, the price may not correspond to a price in variant.prices.

      Returns:
      price
    • getQuantity

      public Long getQuantity()

      Number of Line Items of the given Product Variant present in the Cart or Order.

      Returns:
      quantity
    • getTotalPrice

      public CentPrecisionMoney getTotalPrice()

      Total price of this Line Item equalling price multiplied by quantity. If the Line Item is discounted, the total price is the discountedPricePerQuantity multiplied by quantity. Includes taxes if the TaxRate includedInPrice is true.

      Returns:
      totalPrice
    • getDiscountedPricePerQuantity

      public List<DiscountedLineItemPriceForQuantity> getDiscountedPricePerQuantity()

      Discounted price of a single quantity of the Line Item.

      Returns:
      discountedPricePerQuantity
    • getTaxedPrice

      @Nullable public TaxedItemPrice getTaxedPrice()

      Automatically set after taxRate is set.

      Returns:
      taxedPrice
    • getTaxedPricePortions

      public List<MethodTaxedPrice> 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 after perMethodTaxRate is set.

      Returns:
      taxedPricePortions
    • getState

      public List<ItemState> getState()

      State of the Line Item in the Cart or the Order.

      Returns:
      state
    • getTaxRate

      @Nullable public TaxRate getTaxRate()
      • For a Cart with Platform TaxMode, the taxRate 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, the taxRate of Line Items can be set using ExternalTaxRateDraft.
      Returns:
      taxRate
    • getPerMethodTaxRate

      public List<MethodTaxRate> getPerMethodTaxRate()

      Tax Rate per Shipping Method for a Cart with Multiple ShippingMode. For a Cart with Platform TaxMode it is automatically set after the Shipping Method is added. For a Cart with External TaxMode, the Tax Rate must be set with ExternalTaxRateDraft.

      Returns:
      perMethodTaxRate
    • getSupplyChannel

      @Nullable public ChannelReference getSupplyChannel()

      Identifies Inventory entries that are reserved. The referenced Channel has the InventorySupply ChannelRoleEnum.

      Returns:
      supplyChannel
    • getDistributionChannel

      @Nullable public ChannelReference getDistributionChannel()

      Used to select a Product Price. The referenced Channel has the ProductDistribution ChannelRoleEnum.

      Returns:
      distributionChannel
    • getPriceMode

      public LineItemPriceMode getPriceMode()

      Indicates how the Price for the Line Item is set.

      Returns:
      priceMode
    • getLineItemMode

      public LineItemMode getLineItemMode()

      Indicates how the Line Item is added to the Cart.

      Returns:
      lineItemMode
    • getInventoryMode

      @Nullable public InventoryMode 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 the inventoryMode specified on the Cart.

      Returns:
      inventoryMode
    • getShippingDetails

      @Nullable public ItemShippingDetails getShippingDetails()

      Container for Line Item-specific addresses.

      Returns:
      shippingDetails
    • getCustom

      @Nullable public CustomFields getCustom()

      Custom Fields of the Line Item.

      Returns:
      custom
    • getAddedAt

      @Nullable public ZonedDateTime getAddedAt()

      Date and time (UTC) the Line Item was added to the Cart.

      Returns:
      addedAt
    • getLastModifiedAt

      @Nullable public ZonedDateTime getLastModifiedAt()

      Date and time (UTC) the Line Item was last updated.

      Returns:
      lastModifiedAt
    • build

      public LineItem build()
      builds LineItem with checking for non-null required values
      Specified by:
      build in interface Builder<LineItem>
      Returns:
      LineItem
    • buildUnchecked

      public LineItem buildUnchecked()
      builds LineItem without checking for non-null required values
      Returns:
      LineItem
    • of

      public static LineItemBuilder of()
      factory method for an instance of LineItemBuilder
      Returns:
      builder
    • of

      public static LineItemBuilder of(LineItem template)
      create builder for LineItem instance
      Parameters:
      template - instance with prefilled values for the builder
      Returns:
      builder