I currently manage two separate Shopify stores and I'm looking for a way to sync the discount codes between them. My goal is to ensure that whenever a discount code is created or updated in one store, it automatically gets reflected in the other store.
I came across the Shopify App Template Remix and I'm considering using it to develop a custom app to achieve this synchronization. However, I'm not entirely sure if this is the right approach or if there are better alternatives.
Here's what I have in mind:
Use the Shopify App Template Remix to create a new app.
Implement the necessary logic to listen for discount code creation and updates in Store A.
When a discount code event is detected, use the Shopify Admin API to replicate/update/delete this discount code in Store B.
Ensure that the same process happens in reverse, so any changes in Store B are also reflected in Store A.
What did you try and what were you expecting?
I have successfully set up the Shopify App Template Remix and created a basic app. I have also been able to authenticate and access the Shopify Admin API from the app. My initial tests with creating and updating discount codes via the API did not worked well, because I could not use the authenticate.webhook(request) . I also opened an issue in the repository.
What I was expecting is to be able to use webhooks to listen for discount code creation and updates in each store, then use the Admin API to replicate these changes in the other store via Admin API and GraphQL. However, I'm unsure about the best way to handle the synchronization logic and ensure data consistency, especially when dealing with potential conflicts or errors during the sync process.
My questions are:
Has anyone used the Shopify App Template Remix for a similar purpose? How was your experience?
Are there any specific considerations or best practices I should be aware of when developing this app?
Would this approach be the right one overall or are there any other options ?
Are there any existing apps or integrations that might simplify this process without the need for custom development?
Any insights, advice, or examples would be greatly appreciated!
Thanks in advance for your help.
Best, Fynn