Skip to main content
Updates which sellers are allowed to sell in a product category by creating and removing seller–category links in one call — the mechanism behind restricted categories. Triggered by POST /admin/product-categories/:id/sellers. No events are emitted.

Usage

import { linkSellersToProductCategoryWorkflow } from "@mercurjs/core/workflows"

await linkSellersToProductCategoryWorkflow(container).run({
  input: {
    id: "pcat_01H...",
    add: ["sel_01H..."],
    remove: ["sel_01J..."],
  },
})

Input

id
string
required
Id of the product category whose seller links are being updated.
add
string[]
Seller ids to link to the category.
remove
string[]
Seller ids to unlink from the category.

Result

result
void
Returns nothing; the links are created and removed in place.