Alokai

updateCart

Updates the customer's ID associated to the cart.

This method sends a POST request to the updateCart endpoint of the Vue Storefront API Middleware. In turn, it receives data from the updateCart endpoint exposed by the BigCommerce API

Signature

declare function updateCart(
	props: UpdateCartParameters,
	options?: MethodOptions
): Promise<UpdateCartResponse>;

Parameters

NameRequiredTypeDescription
propsRequiredUpdateCartParametersParameter object which can be used with this method. Refer to its type definition to learn about possible properties.
optionsOptionalMethodOptions

Returns

Returns a response with the cart object used in storefront cart responses.

Referenced Types

Examples

Updating a customer ID associated to the cart.

import { sdk } from '~/sdk.config.ts';

const updateCartResponse = await sdk.bigcommerce.updateCart({
  id: '7c3ab631-782c-4747-8ccc-873e87de5152',
  data: {
    customer_id: 24346
  }
})

On this page