Solved

Getting "Not Found" response when trying to retrieve a single order using orders api

donny
Tourist
7 0 6

Trying to use the orders api endpoint to retrieve orders by order id but i am getting "Not Found". Verified that the endpoint is correct as it returns the order json in the browser. Key works as the

response is not auth related. Screenshot is attached. The X-Request-Id is 2219eb41-d130-47c3-b244-7398d853eced. Replaced order id and shop name with placeholders.

 

Screen Shot 2020-11-25 at 1.07.34 PM.png

 

Accepted Solution (1)
_JCC_
Shopify Staff
200 27 55

This is an accepted solution.

@donny ,

Thanks for providing the request-id.

Looking at the logs, you're not specifying the api version in the request.  I'm seeing /admin/api/orders/somenum.json instead of /admin/api/2020-10/orders/somenum.json. Without the version the REST endpoint will return a 404.

Hope that helps out.

Regards,

John

 

John C | Developer Support @ Shopify 
 - Was my reply helpful? Click Like to let me know! 
 - Was your question answered? Mark it as an Accepted Solution
 - To learn more visit Shopify.dev or the Shopify Web Design and Development Blog

View solution in original post

Replies 9 (9)

Gregarican
Shopify Partner
1033 86 285

This might not be the answer, but have you verified that your Postman session isn't pass along client-side cookies with the request? You can disable this feature in the Postman app settings...

donny
Tourist
7 0 6

yup. verified. Also tried this request via curl and it responded the same.

Gregarican
Shopify Partner
1033 86 285

I'm an idiot lol. You forgot the /api/ portion of the URL. 

https://{my_shop}.myshopify.com/admin/api/2010-10/orders/{order_no}.json

donny
Tourist
7 0 6

Ah sorry I must have removed that by accident. The original call included that in the url. It still returns the same result.

 

Screen Shot 2020-11-25 at 2.17.49 PM.png

 

 

Gregarican
Shopify Partner
1033 86 285

So you provided the request ID in your original post, which hopefully gives a Shopify staffer the ability to look into things on their end to see what happened. That's the long and short of it really, since the test API calls worked fine for me?

_JCC_
Shopify Staff
200 27 55

@donny,

Happy to help you out with this issue.

Looking at the logs the order being requested is outside of the 60-day window that is available to the read_orders scope.  This Link talks more about orders permissions, including how to request read_all_orders scope if that's something you need.

Hope that helps.

John

John C | Developer Support @ Shopify 
 - Was my reply helpful? Click Like to let me know! 
 - Was your question answered? Mark it as an Accepted Solution
 - To learn more visit Shopify.dev or the Shopify Web Design and Development Blog

donny
Tourist
7 0 6

Hey John,

Thanks for the response! I tried the request again with an order made yesterday and was still receiving the same error. X-Request-ID is 26c9323d-b8a2-4dcf-86b2-517eb480a07f

_JCC_
Shopify Staff
200 27 55

This is an accepted solution.

@donny ,

Thanks for providing the request-id.

Looking at the logs, you're not specifying the api version in the request.  I'm seeing /admin/api/orders/somenum.json instead of /admin/api/2020-10/orders/somenum.json. Without the version the REST endpoint will return a 404.

Hope that helps out.

Regards,

John

 

John C | Developer Support @ Shopify 
 - Was my reply helpful? Click Like to let me know! 
 - Was your question answered? Mark it as an Accepted Solution
 - To learn more visit Shopify.dev or the Shopify Web Design and Development Blog

donny
Tourist
7 0 6

Hey John,

I thought I had added that before but it seems not. Everything works now. Thanks!