Our Partner & Developer boards on the community are moving to a brand new home: the .dev community forums! While you can still access past discussions here, for all your future app and storefront building questions, head over to the new forums.

Webhook isn't fired or not registered

Solved

Webhook isn't fired or not registered

Alegrria
Visitor
2 1 0

I have a Rails Shopify app, which belongs to different shops.

I tried to create a new webhook fulfillments/create with the shopify-app gem.

This is my config:

ShopifyApp.configure do |config|
  config.api_key = ENV["SHOPIFY_API_KEY"]
  config.secret = ENV["SHOPIFY_API_SECRET"]
  config.scope = ENV["SHOPIFY_SCOPE"]
  config.embedded_app = true
  config.webhook_jobs_namespace = "shopify_webhooks"
  config.webhooks =
    %w(
      app/uninstalled
      fulfillments/create
      orders/create
      shop/update
    ).map do |topic|
      {
        topic: topic,
        address: "https://#{ENV['APPLICATION_HOST']}/webhooks/#{topic.gsub(%r{/}, '_')}",
        format: "json",
      }
    end
end

and my job:

module ShopifyWebhooks
  class FulfillmentsCreateJob < WebhookJob
    def process_webhook(shop, webhook)
       # do something
    end
  end
end

However, i cannot see the webhook firing, when it should.
How can I check if the webhook exists? And if it does, why it is not firing? 

 

Accepted Solution (1)

Alegrria
Visitor
2 1 0

This is an accepted solution.

I found out that I should have run a rake task on the app to register Webhooks.

Now everything works perfectly.

View solution in original post

Reply 1 (1)

Alegrria
Visitor
2 1 0

This is an accepted solution.

I found out that I should have run a rake task on the app to register Webhooks.

Now everything works perfectly.