Merged Customer disappears from API

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?

3 Likes

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

1 Like

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

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.

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

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.

1 Like

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.

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.

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.