> ## Documentation Index
> Fetch the complete documentation index at: https://docs.mercurjs.com/llms.txt
> Use this file to discover all available pages before exploring further.

# Event reference

> Events emitted by the Offer domain, for subscribers and side effects.

The Offer domain emits events as offers change. Subscribe to them to run side
effects instead of polling, such as re-indexing search, syncing external
systems, or kicking off follow-up workflows.

```ts title="src/subscribers/offer-created.ts" theme={null}
import type { SubscriberArgs, SubscriberConfig } from "@medusajs/framework"

export default async function offerCreatedHandler({
  event,
  container,
}: SubscriberArgs<{ id: string; product_id: string }>) {
  const offerId = event.data.id
  // ...re-index the offer, notify the store, etc.
}

export const config: SubscriberConfig = {
  event: "offer.created",
}
```

## Offer events

| Event           | Emitted when                                      | Payload              |
| --------------- | ------------------------------------------------- | -------------------- |
| `offer.created` | An offer is created                               | `{ id, product_id }` |
| `offer.updated` | An offer's row, prices, or inventory links change | `{ id, product_id }` |
| `offer.deleted` | An offer is deleted                               | `{ id, product_id }` |

<Note>
  `createOffersWorkflow` and `updateOffersWorkflow` emit one event per affected
  offer. `batchOfferInventoryItemsWorkflow` emits `offer.updated` with a single
  `{ id }` payload for the batched offer.
</Note>
