Hi there,
I’m trying to update our Invoice Ninja (v4.5.50) content with data from a CSV file that is provided from our financial department. This file contains the date, the client id, the amount and the invoice number.
I want to mark the related invoices as paid via API.
So, after trial and error for several days, I would like to ask some questions to clarify how to proceed with implementing this:
Question 1:
We have the default “R” as prefix for recurring invoices. This is making me headaches, because this R is not present in the financial software. All invoice numbers are unique, so - in theory - I could abandon the R and be happy.
My question is: Can I safely remove the R prefix on /settings/invoice_settings#options
or do I break something important with that?
Question 2:
I struggle a lot with the API documentation, because it seems that the one for v4 is quite incomplete. For example if I try to find on API (VERSION 4) — Invoice Ninja 4.5.50 documentation how to either mark an invoice as paid or to insert a payment (still not sure which one to use here) there is no information about that. On the other side, the documentation on Invoice Ninja API Spec seems to be for Invoice Ninja v5 only.
Nevertheless, I tried to test the v5 API documentation for bulk invoice processing on Invoice Ninja API Spec to create one:
### Test bulk processing
curl -X POST ${apiurl}/invoices/bulk \
-H "${apikey}: ${apival}" \
-H "Content-Type: application/json" \
-H "X-Requested-With: XMLHttpRequest"
-d '{ "ids":["2404247"], "action":"mark_paid"}'
but this returns the error message The POST method is not supported for this route. Supported methods: GET, HEAD, PUT, PATCH, DELETE.
despite the fact that the API documentation clearly states Bulk invoice actions: POST /api/v1/invoices/bulk
on the above mentioned page. When replacing POST with PUT as a test, the response is record does not exist
no matter what I enter as data content.
So, I would really appreciate any hints (or other websites) with updates on how to mark invoices as paid by API. Also, if there’s a safe way to do this by SQL calls, I’m in.