Admin REST API

Admin REST API

Alexjakovlev
Tourist
4 0 1

Hi,

I use the Admin API for get orders from https://Preke1.lt shop.

When I request:

https://prece1-lv.myshopify.com/admin/api/2023-01/orders.json?limit=250&created_at_min=2023-03-01T00...

I got response where first order has date 2023.04.03.

When I request

https://prece1-lv.myshopify.com/admin/api/2023-01/orders.json?limit=250&created_at_max=2023-04-03T00...

I got response where are lot of orders until 2023.04.03.

How can I get those until 2023.04.03 orders using parameter: created_at_min?

 

Hi,

I use the Admin API for get orders from https://Preke1.lt shop.

When I request:

https://prece1-lv.myshopify.com/admin/api/2023-01/orders.json?limit=250&created_at_min=2023-03-01T00...

I got response where first order has date 2023.04.03.

When I request

https://prece1-lv.myshopify.com/admin/api/2023-01/orders.json?limit=250&created_at_max=2023-04-03T00...

I got response where are lot of orders until 2023.04.03.

How can I get those until 2023.04.03 orders using parameter: created_at_min?

Replies 4 (4)

ShopifyDevSup
Shopify Staff
1453 238 508

Hey @Alexjakovlev - thanks for reaching out. That is definitely odd - it should ideally pull all of the orders since that date. Can you try this call?

https://prece1-lv.myshopify.com/admin/api/2023-01/orders.json?limit=250&status=any&created_at_min=20...

 

This should pull all of the orders from between those dates and may help resolve the issue temporarily. I'm just suggesting this as a workaround for the time being - we are definitely happy to take a look into the issue further. Could you provide a recent X-Request-ID from the API response headers for an example API call where you only used the created_at_min filter and aren't seeing the correct orders? We can use that to track down an exact API call in our logs - the API call would have had to be made in the last 10 or so days of this post though. 

Hope this helps, looking forward to hearing from you.

 

Al | Shopify Developer Support 

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

Alexjakovlev
Tourist
4 0 1

Hi,

There are the two new my requests:

https://prece1-lv.myshopify.com/admin/api/2023-01/orders.json?limit=250&created_at_min=2023-04-19T00...

X-Request-ID: 722a8d02-9903-4575-82ad-315aa8c0e897

I had received orders from 2023.04.20 19:38:26 and no one order for 2023.04.19.

https://prece1-lv.myshopify.com/admin/api/2023-01/orders.json?limit=250&created_at_max=2023-04-20T00...

X-Request-ID: fde344ca-36c7-4071-aac5-ba2bdb58c129

I had received about 100 orders for 2023.04.19 date.

 

I think the solution is simple for bug fixing:

Instead SQL query:

 select top 250 * from orders where created_at_min>’2023-04-19’

 You need to use:

select top 250 * from orders where order desc created_at_min>’2023-04-19’

Alexjakovlev
Tourist
4 0 1

select top 250 * from orders where created_at_min>’2023-04-19’ order by desc

Alexjakovlev
Tourist
4 0 1

Final sql

select top 250 * from orders where created_at_min>’2023-04-19’ order by created_at_min desc