For Product Variant identification, either the productId and variantId, or sku must be provided.

interface LineItemDraft {
    addedAt?: string;
    custom?: CustomFieldsDraft;
    distributionChannel?: ChannelResourceIdentifier;
    externalPrice?: _Money;
    externalTaxRate?: ExternalTaxRateDraft;
    externalTotalPrice?: ExternalLineItemTotalPrice;
    inventoryMode?: string;
    key?: string;
    perMethodExternalTaxRate?: MethodExternalTaxRateDraft[];
    productId?: string;
    quantity?: number;
    shippingDetails?: ItemShippingDetailsDraft;
    sku?: string;
    supplyChannel?: ChannelResourceIdentifier;
    variantId?: number;
}

Properties

addedAt?: string

Date and time (UTC) the Product Variant is added to the Cart. If not set, it defaults to the current date and time.

Optional for backwards compatibility reasons.

Custom Fields for the Line Item.

distributionChannel?: ChannelResourceIdentifier

Used to select a Product Price. The referenced Channel must have the ProductDistribution ChannelRoleEnum.

If the Cart is bound to a [Store](ctp:api:type:Store) with `distributionChannels` set,
the Channel must match one of the Store's distribution channels.
externalPrice?: _Money

Sets the LineItem price value, and the priceMode to ExternalPrice LineItemPriceMode.

externalTaxRate?: ExternalTaxRateDraft

Sets the external Tax Rate for the Line Item, if the Cart has the External TaxMode and Single ShippingMode.

externalTotalPrice?: ExternalLineItemTotalPrice

Sets the LineItem price and totalPrice values, and the priceMode to ExternalTotal LineItemPriceMode.

inventoryMode?: string

Inventory mode specific to the Line Item only, and valid for the entire quantity of the Line Item. Set only if the inventory mode should be different from the inventoryMode specified on the Cart.

key?: string

User-defined unique identifier of the LineItem.

perMethodExternalTaxRate?: MethodExternalTaxRateDraft[]

Sets the external Tax Rates for individual Shipping Methods, if the Cart has the External TaxMode and Multiple ShippingMode.

productId?: string

id of a published Product.

quantity?: number

Quantity of the Product Variant to add to the Cart.

shippingDetails?: ItemShippingDetailsDraft

Container for Line Item-specific addresses.

sku?: string

sku of the ProductVariant.

Used to identify Inventory entries that must be reserved. The referenced Channel must have the InventorySupply ChannelRoleEnum.

variantId?: number

id of the ProductVariant in the Product. If not provided, the Master Variant is used.