We have added a developer app with write_orders and read_orders scopes to be able to create orders from an external client in Shopify using the Admin API access token against the REST Admin API.
The order creation has worked fine for about half a year, but now we started receiving http response 422 (Unprocessable Entity) from the Shopify REST endpoint.
Unfortunately the client doesn’t have any logging of payload so we were wondering if it is at all possible to get access to Shopifys access-logs for this particular access token to see the failed requests?
I know there would be issues around security and privacy, but can it be done?
What do you mean by an “external client” exactly? Are you using some kind of automation platform like Zapier/Make to create orders through? Or is it a custom app you don’t control?
I highly doubt Shopify would be able to provide you with their server logs. You’re better off logging the response body yourself to understand the specific error message.
You don’t even need to use this external client, just attempt to send the same payload using a REST HTTP Client like Postman, Insomnia or Bruno with your merchant’s access token from your app and see the response yourself.
The “external client” is a site running outside Shopify. We control that site as well and have now added logging of all requests sent to Shopify including any response.
The reason I was hoping for an access log from Shopify is because, we have no idea what was wrong, when our client reported issues with the order-creation. Our guess would be something related to the input provided (or not provided) by a user.
We don’t see the 422 issue any more, so now we just have to wait and see, if it happens again - now we have logging outside of Shopify.
Kind of annoying that you are technically blind on Shopify for these kind of issues…
I’m still not understanding what “external client” means exactly. It sounds like maybe you have a custom app set up on this Shopify Store.
To be fair, I don’t know of any service that would provide their API logs on request.
The API is doing it’s job when it tells you the request is malformed, and it should give you specific feedback as to why.
It’s up to you the app developer to set up monitoring when this happens so you can correct the logic in your app that handles these situations.
If it truly is a bug, then you can share the request ID information from the Shopify API response headers with Shopify Partner support so they can look up the request and troubleshoot from there.
I can confirm that we don’t currently provide access to the API logs. 422 Unprocessable Entity codes will typically include the errors in the response body to help. Now that you are logging this, it should help if the issue does re-occur.