Describe the issue/error/question
We’ve been using the Xero node to add/update Contacts for some time now with great success.
Specifically, when a contractor’s bank details are updated in our CRM, it sends a webhook with the update to N8N, which then, amongst other things, looks for the Contact in Xero, and either updates it, or creates it if it wasn’t there already.
This was working fine until recently.
If the Contact already exists, and we need to update the Bank Details (most common request), the call executes ok, but the result is NOT changed, and so we have to compare the returned value to the value we passed in and alert the user that the change failed and it needs to be done manually.
This, too, was working fine until recently.
Looking at the TS code in github, it looks ok to me, so I’m wondering if there is a problem at the Xero end. Ideally, I’d like to have a debug statement to log EXACTLY what was sent to Xero before I try and approach them with “Hey Mr. Xero, your API doesn’t work!”.
So, is anyone else having success (or failure) with Contacts in Xero now?
What is the error message (if any)?
Now, when we’re trying to create a new Contact, we get the following error, which suggests that the parameters into the node weren’t passed out in the HTTP call to Xero.
{“message”:“400 - {“ErrorNumber”:10,“Type”:“ValidationException”,“Message”:“A validation exception occurred”,“Elements”:[{“ContactID”:“00000000-0000-0000-0000-000000000000”,“Addresses”:[],“Phones”:[],“ContactGroups”:[],“ContactPersons”:[],“HasValidationErrors”:true,“ValidationErrors”:[{“Message”:“Contact name cannot be empty”}]}]}”,“name”:“Error”,“stack”:“Error: Request failed with status code 400\n at createError (/usr/local/lib/node_modules/n8n/node_modules/axios/lib/core/createError.js:16:15)\n at settle (/usr/local/lib/node_modules/n8n/node_modules/axios/lib/core/settle.js:17:12)\n at IncomingMessage.handleStreamEnd (/usr/local/lib/node_modules/n8n/node_modules/axios/lib/adapters/http.js:269:11)\n at IncomingMessage.emit (events.js:327:22)\n at endReadableNT (internal/streams/readable.js:1327:12)\n at processTicksAndRejections (internal/process/task_queues.js:80:21)”}
The fields are definitely filled, and I can see the values in the failed execution, so it’s as though the content parameters are not being passed to the Xero API call.
Please share the workflow
Even a simple test workflow with dummy content fails to create a Contact when it should succeed (and did previously).
{
"nodes": [
{
"parameters": {},
"name": "Start",
"type": "n8n-nodes-base.start",
"typeVersion": 1,
"position": [
240,
300
]
},
{
"parameters": {
"resource": "contact",
"organizationId": "df3094b1-8d76-4771-959e-4872dcbe1809",
"name": "Test Contact",
"additionalFields": {}
},
"name": "Xero",
"type": "n8n-nodes-base.xero",
"typeVersion": 1,
"position": [
460,
300
],
"credentials": {
"xeroOAuth2Api": {
"id": "11",
"name": "Xero Accounts"
}
}
}
],
"connections": {
"Start": {
"main": [
[
{
"node": "Xero",
"type": "main",
"index": 0
}
]
]
}
}
}
Share the output returned by the last node
Information on your n8n setup
- **n8n version:0.163.1
- **Database you’re using (default: SQLite):SQLite
- **Running n8n with the execution process [own(default), main]:own
- **Running n8n via [Docker, npm, n8n.cloud, desktop app]:Docker
- **Accessing Xero in: Australia