Solved

Subscribing to a webhook via API

strideapps
Visitor
2 0 2

When I try to subscribe to the "carts/create" topic:

https://{{api_key}}:{{api_password}}@{{store_name}}.myshopify.com/admin/api/{{api_version}}/webhooks.json

{
   "topic": "carts/create",
   "address": "https://callback-url.com",
   "format": "json"
}


I get this message:

'Client error: resulted in a `422 Unprocessable Entity` response: {"errors":{"topic":["Invalid topic specified. Topics allowed: app\\/uninstalled, collections\\/create, collections\\/delete (truncated...) '

The "carts/create" topic is valid, so why am I getting this message ?



Accepted Solution (1)

Busfox
Shopify Staff (Retired)
628 49 110

This is an accepted solution.

Hi @strideapps,

 

Sounds like you don't have permission to create a webhook for that topic. Does your app have read_orders permission?

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

View solution in original post

Reply 1 (1)

Busfox
Shopify Staff (Retired)
628 49 110

This is an accepted solution.

Hi @strideapps,

 

Sounds like you don't have permission to create a webhook for that topic. Does your app have read_orders permission?

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