Skip to main content
The Product Edit module service, ProductChangeModuleService, reads and writes ProductChange and ProductChangeAction records directly. It’s a plain MedusaService with generated methods only, and no custom methods. Use it in subscribers, scheduled jobs, and workflow steps.

Resolve the service

Resolve the service from the Medusa container with MercurModules.PRODUCT_EDIT:
This returns the first 20 pending changes on a product, with their actions, and the total count. For a typed handle, import the class with import type { ProductChangeModuleService } from "@mercurjs/core/modules/product-edit" and pass it as the resolve generic.

ProductChange methods

Medusa generates these methods for the ProductChange model:

ProductChangeAction methods

The same set exists for ProductChangeAction:

When to use a workflow instead

The service writes rows and nothing else. Setting status to confirmed through updateProductChanges doesn’t apply the actions, stamp confirmed_at, emit product-change.confirmed, or run the hooks.
Use the workflows for any status change. Keep the service for reads and for fields with no side effects, such as metadata.