Using Xero-node with a custom connection, the createContacts endpoint has been authorised for my app but any attempt to create a contact produces the same error:
"ErrorNumber": 17,
"Type": "NoDataProcessedException",
"Message": "No data has been processed for this endpoint. This endpoint is expecting Contact data to be specified in the request body."
Here's the code used to call xero-node after capturing tokens etc.:
let response
const contacts = [{EmailAddress:"any@email.com",Name:"the name"}]
try {
response = await xero.accountingApi.createContacts('',contacts,true);
console.log(response.body || response.response.statusCode)
} catch (err) {
const error = JSON.stringify(err.response.body, null, 2)
console.log(`Status Code: ${err.response.statusCode} => ${error}`);
return {error:"Unable to create Xero contact"}
}
Anyone know how to make this work?