I’m trying to search for existing customers first so that I don’t create duplicate customers in the database, but unless I can reliably search for the customers based on the reference_id then I have no choice but to blindly create a new customer for each new order, which in many cases will result in duplicate entry for a given customer.
I guess I can search based on email, since that seems to work. However there is still a potential for duplicate customer accounts if I filter by email, but something is certainly better than nothing.