Product and Mercur’s Seller, stored in the product_seller table. Use it for exclusive ranges, brand-authorized resellers, or products only certain stores may carry.
Open by default, restricted by rows
A product’s allowlist has two states, and the number ofproduct_seller rows decides which one applies. An empty allowlist doesn’t block anyone: it means every store can sell the product.
Adding the first store to a product’s allowlist closes it to every other store. Removing the last store opens it to all stores again.
Read a product’s allowlist
The link exposes the stores under thesellers alias on a product. Read it with query.graph:
sellers array means the product is open to every store. You can also query the link table directly as the product_seller entity, with product_id and seller_id fields.
Where Mercur enforces it
Mercur applies the allowlist when it scopes a store’s view of the catalog. These vendor reads hide a published product restricted to other stores:- Product list and detail: the product returns
404for a store not on its list - Variant list: variants of restricted products are filtered out
- Product variants under a product: blocked with the product itself
draft and proposed submissions, whatever their allowlist. The admin API and the Store API don’t filter by allowlist.
How stores get on the list
Mercur writesproduct_seller rows in two places:
- On create:
createProductsWorkflowlinks every id in a product’sseller_idsinput - Afterwards:
linkSellersToProductWorkflowadds and removes stores in one run
seller_ids, so a store’s own submission starts open to every store. An operator restricts it with linkSellersToProductWorkflow. Removing a store from the list doesn’t touch the offers it already created.
The category_seller link
Categories have a second link to stores,category_seller, between ProductCategory and Seller with the sellers alias on a category. linkSellersToProductCategoryWorkflow writes it.
No shipped route or workflow reads the link to filter products. Mercur exports validateSellerProductPermissionsStep, which throws Seller is restricted from categories when the seller is linked to any of the category ids you pass. Add that step to your own workflow if you treat the link as a category block list.
Related
- Allowlist stores to manage the list from your code
- Master products for what a store sees by default
- Links reference for every link on products and categories