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
| Property | Returns | Description |
|---|---|---|
| adjustedPriceExTax | BigDecimal | The unit price of this item after any discount has been applied, excluding tax. |
| discountExTax | BigDecimal | The total discount applied to this line, calculated as the list price for the full quantity less the final price, both excluding tax. |
| finalListPriceIncTax | BigDecimal | The final list price for this line, including tax, before discounts. |
| finalPriceExTax | BigDecimal | The final price for this line after discounts, excluding tax. |
| listUnitPriceExTax | BigDecimal | The list unit price of this item before any discount, excluding tax. |
Inherited from PurchaseItem
Properties
| Property | Returns | Description |
|---|---|---|
| finalCost | BigDecimal | The tax inclusive final price, including promotions or other discounts |
| itemDescription | String | Human readable description of the item being purchased. |
| lineItemId | String | Identifier for this line item within the cart, used to correlate the item with the source cart line. |
| product | Product | The product being purchased. |
| productSku | ProductSku | The product sku being purchased, if this line item is for a specific sku. |
| quantity | BigDecimal | Number of units of the item being purchased. |
| tax | BigDecimal | The tax amount included in getFinalCost() for this line item. |
| taxRate | BigDecimal | Tax rate applied to this item, expressed as the rate used to calculate getTax(). |
| unitCost | BigDecimal | Price 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.
| Parameter | Description |
|---|---|
narrative | the 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.