Represents one priced line in a cart's checkout, such as a purchased product, a redeemed voucher or a free gift. Extends the base purchase item contract with pricing fields that separate the original list price from the price after promotions and discounts are applied, and with the ability to finalise itself against the order when checkout is processed. Implementations back the line items exposed by CheckoutItems.

Extends: PurchaseItem


Properties

PropertyReturnsDescription
adjustedPriceExTaxBigDecimalThe unit price of this item after any discount has been applied, excluding tax.
discountExTaxBigDecimalThe total discount applied to this line, calculated as the list price for the full quantity less the final price, both excluding tax.
finalListPriceIncTaxBigDecimalThe final list price for this line, including tax, before discounts.
finalPriceExTaxBigDecimalThe final price for this line after discounts, excluding tax.
listUnitPriceExTaxBigDecimalThe list unit price of this item before any discount, excluding tax.

Inherited from PurchaseItem

Properties

PropertyReturnsDescription
finalCostBigDecimalThe tax inclusive final price, including promotions or other discounts
itemDescriptionStringHuman readable description of the item being purchased.
lineItemIdStringIdentifier for this line item within the cart, used to correlate the item with the source cart line.
productProductThe product being purchased.
productSkuProductSkuThe product sku being purchased, if this line item is for a specific sku.
quantityBigDecimalNumber of units of the item being purchased.
taxBigDecimalThe tax amount included in getFinalCost() for this line item.
taxRateBigDecimalTax rate applied to this item, expressed as the rate used to calculate getTax().
unitCostBigDecimalPrice of a single unit of the item, before tax and before any promotions or discounts.

Methods

getLineItemId() · getQuantity() · getUnitCost() · getTaxRate() · getFinalCost() · finalCost(Narrative narrative) · getItemDescription() · getProductSku() · getProduct() · getTax()

getLineItemId()

Returns: String

Identifier for this line item within the cart, used to correlate the item with the source cart line.

getQuantity()

Returns: BigDecimal

Number of units of the item being purchased.

getUnitCost()

Returns: BigDecimal

Price of a single unit of the item, before tax and before any promotions or discounts.

getTaxRate()

Returns: BigDecimal

Tax rate applied to this item, expressed as the rate used to calculate getTax().

getFinalCost()

Returns: BigDecimal

The tax inclusive final price, including promotions or other discounts

finalCost(Narrative narrative)

Returns: BigDecimal

Calculates the final cost of this item within the context of the given narrative, allowing narrative specific pricing or promotions to be applied.

ParameterDescription
narrativethe narrative context the price is calculated for

getItemDescription()

Returns: String

Human readable description of the item being purchased.

getProductSku()

Returns: ProductSku

The product sku being purchased, if this line item is for a specific sku.

getProduct()

Returns: Product

The product being purchased.

getTax()

Returns: BigDecimal

The tax amount included in getFinalCost() for this line item.


Methods

getListUnitPriceExTax()

Returns: BigDecimal

The list unit price of this item before any discount, excluding tax.

getAdjustedPriceExTax()

Returns: BigDecimal

The unit price of this item after any discount has been applied, excluding tax.

getFinalListPriceIncTax()

Returns: BigDecimal

The final list price for this line, including tax, before discounts.

getFinalPriceExTax()

Returns: BigDecimal

The final price for this line after discounts, excluding tax.

getDiscountExTax()

Returns: BigDecimal

The total discount applied to this line, calculated as the list price for the full quantity less the final price, both excluding tax.

To get full access to the Kademi Hub existing customers can login here, or new customers can register here.