When multiple shipping addresses are set for a Line Item, use the Remove LineItem and Add LineItem update action to change the shipping details. Since it is not possible for the API to infer how the overall change in the Line Item quantity should be distributed over the sub-quantities, the shippingDetails field is kept in its current state to avoid data loss.

To change the Line Item quantity and shipping details together,
use this update action in combination with the [Set LineItemShippingDetails](ctp:api:type:CartSetCustomLineItemShippingDetailsAction) update action
in a single Cart update command.

The [LineItem](ctp:api:type:LineItem) price is set as described in [LineItem Price selection](ctp:api:type:LineItemPriceSelection).
interface MyCartChangeLineItemQuantityAction {
    action: "changeLineItemQuantity";
    externalPrice?: _Money;
    externalTotalPrice?: ExternalLineItemTotalPrice;
    lineItemId: string;
    quantity: number;
}

Properties

action: "changeLineItemQuantity"
externalPrice?: _Money

Sets the LineItem price to the given value when changing the quantity of a Line Item with the ExternalPrice LineItemPriceMode.

The LineItem price is updated as described in LineItem Price selection.
externalTotalPrice?: ExternalLineItemTotalPrice

Sets the LineItem price and totalPrice to the given value when changing the quantity of a Line Item with the ExternalTotal LineItemPriceMode.

lineItemId: string

id of the LineItem to update.

quantity: number

New value to set.

If `0`, the Line Item is removed from the Cart.

Generated using TypeDoc