The representation of a Line Item in a Cart.

interface LineItem {
    addedAt?: string;
    custom?: CustomFields;
    discountedPricePerQuantity: DiscountedLineItemPriceForQuantity[];
    distributionChannel?: ChannelReference;
    id: string;
    inventoryMode?: 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 Line Item.

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.

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 Line Item was created or updated on the Cart.
- [Orders](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.

Product Type of the Product.

quantity: number

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

shippingDetails?: ItemShippingDetails

Container for Line Item-specific addresses.

state: ItemState[]

State of the Line Item in the Cart.

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[]

Taxed price of the Shipping Method that is 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.

Generated using TypeDoc