Rails application Webhook error in Home Page Controller index action

2 0 0

Hi I am new to the Shopify,

I am tring to register webhooks, I followd this documentation.

I added below code in shopify_app.rb file

config.webhooks = [
{topic: 'carts/create', address: 'https://95ecca2derw.ngrok.io/webhooks/carts_create', format: 'json'},
{topic: 'carts/update', address: 'https://95ecca2drew.ngrok.io/webhooks/carts_update', format: 'json'}
I created 2 jobs for carts/create and carts/update
App is throwing errors while installing.
here is the errors :
Processing by HomeController#index as HTML
Shop Load (0.9ms) SELECT "shops".* FROM "shops" WHERE "shops"."id" = ? LIMIT ? [["id", 2], ["LIMIT", 1]]
[ActiveJob] [ShopifyApp::WebhooksManagerJob] [6800b7fd-59d1-42c2-9aca-f959e8ed93cc] Error performing ShopifyApp::WebhooksManagerJob (Job ID: 6800b7fd-59d1-42c2-9aca-f959e8ed93cc) from Async(default) in 2828.1ms: ShopifyApp::WebhooksManager::CreationFailed (Topic Invalid topic specified. Topics allowed: app/uninstalled, collections/create, collections/delete, collections/update, products/create, products/delete, products/update, shop/update):

Can anyone please help me

Replies 2 (2)

Shopify Partner
1843 210 488

Hey there,

The list of allowed topics you are getting in the error message are the only ones available for you and granted access to based on the scope your token has been created with. Most probably you might need order read/write access scope added to the list of scopes in config.scope

Sergiu Svinarciuc | CTO @ visely.io
- Was my reply helpful? Click Like to let me know!
- Was your question answered? Mark it as an Accepted Solution!
- To learn more about the awesome stuff we do head over to visely.io or our blog

2 0 0

A ton of Thanks Sergiu, works perfectly as expected.