> ## 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 Order Group domain, for subscribers and side effects.

The Order Group domain emits an event when a group is created during checkout.
Subscribe to it to run side effects such as sending an order confirmation,
syncing external systems, or kicking off follow-up workflows, instead of polling.

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

export default async function orderGroupCreatedHandler({
  event,
  container,
}: SubscriberArgs<{ id: string }>) {
  const orderGroupId = event.data.id
  // ...send a confirmation, notify sellers, etc.
}

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

## Order group events

| Event                 | Emitted when                                    | Payload  |
| --------------------- | ----------------------------------------------- | -------- |
| `order_group.created` | A cart is split and its parent group is created | `{ id }` |

<Note>
  The same checkout split also emits `order.placed` for each child order created.
  Subscribe to `order.placed` when you need to react per seller order, and to
  `order_group.created` when you need the purchase as a whole.
</Note>
