Home > @vsf-enterprise/commercetools-types > LineItem

# LineItem type

A line item is a snapshot of a product variant at the time it was added to the cart.

Since a product variant may change at any time, the ProductVariant data is copied into the field variant. The relation to the Product is kept but the line item will not automatically update if the product variant changes. On the cart, the line item can be updated manually. The productSlug refers to the current version of the product. It can be used to link to the product. If the product has been deleted, the line item remains but refers to a non-existent product and the productSlug is left empty.

Please also note that creating an order is impossible if the product or product variant a line item relates to has been deleted.

Signature:

export declare type LineItem = {
    __typename?: 'LineItem';
    id: Scalars['String'];
    productId: Scalars['String'];
    productKey?: Maybe<Scalars['String']>;
    name?: Maybe<Scalars['String']>;
    nameAllLocales: Array<LocalizedString>;
    productSlug?: Maybe<Scalars['String']>;
    productSlugAllLocales?: Maybe<Array<LocalizedString>>;
    productType?: Maybe<ProductTypeDefinition>;
    productTypeRef?: Maybe<Reference>;
    variant?: Maybe<ProductVariant>;
    price: ProductPrice;
    taxedPrice?: Maybe<TaxedItemPrice>;
    totalPrice?: Maybe<Money>;
    quantity: Scalars['Long'];
    addedAt?: Maybe<Scalars['DateTime']>;
    lastModifiedAt?: Maybe<Scalars['DateTime']>;
    state: Array<ItemState>;
    taxRate?: Maybe<TaxRate>;
    supplyChannel?: Maybe<Channel>;
    supplyChannelRef?: Maybe<Reference>;
    distributionChannel?: Maybe<Channel>;
    distributionChannelRef?: Maybe<Reference>;
    discountedPricePerQuantity: Array<DiscountedLineItemPriceForQuantity>;
    lineItemMode: LineItemMode;
    priceMode: LineItemPriceMode;
    custom?: Maybe<CustomFieldsType>;
    shippingDetails?: Maybe<ItemShippingDetails>;
    inventoryMode?: Maybe<ItemShippingDetails>;
};

References: Scalars, Maybe, LocalizedString, ProductTypeDefinition, Reference, ProductVariant, ProductPrice, TaxedItemPrice, Money, ItemState, TaxRate, Channel, DiscountedLineItemPriceForQuantity, LineItemMode, LineItemPriceMode, CustomFieldsType, ItemShippingDetails