Shopify customers API specific range (min-max) for UPDATED_AT -return records with wrong UPDATED_AT

boazd
New Member
3 0 0

Hi all

When using the Shopify customers API placing a specific range (min-max) for UPDATED_AT -we get records with UPDATED_AT outside the range.
For example, if in the call we filter customers' ID update in April 2020 we get also customers updater in November 11th, 2020.
GET https://EXAMPLE.myshopify.com/admin/api/2020-01/customers.json?updated_at_min=2020-04-01T03:00:00&im...

 is the example list received from the API from April with wrong UPDATED_AT (And there are more in different updated times)
ID UPDATED_AT
2##########7 2020-11-11T11:11:48-05:00
2##########2 2020-11-11T11:12:12-05:00
2##########6 2020-11-11T11:12:12-05:00
2##########8 2020-11-11T11:12:13-05:00
2##########8 2020-11-11T11:26:45-05:00
2##########2 2020-11-11T11:26:46-05:00
...

we run this for more examples and stores  and got again records with updated_at  outside our query in dates 

Anyone had the same issue and found a way it can be fixed?


thank you
Boaz

0 Likes
_JB
Shopify Staff
Shopify Staff
761 89 170

Hey @boazd,

The URL you provided has a typo in the limit param, which is likely causing the updated_at_max to be ignored. I don't see the UTC offset in your date arguments, which means they will be interpreted at UTC. If this wasn't the intention, you can fix it by adding the timezone offset like this: 

 

customers.json?updated_at_min=2020-04-01T03:00:00-05:00

 

Let me know if you're still having an issue after fixing those things.

JB | 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
boazd
New Member
3 0 0

Hi 

thank you for the answer.

Did the changes but the problem remains.

here is the updated Json  after the corrections (removed the shop name)

https://<EXAMPLE>.myshopify.com/admin/api/2020-01/customers.json?updated_at_min=2020-04-01T03:00:00-...

The response still include update at records outside the limit


"customers": [
{
"id": 2901682028586,
"created_at": "2020-04-17T21:15:37-04:00",
"updated_at": "2020-11-11T12:26:48-05:00"
},
{
"id": 2901680521258,
"created_at": "2020-04-17T21:14:26-04:00",
"updated_at": "2020-11-11T12:26:48-05:00"
},
{
"id": 2901679767594,
"created_at": "2020-04-17T21:13:47-04:00",
"updated_at": "2020-11-11T12:26:48-05:00"
},

0 Likes
_JB
Shopify Staff
Shopify Staff
761 89 170

Hey @boazd,

In order to investigate further, kindly provide the X-Request-ID value from the response headers of a call that returns unexpected results. I'll use this to dig up more info from our logs.

JB | 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
boazd
New Member
3 0 0

Hi JB

Hope I identified X-Request-ID value correctly

Please Try 20210217090740

thank you

Boaz

 

0 Likes
_JB
Shopify Staff
Shopify Staff
761 89 170

Hey @boazd,

Was expecting something else. The value is returned as a response header with name X-Shopify-Request-ID. The value is a UUID formatted like this:  962016bc-7145-11eb-9439-0242ac130002

JB | 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
amosmos
Shopify Expert
33 1 10

Hi @_JB ,

 

I work with Boaz.

Here is the Request ID of a request I just did for customers with update date in April 2020: e9b5f0b0-3960-4314-9818-7bbb6a71dcab

The request is: https://<hidden>.myshopify.com/admin/api/2020-01/customers.json?updated_at_min=2020-04-01&updated_at...

The results include customers who's update date is November 2020, so the timezone is not the issue.

 

Thanks!

Amos

0 Likes
_JB
Shopify Staff
Shopify Staff
761 89 170

Hey @amosmos,

Thanks for providing that. I've pulled the logs and I do see something about a record with conflicting dates. Just to make sure we're looking at the same thing, can you confirm the id and exact timestamp of unexpected record? I'll get this in front of our developers for further investigation.

JB | 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
amosmos
Shopify Expert
33 1 10

Hey @_JB ,

 

Thanks for your help.

 

I looked at the first 10 or so and it's really all of them.

 

For example here are the first two:

id: 2901670232106 updated_at: 2020-11-11T12:26:50-05:00

id: 2901670068266 updated_at: 2020-11-11T12:26:50-05:00

 

Thanks,

Amos

0 Likes
_JB
Shopify Staff
Shopify Staff
761 89 170

Hey @amosmos,

Thanks for that. An issue has been raised with our product teams, I'll post back here when we have an update.

JB | 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