[Weird] Customer inserted only after retrying a couple of times

New Member
3 0 0

Hi! I'm new to Shopify API and I'm working on an integration to migrate entities from other e-commerce to Shopify.

I've looked around the forum and didn't find an answer to this case yet.


When inserting a customer that has, for example, an email with invalid domain name, an error is returned. I've looked around and I know that Shopify validates emails against Mx. That's fine.

The thing is about consistency. 


So the error is thrown, and the customer is not inserted. But wait, what if I retry one more time? Nothing, same error.

One more time? So, now it gets weird. This third time (sometimes the 2nd, sometimes the 4th), even though the response keeps throwing the same error, the customer is inserted and does have it's ShopifyId.


In my particular case, I use the ShopifyId to later place orders for this customer, which I'm not able to link because of the failure.

Besides, if I happen to treat the response like an error, and try to reinsert the customer again, at some point the API will return that the email is already taken. So, the behavior is not predictable. 


In summary, I just wanted to know if there's some heuristic in the API causing this behavior, or if it's just random, or maybe there's something I'm missing.


Thanks in advance!