POST
Cancel an invoice
Scope:
sales:invoices.writehttps://api.holded.com/api/v2/invoices/{invoiceId}/cancelCancels a sales invoice, preventing further edits or payments. Returns 200 on success and 422 when the invoice state does not allow cancellation (e.g. already paid or voided). Use when the user asks to cancel or void an invoice, or says "quiero anular esta factura" or "cancelar factura".
Parameters
Path parameters
invoiceId
stringrequiredInvoice ID (24-char hex ObjectId)
Request
python
import requests
url = "https://api.holded.com/api/v2/invoices/{invoiceId}/cancel"
headers = {
"Authorization": "Bearer YOUR_API_KEY",
"Accept": "application/json",
}
response = requests.post(url, headers=headers)
print(response.json())Responses
Success responses
200Invoice cancelledError responses
400Bad requestapplication/json401Invalid or missing API keyapplication/json403Insufficient permissionsapplication/json422Unable to cancel invoiceapplication/json429Rate limit exceededapplication/json