Skip to content

Delete a draft invoice

DELETE
/v1/invoices/{id}
curl --request DELETE \
--url https://api.emite.cr/v1/invoices/example \
--header 'Authorization: Bearer <token>'

Permanently deletes a draft (status="draft") and all its child rows (lines, taxes, discounts, exonerations, payment methods — cascading via FK). Only a draft WITHOUT a number: one that already has a consecutivo (allocated by a signature that failed afterwards) returns 409 INVOICE_HAS_FISCAL_NUMBER — deleting it would leave a hole in the numbering; sign/submit it instead, and void it with a credit note if unwanted. Returns 409 INVOICE_NOT_DRAFT if the invoice has been signed or submitted — those documents cannot be deleted (Hacienda v4.4 requires a Nota de Crédito to revoke an accepted invoice). Returns 404 if the invoice does not exist or belongs to a different tenant.

id
required
string

Invoice UUID

Draft deleted.

Invoice not found.

Invoice is not a draft (INVOICE_NOT_DRAFT), or is a draft that already has a consecutivo (INVOICE_HAS_FISCAL_NUMBER).