Skip to main content
Updates which sellers are eligible for a master product by creating and removing product_seller links in one call. Triggered by POST /admin/products/:id/sellers. No events are emitted and the product record itself is untouched.

Usage

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

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

Input

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

Result

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