Need help on REST API call for webhook

1 0 0

I need help to understand REST API Call to get all webhooks and create a new webhook.

I am able to setup webhook through UI, but I need a mechanism to setup webhook through a REST API call.

I am following the below page for the REST API:

I am able to pull all orders by REST API. For that, I have already created a PRIVATE API.

PRIVATE APP which gives me username and password in Base64 format.

Sample: https://{username}:{password}
I am getting the proper results from the above REST API CALL.


But when I call the below URL, I don't get any webhook information: https://{username}:{password}

I want to know the significance of "shared secret" present under the PRIVATE APP.


Reply 1 (1)

Shopify Staff
297 31 90

Hey there,


If you're creating the webhooks via the shop admin, they won't appear in your API GET request.


This is because webhook subscriptions are scoped only to the app that they're registered to. So those made in the admin, are only visible in the admin. If you want to create some via the API, you can do so with the following request, which is also shown in the documentation you linked:

POST /admin/api/2019-04/webhooks.json
{ "webhook": { "topic": "orders/create", "address": "", "format": "json" } }


The webhooks created this way using your API key and secret will then be returned when you query the `/admin/webhooks.json` endpoint. 

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