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
Change a product’s allowlist
1
Add a route that runs the workflow
The workflow takes the product If a step fails, the workflow undoes the rows it already changed.
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
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 inremove.
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.
Link stores to a category
linkSellersToProductCategoryWorkflow writes the category_seller link with the same input shape.
validateSellerProductPermissionsStep in your own workflow if you want linked stores blocked from a category.
Next steps
- Create a master product with
seller_idsset from the start - Create an offer for an allowed store
- Links reference for the
product_sellerandcategory_sellerdefinitions