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;
    key?: string;
    money: TypedMoney;
    name: LocalizedString;
    perMethodTaxRate: MethodTaxRate[];
    priceMode: string;
    quantity: number;
    shippingDetails?: ItemShippingDetails;
    slug: string;
    state: ItemState[];
    taxCategory?: TaxCategoryReference;
    taxRate?: TaxRate;
    taxedPrice?: TaxedItemPrice;
    taxedPricePortions: MethodTaxedPrice[];
    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.

key?: string

User-defined unique identifier of the Custom Line Item.

money: TypedMoney

Money value of the Custom Line Item.

Name of the Custom Line Item.

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.

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 or Order.

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 or Order.

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.

taxedPricePortions: MethodTaxedPrice[]

Total taxed prices based on the quantity of the Custom 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 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`.