I’m working on migrating to the new API and noticed that when I use the server-side profile create(POST) or update(PATCH) and put “phone_number” as an attribute, I get back “Error: Conflict” if that phone number already exists in my Klaviyo account. However, if I instead put the phone number in the properties list as “$phone_number”, it updates the phone number just fine and allows duplicates.
I’m inclined to use the latter since the e-commerce platform I’m integrating DOES allow duplicate phone numbers, but I want to make sure I’m not missing something or this isn’t going to be “fixed” down the road to start throwing errors.
I guess broadly, what’s the difference between using attributes versus the “$” prefixed versions in properties? There seems to be similar behavior for the “email” attribute versus “$email” property.
Edit: Actually, a bigger issue is that on the old API, I could update $email and $phone_number properties by just posting with a profile ID and nothing in the payload except those properties. On the new API, if I try to do that, it says “A profile with id XYZ does not exist.” unless I put either “email” or “phone_number” in the attributes. But if I do that, I run into the “Error: Conflict” if the email/phone already exists.
The scenario is that a customer has uploaded a list from some event and bob@builder.com is added to Klaviyo. Then that customer goes to the website and registers, but accidentally types “bobb” with two b’s. My integration happily creates his profile in Klaviyo with the typo. He realizes he messed up, so he changes his email address, then my integration tries to update the email and gets “Error: Conflict” because that email address already exists in Klaviyo. In the old API, as long as I sent an external ID (just called “id” in the old API), that took priority as the identifier and it would have allowed the update.