FatturaPA (Italy / SdI)
00423
Importo non coerente / valore negativo non ammesso
What it means
An amount is not coherent with the document totals, or a negative line/total amount was used on a document type that does not allow it (e.g. TD01 invoice). Credit notes (TD04) use positive amounts on a TD04 document, not negatives on an invoice.
How to fix it
Recompute: ImportoTotaleDocumento should equal the sum over DatiRiepilogo of (ImponibileImporto + Imposta), adjusted for Arrotondamento, ScontoMaggiorazione, bollo, cassa and ritenuta as applicable. To reverse a previous invoice, issue a TD04 credit note with positive amounts rather than a negative invoice.
Catch this before it reaches the SdI:
# CLI
npx @eleata/validate-einvoice validate invoice.xml --format fatturapa
# GitHub Action — fail the build on any invalid invoice
- uses: hernaninverso/validate-einvoice-action@v1
with:
files: invoices/**/*.xml
api-key: ${{ secrets.EINVOICE_API_KEY }}