FatturaPA (Italy / SdI)

00320

CodiceDestinatario errato per FPA12

What it means

For a Pubblica Amministrazione invoice (FormatoTrasmissione=FPA12) the CodiceDestinatario must be the 6-character codice univoco ufficio from the IPA index.

How to fix it

Look up the recipient office in https://indicepa.gov.it and use its 6-character code; do not pad to 7 characters and do not use 0000000 for a PA.

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 }}

Other FatturaPA (Italy / SdI) error codes

All error codes →