garettB / shopify-flask-example

A simple Shopify app created using Flask and Python
Other
229 stars 66 forks source link

422 Client Error: Unprocessable Entity for url: /admin/api/2021-10/webhooks.json #10

Open klauBertram opened 2 years ago

klauBertram commented 2 years ago

Hi there,

Thank you for your example. Still learning the ins and outs of the Shopify apps ecosystem. I am creating a custom app and running the repo in docker. Whenever I make a code change in the app, then I would refresh the store page, and I would get an error 422, however, on 2nd refresh of the store page, the page would load fine. Do you mind pointing me in the right direction so I can fix this? Thanks again!

fersarr commented 2 years ago

Hey! I'm no shopify expert but I was just bumping into the same issue and I think it is because Shopify returns the Error 422 if the webhook is already registered for that shop. See here: https://community.shopify.com/c/Shopify-APIs-and-SDKs/Subscribing-to-a-webhook-via-API/td-p/568703

requests.exceptions.HTTPError: 422 Client Error: Unprocessable Entity for url: https://xxxx.myshopify.com/admin/api/2020-01/webhooks.jso

But that issue is surrounded by a try-catch, so it shouldn't affect your flow

klauBertram commented 2 years ago

Hi Fer,

Thank you for the response. How did you fix it?

Kenn

On Sun, Aug 22, 2021 at 2:51 PM Fer Sar @.***> wrote:

Hey! I was just bumping into the same issue and I think it is because Shopify returns the Error 422 if the webhook is already registered for that shop. See here: https://community.shopify.com/c/Shopify-APIs-and-SDKs/Subscribing-to-a-webhook-via-API/td-p/568703

requests.exceptions.HTTPError: 422 Client Error: Unprocessable Entity for url: https://xxxx.myshopify.com/admin/api/2020-01/webhooks.jso

— You are receiving this because you authored the thread. Reply to this email directly, view it on GitHub https://github.com/garettB/shopify-flask-example/issues/10#issuecomment-903335335, or unsubscribe https://github.com/notifications/unsubscribe-auth/AAN4SWMFZ6OIYVQP33IATS3T6FWMTANCNFSM5CRPGQJQ . Triage notifications on the go with GitHub Mobile for iOS https://apps.apple.com/app/apple-store/id1477376905?ct=notification-email&mt=8&pt=524675 or Android https://play.google.com/store/apps/details?id=com.github.android&utm_campaign=notification-email .