Skip to main content
POST

Cancel an invoice

Scope:sales:invoices.write
https://api.holded.com/api/v2/invoices/{invoiceId}/cancel

Cancels 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

invoiceIdstringrequired

Invoice 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 cancelled

Error responses

400Bad requestapplication/json
401Invalid or missing API keyapplication/json
403Insufficient permissionsapplication/json
422Unable to cancel invoiceapplication/json
429Rate limit exceededapplication/json