hotwax / job-manager

HotWax Commerce Job Manager App
https://job-manager.hotwax.io/
Apache License 2.0
13 stars 31 forks source link

Add missing webhook service endpoints #232

Closed adityasharma7 closed 1 year ago

adityasharma7 commented 2 years ago

What is the motivation for adding/enhancing this feature?

Add following API endpoint to webhookEndpointUrls:

  1. subscribeOrderCreateWebhook
  2. subscribeOrderReturnWebhook
  3. subscribeOrderCancelWebhook
  4. subscribeProductCreateWebhook

https://github.com/hotwax/job-manager/blob/main/src/services/WebhookService.ts#L14

Additional information

dt2patel commented 1 year ago

The scope of this task has changed since we have decided to move forward with a generic subscribe/unsub function model where you pass in the topic and the function calls a generic api in the backend

shashwatbangar commented 1 year ago

Understanding:

As we now using general Webhook pub/sub model where we will pass a topic to a single webhook api and according to the topic, API will be called.

Findings:

What are webhooks: https://zapier.com/blog/what-are-webhooks/ How webhooks are different from APIs: https://snipcart.com/blog/webhook-vs-api Shopify Webhooks: https://shopify.dev/api/admin-rest/2022-01/resources/webhook

adityasharma7 commented 1 year ago

API: subscribeShopifyWebhook

Parameters: shopifyConfigId topic endpoint

subscribeProductDeleteWebhook "topic", "products/delete" "endpoint", "deleteProductFromShopify"

subscribeFileStatusUpdateWebhook "topic", "bulk_operations/finish" "endpoint", "uploadedFileStatusUpdateFromShopify"

subscribeOrderPaidWebhook "topic", "orders/paid" "endpoint", "orderPaidNotificationFromShopify"

subscribeInventoryLevelUpdateWebhook "topic", "inventory_levels/update" "endpoint", "inventoryLevelUpdateFromShopify"