MLInvoice icon indicating copy to clipboard operation
MLInvoice copied to clipboard

Add API support

Open aksl opened this issue 8 years ago • 2 comments

As the title says, would be nice to have some sort of API to query and even create invoices and clients. Quick way to implement a fetch-only API would be to print out the queried invoice in Finvoice format. JSON format would be nice, but not necessary.

It is already possible (and in my experience, rather easy) to create clients and invoices (and invoice rows) straight into database, but calculating sums is the problematic part with direct database access. I've previously solved this by creating slightly modified printer handler that either prints (echoes) invoice in Finvoice format or sends the invoice via email. The printer is then run over command line php, which requires shell access that might be problematic in shared environments.

aksl avatar Mar 31 '16 19:03 aksl

There's a fairly functional API in json.php, though it's more meant for internal use so subject to change and undocumented. Feel free to experiment anyway. A proper public API probably won't become before version 2 which doesn't have a timeframe at the moment.

emaijala avatar Apr 03 '16 13:04 emaijala

+1 for this feature. An API would allow automatically adding invoices and rows to existing invoices would enable many things to run in an automated way and improve efficiency. For our use case it would allow us to integrate invoicing with some of our other systems.

mtchetch avatar Jun 02 '24 08:06 mtchetch