You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
> Setting `subscribed_saleschannel` as "specific" means, you will have to manually subscribe saleschannel level event for individual saleschannel. Default value here is "all" and event will be subscribed for all sales channels. For enabling events manually use function `enable_sales_channel_webhook`. To disable receiving events for a saleschannel use function `disable_sales_channel_webhook`.
188
212
189
213
214
+
#### Filters and reducers in webhook events
215
+
216
+
A filter and reducer can be provided to refine the data delivered for each subscribed event. The Filter functionality allows selective delivery of data by specifying conditions based on JSONPath queries and logical operators. Reducer allow customization of the payload structure by specifying only the fields needed by the subscriber. The reducer extracts fields from the event’s data and restructures them as needed.
217
+
218
+
```python
219
+
"webhook_config": {
220
+
"api_path": "/api/v1/webhooks",
221
+
"notification_email": "test@abc.com",
222
+
"subscribe_on_install": False,
223
+
"subscribed_saleschannel": "specific",
224
+
"marketplace": True,
225
+
"event_map": {
226
+
'company/brand/update': {
227
+
"version": '1',
228
+
"handler": handle_webhook,
229
+
"filters": {
230
+
"query": "$.brand.uid",
231
+
"condition": "(uid) => uid === 130"
232
+
},
233
+
"reducer": {
234
+
"brand_name": "$.brand.name",
235
+
"logo_link": "$.brand.logo"
236
+
}
237
+
}
238
+
}
239
+
}
240
+
```
241
+
190
242
##### How webhook registery subscribes to webhooks on Fynd Platform?
191
243
After webhook config is passed to setupFdk whenever extension is launched to any of companies where extension is installed or to be installed, webhook config data is used to create webhook subscriber on Fynd Platform for that company.
0 commit comments