I was able to perform this exact same PUT request for my test store, and I can verify from my end that it worked correctly and my order was updated to have the new “Imported” tag. See the following screenshot:
Perhaps your error may have come from a formatting issue. If you are still experiencing this same error, could you please provide me with the value of the “X-Request-ID” header from the API Response? With this value I can go through the logs on our end and see why this error may be occurring
Yeah, this seems like a very strange one, I cant seem to see any formatting errors, as what i copied above was exactly what i am sending (all be it with a different ID)
An example failure is X-Request-Id: 960bb787-aaec-4abe-979f-7d1bf926ee2e
I was able to find your specific request with the 400 error response through the Shopify platform logs, but unfortunately I was unable to find any information that would indicate why the error was being thrown.
Could you verify you are passing the body of with the PUT request? Or using the correct API Access Token with your request? If you could provide a screenshot of the agent you are using to make the request (i.e. POSTMan, Insomnia, cURL) or provide the code that is generating the request, that could help. Thanks
I’m using VB.net to issue the request, however because i was experiencing the issue, i tried to debug it in Postman, however i’m getting the same issue. i’m passing a basic authorisation in the header, and presume its working as I’m not getting any authorisation errors. Using the same token method and auth, i am able to retrieve orders.
In PostMan, change the type of the Body of your PUT request from “Text” to “JSON”. Also make sure that the header of “Content-Type”=“application/json” has been added to your request. That should resolve your issue.
Here are some screenshots that demonstrate what I am talking about:
You can look into the concept of Webhooks (https://help.shopify.com/en/manual/sell-online/notifications/webhooks). Webhooks are notifications that Shopify will fire out to your app whenever an event happens that your app is subscribed to. So for example, your app can subscribe to a store’s “order/create” topic and then it will receive webhook notifications every time an order happens on that store.
Thank you @hassain ! I will keep this in mind. And, I was able to address it via Workflow. Thankfully my store is Shopify Plus, so we can take advantage of that.
Thank you for the feedback! Thank you for the API and Webhooks suggestion, that is definitely an acceptable solution. Thankfully, being that we are a Shopify Plus customer, we are were able to take advantage of the Workflow functionality. Easy to setup and it works like a charm! Thank you all so much.