Skip to main content
Skip to main content

deleteCategory - Product Module Reference

Beta

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

This method is used to delete a product category by its ID.

Example

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

async function deleteCategory (id: string) {
const productModule = await initializeProductModule()

await productModule.deleteCategory(id)
}

Parameters

categoryIdstringRequired
The ID of the product category to delete.
sharedContextContext
A context used to share resources, such as transaction manager, between the application and the module.

Returns

PromisePromise<void>Required
Resolves when the product category is successfully deleted.
Was this section helpful?