Upload attachment to Quickbooks via API

Hi !

I spent the all night with no success on this.
Could someone help me ?

I want to send an Airtable attachement to Quickbooks.
The Airtable part is not a problem : webhook, automation etc… The file is download in binary mode and is the input of the http request to Quickbooks API.

The problem is the configuration of the http request node to Quickbooks API.
https://developer.intuit.com/app/developer/qbo/docs/api/accounting/all-entities/attachable#upload-attachments
https://developer.intuit.com/app/developer/qbo/docs/workflows/attach-images-and-notes

I’ve got this error :

{
“status”: “rejected”,
“reason”: {
“message”: “connect ECONNREFUSED 127.0.0.1:80”,
“name”: “Error”,
“stack”: “Error: connect ECONNREFUSED 127.0.0.1:80 at TCPConnectWrap.afterConnect [as oncomplete] (node:net:1187:16)”,
“code”: “ECONNREFUSED”
}
}

Is it a problem with the http request node ?
In this case, can someone give me an exemple ?

Or is it a network problem with the port 80 and docker ?
And how to solve that ?
I’ve done the docker installation according the doc in august 2021.
My n8n serveur is only reachable from 443 port, not 80 and I had no problem with other http request nodes

Thanks for your help !

Welcome to the community @Tom4444!

Could you please share the HTTP Request node you are using. That will make it easier to identify what is going wrong. Thanks!

The problem is my weak knowledge of http request and how to fill the http request node.

I think the error above was as stupid as forgetting to write the correct url.

I’ve decided to split the problem in 2 more little pieces :

  1. Upload an attachement
    Intuit Developer
  2. Link an existing attachement to a bill
    Intuit Developer

I really don’t know how to fill the http request node :

  • how do I put the needed boundaries ?
  • Is the file sent as binary ?
  • what about his data ?

Hey @Tom4444, the example you have provided looks good to me. The upload actually works with the logic you have built (I’ve swapped the prod API URL for the sandbox one here and simplified the workflow so I don’t have to rely on Airtable):

The one thing that appears to have been missing was the property name file_content_01 which seems to be what QuickBooks expects as per the docs you have linked:
image

When executing the workflow I get a success response from Quickbooks:

So once you adjust your workflow like in this example you should no longer see an error (assuming your credentials and IDs used in the respective API calls are valid of course :slight_smile: ).