Skip to main content
Skip to main content
You're viewing the documentation for v1, which isn't the latest Medusa version.Latest documentation

createCollections - Product Module Reference

Beta

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

createCollections(data, sharedContext?): Promise<ProductCollectionDTO[]>​

This method is used to create product collections.

Example​

const collections =
await productModuleService.createCollections([
{
title: "Summer Collection",
},
{
title: "Winter Collection",
},
])

Parameters​

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

Returns​

PromisePromise<ProductCollectionDTO[]>Required
The list of created product collections.

createCollections(data, sharedContext?): Promise<ProductCollectionDTO>​

This method is used to create a product collection.

Example​

const collection =
await productModuleService.createCollections({
title: "Summer Collection",
})

Parameters​

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

Returns​

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