Hello,
I have an application distributed on the shopify app store.
It has been installed on several shops and I would like to be able to make API requests on these shops to, for example, detect new orders and access a metafield of the products included in the order.
To do this, I have two options:
-
Subscribe to the ORDERS_CREATED webhook and connect to the Shopify API admin on the server. But how can I authenticate myself to retrieve data from the shop where the order was placed?
-
Create a cronjob that will check each of the shops that have installed my application to see if there are any new orders, and if so, fetch the product metafields. But once again, how do I retrieve the data?
My biggest concern is how to authenticate myself on the API admin without having received a request from a user of my plugin beforehand?
Hopefully my request is clear.
Thanks