The master products model
Aproduct row is a shared catalog entry — it has no owner column. Three rules follow:
- Selling eligibility is a separate allowlist: the
product_sellerlink. One or more rows restrict the product to those sellers; zero rows mean the product is unrestricted. - Creator attribution lives on the change record (
product_change.created_byplus aPRODUCT_ADDaction), and is used only for scoping vendor list views — a seller sees products they created, plus published products not restricted to other sellers. - Edits are requests. Vendor product update endpoints stage a change instead of writing directly; there is no ownership gate on requesting a change.
Data models
ProductChange
Table product_change, ID prefix prodch.
| Field | Type | Notes |
|---|---|---|
product_id | text | Target product |
status | enum | ProductChangeStatus, default pending |
created_by | text | Nullable; requesting actor |
internal_note / external_note | text | Nullable |
confirmed_by / confirmed_at | text / dateTime | Nullable; audit trail |
declined_by / declined_at / declined_reason | text / dateTime / text | Nullable |
canceled_by / canceled_at | text / dateTime | Nullable |
requires_action_by / requires_action_at / requires_action_reason | text / dateTime / text | Nullable; “changes requested” state |
metadata | json | Nullable |
actions (one-to-many, deleted with the change).
ProductChangeAction
Table product_change_action, ID prefix prodchact. The ordered operations a change applies:
| Field | Type | Notes |
|---|---|---|
product_id | text | |
ordering | autoincrement | Apply order |
action | text | Operation type (e.g. PRODUCT_ADD, update, variant, attribute operations) |
details | json | Default {}; the operation payload |
applied | boolean | Default false |
internal_note | text | Nullable |
Enums
Links
| Link | Purpose |
|---|---|
changes (read-only) | Product → its change records via product_id |
Service
ProductChangeModuleService extends MedusaService with auto-generated CRUD only — the lifecycle logic lives in workflows: createProductChangeWorkflow, stageProductChangeWorkflow, confirmProductChangeWorkflow, autoConfirmProductChangeWorkflow, cancelProductChangeWorkflow, rejectProductChangeWorkflow, and the applyProductChangeActionsWorkflow family that replays the staged actions onto the product. See Workflows.
Related endpoints
- Vendor:
POST /vendor/products/:idand variant/attribute sub-routes stage changes;GET /vendor/products/:id/previewshows the product with pending changes applied;POST /vendor/products/:id/cancelwithdraws a request. - Admin:
GET /admin/products/:id/preview,POST /admin/products/:id/confirm,POST /admin/products/:id/reject,POST /admin/products/:id/request-changes, plusPOST /admin/product-changes/:id/confirmand/cancel.