Xero - beautiful accounting software

Xero Developer Help Center

Xero Developer Community

Community > API Endpoints >

May multiple contacts be generated with the same name?

Started by Chris Santala -   in API Endpoints

The documentation at http://blog.xero.com/developer/api/Contacts/ verifies the issue that I am encountering - I receive an error when trying to PUT a new contact with the same name as an existing contact.

May contacts be generated with the same name?
@Chris - both the ContactID and Name are unique fields for contacts in Xero so you can't have two contacts with the same name. I suggest you concatenate something unique to end of each one.

@everyone - would be good to know if many developers would like to see us have two types of contacts (companies and people) where we only require contacts of type "Company" to be a unique name? We could also look to support many people belonging to a company.

Tony Rule (Xero Staff)  

@Tony - Companies and people would be a very useful distinction for us. Or at least being able to add contacts to groups via the API.

WiseNET Integration Services  

@Tony not requiring Name to be unique would be useful for adding contacts via the API. Figuring out a unique id to append to name adds a bit of unnecessary overhead/complexity to PUT contact requests.

Frank Mullenger  


I seem to be having an issue related to ContactID and contact name coming from the api but not being unique.

That is, Ive got 2 contacts with the same name, but a different ContactID.

Any suggestions?


Support CashFlowBuilder  

@Tony, we've a client who has contacts with duplicate company names, and duplicate personal names, so that distinction would not be useful. Currently we're getting around this by annotating names accordingly, but this looks very unprofessional to recipients of invoices.

Since the API allows unique identification via the ContactID that Xero produces when a new contact record is created, it would seem that PUT operations should allow duplicates during creation, and POSTs should update record(s) as identified by the ContactID.

Chris Aves  

This would be very very useful for us too. We have integrated xero into our customer website, where many customers can belong to the same company and each of them can create orders. Right now each customer is a contact in xero, but then we can't really use the debtor exposure stuff properly, and our invoices are addressed to people, not companies.

Admin GoHiring  

Hi Tony & Ronan - yes would love to see the ability to have this implemented. Some of my clients who are RTO companies have overseas students and so there could be many with same first and last name. In addition, couple of tradies also have situation real estate companies (have managed to tweek with the branch name at the end). Definitely would be a A+

Gillian Rossouw  

I definitely need to be able to create contacts with the same name.
My clients are multinational, they have companies registered in many countries with the same name. I need to invoice to contacts with the same name, which at appears I currently cannot do.
At the moment I am having to replicate a unique name validator on my own contact creation process so that I don't generated errors with the Xero API when customers try to create their invoices.
Its a pain, and confuses my customers who wonder why they cannot register their company name with my software because the name is taken in a different country!

Mark Ogilvie  

Vote Here:
Contacts: Allow duplicate contact names

Gerard Mongan