Not able to register webhooks like inventory,draft_order

Highlighted
New Member
5 0 0

Hi,

When I am trying to register webhooks programmaticaly for a merhcant, 

 

requesturl: https://abc.com/admin/api/2020-04/webhooks.json

requestBody:
{
  "webhook": {
    "topic""inventory_items/create",
    "address""my_endpoint_url",
    "format""json"
  }
}
 
I am getting response:
 
{
    "errors": {
        "topic": [
            "Invalid topic specified: inventory_items/create. Topics allowed: app/uninstalled, carts/create, carts/update, checkouts/create, checkouts/delete, checkouts/update, checkouts/paid, collections/create, collections/delete, collections/update, customer_groups/create, customer_groups/delete, customer_groups/update, customers/create, customers/delete, customers/disable, customers/enable, customers/update, order_transactions/create, orders/cancelled, orders/create, orders/delete, orders/edited, orders/fulfilled, orders/paid, orders/partially_fulfilled, orders/updated, products/create, products/delete, products/update, refunds/create, shop/update, tender_transactions/create, app_purchases_one_time/update, app_subscriptions/update, variants/delete, domains/create, domains/update, domains/destroy"
        ]
    }
}
{
    "errors": {
        "topic": [
            "Invalid topic specified: inventory_items/create. Topics allowed: app/uninstalled, carts/create, carts/update, checkouts/create, checkouts/delete, checkouts/update, checkouts/paid, collections/create, collections/delete, collections/update, customer_groups/create, customer_groups/delete, customer_groups/update, customers/create, customers/delete, customers/disable, customers/enable, customers/update, order_transactions/create, orders/cancelled, orders/create, orders/delete, orders/edited, orders/fulfilled, orders/paid, orders/partially_fulfilled, orders/updated, products/create, products/delete, products/update, refunds/create, shop/update, tender_transactions/create, app_purchases_one_time/update, app_subscriptions/update, variants/delete, domains/create, domains/update, domains/destroy"
        ]
    }
}
 
 
This behavior is coming for webhooks: 
inventory_levels/create,inventory_levels/update,inventory_levels/delete,inventory_items/create
inventory_items/update,inventory_items/delete,draft_orders/create, draft_orders/update,draft_orders/delete
But these webhooks i can register from admin console.
 
But for other webhooks it is working fine
 
Kindly help me if I am doing anything wrong while registering webhooks

 

0 Likes
Highlighted
Shopify Partner
249 23 30

Hi,
As per my understanding, you're missing scope for that

If helpful then please Like and Accept Solution.
Email: suhagiyajivan1992@gmail.com
Skype: jivan.suhagiya
Give a try to Shopify APP: https://apps.shopify.com/short-track
0 Likes
Highlighted
New Member
5 0 0

Hi Jivan,

 

If I am not wrong by scope you mean "read access" or "read and write access". How can I set scope while registering webhooks using https request?

0 Likes
Highlighted
Shopify Staff
Shopify Staff
464 57 91

Hey @arunvettil,

You need to request the scopes before creating a webhook. If you're using a private app, the scopes are chosen when you create the API credentials on the Admin > Apps > Private Apps page. If you're using a public app, the scopes are requested during the installation process using Oauth. Once your app has the necessary scopes, you should be able to create those webhooks.

JB | Developer Support @ Shopify
 - Was my reply helpful? Click Like to let me know! 
 - Was your question answered? Click Accept as Solution 

0 Likes