Feature Request
This is a follow-up to #7838 and #10066 (closed with no resolution). The problem has not been fixed as of v22.0.4 and v23.0.x.
Problem
The REST API allows creating a payment via POST /invoices/{id}/payments, but there is no way to delete one. The DELETE /invoices/payments/{id} endpoint does not exist — calling it returns "API not found
(failed to include API file)".
This makes it impossible to manage the full invoice lifecycle via the REST API alone. Concretely:
- A paid invoice cannot be deleted (returns 403 "not erasable") even after settounpaid + settodraft, because the llx_paiement_facture record is still present
- The only workaround is a direct SQL DELETE FROM llx_paiement_facture — which defeats the purpose of having a REST API
Requested endpoint
DELETE /invoices/payments/{id}
Where {id} is the payment ID from llx_paiement. This already exists as a UI action (action=deletepayment&paiement_id=X on compta/facture/card.php) — it just needs to be exposed in the API.
References
Feature Request
This is a follow-up to #7838 and #10066 (closed with no resolution). The problem has not been fixed as of v22.0.4 and v23.0.x.
Problem
The REST API allows creating a payment via POST /invoices/{id}/payments, but there is no way to delete one. The DELETE /invoices/payments/{id} endpoint does not exist — calling it returns "API not found
(failed to include API file)".
This makes it impossible to manage the full invoice lifecycle via the REST API alone. Concretely:
Requested endpoint
DELETE /invoices/payments/{id}
Where {id} is the payment ID from llx_paiement. This already exists as a UI action (action=deletepayment&paiement_id=X on compta/facture/card.php) — it just needs to be exposed in the API.
References