Skip to main content

removeCartItem

Removes an item from the cart. Works for an authenticated user or a guest (see Guest mode).

Description​

Removes one product from the cart of the authenticated user, or of a guest identified by the x-guest-id header (see Guest mode). Resolves to the updated ICartResponse.

.removeCartItem(

);

Parameters schema​

Schema

productId(required): number
Product ID.
example: 12345

Examples​

Minimal example​

const response = await Users.removeCartItem(12345);

Example response​

{
"items": [],
"total": 0
}

Response schema​

Schema: ICartResponse

items: ICartItem[]
Items in the cart.

items.productId: number
Product ID.
example: 1

items.qty: number
Quantity of the product in the cart.
example: 2

items.addedAt: string
Date and time the item was added, in ISO 8601 format.
example: "2026-05-30T10:00:00.000Z"

total: number
Number of distinct products in the cart, not the sum of qty.
example: 3