Events Reference
This document details all events in Medusa, when they are triggered, and what data your handler function will receive when the event is triggered.
Prerequisites
It is assumed you’re already familiar with Subscribers in Medusa and how to listen to events. You can then use the name of events from this documentation in your subscriber to listen to events.
Legend
Events in this document are listed under the entity they’re associated with. They’re listed in a table of three columns:
- Event Name: The name you use to subscribe a handler for the event.
- Description: When this event is triggered.
- Event Data Payload: The data your handler receives as a parameter.
Batch Jobs Events
This section holds all events related to batch jobs.
Event Name | Description | Event Data Payload |
---|---|---|
| Triggered when a batch job is created. | Object of the following format: |
| Triggered when a batch job is updated. | Object of the following format: |
| Triggered when a batch job is canceled. | Object of the following format: |
| Triggered after the | Object of the following format: |
| Triggered after the batch job is done pre-processing and the batch job is not in dry-run mode. | Object of the following format: |
| Triggered when a batch job starts processing after it's confirmed. | Object of the following format: |
| Triggered when a batch job is done processing and is completed. | Object of the following format: |
| Triggered when an error occurs while running a batch job and the batch job fails. | Object of the following format: |
Cart Events
This section holds all events related to a cart.
Event Name | Description | Event Data Payload |
---|---|---|
| Triggered when a cart is associated with a different email than it was already associated with, or if a customer logs in after adding items to their cart as a guest. | The cart ID passed as a string parameter. |
| Triggered when a cart is created. | Object of the following format: |
| Triggered when a cart and data associated with it (payment sessions, shipping methods, user details, etc…) are updated. | An object with at least the ID of the cart, however, in most cases the entire cart model is available. You can refer to the Cart entity for an idea of what fields to expect. |
Claim Events
This section holds all events related to claims.
Event Name | Description | Event Data Payload |
---|---|---|
| Triggered when a claim is created. | Object of the following format: |
| Triggered when a claim is updated. | Object of the following format: |
| Triggered when a claim is canceled. | Object of the following format: |
| Triggered when fulfillment is created for a claim. | Object of the following format: |
| Triggered when a claim fulfillment is set as “shipped”. | Object of the following format: |
| Triggered when a claim of type “refunded” has been refunded. | Object of the following format: |
Claim Item Events
This section holds all events related to claim items.
Event Name | Description | Event Data Payload |
---|---|---|
| Triggered when claim items are created and associated with a claim. This happens during the creation of claims. | Object of the following format: |
| Triggered when a claim item is updated. This happens when a claim is updated. | Object of the following format: |
| Triggered when a claim is canceled. | Object of the following format: |
Currency Events
This section holds all events related to currencies.
Event Name | Description | Event Data Payload |
---|---|---|
| Triggered when a currency is updated. | Object of the following format: |
Customer Events
This section holds all events related to customers.
Event Name | Description | Event Data Payload |
---|---|---|
| Triggered when a customer is created. | The entire customer passed as an object. You can refer to the Customer entity for an idea of what fields to expect. |
| Triggered when a customer is updated including their information or password, or when a customer account is created that is associated with an existing email (for example, if a customer placed an order with their email as a guest, then created an account with that email). | The entire customer passed as an object. You can refer to the Customer entity for an idea of what fields to expect. |
| Triggered when a customer requests to reset their password. | Object of the following format: |
Draft Order Events
This section holds all events related to draft orders.
Event Name | Description | Event Data Payload |
---|---|---|
| Triggered when a draft order is created. | Object of the following format: |
| Triggered when a draft order and data associated with it (email, billing address, discount, etc…) are updated. | Object of the following format: |
Gift Card Events
This section holds all events related to gift cards.
Event Name | Description | Event Data Payload |
---|---|---|
| Triggered when a gift card is created. | Object of the following format: |
Inventory Item Events
This section holds all events related to inventory items.
Event Name | Description | Event Data Payload |
---|---|---|
| Triggered when an inventory item is created. | Object of the following format: |
| Triggered when an inventory item is updated. | Object of the following format: |
| Triggered when an inventory item is deleted. | Object of the following format: |
Inventory Level Events
This section holds all events related to inventory levels.
Event Name | Description | Event Data Payload |
---|---|---|
| Triggered when an inventory level is created. | Object of the following format: |
| Triggered when an inventory level is updated. | Object of the following format: |
| Triggered when an inventory level is deleted, which can be done either directly using its ID or based on the ID of a location. The returned ID depends on how the inventory level was deleted. | Object of the following format: |