When I use the createContact and enter an email that already exists I am given an error.
Uncaught (in promise) permission_denied, details: {"Error":"A member with these communication details (Email / Phone) already exists"} (403)
It would be great if it would instead update the user with the different field values I give it, specially the custom fields which I desperately need to update in a project.
According to API reference it says “newly created or updated contact’s ID when the contact has been created or updated” so I guess I should be able to update a contact.
Code I use is
let email = "existing email in wix CRM";
let contactInfo = {
"firstName": "Andreas",
"lastName": "Kviby",
"emails": [email],
"eMailStep": 1, // Custom field
};
console.log(contactInfo);
wixCRM.createContact(contactInfo)
.then( (contactId) => {
console.log(contactId);
} );
Is there any other solution to update information from code?