Questions and discussions about using the Shopify CLI and Shopify-built libraries.
I can't get around this deprecation warning interception blocking an actual response from the POST order to the shopify node.js REST API, I've even dumbed my order body down to the example on the docs and still getting
The session seems set up fine, all my GET requests are successful, but any POST request, either order or customer creation is getting interception with a deprecation warning and not giving me a response.
I'm using the latest libraries according to the documentation
Any help?
Solved! Go to the solution
This is an accepted solution.
If the order is created then the orderRequest object will be updated with the data that was returned. You will continue to use the orderRequest object instead of creating a new object.
The API deprecation is just a notice. It is to let you know that in the those properties have been deprecated. If you are not using them, then no action is required at this time.
To learn more visit the Shopify Help Center or the Community Blog.
I believe that your code may actually be working. The save function returns a void promise, so your result being undefined is expected.
The save function instead updates the orderRequest object if the request has been successful.
To learn more visit the Shopify Help Center or the Community Blog.
Thanks,
According to the REST API Node.js documentation for the create order route,
https://shopify.dev/docs/api/admin-rest/2023-07/resources/order#resource-object
I was expecing a 201 response with the order, so that I can use this newly created order. If it's not on the save function return where is it in that set up?
When I do an ajax curl request directly to the API
"https://your-development-store.myshopify.com/admin/api/2023-07/orders.json";
I get the order response i'm expecting. So my solution was going to be scrapping the node.js version altogether and make curl requests. But I'd rather use the node.js packages if I can get that response
Also, how do I get around that deprecation message? Even if it's not the blocker, it still is disconcerting. I'm not using any of the deprecated fields mentioned in the documentation.
Thank you for your assistance with this! I really appreciate your response
This is an accepted solution.
If the order is created then the orderRequest object will be updated with the data that was returned. You will continue to use the orderRequest object instead of creating a new object.
The API deprecation is just a notice. It is to let you know that in the those properties have been deprecated. If you are not using them, then no action is required at this time.
To learn more visit the Shopify Help Center or the Community Blog.
You are correct, after the await save is made the orderRequest object has been updated with the new data like id of the order. Thanks for walking me through this!!