Xero credentials authentication error

Describe the problem/error/question
Error when trying to connect between Xero and n8n, I get a 403 authentication unsuccessful error message. I’ve followed the steps exactly as per the Xero documentation but still not had any luck. At first I thought it could be to do with Xero permissions but I also tried this with a Xero admin. Also, I’ve followed the Xero troubleshooting guide and we’ve eliminated a TLS issue from potential factors as our organisation’s is the most up to date.

What is the error message (if any)?

{
  "errorMessage": "Forbidden - perhaps check your credentials?",
  "errorDescription": "403 - {\"Type\":null,\"Title\":\"Forbidden\",\"Status\":403,\"Detail\":\"AuthenticationUnsuccessful\",\"Instance\":\"5fca7b36-d3eb-413b-ba2a-42d80165e54c\",\"Extensions\":{}}",
  "errorDetails": {
    "rawErrorMessage": [
      "403 - {\"Type\":null,\"Title\":\"Forbidden\",\"Status\":403,\"Detail\":\"AuthenticationUnsuccessful\",\"Instance\":\"5fca7b36-d3eb-413b-ba2a-42d80165e54c\",\"Extensions\":{}}"
    ],
    "httpCode": "403"
  },
  "n8nDetails": {
    "nodeName": "Xero1",
    "nodeType": "n8n-nodes-base.xero",
    "nodeVersion": 1,
    "resource": "invoice",
    "operation": "get",
    "time": "07/10/2024, 15:37:12",
    "n8nVersion": "1.51.2 (Cloud)",
    "binaryDataMode": "filesystem",
    "stackTrace": [
      "NodeApiError: Forbidden - perhaps check your credentials?",
      "    at Object.xeroApiRequest (/usr/local/lib/node_modules/n8n/node_modules/n8n-nodes-base/dist/nodes/Xero/GenericFunctions.js:31:15)",
      "    at processTicksAndRejections (node:internal/process/task_queues:95:5)",
      "    at Object.execute (/usr/local/lib/node_modules/n8n/node_modules/n8n-nodes-base/dist/nodes/Xero/Xero.node.js:317:40)",
      "    at Workflow.runNode (/usr/local/lib/node_modules/n8n/node_modules/n8n-workflow/dist/Workflow.js:728:19)",
      "    at /usr/local/lib/node_modules/n8n/node_modules/n8n-core/dist/WorkflowExecute.js:673:51",
      "    at /usr/local/lib/node_modules/n8n/node_modules/n8n-core/dist/WorkflowExecute.js:1085:20"
    ]
  }
}

Please share your workflow

Share the output returned by the last node
If you need help with data transformations, please also share your expected output.

Information on your n8n setup

  • n8n version: 1.51.2
  • Database (default: SQLite):
  • n8n EXECUTIONS_PROCESS setting (default: own, main):
  • Running n8n via (Docker, npm, n8n cloud, desktop app): n8n cloud
  • Operating system: Windows 11 Pro

Hi @Oliver_Stonehouse

How did you configure the n8n app in your Xero Developer account? Do you have “n8n” in the name?


→ Xero doesn’t support app instances within the Xero Developer Centre that contain n8n in their name


Hi Ria. No I didn’t include n8n in the name, I think I called it invoicing automation app #1.

Please can someone get back to me on this, the issue has not been resolved?

Hello Oliver,

I’m not very aware of the Xero API but when I have a 401 or a 403 error on a built-in node, I always try 2 things to troubleshoot :

  • reach the API via an API testing soft like Postman
  • reach the API via the HTTP Request node, here a GET /invoices

If you have the same issue on Postman, this mean that your problem would be on Xero configuration end.

I hope you will solve this !
Mathias

Thanks, I’ll try this and let you know.