Discussing APIs and development related to customers, discounts, and order management.
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.
Solved! Go to the solution
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
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...
yup. verified. Also tried this request via curl and it responded the same.
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
Ah sorry I must have removed that by accident. The original call included that in the url. It still returns the same result.
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?
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
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
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
Hey John,
I thought I had added that before but it seems not. Everything works now. Thanks!