Home > @shopware-pwa/shopware-6-client > changeCartItemQuantity

# changeCartItemQuantity() function

This API is provided as a preview for developers and may change based on feedback that we receive. Do not use this API in a production environment.

Changes the current quantity in specific cart line item to given quantity.

Example: If current quantity is 3 and you pass 2 as quantity parameter, you will get a new cart's state with quantity 2.

Signature:

export declare function changeCartItemQuantity(itemId: string, newQuantity?: number, contextInstance?: ShopwareApiInstance): Promise<Cart>;

# Parameters

Parameter Type Description
itemId string
newQuantity number
contextInstance ShopwareApiInstance

Returns:

Promise<Cart>

# Exceptions

ClientApiError