Xero - beautiful accounting software

Xero Developer Help Center

Xero Developer Community

Community > API Endpoints >

UpdateContactAsync not clear

Started by Darren Lawrence -   in API Endpoints

While building my own Wrapper I am confused with one of the API methods

The UpdateContactAsync mehod allows the update of a single Contact or a list of them

https://developer.xero.com/documentation/api/contacts#POST

For a single contact I dont see a problem

The call requires the Contacts object with a single contact and the contactID

var list = new List<Xero.NetStandard.OAuth2.Model.Accounting.Contact>();
list.Add(contact);

var header = new Xero.NetStandard.OAuth2.Model.Accounting.Contacts();
header._Contacts = list;

var task = Task.Run(() => xeroAPI_A.UpdateContactAsync(AccessToken, TenantID, contact.ContactID.Value, header));

BUT when updating multiple contacts you shouldnt need to pass a contact ID because they are all different!

So I expected a UpdateContactsAsync but there is none

var header = new Xero.NetStandard.OAuth2.Model.Accounting.Contacts();
header._Contacts = contacts;

var task = Task.Run(() => xeroAPI_A.UpdateContactAsync(AccessToken, TenantID, new Guid(), header));

I have not tested this yet but it don't look right!
Found a similar issue with
UpdateItemAsync

Apparently you can specify a list of Items to update but you need to provide an ItemID in the call!
 

Darren Lawrence