ProductChange. Mercur
exposes high-level edit workflows that diff your update against the current
product and stage only the fields that actually changed.
Update product fields
productEditUpdateProductWorkflow diffs the update payload against the product
and stages an UPDATE action per changed field.
src/api/custom/edit/route.ts
If a product already has a
pending change, staging another one is rejected.
Only one active change per product is allowed. Resolve or cancel the open
change first.Stage actions directly
For finer control (variants, attributes, mixed operations), stage the actions yourself withstageProductChangeWorkflow:
Auto-confirm
Both workflows run auto-confirm after staging: with review off the change applies immediately, with review on it stayspending. Pass auto_confirm: true
to stageProductChangeWorkflow to force immediate application regardless of the
review setting.