Solved

Deprecation Warning blocking post order response

aweertman
Shopify Partner
6 0 0

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 

aweertman_1-1692984601443.png

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.
aweertman_0-1692984347419.png
I'm using the latest libraries according to the documentation

aweertman_2-1692984794711.png

Any help?

 

Accepted Solution (1)
lizk
Shopify Staff
246 58 72

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.

View solution in original post

Replies 4 (4)

lizk
Shopify Staff
246 58 72

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.

aweertman
Shopify Partner
6 0 0

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

lizk
Shopify Staff
246 58 72

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.

aweertman
Shopify Partner
6 0 0

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!!