* Fix issue on fixed total amount discount when using includes tax (#3472) The calculation of the fixed discount amount breaks when having includes_tax setting active, due to the line item totals are incorrect and returning everything as 0, thus the totalItemPercentage will be Infinitiy due to the division by a subtotal of 0 * chore: Add missing changeset for @medusajs/medusa * feat(medusa): Improve performance of Products domain (#3417) * feat(medusa): Improve product update performances * fix tests and update * update mock repo * improve repo * cleanup * fix * cleanup + bulk emit + unit test fix * improvements * improve * fix unit tests * fix export * fix product update handler * enhance mock repo * fix import integration * fix end point tests * revert mock repo product variant * fix unit * cleanup * cleanup * address feedback * fix quotes in tests * address feedback * Create new-tips-mate.md * use types * chore: Remove integration-tests from changeset * chore(release): v1.7.14 * chore(docs): Generated Docs Announcement Bar (automated) (#3489) Co-authored-by: olivermrbl <olivermrbl@users.noreply.github.com> * fix(medusa): EventBusService.emit using Redis mock (#3491) * Fix eventBusService.emit using redis mock * revert gitignore * enqueuer * unit test add redis_url * fix test * chore(docs): Generated Services Reference (automated) (#3490) Co-authored-by: olivermrbl <olivermrbl@users.noreply.github.com> * docs: publish restructure (#3496) * docs: added features and guides overview page * added image * added version 2 * added version 3 * added version 4 * docs: implemented new color scheme * docs: redesigned sidebar (#3193) * docs: redesigned navbar for restructure (#3199) * docs: redesigned footer (#3209) * docs: redesigned cards (#3230) * docs: redesigned admonitions (#3231) * docs: redesign announcement bar (#3236) * docs: redesigned large cards (#3239) * docs: redesigned code blocks (#3253) * docs: redesigned search modal and page (#3264) * docs: redesigned doc footer (#3268) * docs: added new sidebars + refactored css and assets (#3279) * docs: redesigned api reference sidebar * docs: refactored css * docs: added code tabs transition * docs: added new sidebars * removed unused assets * remove unusued assets * Fix deploy errors * fix incorrect link * docs: fixed code responsivity + missing icons (#3283) * docs: changed icons (#3296) * docs: design fixes to the sidebar (#3297) * redesign fixes * docs: small design fixes * docs: several design fixes after restructure (#3299) * docs: bordered icon fixes * docs: desgin fixes * fixes to code blocks and sidebar scroll * design adjustments * docs: restructured homepage (#3305) * docs: restructured homepage * design fixes * fixed core concepts icon * docs: added core concepts page (#3318) * docs: restructured homepage * design fixes * docs: added core concepts page * changed text of different components * docs: added architecture link * added missing prop for user guide * docs: added regions overview page (#3327) * docs: added regions overview * moved region pages to new structure * docs: fixed description of regions architecture page * small changes * small fix * docs: added customers overview page (#3331) * docs: added regions overview * moved region pages to new structure * docs: fixed description of regions architecture page * small changes * small fix * docs: added customers overview page * fix link * resolve link issues * docs: updated regions architecture image * docs: second-iteration fixes (#3347) * docs: redesigned document * design fixes * docs: added products overview page (#3354) * docs: added carts overview page (#3363) * docs: added orders overview (#3364) * docs: added orders overview * added links in overview * docs: added vercel redirects * docs: added soon badge for cards (#3389) * docs: resolved feedback changes + organized troubleshooting pages (#3409) * docs: resolved feedback changes * added extra line * docs: changed icons for restructure (#3421) * docs: added taxes overview page (#3422) * docs: added taxes overview page * docs: fix sidebar label * added link to taxes overview page * fixed link * docs: fixed sidebar scroll (#3429) * docs: added discounts overview (#3432) * docs: added discounts overview * fixed links * docs: added gift cards overview (#3433) * docs: added price lists overview page (#3440) * docs: added price lists overview page * fixed links * docs: added sales channels overview page (#3441) * docs: added sales overview page * fixed links * docs: added users overview (#3443) * docs: fixed sidebar border height (#3444) * docs: fixed sidebar border height * fixed svg markup * docs: added possible solutions to feedback component (#3449) * docs: added several overview pages + restructured files (#3463) * docs: added several overview pages * fixed links * docs: added feature flags + PAK overview pages (#3464) * docs: added feature flags + PAK overview pages * fixed links * fix link * fix link * fixed links colors * docs: added strategies overview page (#3468) * docs: automated upgrade guide (#3470) * docs: automated upgrade guide * fixed vercel redirect * docs: restructured files in docs codebase (#3475) * docs: restructured files * docs: fixed eslint exception * docs: finished restructure loose-ends (#3493) * fixed uses of backend * docs: finished loose ends * eslint fixes * fixed links * merged master * added update instructions for v1.7.12 * docs: fixed discount details (#3499) * docs: fix trailing slash causing 404 (#3508) * docs: fix error during navigation (#3509) * docs: removed the gatsby storefront guide (#3527) * docs: removed the gatsby storefront guide * docs: fixed query value * chore(docs): Removed Docs Announcement Bar (automated) (#3536) Co-authored-by: shahednasser <shahednasser@users.noreply.github.com> * fix(medusa): Variant update should include the id for the listeners to be able to identify the entity (#3539) * fix(medusa): Variant update should include the id for the listeners to be able to identify the entity * fix unit tests * Create brave-seahorses-film.md * docs: fix admin redirects (#3548) * chore(release): v1.7.15 * chore(docs): Generated Docs Announcement Bar (automated) (#3550) Co-authored-by: olivermrbl <olivermrbl@users.noreply.github.com> * chore(docs): Generated Services Reference (automated) (#3551) Automated changes by [create-pull-request](https://github.com/peter-evans/create-pull-request) GitHub action Co-authored-by: Oliver Windall Juhl <59018053+olivermrbl@users.noreply.github.com> * chore: updated READMEs of plugins (#3546) * chore: updated READMEs of plugins * added notice to plugins * docs: added a deploy guide for next.js storefront (#3558) * docs: added a deploy next.js guide * docs: fix image zoom * docs: fixes to next.js deployment guide to vercel (#3562) * chore(workflows): Enable manual workflow in pre-release mode (#3566) * chore(docs): Removed Docs Announcement Bar (automated) (#3598) Co-authored-by: shahednasser <shahednasser@users.noreply.github.com> * fix(medusa): Rounding issues on line item adjustments (#3446) * chores(medusa): Attempt to fix discount rounding issues * add migration * update entities * apply multipler factor properly * fix discount service * WIP * fix rounding issues in discounts * fix some tests * Exclude raw_discount_total from responses * fix adjustments * cleanup response * fix * fix draft order integration * fix order integration * fix order integration * address feedback * fix test * Create .changeset/polite-llamas-sit.md * remove comment --------- Co-authored-by: Oliver Windall Juhl <59018053+olivermrbl@users.noreply.github.com> * chore(workflows): Add release notification (#3629) --------- Co-authored-by: pepijn-vanvlaanderen <pepijn@webbers.com> Co-authored-by: olivermrbl <oliver@mrbltech.com> Co-authored-by: Adrien de Peretti <adrien.deperetti@gmail.com> Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com> Co-authored-by: olivermrbl <olivermrbl@users.noreply.github.com> Co-authored-by: Carlos R. L. Rodrigues <37986729+carlos-r-l-rodrigues@users.noreply.github.com> Co-authored-by: shahednasser <shahednasser@users.noreply.github.com> Co-authored-by: Oliver Windall Juhl <59018053+olivermrbl@users.noreply.github.com>
34 KiB
description
| description |
|---|
| Learn about the available events and their data payloads in Medusa. Events can be used to perform an action when the events are triggered. |
Events Reference
This document details all events in Medusa, when they are triggered, and what data your handler method 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: |
Invite Events
This section holds all events related to invites.
| Event Name | Description | Event Data Payload |
|---|---|---|
|
|
Triggered when an invite is created for a user to join the admin team. |
Object of the following format: |
Note Events
This section holds all events related to notes.
| Event Name | Description | Event Data Payload |
|---|---|---|
|
|
Triggered when a note is created. |
Object of the following format: |
|
|
Triggered when a note is updated. |
Object of the following format: |
|
|
Triggered when a note is deleted. |
Object of the following format: |
App Authentication Events
This section holds all events related to app authentications.
:::note
Event names of app authentication are scoped specifically towards each application. When listening to these events, you must replace <APP> with the name of the application you’re targeting.
:::
| Event Name | Description | Event Data Payload |
|---|---|---|
|
|
Triggered when a token is generated for an application. |
The returned data from the method |
|
|
Triggered when the token of an application is refreshed. |
The returned data from the method |
Order Events
This section holds all events related to orders.
| Event Name | Description | Event Data Payload |
|---|---|---|
|
|
Triggered when a new order is placed. |
Object of the following format: |
|
|
Triggered when an order and data associated with it (shipping method, shipping address, etc…) are updated. |
Object of the following format: |
|
|
Triggered when an order is canceled. |
Object of the following format: |
|
|
Triggered when an order is completed. |
Object of the following format: |
|
|
Triggered when an order is claimed. |
Object of the following format: |
|
|
Triggered when a gift card in an order is created. |
Object of the following format: |
|
|
Triggered when the payment of an order is captured. |
Object of the following format: |
|
|
Triggered when capturing the payment of an order fails. |
Object of the following format: |
|
|
Triggered when fulfillment is created for an order. |
Object of the following format: |
|
|
Triggered when a shipment is created for fulfillment and the fulfillment is registered as “shipped”. |
Object of the following format: |
|
|
Triggered when fulfillment of an order is canceled. |
Object of the following format: |
|
|
Triggered when a return of an order is requested. |
Object of the following format: |
|
|
Triggered when the items of an order have been returned and the order has been registered as “returned”. |
Object of the following format: |
|
|
Triggered when the order is being registered as “returned” but there are additional actions required related to refunding the payment. |
Object of the following format: |
|
|
Triggered when the order’s payment is refunded. |
Object of the following format: |
|
|
Triggered when the refund of the order’s payment fails. |
Object of the following format: |
|
|
Triggered when a swap for an order is created. |
Object of the following format: |
Order Edit Events
This section holds all events related to order edits.
| Event Name | Description | Event Data Payload |
|---|---|---|
|
|
Triggered when a order edit is created. |
Object of the following format: |
|
|
Triggered when an order edit is updated. |
Object of the following format: |
|
|
Triggered when an order edit is canceled. |
Object of the following format: |
|
|
Triggered when an order edit is declined. |
Object of the following format: |
|
|
Triggered when an order edit is requested. |
Object of the following format: |
|
|
Triggered when an order edit is confirmed. |
Object of the following format: |
Order Edit Item Changes Events
This section holds all events related to order edit item changes.
| Event Name | Description | Event Data Payload |
|---|---|---|
|
|
Triggered when an order edit item change is created. |
|
|
|
Triggered when an order edit item change is deleted. |
|
Payment Events
This section holds all events related to payment.
| Event Name | Description | Event Data Payload |
|---|---|---|
|
|
Triggered when a payment is created. |
The entire payment passed as an object. You can refer to the Payment entity for an idea of what fields to expect. |
|
|
Triggered when a payment is updated. |
The entire payment passed as an object. You can refer to the Payment entity for an idea of what fields to expect. |
|
|
Triggered when a payment is captured. |
The entire payment passed as an object. You can refer to the Payment entity for an idea of what fields to expect. |
|
|
Triggered when the capturing of a payment fails. |
The entire payment passed as an object. You can refer to the Payment entity for an idea of what fields to expect. In addition, an error object is passed within the same object as the Payment provider: |
|
|
Triggered when a refund of a payment is created. |
The entire refund passed as an object. You can refer to the Refund entity for an idea of what fields to expect. |
|
|
Triggered when a payment's refund fails. |
The entire payment passed as an object. You can refer to the Payment entity for an idea of what fields to expect. |
Payment Collection Events
This section holds all events related to payment collections.
| Event Name | Description | Event Data Payload |
|---|---|---|
|
|
Triggered when a payment collection is created. |
The entire payment collection passed as an object. You can refer to the Payment Collection entity for an idea of what fields to expect. |
|
|
Triggered when a payment collection is update. |
The entire payment collection passed as an object. You can refer to the Payment Collection entity for an idea of what fields to expect. |
|
|
Triggered when a payment collection is deleted. |
The entire payment collection passed as an object. You can refer to the Payment Collection entity for an idea of what fields to expect. |
|
|
Triggered when a payment collection is either marked authorized or its payment session is authorized. |
The entire payment collection passed as an object. You can refer to the Payment Collection entity for an idea of what fields to expect. |
Product Events
This section holds all events related to products.
| Event Name | Description | Event Data Payload |
|---|---|---|
|
|
Triggered when a product is created. |
Object of the following format: |
|
|
Triggered when a product and data associated with it (options, variant orders, etc…) is updated. |
The entire product passed as an object. You can refer to the Product entity for an idea of what fields to expect. In one case, when the |
|
|
Triggered when a product is deleted. |
Object of the following format: |
Product Category Events
This section holds all events related to product categories.
| Event Name | Description | Event Data Payload |
|---|---|---|
|
|
Triggered when a product category is created. |
Object of the following format: |
|
|
Triggered when a product category is updated. |
Object of the following format: |
|
|
Triggered when a product category is deleted. |
Object of the following format: |
Product Variant Events
This section holds all events related to product variants.
| Event Name | Description | Event Data Payload |
|---|---|---|
|
|
Triggered when a product variant is created. |
Object of the following format: |
|
|
Triggered when a product variant is updated. |
Object of the following format: |
|
|
Triggered when a product variant is deleted. |
Object of the following format: |
Publishable API Key Events
This section holds all events related to publishable API keys.
| Event Name | Description | Event Data Payload |
|---|---|---|
|
|
Triggered when a publishable API key is created. |
Object of the following format: |
|
|
Triggered when a publishable API key is revoked. |
Object of the following format: |
Region Events
This section holds all events related to regions.
| Event Name | Description | Event Data Payload |
|---|---|---|
|
|
Triggered when a region is created. |
Object of the following format: |
|
|
Triggered when a region or data associated with it (countries, fulfillment providers, etc…) are updated. |
Object of the following format: |
|
|
Triggered when a region is deleted. |
Object of the following format: |
Sales Channel Events
This section holds all events related to sales channels.
| Event Name | Description | Event Data Payload |
|---|---|---|
|
|
Triggered when a sales channel is created. |
Object of the following format: |
|
|
Triggered when a sales channel is updated |
Object of the following format: |
|
|
Triggered when a sales channel is deleted. |
Object of the following format: |
Swap Events
This section holds all events related to swaps.
| Event Name | Description | Event Data Payload |
|---|---|---|
|
|
Triggered when a swap is created. |
Object of the following format: |
|
|
Triggered when a swap is registered as received. |
Object of the following format: |
|
|
Triggered when fulfillment is created for a swap. |
Object of the following format: |
|
|
Triggered when a shipment is created for a swap and the fulfillment associated with it is set as “shipped”. |
Object of the following format: |
|
|
Triggered when payment is completed for a swap which happens when the cart associated with the swap is registered as completed. |
Object of the following format: |
|
|
Triggered when the payment is captured for a swap. |
Object of the following format: |
|
|
Triggered when the capturing of the payment of a swap fails. |
Object of the following format: |
|
|
Triggered when a swap’s amount difference is processed and refunded. |
Object of the following format: |
|
|
Triggered when processing and refunding a swap’s amount difference fails. |
Object of the following format: |
Token Events
This section holds all events related to tokens.
| Event Name | Description | Event Data Payload |
|---|---|---|
|
|
Triggered when a customer requests to claim an order and a token is created. |
Object of the following format: |
User Events
This section holds all events related to users.
| Event Name | Description | Event Data Payload |
|---|---|---|
|
|
Triggered when a user is created. |
Object of the following format: |
|
|
Triggered when a user is updated. |
Object of the following format: |
|
|
Triggered when a user requests to reset their password. |
Object of the following format: |
|
|
Triggered when a user is deleted. |
Object of the following format: |