December 27, 2018 at 11:08 am #17868
I’ve now got my bespoke accounts system pulling data from IN. Very happy 🙂
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 🙁
The documentation for API calls is a little sparse for my needs 😉
I’m hoping I don’t need to make multiple curl calls (one for each invoice) to achieve this!
ThanksDecember 27, 2018 at 5:26 pm #17872
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.December 28, 2018 at 11:25 am #17883
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 😉
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.December 28, 2018 at 12:59 pm #17884
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=100December 30, 2018 at 11:04 am #17985
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.December 30, 2018 at 1:42 pm #17992
Can you mark this one as [SOLVED] too please?
You must be logged in to reply to this topic.