updateCartItem
Updates an existing product in the the cart.
It receives data from the updateCartItem endpoint exposed by the BigCommerce API
Signature
declare function updateCartItem(
context: BigcommerceIntegrationContext,
params: UpdateLineItemParameters
): Promise<UpdateLineItemResponse>;Parameters
| Name | Required | Type | Description |
|---|---|---|---|
context | Required | BigcommerceIntegrationContext | |
params | Required | UpdateLineItemParameters |
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
Updating a line item in the cart
import { sdk } from '~/sdk.config.ts';
const updateCartItem = await sdk.bigcommerce.updateCartItem({
cartId: '7c3ab631-782c-4747-8ccc-873e87de5152',
itemId: 'bd64d491-a4ac-4839-9fc2-5fc9f95a3bfd'
data: {
line_items:[{
quantity: 2,
product_id: 77
}]
}
})