I'm using xero-node npm package & looks like it will save me a ton of time.
I want to create OR update multiple contacts but not sure how. I'm hoping someone from Xero monitors this tag.
var contacts = [];
var contact = { "Name": "ABC", ContactNumber:"code123"};
contacts.push(xeroClient.core.contacts.newContact(contact));
const retVal = await xeroClient.core.contacts.saveContacts(contacts);
If I run it once , it creates the contact ( or multiple if I add to the array ) . I want to update the contact using my code ( not the xero generated id - because then I would need to store that it my other system).
If I run it a second time , it fails. I assume that is because it is doing a PUT instead of a POST..?
Here are the docs. https://github.com/XeroAPI/xero-node/blob/2a1ec34888e998cabd72aa79fa58a5b14f2c9cd5/docs/Contacts.md