I use Laravel with BasicShopifyAPI to create the orders and the code seems to be working fine - orders are created as expected.
Recently, I’ve added a new partner shop to my production site (using private apps). The partner has set ‘Orders’ permission to ‘Read and Write’ and my code can successfully parse the products, product listings, and the list of existing orders. But whenever I try to create a new order by calling POST admin/orders.json, nothing is created.
I receive no errors. Instead, the response contains the list of all of the orders. Looks like I call GET instead of POST but I checked that multiple times and pretty sure that the POST method is used.
Then I realized one more thing: when I try to run the same code from my local computer, everything works fine. The problem exists only on production but I have rechecked all the environment configuration and the versions of libraries and found nothing there.
{
"errors":false,
"response":{"GuzzleHttp\\Psr7\\Response":[]},
"status":200,
"body":{
"Osiset\\BasicShopifyAPI\\ResponseAccess":{"orders":[...all of the orders are listed here...]}
}
}
Hey @kbeat , would you be able to share an example of an x-request-id response header value returned for a request where this unexpected behaviour is present. With that I can absolutely take a closer look at our logs and pass back any insights or next steps! - Cheers
I was able to dig deeper here and found the logs linked the ID you shared - this was logged as a GET method to the /admin/api/2021-07/orders.json endpoint in our system. I simulated several REST Order API requests (POST, PUT, GET) manually with an API client as well as cURL to be sure - but found no issue with our API.
From my understanding in the example shared the intention was a POST request, so my suggestion would be working through your apps configuration again, specifically referencing the documentation for any libraries in use.
Beyond that, you mentioned this was third-party library so I would consider looking for insights, open/related issues, or creating your own in their GitHub repos as next steps. For convenience, we have our first-party and some third-party libraries listed, each with links to GitHub.
Hope you are able to get this figured out soon! - Best