Re: Merged Customer disappears from API

Merged Customer disappears from API

HunkyBill
Shopify Partner
4853 60 562

Customer records A and B exist. Customer A is reachable with simple API call on Customer endpoint, GET with ID.

Merge Customer B into A. Merge goes excellent! Record for A maintains same ID. But a GET to the customer endpoint with that ID returns 404.

Why is that? What happened?

Custom Shopify Apps built just for you! hunkybill@gmail.com http://www.resistorsoftware.com
Replies 8 (8)

Abdullah-Korogl
Visitor
1 0 1

I had the same problem. Could you find any solution?

ShopifyDevSup
Shopify Staff
1453 238 512

Hi @HunkyBill and @Abdullah-Korogl 

The customerMerge mutation returns an asynchronous job rather than a customer object, so I suspect you are seeing a delay while the REST Admin API re-indexes.

I will check on the expected delay, but for now I would recommend querying the returned job with GraphQL to check on it's status, as well as the merged customer's details: 



query jobStatus($jobID: ID!, $customerId: ID!) {
job(id: $jobID) {
 id
 done
 query {
  customer(id: $customerId) {
   id
   displayName
   updatedAt
  }
 }
}
}
 

 

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

holidaypuzzles
Tourist
6 0 1

How long should it take to update? My entire app is broken because of this. It has been almost an hour. 

holidaypuzzles
Tourist
6 0 1

You can try making an update on the customer's profile on the website (I added a tag, saved and then removed the tag again and saved) I guess it forces a cache bust or updates a mapping somewhere. 

holidaypuzzles
Tourist
6 0 1

I am experiencing the same problem, not only does it return a 404 for the merged customer but it completely breaks the API call to get all customers from shopify (/customers.json) so my entire API is basically broken after merging a customer and there's nothing I can do to fix it. 

holidaypuzzles
Tourist
6 0 1

I have fixed the issue by making a random update to the customer's profile on the website. The customer is now available with the new ID and the /customers endpoint works again. I had tried this before and it didn't work. Not sure why it worked the second time round. 

holidaypuzzles
Tourist
6 0 1

This error is happening again and the solution above is not working anymore. 

 

If you use the Shopify API just stay away from the merge customer function. It is completely broken and the support team refuse to help me. 

HunkyBill
Shopify Partner
4853 60 562

It does make it harder to work with Shopify API when these kinds of things persist! Obviously it is a tougher problem then one would think.

Custom Shopify Apps built just for you! hunkybill@gmail.com http://www.resistorsoftware.com