Development discussions around Shopify APIs
Getting issue with date and time of the order webhook not getting midnight order and getting that orders in previous date
for example if I use "/admin/api/2020-10/orders.json?status=any&created_at_min=2021-07-28T00:01:00+05:30&created_at_max=2021-07-29T00:01:00+05:30&fields=name,created_at"
this returns me the order of 28 plus orders of midnight 29
and when I add filter of 29 and 30 date I do not get the midnight orders of 29
Solved! Go to the solution
This is an accepted solution.
With the issue of orders not being filtered properly, this has to do with the way the + is decoded when it get's to our servers. When a request with the following 2021-07-28T00:01:00+05:30 is sent, the + is decoded as a space and hence the request becomes 2021-07-28T00:01:00 05:30. With this, the timezone portion is ignored and the UTC timezone is used.
To get the appropriate results, you would have to encode the + operator, and this becomes %2B. Thus, the filtered date and timestamp should be 2021-07-28T00:01:00%2B05:30. Doing this, would ensure your results are filtered properly.
Also, I'd like to point out that the recommended way when filtering by dates is always to use the date and timestamp, and not the date only as that leads to UTC time and not the shop's time being used.
This is an accepted solution.
With the issue of orders not being filtered properly, this has to do with the way the + is decoded when it get's to our servers. When a request with the following 2021-07-28T00:01:00+05:30 is sent, the + is decoded as a space and hence the request becomes 2021-07-28T00:01:00 05:30. With this, the timezone portion is ignored and the UTC timezone is used.
To get the appropriate results, you would have to encode the + operator, and this becomes %2B. Thus, the filtered date and timestamp should be 2021-07-28T00:01:00%2B05:30. Doing this, would ensure your results are filtered properly.
Also, I'd like to point out that the recommended way when filtering by dates is always to use the date and timestamp, and not the date only as that leads to UTC time and not the shop's time being used.
Also if this doesn't save your problem , than if you want to fetch the date from 12 april to 15 april just fetch use date filter as 12 april to 16 april , hope this works as this works for me
User | RANK |
---|---|
44 | |
16 | |
9 | |
9 | |
7 |
Thanks to all Community members that participated in our inaugural 2 week AMA on the new E...
By Jacqui Mar 10, 2023Upskill and stand out with the new Shopify Foundations Certification program
By SarahF_Shopify Mar 6, 2023One of the key components to running a successful online business is having clear and co...
By Ollie Mar 6, 2023