Skip to main content
Skip to main content

createTags - Product Module Reference

Beta

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

This method is used to create product tags.

Example

import {
initialize as initializeProductModule,
} from "@medusajs/product"

async function createProductTags (values: string[]) {
const productModule = await initializeProductModule()

const productTags = await productModule.createTags(
values.map((value) => ({
value
}))
)

// do something with the product tags or return them
}

Parameters

dataCreateProductTagDTO[]Required
The product tags to create.
sharedContextContext
A context used to share resources, such as transaction manager, between the application and the module.

Returns

PromisePromise<ProductTagDTO[]>Required
The list of product tags.
Was this section helpful?