Cancel Invoice
Authenticate with either a Supabase session (member of the invoice’s organization) or an API key belonging to that same organization. Determines automatically whether the cancellation is direct or requires receptor approval per SAT rules — Timbrix cannot confirm receptor approval in real time, so a pending cancellation must be resolved manually via the resolve endpoint. This is a FLAT route — no organizationId in the URL, unlike create/list above; the organization is resolved from the invoice’s globally-unique uuid.
/organizations/{organizationId}/ in the URL. The invoice’s uuid (its folio fiscal, globally unique across all organizations) is enough to resolve the owning organization server-side, combined with the caller’s own auth context (session or API key).
Authentication
Accepts either:- A Supabase Bearer session (
Authorization: Bearer <token>) — the authenticated user must be a member of the invoice’s organization. - An API key (
X-API-Key: sk_...) with thewrite:invoicesscope — the key’s own organization must match the invoice’s organization, or the request is rejected with403 Forbidden.
Path Parameters
Request Body
motivo is 01 (sustitución). Must be the folio fiscal of an existing, vigente invoice belonging to the same organization, and cannot be the invoice being cancelled itself — an arbitrary or unverified UUID is rejected with a 400. Ignored for motivo 02, 03, and 04, even if sent.
motivo codes
How eligibility is determined
Timbrix computes, from the invoice’s own data, whether the cancellation applies directly or requires the receptor’s approval — this follows the SAT’s own rule and you never send it yourself; it’s returned in the response asrequiresApproval. The cancellation is direct (no approval needed) when at least one of these is true:
tipoComprobanteisE(Egreso) orT(Traslado)totalis ≤ $5,000 MXNrfcReceptorisXAXX010101000(público en general) orXEXX010101000(residente extranjero)- The invoice was issued 3 business days ago or less (Mon–Fri, America/Mexico_City calendar)
cancellationStatus: "aceptada" and the invoice’s status flips to cancelado immediately.
Mass cancellation limit
Organizations on the Starter or Pro plan are limited to 50 cancellation requests per calendar day; the 51st request that day returns400 Bad Request. Business and Enterprise plans have no daily limit.
Example Request
motivo: "01") — replacing this CFDI with an already-stamped corrected one:
Example Response
Direct cancellation — resolved immediately:Common Errors
400 Bad Request
motivo is invalid; folioSustitucion is missing when motivo is 01, is not a vigente invoice of the same organization, or is the same invoice being cancelled; the invoice is already cancelado; or the organization has hit the daily mass-cancellation limit (Starter/Pro plans).
401 Unauthorized
Missing or invalid Bearer token / API key.403 Forbidden
The authenticated user is not a member of the invoice’s organization, or the API key does not have thewrite:invoices scope / belongs to a different organization than the one that owns the invoice.
404 Not Found
uuid does not match any invoice, or (when motivo is 01) folioSustitucion does not match any invoice belonging to the same organization.
409 Conflict
A cancellation is alreadypendiente for this invoice. Resolve it via Resolve Cancellation — or wait for the receptor to respond — before requesting another.
Authorizations
API Key for authentication (format: sk_...)
Path Parameters
Folio fiscal UUID of the invoice to cancel
Body
01 = emitido con errores con relación (requiere folioSustitucion), 02 = emitido con errores sin relación, 03 = no se llevó a cabo la operación, 04 = operación nominativa relacionada en factura global
01, 02, 03, 04 "02"
UUID fiscal del CFDI que sustituye a este. Requerido cuando motivo=01, debe ser una factura vigente de la misma organización.
"d3bfbc57-44af-4390-a064-f0afab85e5df"
Response
"6a1b2c3d-4e5f-4890-9abc-def012345678"
Timbrix invoice record ID
"0f2a1c3e-1a2b-4c3d-9e8f-1234567890ab"
01, 02, 03, 04 "02"
false
pendiente, aceptada, rechazada "aceptada"
"2026-08-09T15:50:03.412Z"
null
null
"9f8e7d6c-5b4a-3210-fedc-ba9876543210"
null
null