The QuickBooks “Send Invoice” node fails before sending the request.
Error:
TypeError: Cannot set properties of undefined (setting ‘Content-Type’)
Stack Trace:
TypeError: Cannot set properties of undefined (setting ‘Content-Type’)
at ExecuteContext.quickBooksApiRequest
(…/nodes/QuickBooks/GenericFunctions.ts:70:35)
Expected Behavior
The node should send the invoice successfully using the QuickBooks API.
Steps to Reproduce
Create an invoice.
Add a QuickBooks “Send Invoice” node.
Provide a valid Invoice ID.
Provide a valid email address.
Execute the node.
Environment
n8n version: 2.29.9
Deployment: Self-hosted
Binary Data Mode: filesystem
Additional Information
Same error occurs on both local and self-hosted instances.
Hardcoded Invoice ID and email produce the same error.
The failure occurs before the request reaches QuickBooks.
The QuickBooks API documentation specifies Content-Type: application/octet-stream for this endpoint.
Hi @ankitsingh3112 Welcome!
That stack trace lands inside the node’s own code (quickBooksApiRequest at GenericFunctions.ts:70), where it sets Content-Type on a headers object that is undefined, so Send Invoice throws before any request leaves n8n. It’s a bug in the node, not your setup, which is why hardcoded IDs and both instances fail the same way.
Until it’s patched, bypass the operation with an HTTP Request node using your QuickBooks Online OAuth2 credential (Authentication: Predefined Credential Type). Send an empty body to the send endpoint with the octet-stream header, putting your company (realm) ID, invoice ID and recipient in the URL:
POST https://quickbooks.api.intuit.com/v3/company/{realmId}/invoice/{invoiceId}/send?sendTo={email}
Header Content-Type: application/octet-stream
If that call comes back 401, that’s a separate known issue with the QBO credential on the HTTP Request node, not this endpoint:
@ankitsingh3112 hey! if you run into that 401 authorization failure using the predefined QBO credential on the HTTP Request node, it’s because n8n doesn’t trigger the token refresh flow correctly for custom HTTP modules.
the quick way to bypass the 401 is using Generic OAuth2 authentication instead of the predefined QBO credential inside the HTTP Request node.
set the Authorization URL to: https://appcenter.intuit.com/connect/oauth2
and the Access Token URL to: https://oauth.platform.intuit.com/oauth2/v1/tokens/bearer
then put in your QBO client ID and secret. once authorized this way, the POST request to the /send endpoint will authenticate successfully every time. let me know if you get stuck setting up the custom OAuth2 parameters!
We have taken a look at this and it looks like it might be fixed in a recent release, Please update and see if you are still running into the same problem.
Appreciate the clarification here. These kinds of errors can be confusing when they look like setup problems, so having the root cause explained makes it much easier to troubleshoot.