Hi,
I am facing an issue with my Shopify app where I receive a 400 Bad Request when the app is uninstalled from a store. I need help troubleshooting this problem.
Upon installation of the app, I can observe the following message in the console:
[shopify-api/WARNING] API Deprecation Notice 7/11/2023, 11:45:07 AM: {"message":"https://shopify.dev/api/usage/versioning#deprecation-practices","path":"https://store.myshopify.com/admin/api/2023-04/graphql.json","body":"{\n webhookSubscriptions(\n first: 250,\n after: null,\n ){\n edges {\n node {\n id..."} - Stack Trace: Error
When I check the subscribed webhooks of my store, I find that the “App_uninstalled” topic is subscribed with the callback URL as http://{url}/api/webhooks.
Upon investigating the node modules where the error is logged from, I noticed a variable called “deprecationReason”.
However, when I log its value using console.log, it gives me “undefined”.
Here is the code snippet where the “deprecationReason” is assigned:
deprecationReason = (0, http_1.getHeader)(response.headers, 'X-Shopify-API-Deprecated-Reason');
console.log("deprecationReason", deprecationReason); // Output: (deprecationReason undefined)
I even tried to make some api’s in my node main file so that incase webhooks tries to hit the endpoint /api/webhooks it gets a 200 response.
This works when in request from postman
app.post("/api/test",(req,res)=>{
res.status(200).send("OK");
});
This does not work when in request from postman
app.post("/api/webhooks", (req, res) => {
res.status(200).send("OK");
});
Tried Approaches -
- https://github.com/Shopify/shopify-api-js/blob/main/docs/guides/webhooks.md
- https://community.shopify.com/post/2120242
- https://community.shopify.com/topic/1736472
I would greatly appreciate any insights, guidance, or suggestions to resolve this issue.
Thank you in advance!