Skip to main content
Skip to main content

update - Product Module Reference

Beta

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

This method is used to update a product.

Example

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

async function updateProduct (id: string, title: string) {
const productModule = await initializeProductModule()

const products = await productModule.update([
{
id,
title
}
])

// do something with the products or return them
}

Parameters

dataUpdateProductDTO[]Required
The products to be updated, each holding the attributes that should be updated in the product.
sharedContextContext
A context used to share resources, such as transaction manager, between the application and the module.

Returns

PromisePromise<ProductDTO[]>Required
The list of updated products.
Was this section helpful?