App should be aware of it's discount status being updated from Discounts page #212
Closed
cyberabis
started this conversation in
Feedback: Discounts APIs
Replies: 4 comments
-
+1 |
Beta Was this translation helpful? Give feedback.
0 replies
-
There are now webhook topics for discounts. |
Beta Was this translation helpful? Give feedback.
0 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
A custom discount created by an app can be activated / deactivated / deleted from the Shopify's discount page. App has to keep (long) polling to be aware of this change.
Why this is a problem?
For example, an app like volume discount typically displays a widget on the product page. The product page is heavily accessed and its not ideal to query the GraphQL for each product page visit to find applicable volume discounts. This also slows down the widget load on page. So the app should be able to cache the discounts it created. And if the app caches the discount, any update on the discount should be notified to the app.
Suggested proposals I can think of:
Option 1: Do not allow to activate / deactivate / delete custom discounts from the Discount page. This has to be managed through the app, or an app API.
Option 2: Add a webhook topic that app can subscribe and listen to. Will be even better if only the app's related discount changes are notified.
Related discussion on Slack:
https://shopifypartners.slack.com/archives/C0225DTE1M1/p1680176461557429
https://shopifypartners.slack.com/archives/C0225DTE1M1/p1676592256778369
Beta Was this translation helpful? Give feedback.
All reactions