Skip to main content
Skip to main content

create - Product Module Reference

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

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

This method is used to create a list of products.

Example

const products = await productModuleService.create([
{
title: "Shirt",
},
{
title: "Pants",
handle: "pants",
},
])

Parameters

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

Returns

PromisePromise<ProductDTO[]>Required
The list of created products.

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

This method is used to create a product.

Example

const product = await productModuleService.create({
title: "Shirt",
})

Parameters

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

Returns

PromisePromise<ProductDTO>Required
The created product.
Was this section helpful?