CartItem

interface CartItem { id: number; packageId: number; originalPackageId?: number; quantity: number; price: number; image: string | undefined; title: string; sku: string | undefined; is_upsell: boolean | undefined; price_per_unit?: string; qty?: number; price_total?: string; price_retail?: string; price_retail_total?: string; price_recurring?: string; price_recurring_total?: string; unit_price?: string; original_unit_price?: string; package_price?: string; original_package_price?: string; total?: string; total_discount?: string; discounts?: { offer_id: number; amount: string; description?: string; name?: string }[]; is_recurring?: boolean; interval?: string | null; interval_count?: number | null; productId?: number; productName?: string; variantId?: number; variantName?: string; variantAttributes?: { code: string; name: string; value: string }[]; variantSku?: string; groupedItemIds?: number[]; selectorId?: string; properties?: Record<string, string>; }

Source: global.ts:940

One line in the cart — a package the shopper has added, plus every price and product detail the SDK tracks for it. This is the raw stored shape; for the display-ready version with a full pricing breakdown see EnrichedCartLine.


Properties

id: number

Unique cart line ID returned by the API.

packageId: number

The campaign package ref_id for this item.

originalPackageId: number

Original package ID before any variant swap was applied.

quantity: number

Number of packages in the cart (not units — see qty for units per package).

price: number

Total package price as a raw number (mirrors price_total from the campaign). Used for calculations.

image: string | undefined

Product image URL.

title: string

Package display name.

sku: string | undefined

Product SKU.

is_upsell: boolean | undefined

true when this item was added via a post-purchase upsell, not a regular add-to-cart.

price_per_unit: string

Per-unit price as a formatted string (matches price from the campaign API).

qty: number

Number of product units included in this package (matches qty from the campaign API).

price_total: string

Total package price as a formatted string (matches price_total from the campaign API).

price_retail: string

Per-unit retail/compare-at price as a formatted string.

price_retail_total: string

Total retail/compare-at price as a formatted string.

price_recurring: string

Recurring per-unit price string. Present when is_recurring is true.

price_recurring_total: string

Total recurring price string.

unit_price: string

Per-unit price after offer discounts.

original_unit_price: string

Per-unit price before offer discounts.

package_price: string

Total package price after offer discounts.

original_package_price: string

Total package price before offer discounts.

total: string

Total line amount as a formatted string.

total_discount: string

Total discount amount for this line as a formatted string.

discounts: { offer_id: number; amount: string; description?: string; name?: string }[]

Offer discounts applied to this line.

is_recurring: boolean

true for subscription/recurring items. Check interval and interval_count for billing cycle details.

interval: string | null

Billing interval for recurring items ('day' or 'month').

interval_count: number | null

Number of intervals between billing cycles (e.g. 3 with interval: 'month' = every 3 months).

productId: number

Associated product ID.

productName: string

Associated product display name.

variantId: number

Product variant ID.

variantName: string

Product variant display name.

variantAttributes: { code: string; name: string; value: string }[]

Variant attribute values (e.g. [{ code: 'color', name: 'Color', value: 'Red' }]).

variantSku: string

Variant SKU.

groupedItemIds: number[]

IDs of other cart items grouped with this one (bundle support).

selectorId: string

Selector ID this item belongs to (set by BundleSelectorEnhancer via data-next-selector-id).

properties: Record<string, string>

Custom key-value properties for this line item. Two items with the same packageId but different properties are treated as separate lines.