Bug - Cannot get the orders when timezone was change.

albertfermo
New Member
3 0 0

Hi,

I just encountered a bug and I think it is a bug in Shopify. 


I created a new Development Store to test out my software by pulling the orders from Shopify order then store it to my software.
When I created the Development Store, the default time zone of my store is Canada (-5:00) so I changed it to fit my Time zone which is Singapore (+8:00).

before I change the time zone, I created a few orders to test it. when I try to check it in my POSTMAN, the created_at, updated_at and processed_at timezone is incorrect. 

I decided to change the timezone later and focus on pulling the orders in Shopify. 

 

Using Canada Timezone, I pull the orders in Shopify using this endpoint:

                     /admin/api/2020-10/orders.json?status=any&updated_at_min=2020-12-02T12:49:19-05:00 

Capture.PNG

The results is good, I was able to pull the orders.

 

Now, time to change the timezone to Singapore (+08:00).

I created another order to fit my timezone then pull this in Postman.

First, I didn't place the updated_at_min parameter to get the all the orders created in Shopify because I wanted to get the updated_at value of the last order I created.

End Point:  /admin/api/2020-10/orders.json?status=any

Result: 

Capture2.PNG

The results is good, I was able to get all the orders in Shopify.


Now, I copied the updated_at value then put this in my updated_at_min parameter.


End Point: /admin/api/2020-10/orders.json?status=any&updated_at_min=2020-12-03T02:00:34+08:00

Result:

Capture3.PNG

The Result is unexpected, I didn't get the orders I need..

 

I debug it by changing the date & time of the updated_at_min.

EndpointResult
/admin/api/2020-10/orders.json?status=any&updated_at_min=2020-12-03T01:00:34+08:00Same Result above
/admin/api/2020-10/orders.json?status=any&updated_at_min=2020-12-03T00:00:34+08:00Same Result above
/admin/api/2020-10/orders.json?status=any&updated_at_min=2020-12-02T23:00:34+08:00Same Result above
..... 
..... 
.... 
.... 
/admin/api/2020-10/orders.json?status=any&updated_at_min=2020-12-02T18:00:34+08:00Capture4.PNG

 

I finally able to get the orders using &updated_at_min=2020-12-02T18:00:34+08:00 but the actual value of the updated_at is 2020-12-03T02:00:34+08:00. 

8 hours difference, This is not good when I used this in my Software. I don't want to always place -8 hours in my date when pulling the sales order.


Btw, I posted this problem before in Technical Q&A section.
Shopify REST Orders API, Date parameters is not working properly. - Shopify Community

but since there is no one answering my problem, I debug this myself to find out the problem.

I hope Shopify will fix this issue.

Thank you.

0 Likes
_JCC_
Shopify Staff
Shopify Staff
158 21 27

@albertfermo ,

Happy to help you out with this issue.

I've done some testing and haven't been able to reproduce the issue. In order to assist you better, could you please provide the x-request-id from the response headers of a request that doesn't return a result when you expect one.

Thanks,

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

0 Likes
albertfermo
New Member
3 0 0

Hi @_JCC_ ,

This is the X-Request-ID: db334d2c-6008-4838-b435-8087dbbb9a38

 

0 Likes
_JCC_
Shopify Staff
Shopify Staff
158 21 27

Hey @albertfermo,

Thanks for providing the request-id!

Taking a look at the logs and the shop in question it seems in this case no result would be expected.

The request-id indicates an updated_at_min of 2020-12-03T02:00:34+08:00. The only order I believe you might be expecting to be returned has subsequently been marked as paid, and archived. That being said, the created_at date of the order is  2020-12-03T02:00:33+08:00 and the updated_at date would have initially mirrored the created date. With the updated_at_min provided 2020-12-03T02:00:34+08:00 being one second later this would cause that order to be excluded.

For example the following request would not return a result

/admin/api/orders.json?status=any&created_at_min=2020-12-03T02:00:34+08:00

Where as adjusting the seconds to 33 or less should return a result

/admin/api/orders.json?status=any&created_at_min=2020-12-03T02:00:33+08:00

I hope this helps but if not please don't hesitate to reply with any questions or points of clarification you may have.

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

0 Likes