Corrective invoices and voids follow the rules of the law
A corrective can no longer rectify more than was invoiced, has a deadline, and can fix the recipient's data; a sent or paid invoice is voided only if issued in error.
A corrective invoice and a void are two different fiscal acts, and the API now tells them apart the way the law does. A corrective corrects an operation that took place: it cannot take any rate below what was invoiced, it has a four-year deadline, and each reason code has its conditions. A void is only for an invoice issued by mistake. Corrective invoices and voids already issued do not change.
What breaks
- A
TOTALcorrective takes nolines. It rectifies everything still invoiced on the original, its live correctives included. Sendinglinesanswers422 RECTIFICATIVA_TOTAL_CON_LINEAS; until now they were accepted, and without them the original lines were copied negated. ATOTALon an invoice that earlier correctives already brought to zero answers422 CORRECTIVE_NOTHING_LEFT_TO_RECTIFY. - A
PARTIALcorrective cannot rectify more than was invoiced. Counting earlier correctives, no rate may end below zero:422 CORRECTIVE_EXCEEDS_INVOICED_AMOUNT, withtax_groupandmax_reductioninerror.details. APARTIALthat only changes the withholding answers422 CORRECTIVE_WITHHOLDING_ONLY: a withholding is not a reason to correct, so void the invoice and issue a new one. - Four years to correct. Counted from the original's operation date or, for a cause of article 80 of the VAT Act, from the new optional
circumstance_date. Past it:422 CORRECTIVE_OUT_OF_TIME, withdeadlineandcounted_frominerror.details.circumstance_dateis rejected withR4(422 CORRECTIVE_CIRCUMSTANCE_DATE_NOT_APPLICABLE) and outside the original's operation date and today (422 CORRECTIVE_CIRCUMSTANCE_DATE_OUT_OF_RANGE). R2andR3have conditions. Both need a recipient established in Spain, the Canary Islands, Ceuta or Melilla (anR2also in another EU member state):422 CORRECTIVE_RECIPIENT_NOT_ESTABLISHED. AnR3needs six months since the original's operation date (422 CORRECTIVE_BAD_DEBT_TOO_EARLY, withearliest_date) and, on a base of 50 € or less, the newrecipient_is_business: true(422 CORRECTIVE_BAD_DEBT_BASE_TOO_LOW).- An original rejected by the AEAT is fixed first. When VeriFactu rejected the original's record and it was not resubmitted, a corrective answers
422 CORRECTIVE_ORIGINAL_RECORD_REJECTED. - Voiding a sent or paid invoice needs
issued_in_error: true, confirming the operation never took place, was a test or a duplicate; without it:422 VOID_REQUIRES_ISSUED_IN_ERROR. An invoice with live correctives cannot be voided (422 INVOICE_HAS_LIVE_CORRECTIVES), nor can aTOTALcorrective (422 TOTAL_CORRECTIVE_NOT_VOIDABLE).
Does this affect you?
- If you send
lineson aTOTALcorrective, remove them. - If you void invoices that were already sent or paid, send
issued_in_error: truewhen that is the case, and use a corrective otherwise. - If you correct a withholding with a
PARTIALcorrective, void and reissue instead. - If you issue
R3correctives, check the six months and sendrecipient_is_businesson small operations. - If you branch on
error.codefor corrective or void requests, add the new codes.
What else changed
- Correct the recipient's data. When the invoice recorded its recipient with a wrong name, tax ID or address, send the corrected
recipientwithPARTIAL,R4and nolines: the amounts do not change. Another person is not a data correction (422 CORRECTIVE_RECIPIENT_IS_ANOTHER_PERSON); the same data as recorded answers422 CORRECTIVE_RECIPIENT_UNCHANGED.recipienton any other corrective still answers422 CORRECTIVE_RECIPIENT_NOT_ACCEPTED. - The corrective series is created for you. Without
series_idand without a default corrective series, one is created on first use (codeR, or the next free one) instead of answering422 SERIES_DEFAULT_NOT_FOUND. - A corrective whose
total_to_payis 0 is issued asPAID, withpayment_dateequal toissue_date. CORRECTIVE_RECENT_DUPLICATEcovers two minutes, not 24 hours. It catches a double submission; a second identical corrective a few minutes later is no longer refused as a duplicate.- A simplified invoice is always corrected with
R5. To give its customer a full invoice with their details, use the exchange of simplified invoices, not a corrective.
Endpoints
- POST/v1/companies/{company_id}/invoices/{invoice_id}/correctiveNew optional circumstance_date and recipient_is_business; recipient accepted for an R4 data correction; new 422 codes
- POST/v1/companies/{company_id}/invoices/{invoice_id}/voidNew issued_in_error; 422 VOID_REQUIRES_ISSUED_IN_ERROR / INVOICE_HAS_LIVE_CORRECTIVES / TOTAL_CORRECTIVE_NOT_VOIDABLE
Where to go next
The VeriFactu status webhook says whether it reports the registration or the cancellation
`verifactu.status.updated` now carries `operation`: `REGISTRATION` or `VOID`. AEAT's answer to a cancellation reaches you by webhook without a lookup.
Series by type, and what AEAT would reject is refused before numbering
A series numbers only its own type, and an invoice AEAT would reject answers `422` before a number is used. Zero-total invoices are accepted and issued paid.