removeCartItem
Removes a product from the cart.
This method sends a POST request to the removeCartItem endpoint of the Vue Storefront API Middleware. In turn, it receives data from the removeCartItem endpoint exposed by the BigCommerce API
Signature
declare function removeCartItem(
props: RemoveLineItemParameters,
options?: MethodOptions
): Promise<RemoveLineItemResponse>;Parameters
| Name | Required | Type | Description |
|---|---|---|---|
props | Required | RemoveLineItemParameters | Parameter object which can be used with this method. Refer to its type definition to learn about possible properties. |
options | Optional | MethodOptions |
Returns
Returns a response of a cart that contains a collection of items, prices, discounts, etc. It does not contain customer-related data.
Referenced Types
Examples
Removiing a line item from the cart
import { sdk } from '~/sdk.config.ts';
const removeCartItemResponse = await sdk.bigcommerce.removeCartItem({
data: {
cartId: '7c3ab631-782c-4747-8ccc-873e87de5152',
itemId: 'bd64d491-a4ac-4839-9fc2-5fc9f95a3bfd'
}
})