The data model is
Offer (id prefix offer), resolved with MercurModules.OFFER from @mercurjs/types. A store never owns a product. Two stores selling the same variant each hold their own offer.Key features
The Offer module covers everything a store needs to sell a catalog variant:- Per-store listings: an offer points at one master variant, with a SKU that’s unique within its store
- Offer-scoped pricing: price rows sit on the variant’s shared price set, each tagged with an
offer_idprice rule - Offer-scoped inventory: inventory items link to the offer, not the variant, so stock never mixes between stores
- Conditions: operators define conditions such as
neworrefurbished, and stores list offers under the active ones - Per-offer shipping: each offer names the store’s own shipping profile
- Order attribution: cart and order line items link to the offer that was bought
- Hooks and events: every workflow exposes hooks and emits
offer.*events for your own side effects
How it works
An offer moves through the marketplace in four steps:- A store runs
createOffersWorkflowagainst a master variant, with a SKU, prices, inventory items, and a shipping profile. - The workflow writes the prices onto the variant’s price set with an
offer_idrule and creates inventory items linked to the offer. - When a shopper adds the offer to a cart, the line item links to the offer and pricing resolves the offer’s own rows.
- At checkout the order line item keeps the offer link, so the right store fulfills the item and gets paid.
Get started
Learn how offers, prices, stock, and shipping fit together.What is an offer
The offer record, its SKU rules, and offer conditions.
Pricing & inventory
Prices on the shared price set and stock linked to the offer.
Shipping
How an offer ships with its store’s shipping profile.
Examples
Build against offers in your own server code.Create an offer
Run
createOffersWorkflow from an API route.Bulk-create offers
List a store’s catalog in a single run.
Manage offer inventory
Attach, update, and detach inventory items on an offer.
Resources
The data models, links, workflows, service methods, and events behind offers.Data models
Offer and OfferCondition, field by field.Links
How offers link to stores, catalog, pricing, inventory, and orders.
Workflows
Offer, price, inventory, and condition workflows with their hooks.
Service
Module service methods for reading and writing records directly.
Events
Events emitted as offers and conditions change.