JavaScript
import Medusa from "@medusajs/js-sdk" export const sdk = new Medusa({ baseUrl: import.meta.env.VITE_BACKEND_URL || "/", debug: import.meta.env.DEV, auth: { type: "session", }, }) sdk.admin.productCategory.delete("pcat_123") .then(({ deleted }) => { console.log(deleted) })
200
Example
{ "id": "<string>", "object": "product_category", "deleted": true}
Delete a product category. This doesn’t deleted products in that category.
Bearer authentication header of the form Bearer <token>, where <token> is your auth token.
Bearer <token>
<token>
The product category's ID.
OK
The details of deleting the category.
The name of the deleted object.
Whether the product category was deleted.