Invoice Ninja node - Expense date does not work

Describe the problem/error/question

The Invoice Ninja create an expense node does not send Expense date

What is the error message (if any)?

The field is expenseDate when it should just be date

Information on your n8n setup

  • n8n version: 2.2.4
  • Database (default: SQLite): SQLite
  • n8n EXECUTIONS_PROCESS setting (default: own, main): Own
  • Running n8n via (Docker, npm, n8n cloud, desktop app): Docker
  • Operating system: Ubuntu 24.04

Hi @Wade0,

please can you share your workflow in a code block so we can better understand what is going on in your workflow

As per screenshot the Expense date in the nodes backend is not sending to date as it is set to expenseDate and not date.

Hi @Wade0,
It seems to be an issue with the Data Type mismatch.
Try using {{ $luxon.DateTime.fromISO($json.date).toFormat(‘yyyy-MM-dd HH:mm:ss’) }}.
Adjust the format according to the expected format.

It’s not writing anything to date that’s why its filling in Todays date due to a field-name mismatch between:

  • what Invoice Ninja’s API expects (date, payment_date in Y-m-d), and

  • what the n8n Invoice Ninja node is actually sending (it looks like it’s using expenseDate internally).

Here is the problem should be body.date

Hi @Wade0 ,

According to the invoice ninja api code for the expense model, it is definitely expecting “exepense_date”

Hi @Wade0,

Ok so I installed invoice ninja locally and tested your claims. While expense_date is the valid and correct field for the expense request, it seems like this is a problem in invoice ninja itself ignoring the expense_date field. You seem to be correct that ‘date’ will set the actual date. I tested this both with the ninja node as well as making a direct http rest call to their API. Same results.

However, when using the http node and setting ‘date’, it seems like invoice ninja does use this as the date.

Thus, I wouldnt call this a bug in n8n’s invoice ninja node, however maybe a suggested enhancement to add the “Date” field as a possible input.

Having all that said, maybe for now, just use the http rest call direct when dealing with Expense creation if you want to set the date. See below example:

And when using the date in the rest http node, it does work:

@Wouter_Nigrini Thanks for the extra insight. I am using the Http node for now.

Ok I see now I am using v5-Stable and expense_date is used in the Master branch.

Guess I’m going to have to wait for that to be pushed to Stable

Thanks all for the help. :+1:

1 Like

This topic was automatically closed 7 days after the last reply. New replies are no longer allowed.