API - How do I "pull" invoices between specific dates?

I’ve now got my bespoke accounts system pulling data from IN. Very happy :slight_smile:

However it pulls every invoice since the beginning!

So how do I

a) pull invoices from a specific date/invoice number?
As I add invoices into the system (and every client has a monthly recurring retainer too) I want to be able to pull new ones not already in the accounts system

b) pull invoices between specific dates?
My account sometimes asks for this :frowning:

The documentation for API calls is a little sparse for my needs :wink:

I’m hoping I don’t need to make multiple curl calls (one for each invoice) to achieve this!


You can use the reports to filter invoices between a set of dates but it isn’t supported in the API.

If you’re a developer it shouldn’t be too hard to add, we’d most likely merge a pull request.

This is something I need/want in the API.

I’m intrigued now as to how do accounts packages (Xero, Quickbooks etc) do this? Do they take every invoice and filter at there end? If so, doesn’t this get really slow as the number of invoices gets large?

“If you’re a developer it shouldn’t be too hard to add, we’d most likely merge a pull request.”

I was a developer 20 years ago, and I’ve written a bunch of Perl scripts to integrate InvoiceNinja into my accounts system (LibreOffice spreadsheets) which works. If you point me in the direction I need to look, I could probably hack something together to achieve what i want and then make it available to you/everyone if they want to include it in their systems.

Interestingly since your reply, I’ve been playing around and discovered that if I pull invoices using updated_at I get the invoice with that timestamp pulls every one created after that date so I can actually work with this if i have to (my Perl script just drops the matching row). If this isn’t the intended behaviour, please don’t change it unless you have to :wink:

Tangential to this topic, but how do you combine the optional settings? I want to pass per_page and updated_at at the same time.

Here’s the relevant part of the code:


That’s the intended behavior, you can see the list of options here:


You can add multiple params to the query string. ie, /api/v1/clients?page=2&per_page=100

Thanks Hillel - very helpful. As this is the intended behaviour, I’ll code for this until I’ve got time to delve into the inner workings of the app.

On the params questions, this doesn’t work for me so I’ve opened a new topic here in case others are having the same issue.

Can you mark this one as [SOLVED] too please?