Happy to be part of the community and be able to use the n8n. It is great tool!
I‘m facing the following challenge.
I was able to connect to XERO using the standard XERO nodes provided by n8n in cloud (latest version).
However, I‘m missing some scopes, which I would like to use. Specifically the reporting scope.
I searched and found out that in local n8n installation, I could change the hardcoded scopes and add new ones (XeroOAuth2 file in GitHub) but I would like to do similar in cloud.
I understand this is not possible, therefore I would like to create my own custom workflow to authenticate to XERO and use it to get data from XERO APIs.
Is there anyone who could help or advise how to build the n8n Workflow, please?
Maybe I‘m missing some conceptual basics so this approach is simply not possible… Not sure.
Stop the local instance and change the scopes in the following file: …/n8n/packages/nodes-base/credentials/XeroOAuth2Api.credentials.ts
Build and start the app using: pnpm build, pnpm start
Create the OAuth credentials. (it is important to first change scopes and only after that create credentials)
Client ID and Secret created in Xero must be added.
Create a Workflow and add new HTTP node.
Important points in the HTTP node which I’m missing in the n8n documentation and should be added
Headers MUST include: xero-tenant-id, parameter - otherwise error: 401 unauthorized, is shown.
Tenant ID is basically Company ID, which can be found in the table: organization, in Xero system tables.
Pagination MUST be activated with interval between request set to for example 100ms - otherwise error: 429 too many requests, is shown.