Topics covering webhook creation & management, event handling, Pub/Sub, and Eventbridge, in Shopify apps.
Hi everyone,
I am having a lot of trouble with these two webhooks where by I can create them but I can not seem to be able to delete these webhooks.
I am using the API using an Admin API token to initially create them but when I try to retrieve a list, these do not come back and I can not delete them.
This is causing us lots of issues when trying to recreate them as we keep getting the 'Address is taken for this topic' error.
Can someone please help us? I understand that returns_approve and close are part of the unstable API so unsure if this is related? Is it a bug on your end?
What we want to do is get notified when an item is returned both in-progress/approved and closed and if there are alternative webhooks that can notify of this then we can avoid using the unstable API.
Solved! Go to the solution
This is an accepted solution.
Hi @iq-dot 👋
To delete the `RETURNS_APPROVE` and `R
We can fetch the ID with the `webhookSubscriptions` query using the `unstable` version.
curl
-L -X POST 'https://shopname.myshopify.com/admin/api/unstable/graphql.json' \
-H 'X-Shopify-Access-Token: shpat_c9876543210' \
-H 'Content-Type: application/json' \
--data-raw '{"query":"{\n webhookSubscriptions (first:5, topics:RETURNS_CLOSE){\n nodes {\n id\n callbackUrl\n }\n }\n}"}'
Then delete it by ID with the `webhookSubscriptionDelete` mutation using the `unstable` version.
curl
-L -X POST 'https://shopname.myshopify.com/admin/api/unstable/graphql.json' \
-H 'X-Shopify-Access-Token: shpat_c9876543210' \
-H 'Content-Type: application/json' \
--data-raw '{"query":"\nmutation {\n \twebhookSubscriptionDelete(id:\"gid://shopify/WebhookSubscription/WEBHOOK_SUBSCRIPTION_ID_HERE\") {\n \tdeletedWebhookSubscriptionId\n \n \t}\n}"}'
Hope that helps!
Developer Support @ Shopify
- Was this reply helpful? Click Like to let us know!
- Was your question answered? Mark it as an Accepted Solution
- To learn more visit Shopify.dev or the Shopify Web Design and Development Blog
This is an accepted solution.
Hi @iq-dot 👋
To delete the `RETURNS_APPROVE` and `R
We can fetch the ID with the `webhookSubscriptions` query using the `unstable` version.
curl
-L -X POST 'https://shopname.myshopify.com/admin/api/unstable/graphql.json' \
-H 'X-Shopify-Access-Token: shpat_c9876543210' \
-H 'Content-Type: application/json' \
--data-raw '{"query":"{\n webhookSubscriptions (first:5, topics:RETURNS_CLOSE){\n nodes {\n id\n callbackUrl\n }\n }\n}"}'
Then delete it by ID with the `webhookSubscriptionDelete` mutation using the `unstable` version.
curl
-L -X POST 'https://shopname.myshopify.com/admin/api/unstable/graphql.json' \
-H 'X-Shopify-Access-Token: shpat_c9876543210' \
-H 'Content-Type: application/json' \
--data-raw '{"query":"\nmutation {\n \twebhookSubscriptionDelete(id:\"gid://shopify/WebhookSubscription/WEBHOOK_SUBSCRIPTION_ID_HERE\") {\n \tdeletedWebhookSubscriptionId\n \n \t}\n}"}'
Hope that helps!
Developer Support @ Shopify
- Was this reply helpful? Click Like to let us know!
- Was your question answered? Mark it as an Accepted Solution
- To learn more visit Shopify.dev or the Shopify Web Design and Development Blog