Delete Invoice
DELETE/rest/invoices/:invoice_number
/rest/invoices/:invoice_numberDeletes a specific invoice by its invoice/debt claim number. On success this request returns no body, only response code 204 No Content.
info
An invoice with an active payment plan cannot be deleted — deleting it would remove the plan and its scheduled instalments as well. Cancel the payment plan first, or deactivate the invoice instead of deleting it. Plans that are already completed, cancelled or failed do not block the delete.
Request
invoice_numberStringrequiredAppend invoice number to
/rest/invoices/#invoice_numberExample Request
DELETE /rest/invoices/fhd-12102020
Authorization: Basic <base64(api_key:api_password)>
Response
The response is empty on success (HTTP 204 No Content).
Error responses
| Status | When | Body |
|---|---|---|
| 404 | No invoice with this number for the authenticated merchant | { "message": "Invoice not found.", "error": "Invoice not found." } |
| 422 | The invoice has an active payment plan | { "message": "Payment plan must be stopped before deleting the invoice.", "error": "Invoice has an active payment plan." } |
Example — invoice still has an active payment plan
{
"message": "Payment plan must be stopped before deleting the invoice.",
"error": "Invoice has an active payment plan."
}