The offer record
TheOffer data model (table offer, id prefix offer) is a thin row that points at catalog records by id. Prices and inventory aren’t columns on it: they attach through module links.
The row carries these groups of fields:
- Ownership:
seller_idis the store, andcreated_byis the member who created the offer - Catalog pointers:
variant_idandproduct_id, whereproduct_idis read from the variant when the offer is created - Identity:
sku, plus optionaleanandupcbarcodes copied from the variant when you leave them out - Selling terms:
shipping_profile_id,manage_inventory(defaulttrue),allow_backorder(defaultfalse), andleadtime_to_ship - Condition: an optional
condition_idthat points at anOfferCondition
seller resolves through the offer_seller link table, which createOffersWorkflow writes next to seller_id; product_variant resolves through a read-only link on variant_id.
Offers and master products
A master variant can back any number of offers. Each store that sells the variant holds its own offer, and the variant itself never changes when a store lists, prices, or stocks it. The same store can also list a variant more than once, for example a new and a refurbished copy. The module doesn’t limit offers per variant. The only uniqueness rule is the SKU.Offer conditions
An offer condition describes the physical state an offer is sold in. Operators manage conditions, and stores pick one when they create or update an offer. TheOfferCondition model (id prefix ofcond) has a unique code, a display label, an is_active flag, and a rank that orders the list. The create and update workflows check every condition_id they receive:
- Unknown id: the run fails with a not found error
- Inactive condition: the run fails, so a deactivated condition can’t be assigned to new or edited offers
- Condition in use:
deleteOfferConditionsWorkflowrefuses to delete a condition while any offer still uses it
Grouping offers by store
A store’s offers on one product usually mirror that product’s variants. The service can collapse them into one row per product and store. When you passgroup_by_seller: true to listOffers or listAndCountOffers, the service returns the newest offer of each (product_id, seller_id) group and sets two computed fields on it:
variant_count: how many offers the store has on that productoffer_ids: the ids of all offers in the group
product_id and seller_id filters apply in grouped mode.