Prevent duplicate transactions

Hi,

I am using the REST route /v1/bank_transactions to create transactions. Is there a way to prevent InvoiceNinja from creating duplicate transactions when I push the same transactions again a second time?

Currently I am running this task at 1:00 a.m. and I am pulling the transactions from my bank account but then only creating them in InvoiceNinja when they have “date created” = yesterday. This is completey working as aspected.

I wish to create the transactions a bit quciker when they are booked on my bank account. So “date created” = today and running the same task every few hours.

In that case it will create transactions multiple times as there seems no option to prevent InvoiceNinja from creating duplicates.

  1. Is there a way, either a setting in IN or a parameter in the REST API to prevent IN from adding duplicates?
  2. If not, could you imagine to add such an option?

Thanks,
Gijs

Hi,

@david can you please advise?

I think the main problem here using just the date / amount is that the may not be accurate enough to prevent duplicates or may even prevent valid transactions from being added.

You may want to perform some filtering prior to inserting data, or validate that the item does not exist in the API prior to creating a new transaction depending on your own parameters.

1 Like

Thanks David,

each transaction has its ID. So I can already filter duplicates before I submit them through the API to InvoiceNinja. But I am, like most people, very lazy :wink: and I was hoping IN had some option to prevent duplicates.

No problem at all. I will change my process and check for the internal ID before adding the transactions to IN.

Cheers,
Gijs