Fix

API payment deletes check the invoice, and list filters refuse unknown values

Deleting a payment through the API now only deletes a payment of the invoice in the path and answers 404 otherwise, payments recorded or removed through the API update the invoice's state, and unknown filter values on the invoice, user and time entry lists answer 400 instead of failing or being ignored.

DELETE /api/v1/invoices/{id}/payments/{paymentId} read only the payment id: it would delete a payment that belonged to a different invoice from the one in the path, and answered 200 for a payment that did not exist. It now answers 404, and deletes nothing, when the invoice does not exist, the payment does not exist, or the payment belongs to another invoice.

Recording or removing a payment through the API now updates the invoice's state the way the app does, so an invoice paid in full reads paid, and one whose payment is removed goes back to open or partially_paid. Recording the payment that settles an invoice now sends the invoice.paid webhook, as it does from the app.

GET /api/v1/invoices?state=, GET /api/v1/users?role= and GET /api/v1/time_entries?approval_status= now answer an unknown value with a 400 that names the parameter and lists the values it takes. Before, the first two failed with a server error and the third ignored the filter and returned every entry.

← Everything that has changed

The hours, the invoices, and what they earned

Free for unlimited people. One paid plan, $10 per member per month, when you want HR, scheduling, timesheet approvals, scheduled backups, email from your own domain and scheduled reports.

Start free