createOptions - Product Module Reference
BetaThis documentation provides a reference to the createOptions method. This belongs to the Product Module.
This method is used to create product options.
Example
import {
initialize as initializeProductModule,
} from "@medusajs/product"
async function createProductOption (title: string, productId: string) {
const productModule = await initializeProductModule()
const productOptions = await productModule.createOptions([
{
title,
product_id: productId
}
])
// do something with the product options or return them
}
Parameters
The product options to be created.
sharedContext
ContextA context used to share resources, such as transaction manager, between the application and the module.
sharedContext
ContextReturns
The list of created product options.
Was this section helpful?