Skip to main content
Skip to main content

update - Cart Module Reference

This documentation provides a reference to the update method. This belongs to the Cart Module.

update(data): Promise<CartDTO[]>

This method updates existing carts.

Example

const carts = await cartModuleService.update([
{
id: "cart_123",
region_id: "reg_123",
},
{
id: "cart_321",
customer_id: "cus_123",
},
])

Parameters

dataUpdateCartDTO[]Required
The attributes to update in the carts.

Returns

PromisePromise<CartDTO[]>Required
The updated carts.

update(cartId, data, sharedContext?): Promise<CartDTO>

This method updates an existing cart.

Example

const cart = await cartModuleService.update("cart_123", {
region_id: "reg_123",
})

Parameters

cartIdstringRequired
The cart's ID.
dataUpdateCartDataDTORequired
The attributes to update in the cart data.
sharedContextContext
A context used to share resources, such as transaction manager, between the application and the module.

Returns

PromisePromise<CartDTO>Required
The updated cart.

update(selector, data, sharedContext?): Promise<CartDTO[]>

This method updates existing carts matching the specified filters.

Example

const carts = await cartModuleService.update(
{
currency_code: "usd",
},
{
region_id: "reg_123",
}
)

Parameters

selectorPartial<CartDTO>Required
The filters that specify which carts to update.
dataUpdateCartDataDTORequired
The attributes to update in the carts.
sharedContextContext
A context used to share resources, such as transaction manager, between the application and the module.

Returns

PromisePromise<CartDTO[]>Required
The updated carts.
Was this section helpful?