The representation of a Line Item in a Cart or in an Order.

interface LineItem {
    addedAt?: string;
    custom?: CustomFields;
    discountedPricePerQuantity: DiscountedLineItemPriceForQuantity[];
    distributionChannel?: ChannelReference;
    id: string;
    inventoryMode?: string;
    key?: string;
    lastModifiedAt?: string;
    lineItemMode: string;
    name: LocalizedString;
    perMethodTaxRate: MethodTaxRate[];
    price: Price;
    priceMode: string;
    productId: string;
    productKey?: string;
    productSlug?: LocalizedString;
    productType: ProductTypeReference;
    quantity: number;
    shippingDetails?: ItemShippingDetails;
    state: ItemState[];
    supplyChannel?: ChannelReference;
    taxRate?: TaxRate;
    taxedPrice?: TaxedItemPrice;
    taxedPricePortions: MethodTaxedPrice[];
    totalPrice: CentPrecisionMoney;
    variant: ProductVariant;
}

Properties

addedAt?: string

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

custom?: CustomFields

Custom Fields of the Line Item.

discountedPricePerQuantity: DiscountedLineItemPriceForQuantity[]

Discounted price of a single quantity of the Line Item.

distributionChannel?: ChannelReference

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

id: string

Unique identifier of the LineItem.

inventoryMode?: string

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.

key?: string

User-defined unique identifier of the LineItem.

lastModifiedAt?: string

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

lineItemMode: string

Indicates how the Line Item is added to the Cart.

Name of the Product.

perMethodTaxRate: MethodTaxRate[]

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.

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.

priceMode: string

Indicates how the Price for the Line Item is set.

productId: string

id of the Product the Line Item is based on.

productKey?: string

key of the Product.

This field is only present on:

- Line Items in a [Cart](ctp:api:type: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](ctp:api:type: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.
productSlug?: LocalizedString

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.

productType: ProductTypeReference

Product Type of the Product.

quantity: number

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

shippingDetails?: ItemShippingDetails

Container for Line Item-specific addresses.

state: ItemState[]

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

supplyChannel?: ChannelReference

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

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.
taxedPrice?: TaxedItemPrice

Automatically set after taxRate is set.

taxedPricePortions: MethodTaxedPrice[]

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.

totalPrice: CentPrecisionMoney

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.

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](ctp:api:type:CartRecalculateAction) update action.