Development discussions around Shopify APIs
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
User | RANK |
---|---|
10 | |
5 | |
3 | |
3 | |
3 |
Photo by Marco Verch Sales channels on Shopify are various platforms where you can sell...
By Ollie May 25, 2023Summary of EventsBeginning in January of 2023, some merchants reported seeing a large amo...
By Trevor May 15, 2023With 2-Factor Authentication being required to use Shopify Payments, we’re here to help yo...
By Imogen Apr 26, 2023