Skip to main content
Run linkSellersToProductWorkflow to change which stores can see and sell a master product. Use it for exclusive ranges, authorized resellers, or to restrict a store’s own submission after review.

Before you begin

Know how the list behaves before you change it:
  • Empty list: every store can sell the product
  • One or more stores: only those stores can sell it
Read the store allowlist for where Mercur enforces it.

Change a product’s allowlist

1

Add a route that runs the workflow

The workflow takes the product id and optional add and remove arrays of seller ids. It writes and deletes product_seller rows in one run.
src/api/admin/exclusive-products/[id]/route.ts
If a step fails, the workflow undoes the rows it already changed.
2

Check the result

Read the product’s sellers to confirm the new list.
product.sellers holds every store on the list. An empty array means the product is open to all stores.

Open a product to every store again

Remove every store on the list. Read the current stores first, then pass all of them in remove.
The product now has no product_seller rows, so every store can see and sell it once it’s published.

Check the allowlist before creating offers

createOffersWorkflow doesn’t read the allowlist. If your code creates offers for stores, read the product’s sellers as shown above and check that the store may sell it first.
allowed is true when the list is empty or names the store. Removing a store from the list later doesn’t delete the offers it already has. linkSellersToProductCategoryWorkflow writes the category_seller link with the same input shape.
Mercur doesn’t filter products by this link. Run validateSellerProductPermissionsStep in your own workflow if you want linked stores blocked from a category.

Next steps