Issue while Creating Webhook Subscription using Admin REST API

Solved

Issue while Creating Webhook Subscription using Admin REST API

mhengineering
Shopify Partner
4 1 0

Hi Shopify Team! 

 

I am having issues at the moment of creating a new webhook using the admin api for a Custom App of a client. 

{{shopifyStore}}/admin/api/2023-07/webhooks.json (POST)

 

I  tried using Postman and i get the following response and the webhooks is not created

mhengineering_0-1710957012217.png

x-request-id: 66385f7a-cc6a-42c0-a293-47cb6af8e759-1710956766

 

If I try the same request with curl I get a different response 

 

curl --location --max-time 3 --request POST 'https://xxxx.myshopify.com/admin/api/2023-07/webhooks.json' \
--header 'X-Shopify-Access-Token: xxxxxx' \
--header 'Content-Type: application/json' \
--header 'Cookie: request_method=POST' \
--data-raw '{
    "webhook": {
        "address": "https://xxxxxxx/v1/shopify/af799ae56ad5ba126fd6a72ce4e0cd13e1a34ad1c68ca7347fe094199b7483333/add-order",
        "topic": "customers/update",
        "format": "json"
    }
}'

Response 

{"errors":{"webhook":"Required parameter missing or invalid"}}%  

x-request-id: 0d8ff4d6-63fc-4152-944c-8b3a2b8716b3-1710957185

 

It seems a bug in the Shopify side. 

 

I  appreciate your help. Thank you!

Accepted Solution (1)

mhengineering
Shopify Partner
4 1 0

This is an accepted solution.

I could found the issue. It seems that the store domain changed and there was having a redirection and for any reason POST and DELETE requesst were not working using the old domain. If i change the domain it works.  

View solution in original post

Reply 1 (1)

mhengineering
Shopify Partner
4 1 0

This is an accepted solution.

I could found the issue. It seems that the store domain changed and there was having a redirection and for any reason POST and DELETE requesst were not working using the old domain. If i change the domain it works.