I am basically a NetSuite Developer and is new to Shopify. One of our clients is planning to open a Shopify Store and want to integrate with their NetSuite ERP System. I had looked at the Shopify API Documentation and it seems we can use REST API Services for our Integration. While I got a fair bit of an idea on how we can push data (Products/ Inventory details etc.) from the ERP system to Shopify, I don't have much idea on how we can push data from Shopify to the ERP system in real time. For Eg Whenever a customer places an order in Shopify, a sales order needs to be created in the ERP System in real time. Another one will be to update Inventory Stock levels in real time from Shopify to NetSuite.
Would any of you guys throw some light on how this can be achieved? Should we create an app in Shopify that pushes the data to the ERP?
We looked at the option of pulling the data from Shopify (through REST API), but this will be a significant overhead in the ERP system as we may need to create a recurring scheduled job trying to pull the data from Shopify every 15 minutes or so. Also it will not be a real time update. So this will be the last option.
NB: Please note that we are planning to develop this integration on our own and not planning to use any middleware or app.
Thanks in advance!
Just to clear this up, webhooks do retry. If an app times out when responding to a webhook, the webhook will retry up to 19 times over a 2 day period. More information is under "responding to a webhook" in this link https://shopify.dev/tutorials/manage-webhooks
Webhooks will be the best bet here. They're near real-time (a few seconds in most cases), and Shopify automatically retries failed webhook deliveries if your endpoint doesn't respond. This approach allows Shopify to do most of the heavy lifting.
When using webhooks we recommend implementing a periodic job to ensure your app has been notified of all newly created resources, in the extremely rare event Shopify doesn't fire a webhook. This can be a once a day job that pulls all new resource ids from the last day to compare to webhooks you received. This is almost not worth mentioning as it rarely ever happens, but for data integrity purposes it's still a recommendation.
Hi @Wolf7967, I'm also interested in how you're planning to integrate with Netsuite. How come you are not planning to use a middleware or existing Netsuite integration solution? Are you planning to build something in Heroku yourself?
Hi @_JB , @marcusradica , @Anto_S , Thank you gurus for the inputs. I am trying to use the webhooks but it seems there is a challenge in that. The message triggered by the webhooks gets ignored by NetSuite and it never reaches the end point url (Suitelet). On researching I found that this is caused by the "User-Agent" header value in the message. Shopify sets this as "ruby" and it seems the ERP doesn't like it and rejects that. They accepts only if the User-Agent is set to a web browser. Is there a way we can change this setting in Shopify Webhooks?
Hi @Anto_S , Thank you for the suggestion. I am able to resolve it and the webhook request is hitting the suitelet now. I was following the shopify documentation for the hmac_sha256 signature verification and is trying to do the verification in NetSuite but it seems the signature generated from the suitelet suitescript is always different from the one sent by the Shopify. Do you have any suggestions on this? Would that be because the webhooks are forwarded from the intermediary server?
Appreciate your help .