From bf44294c6b376412edff6529a662dba0bf943f8a Mon Sep 17 00:00:00 2001 From: Shahed Nasser Date: Thu, 4 Aug 2022 18:03:01 +0300 Subject: [PATCH] docs: updated event reference (#1996) * docs: updated event reference * added note about sales channels --- .../backend/subscribers/events-list.md | 179 +++++++++++++++++- 1 file changed, 178 insertions(+), 1 deletion(-) diff --git a/docs/content/advanced/backend/subscribers/events-list.md b/docs/content/advanced/backend/subscribers/events-list.md index 37a954fc61..7576991bd6 100644 --- a/docs/content/advanced/backend/subscribers/events-list.md +++ b/docs/content/advanced/backend/subscribers/events-list.md @@ -1454,7 +1454,7 @@ In one case, when the `/admin/products/{id}` endpoint is used to update the prod ```js { id, //id of product - field //an array of field names that were updated + fields //an array of field names that were updated } ``` @@ -1681,6 +1681,111 @@ Object of the following format: +## Sales Channel Events + +This section holds all events related to sales channels. + +:::note + +As of Medusa v1.3.5, Sales Channels are available but guarded by a feature flag. To use Sales Channels, add the following environment variable: + +```bash +MEDUSA_FF_SALES_CHANNELS=true +``` + +Then, run the [migrations](../migrations.md#how-to-run-migrations). + +::: + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+Event Name + +Description + +Event Data Payload +
+ +`sales_channel.created` + + + +Triggered when a sales channel is created. + + + +Object of the following format: + +```js +{ + id //string ID of sales channel +} +``` + +
+ +`sales_channel.updated` + + + +Triggered when a sales channel is updated + + + +Object of the following format: + +```js +{ + id, //string ID of sales channel +} +``` + +
+ +`sales_channel.deleted` + + + +Triggered when a sales channel is deleted. + + + +Object of the following format: + +```js +{ + id //string ID of sales channel +} +``` + +
+ ## Swap Events This section holds all events related to swaps. @@ -1953,6 +2058,54 @@ Event Data Payload +`user.created` + + + + +Triggered when a user is created. + + + + +Object of the following format: + +```js +{ + id //string ID of user +} +``` + + + + + + + +`user.updated` + + + + +Triggered when a user is updated. + + + + +Object of the following format: + +```js +{ + id //string ID of user +} +``` + + + + + + + `user.password_reset` @@ -1972,6 +2125,30 @@ Object of the following format: } ``` + + + + + + +`user.deleted` + + + + +Triggered when a user is deleted. + + + + +Object of the following format: + +```js +{ + id //string ID of user +} +``` +