updateVariants - Product Module Reference
BetaThis documentation provides a reference to the updateVariants method. This belongs to the Product Module.
This method is used to update a product's variants.
Example
import {
initialize as initializeProductModule,
} from "@medusajs/product"
import {
UpdateProductVariantDTO
} from "@medusajs/product/dist/types/services/product-variant"
async function updateProductVariants (items: UpdateProductVariantDTO[]) {
const productModule = await initializeProductModule()
const productVariants = await productModule.updateVariants(items)
// do something with the product variants or return them
}
Parameters
The product variants to update.
Returns
The updated product variants's details.
Was this section helpful?