Not able to add webhook on the Heroku

Shopify Partner
2 0 0


I am a developer of ruby app with rails framework. I am using shopify_app gem for developing app with shopify.

Gem link:

I am able to add a webhook in my local using following command: 

rails g shopify_app:add_webhook -t carts/update -a

but I need to deploy the code on the Heroku also and I need webhook on Heroku also. So, How can I add and use webhook for Heroku?

Reply 1 (1)

Shopify Staff (Retired)
624 104 187

Hey @jigar_narola .


I am not sure if I follow your question. Are you asking how do you write code in your Ruby app (that is using the shopify_app gem) to generate and register a Shopify webhook? Or are you asking how to write code that will listen to Shopify webhook notifications and parse the payload?


If it's the former, you should be able to do this quite simply with code like this:

new_webhook ={
   topic: "orders/create",
   address: "", # substitute url with your endpoint
   format: "json"

If its the latter, there are helpful guides to follow:


To learn more visit the Shopify Help Center or the Community Blog.