Skip to main content
Skip to main content

create - Cart Module Reference

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

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

This method creates carts.

Example

const carts = await cartModuleService.create([
{
currency_code: "usd",
},
{
currency_code: "eur",
},
])

Parameters

dataCreateCartDTO[]Required
The carts to be created.
sharedContextContext
A context used to share resources, such as transaction manager, between the application and the module.

Returns

PromisePromise<CartDTO[]>Required
The created carts.

create(data, sharedContext?): Promise<CartDTO>

This method creates a cart.

Example

const cart = await cartModuleService.create({
currency_code: "usd",
})

Parameters

dataCreateCartDTORequired
The cart to be created.
sharedContextContext
A context used to share resources, such as transaction manager, between the application and the module.

Returns

PromisePromise<CartDTO>Required
The created cart.
Was this section helpful?