Back to Medusa

Customer Module Events Reference

www/apps/resources/references/module_events/module_events.Customer/page.mdx

2.14.23.4 KB
Original Source

import { TypeList } from "docs-ui"

Customer Module Events Reference

This reference shows all the events emitted by the Medusa application related to the Customer Module. If you use the module outside the Medusa application, these events aren't emitted.

Summary

<Table> <Table.Header> <Table.Row> <Table.HeaderCell> Event </Table.HeaderCell> <Table.HeaderCell> Description </Table.HeaderCell> </Table.Row> </Table.Header> <Table.Body> <Table.Row> <Table.Cell> [customer.created](#customercreated) </Table.Cell> <Table.Cell> Emitted when a customer is created. </Table.Cell> </Table.Row> <Table.Row> <Table.Cell> [customer.updated](#customerupdated) </Table.Cell> <Table.Cell> Emitted when a customer is updated. </Table.Cell> </Table.Row> <Table.Row> <Table.Cell> [customer.deleted](#customerdeleted) </Table.Cell> <Table.Cell> Emitted when a customer is deleted. </Table.Cell> </Table.Row> </Table.Body> </Table>

<EventHeader headerLvl="2" headerProps={{ id: "customercreated", children: (<>customer.created</>), className: "flex flex-wrap justify-center gap-docs_0.25" }} eventName="customer.created" payload={\``ts { id, // The ID of the customer } ````} />

Emitted when a customer is created.

Payload

ts
{
  id, // The ID of the customer
}

Workflows Emitting this Event

The following workflows emit this event when they're executed. These workflows are executed by Medusa's API routes. You can also view the events emitted by API routes in the Store and Admin API references.


<EventHeader headerLvl="2" headerProps={{ id: "customerupdated", children: (<>customer.updated</>), className: "flex flex-wrap justify-center gap-docs_0.25" }} eventName="customer.updated" payload={\``ts { id, // The ID of the customer } ````} />

Emitted when a customer is updated.

Payload

ts
{
  id, // The ID of the customer
}

Workflows Emitting this Event

The following workflows emit this event when they're executed. These workflows are executed by Medusa's API routes. You can also view the events emitted by API routes in the Store and Admin API references.


<EventHeader headerLvl="2" headerProps={{ id: "customerdeleted", children: (<>customer.deleted</>), className: "flex flex-wrap justify-center gap-docs_0.25" }} eventName="customer.deleted" payload={\``ts { id, // The ID of the customer } ````} />

Emitted when a customer is deleted.

Payload

ts
{
  id, // The ID of the customer
}

Workflows Emitting this Event

The following workflows emit this event when they're executed. These workflows are executed by Medusa's API routes. You can also view the events emitted by API routes in the Store and Admin API references.