Xero: More Resources

Currently, we only have the option of ‘Contact’ or Invoice’ with Xero, and many very helpful methods are missing (e.g. Bank Transactions, Invoices, Manual Journals, all can be found here: Accounting API HTTP Requests and Responses | Xero Developer

It would be great to see some more Resources added. Otherwise, any feedback on being able to access the Xero API directly via a HTTP request? I tried this, but found it difficult to connect Xero outside of the n8n module.

Hey @pb84,

We tend to update the nodes based on specific use cases as that can often solve issues quicker than implementing everything.

What would you like to do from the Xero node? The more specific the better :slight_smile:

1 Like

Absolutely:

Bank Transactions: Massively helpful

  • lets say you need to make a payment to 50 employees via a batch.
  • The Bank Transactions Resource will allow you to generate a bank transaction on Xero for this payment in advance of reconciliation. That is, you can automate filling out all of the line items, correct amounts paid to each employee etc
  • Without this you would have to manually enter 50 lines for each employee on Xero
  • Then when the payment clears on Xero, it can be automatically reconciled

This will be very very helpful to anyone using Xero to manage a business and n8n to manage automation (like us!)

Here is a screenshot of currently what is available on Integromat/Make.

Key Point:

Above are all convenient of course, but there is one single integration, that if possible, would enable all of the above essentially in one go:

That is the Make an API Call:

image

With configurable fields:

If we could use something like this, then we could essentially manually create any of the other above integrations easily using the developer docs on Xero, until they become available on n8n.

You probably are aware already, but the poor transition from Integromat to Make has disappointed a lot of people and there is a mass exodus. If this feature was possible, it would definitely open n8n up to a lot of people in business who rely on Xero API (and currently use make/integromat for this).

Thanks so much!

1 Like

@pb84 thanks for that it is very useful, @Nivb_6 just so you are aware :slight_smile: not sure if you have anything like this up your sleeves for the future.

hi @pb84, thanks a lot for the feedback and the request
We do have on our (short term) roadmap a feature that is quite similar to the Make API Call, you would be able to do it easily (way easier than now) via the HTTPRequest node, this should allow you to do any operation that you like without the hustle of setting up credentials the hard way

On the Xero node front - We’ve processed several PRs regarding the Xero node recently, it definitely needs some love for our side, but for sake of priorities, I can’t really say that we’re going to do that soon.

If still needed, we could definitely help you set up the credentials via the current HTTPRequest node, just give us a shout

1 Like

Hi @Nivb_6, that is really pleasing to hear that you have a Make an API Call feature on the roadmap.

I would be incredibly grateful to take up your offer to assist with getting Xero credentials up and running via the current HTTPRequest node! I did try and do this with no success myself. What would be the best way of doing this?

Hey @pb84,

Which API are you trying to use with the HTTP Request node? Did you get any errors back? I know using Xero Webhooks can be a massive pain as the signing process involves a bit of extra code in a function node and allowing a library to be used.

1 Like

Hi Jon,

Yes exactly, trying to use the HTTP Request node. Have been able to:

  • Properly set up Credential for OAuth2 API (this works well):

Then when trying to execute the node:

Note: URL field is https://api.xero.com/api.xro/2.0/BankTransactions/{Valid-Transaction-String}

I suspect that my headers might be incorrect, but also that there might be more steps involved (some sort of response to Xero required)

Many thanks again!

Hey @pb84,

I would start by removing the authorization header, This would be set by the Oauth2 credentials automatically so that could be why you are getting an auth error.

With the credentials the Auth URL should only need to be https://login.xero.com/identity/connect/authorize the other parts will be sent automatically.

Hi @jon, thanks for this - I have made the change (set-up the Credential for OAuth2 API as recommended - this worked no problem). Still getting the same error when executing the node though:

Even if I remove the content-type header as well

Hey @pb84,

Is there anything else in the details?

Ah yes, please see below:

{
"status": "rejected",
"reason": {
"message": "403 -
{"Type":null,"Title":"Forbidden","Status":403,"Detail":"AuthenticationUnsuccessful",
"Instance":"f9b11bee-1ca4-4c6f-9416-2##########","Extensions":{}}",
"name": "Error",
"stack": "Error: Request failed with status code 403 at createError (/usr/local/lib/node_modules/n8n/node_modules/axios/lib/core/createError.js:16:15) at
settle (/usr/local/lib/node_modules/n8n/node_modules/axios/lib/core/settle.js:17:12) at
IncomingMessage.handleStreamEnd
(/usr/local/lib/node_modules/n8n/node_modules/axios/lib/adapters/http.js:269:11) at
IncomingMessage.emit (node:events:538:35) at endReadableNT
(node:internal/streams/readable:1345:12) at processTicksAndRejections
(node:internal/process/task_queues:83:21)"
}
}

Fixed:

You need to add the key and value:

  • Key: xero-tenant-id
  • Value: obtained with GET request: https://api.xero.com/connections

In the header; then everything works as expected

2 Likes