Xero - beautiful accounting software

Xero Developer Help Center

Xero Developer Community

Community > Find a Developer >

How to update contact name?

Started by Kris Gella -   in Find a Developer

from Xero website they say we can update Contact Name via API.
i have tried to pass ContactID, ContactNumber and new Name value.

<Name>New Name1</Name>
<Name>New Name2</Name>

Message: "Another contact has this contact number. Please enter a different contact number."

pls halp!
@Chris - The ContactID, Name and ContactNumber are all unique identifiers. You can read more about this in the API Reference.

So the reason you're getting this message is one of your other contacts will be using one of these ContactNumbers already.

Tony Rule (Xero Staff)  

I get the same issue. The reason is not other contacts using this number, but the same contact having this number. Because the Api adds a new contact instead of updating the "Name" field of the same contact (If the ContactNumber is removed from the above query).

Is it not allowed to update the Contact "Name" field through API?

(Tried on the API Previewer as well as using sdk Contacts.UpdateAsync)

Iresha Jayasekara