This article explains which FatturaPA document types (TipoDocumento) fiskaly E-INVOICE produces for Italy.
The document type is not a field in the invoice request. It is derived from the operation you use. The supported types are:
TRANSACTION::INVOICE = TD01 — Fattura (invoice)
TRANSACTION::CORRECTION = TD04 — Nota di credito (credit note)
Advance payments (fattura di acconto)
FatturaPA defines TD02 for advances, which E-INVOICE IT does not currently emit. An advance is issued as a TRANSACTION::INVOICE for the amount received, producing a TD01 that covers the partial amount. Since the document type does not itself indicate an advance, we recommend carrying that in the line description, for example Acconto su contratto/ordine n. X del GG/MM/AAAA.
A balance invoice is a new invoice rather than a correction, so the system can't look up the advance invoice for you. Link it to the advance yourself using document.references.preceding_document, with the advance invoice's number and issue date.
Note: The AdE Guida alla compilazione delle fatture elettroniche provides TD02 for this case. If your process requires the dedicated document type, or you are unsure how the advance and balance amounts should be split, please confirm the approach with your tax advisor before implementing.