We are trying to hit Shopify API for search with particular tags. The issue is we do not get the updated tags immediately. Only when the customer’s information like address or email id is updated, only then we get the updated tags in the API.
Can we please fix the bugs so that as soon as the tags are updated, we get them in the API as well?
Please let us know if you need any additional information.
Hi Repspark,
Need a bit more information to help you.
Are you using webhooks? If so which one are you using?
What do you mean hitting shopify searching for a particular tag?
Cheers
Hi, we are using the below API request to get the customers who have tag as wholesale in their accounts. We found that if we update the tags, we do not get the updated information from the below API, unless we update information on the customer. Information like email or addresses.
https://****.myshopify.com/admin/api/2023-01/customers/search.json?query=tag:wholesale
Please let me know if you need more information.
I am having this exact issue too. We have added a tag to around 500 customers using the Add tags tool in admin. These customers are not returned in the REST API search unless we manually edit that customer in the admin. Have updated to the latest version of the API (2023-01) and are still getting the issue.
Hello,
I just tried it myself and can confirm that it works. It takes about 2-3 minutes, however, before the changes propagate through the system. Either that or Shopify is caching the query.
With graphql it takes about 10 seconds for the query to either return something or not.
Cheers,
Gary
Thanks fort the reply Gary. Odd that it’s working for you and not for me. I’ve just tried again and I am still getting the issue.
I tested this by adding a new tag to those tagged customers, tagging a total of 567 customers.
I called the search API periodically (approx every 2 seconds) and the number of results slowly increased however, they stoped at 67. So I am only retrieving 67 of the 567 customers in total.
If I manually update one of the customers in the Shopify admin, I get 68 results.
I am not sure if this is relevant, but we have 84854 customers and many of them (particularly those who I would expect to see in the results) have around 50 - 60 tags.
This only happens to newly added tags (ie, tags which have been added today) via the Add tags tool in admin.
All searches against historic tagging (regardless of how they have been added) are returning just fine.
I’ve tested on another store and am getting 230 out of a possible 2346 tagged customers.
Oh, that is quite a number of tags and quite a number of customers to be tagging. My dev store has about 5 customers
and it still took about 3 minutes to show up in the search results.
I’m not sure what your use-case is with the tags but maybe you might want to consider an alternative approach?
Cheers,
Gary
Thanks Gary,
We waited for almost 30 mins before pulling the customers with new tags and they are not received until we update the customer information. I have been checking this on a list of 30 customers which have around 5-6 tags.
We feel that search.json API does not check for the updated tags and brings back the historic data (which might be from the cache) and that it only updates when the customer details are updated.
Tags are important part of our integration where we filter customers based on the tags added.
Have you checked the search.json API result by updating the tags only?
Thanks.
Hi Repsspark,
Yeah I only updated the tags of the customer no other data.
Have you subscribed to the customers/update webhook? With that webhook you would at least be informed as soon as a customer has been updated, if it then contains one of the important tags then you could act on it instead of looping over all the customers..in a batch job.
Just an idea as an alternative solution?
Cheers,
Gary
Oh, that is quite a number of tags and quite a number of customers to be tagging.
Do you think? We have had no problem actually bulk tagging the customers and we are well within the 250 tag limit per customer. I don’t think this is down to the number of customers we are tagging nor the number of tags we are adding to customers.
Feels to me like this is some kind of API caching issue, the fact that tags added via a bulk update are not propagating to API search results until after a product is manually updated suggests that this might be the case.
Hi Gary,
We cannot use webhooks and need Shopify to fix this caching issue.
Can you help with that?
Thanks.
1 Like
Hi Repspark,
No sorry I cant help you with that. I think at this stage you should contact your partner representative directly and see if they can help you get in contact with some technical help.
I just a shopify partner that likes to help now and then.
Cheers,
Gary
Facing the same issue. Shopify support not helping at all. No idea how to solve this. Have you had any luck?
Not quite sure if this will work but - @ShopifyDevSup any chance you could jump in on this one?
Hi all, thanks for waiting on this response, our team has seen similar reports to the behaviour you’re mentioning here, so we’re happy to gather some information from you all and see if we can look into this.
I can’t guarantee a turnaround time on a response, but we’ll definitely investigate this further on our end. One thing I’ll note is that the search.json endpoint in the Customer API, while still accessible, is technically undocumented at the moment and no longer officially supported. That said, I don’t think this is what’s causing the issue, but did want to mention it in case it has relevance here.
For troubleshooting purposes, could you try to query the customer tags in GraphQL using an API client (Postman, etc.) and see if the issue replicates in GQL too? If so, could you respond here with an X-Request-ID from one of the response headers headers and the response body? If it’s not replicable on GraphQL - no worries! We’d still take an X-Request-ID header value from a REST call so we can pull the info in our logs and get in touch with the product team to further investigate. Here’s a quick example GQL query to pull the most recent customers who have been tagged the relevant tag if needed:
query {
customers(query: “tag:(your tag)”, first: 10, sortKey: UPDATED_AT, reverse: true) {
edges {
node {
id
firstName
lastName
tags
updatedAt
}
}
pageInfo {
hasNextPage
}
}
}
Hope to hear from you soon - we’ll get this looked into.
Al | Shopify Developer Support
@ShopifyDevSup
Thanks for looking in to this. I will look in to testing the query with GraphQL.
In the meantime, Can I check what you mean by this endpoint is technically undocumented at the moment and no longer officially supported. It is documented in Shopify Dev Docs here, where a specific example of searching by tags is given:
https://shopify.dev/docs/api/admin-rest/2023-01/resources/customer#get-customers-search?query=email:bob.norman@mail.example.com
Could do with clearing this one up as our app depends on this functionality.
Thanks!
Ciaron.
1 Like
@m60digital you beat me to it by 5 minutes 
Hi,
It looks as if this is now working.
Could you please clarify your statement on support for this feature going forward?
It is documented in Shopify Dev Docs here, where a specific example of searching by tags is given:
https://shopify.dev/docs/api/admin-rest/2023-01/resources/customer#get-customers-search?query=email:…
Our app depends on this feature so would be good to clear this up.
Thanks!
1 Like