Covers all questions related to inventory management, order fulfillment, and shipping.
GET orders url does not include closed orders.
Even by adding ?id=1234567890123 I receive all not fulfilled orders.
...myshopify.com/admin/api/2022-xx/orders/?id=5172240154869
I would like to get closed orders from one month ago.
Is there a http what can return me old orders?
Thanks
Solved! Go to the solution
This is an accepted solution.
Hey @JohannDtec,
The REST Orders APIs default to returning orders with status=open as indicated in the documentation (despite the fulfillment_status default of any).
When querying the order endpoint for all orders within the last 60 days (see here), I would suggest following the example request provided in the docs to start from, and build filtering from there:
GET /admin/api/{version}/orders.json?status=any
If the intent of a request is to query instead by a specific order.id, this id value should be included in the URL path and not specifically as a filter - see example here. This endpoint doesn't default to order status values the same way as the endpoint above.
GET /admin/api/{version}/orders/{order_id}.json?{filter_params}
Cheers!
Developer Support @ Shopify
- Was this reply helpful? Click Like to let us 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 is an accepted solution.
@JohannDtec, glad it helped!
In my testing with status=any passed, all archived orders from the last 60 days were returned. When aiming to return orders that are older than 60 day window (available to apps with read_order), instead additional scope access to read_all_orders will need to be requested , and then updated for the app - more info here.
In my testing, everything is working as expected - across several apps and stores. However, if you are ever concerned about potentially unexpected behaviors or errors involving our APIs, please don't hesitate to connect with support directly sharing example requests details; endpoint used, request and response body if applicable, any error, and most importantly timeframe and x-request-id response header value.
Cheer!
Developer Support @ Shopify
- Was this reply helpful? Click Like to let us 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 is an accepted solution.
Hey @JohannDtec,
The REST Orders APIs default to returning orders with status=open as indicated in the documentation (despite the fulfillment_status default of any).
When querying the order endpoint for all orders within the last 60 days (see here), I would suggest following the example request provided in the docs to start from, and build filtering from there:
GET /admin/api/{version}/orders.json?status=any
If the intent of a request is to query instead by a specific order.id, this id value should be included in the URL path and not specifically as a filter - see example here. This endpoint doesn't default to order status values the same way as the endpoint above.
GET /admin/api/{version}/orders/{order_id}.json?{filter_params}
Cheers!
Developer Support @ Shopify
- Was this reply helpful? Click Like to let us 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
Thank you for the quick answer on this.
I was able to see some of the closed orders, but looks like if the order is archived it will not be in the returning json file any more. Correct?
Thank you for the additional information.
It helps lot to know this.
This is an accepted solution.
@JohannDtec, glad it helped!
In my testing with status=any passed, all archived orders from the last 60 days were returned. When aiming to return orders that are older than 60 day window (available to apps with read_order), instead additional scope access to read_all_orders will need to be requested , and then updated for the app - more info here.
In my testing, everything is working as expected - across several apps and stores. However, if you are ever concerned about potentially unexpected behaviors or errors involving our APIs, please don't hesitate to connect with support directly sharing example requests details; endpoint used, request and response body if applicable, any error, and most importantly timeframe and x-request-id response header value.
Cheer!
Developer Support @ Shopify
- Was this reply helpful? Click Like to let us 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
Thank you!