Uploading attachment to Xero Invoice

Describe the problem/error/question

I am trying to upload an attachment to an existing invoice on Xero. My workflow can successfully create the invoice, but when I try and upload an attachment to the invoice my node just hangs.

What is the error message (if any)?

It just hangs, never executes

Please share your workflow

Information on your n8n setup

  • n8n version: 2.3.5

  • Database (default: SQLite):

  • n8n EXECUTIONS_PROCESS setting (default: own, main)

  • Running n8n via: (Docker)

  • Operating system: Ubuntu 22.04

The issue is likely with how you’re sending the attachment to the Xero API. You’re using an HTTP Request node and setting the `Content-Type` header to `application/pdf`, which is correct. However, make sure the `data` field in the HTTP Request node contains the actual binary data of the PDF file.

You’ll also need to ensure your Xero OAuth2 credentials have the correct scopes, specifically the `accounting` scope, as mentioned in the forum. Double-check your Xero app configuration to confirm the scope is enabled.

Give that a shot

thanks, I have check permissions and everything seems in order. The strange thing, is in Xero history I can actually see the response as being succesfull, but in n8n it errors and the attachment is n’t uploaded.

I am no expert, but I don’t think the request body looks correct being send by n8n.

Okay I have got it working, the build in Xero connector does not include the attachment scope, so you need to configure your credential connectors.

Hopefully n8n will update the Xero node to support attachments, it’s should be a default feature.

1 Like