A generic item that can be added to the Cart but is not bound to a Product that can be used for discounts (negative money), vouchers, complex cart rules, additional services, or fees. You control the lifecycle of this item.

interface CustomLineItem {
    custom?: CustomFields;
    discountedPricePerQuantity: DiscountedLineItemPriceForQuantity[];
    id: string;
    money: TypedMoney;
    name: LocalizedString;
    priceMode: string;
    quantity: number;
    shippingDetails?: ItemShippingDetails;
    slug: string;
    state: ItemState[];
    taxCategory?: TaxCategoryReference;
    taxRate?: TaxRate;
    taxedPrice?: TaxedItemPrice;
    totalPrice: CentPrecisionMoney;
}

Properties

custom?: CustomFields

Custom Fields of the Custom Line Item.

discountedPricePerQuantity: DiscountedLineItemPriceForQuantity[]

Discounted price of a single quantity of the Custom Line Item.

id: string

Unique identifier of the Custom Line Item.

money: TypedMoney

Money value of the Custom Line Item.

Name of the Custom Line Item.

priceMode: string

Indicates whether Cart Discounts with a matching CartDiscountCustomLineItemsTarget are applied to the Custom Line Item.

quantity: number

Number of Custom Line Items in the Cart.

shippingDetails?: ItemShippingDetails

Container for Custom Line Item-specific addresses.

slug: string

User-defined identifier used in a deep-link URL for the Custom Line Item. It matches the pattern [a-zA-Z0-9_-]{2,256}.

state: ItemState[]

State of the Custom Line Item in the Cart.

taxCategory?: TaxCategoryReference

Used to select a Tax Rate when a Cart has the Platform TaxMode.

taxRate?: TaxRate
  • For a Cart with Platform TaxMode, the taxRate of Custom 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 Custom Line Items can be set using ExternalTaxRateDraft.
taxedPrice?: TaxedItemPrice

Automatically set after the taxRate is set.

totalPrice: CentPrecisionMoney

Total price of the Custom Line Item (money multiplied by quantity). If the Custom Line Item is discounted, the total price is discountedPricePerQuantity multiplied by quantity.

Includes taxes if the [TaxRate](ctp:api:type:TaxRate) `includedInPrice` is `true`.

Generated using TypeDoc