The complete open source platform to run your entire marketplace. Storefront, vendor panel, admin console, and integrations in one enterprise-grade platform you own.
TypeScript b2b-marketplacecomposable-commerceecommerceenterpriseheadless-commercemarketplacemedusamedusajsmulti-vendortypescript
---
title: "Catalog events"
sidebarTitle: "Events"
description: "The events Mercur's product workflows emit, their payloads, and how to subscribe to them."
---
Mercur's product workflows emit 4 events as products are created and reviewed. The names are exported as `ProductWorkflowEvents` from `@mercurjs/core/workflows`. Subscribe to them to notify stores, sync external systems, or reindex search.
## Product events
Each event is emitted once per product. Payloads come from the `emitEventStep` calls in `packages/core/src/workflows/product/workflows`.
| Event | Constant | Emitted when | Payload |
| --- | --- | --- | --- |
| `product.created` | `CREATED` | `createProductsWorkflow` creates a product | `{ id }` |
| `product.published` | `PUBLISHED` | `confirmProductsWorkflow` publishes a product | `{ id, internal_note? }` |
| `product.rejected` | `REJECTED` | `rejectProductWorkflow` rejects a product | `{ id, message? }` |
| `product.change-requested` | `CHANGE_REQUESTED` | `requestProductChangeWorkflow` asks for a revision | `{ id, message?, actor_id? }` |
<Warning>
Mercur's `createProductsWorkflow` runs Medusa's `createProductsWorkflow` as a step, which also emits `product.created` with `{ id }`. Expect 2 `product.created` events per product and make handlers idempotent.
</Warning>
## Subscribe to an event
Write a subscriber that listens for one of the events. This one logs the rejection reason for each rejected product.
```ts title="src/subscribers/product-rejected.ts"
import type { SubscriberArgs, SubscriberConfig } from "@medusajs/framework"
import { ProductWorkflowEvents } from "@mercurjs/core/workflows"
export default async function productRejected({
event,
container,
}: SubscriberArgs<{ id: string; message?: string }>) {
const logger = container.resolve("logger")
const reason = event.data.message ?? "no reason given"
logger.info(`Product ${event.data.id} rejected: ${reason}`)
}
export const config: SubscriberConfig = {
event: ProductWorkflowEvents.REJECTED,
}
```
Medusa calls the handler once per rejected product with the payload above.
## Events from Medusa
Medusa's own product workflows emit their events alongside Mercur's. These matter for the catalog:
- **`product.updated`**: from Medusa's `updateProductsWorkflow`, which `assignProductsToCategoryWorkflow` and the admin product update both run
- **`product.deleted`**: from Medusa's `deleteProductsWorkflow`
- **`product-variant.created`**: from `createProductVariantsWorkflow`, which Mercur's create workflow runs for `variants`
See the [Medusa events reference](https://docs.medusajs.com/resources/references/events) for the full list. Edits that stores submit through the product edit pipeline emit `product-change.*` events, listed in the [product edit events](/platform/product-edit/reference/events).