FatturaPA Document Type Codes
When sending invoices to the Italian SDI (Sistema di Interscambio) in FatturaPA format, you can specify the document type using the type_document field. This field corresponds to the TipoDocumento element in the FatturaPA XML structure.
The type_document field is optional when creating invoices. If not provided, B2Brouter will automatically assign an appropriate default value based on the invoice type (regular invoice, credit note, etc.).
Setting type_document via API
Section titled “Setting type_document via API”{ "invoice": { "type_document": "TD01", "number": "1", "date": "2025-01-26", "contact_id": 12345, "invoice_lines_attributes": [...] }}Valid FatturaPA Document Type Codes
Section titled “Valid FatturaPA Document Type Codes”The following codes are valid for Italian FatturaPA invoices:
Invoice Types
Section titled “Invoice Types”| Code | Description (Italian) | Description (English) |
|---|---|---|
| TD01 | Fattura | Standard invoice |
| TD02 | Acconto/Anticipo su fattura | Down payment / Advance on invoice |
| TD03 | Acconto/Anticipo su parcella | Down payment / Advance on proforma invoice |
| TD04 | Nota di credito | Credit note |
| TD05 | Nota di debito | Debit note |
| TD06 | Parcella | Proforma invoice |
| TD16 | Integrazione fattura reverse charge interno | Local reverse charge |
| TD17 | Integrazione o autofattura per acquisti di servizi da soggetto non residente ai sensi dell’articolo 17, comma 2, DPR 633/1972 | Self-billing for EU services |
| TD18 | Integrazione della fattura del fornitore UE per acquisto intracomunitario di beni | EU acquisition reverse charge |
| TD19 | Integrazione o autofattura per acquisti di beni da soggetti non residenti ai sensi dell’articolo 17, comma 2, DPR 633/1972 | Not resident acquisition reverse charge |
| TD20 | Autofattura per regolarizzazione e integrazione delle fatture | Self-billing |
| TD21 | In caso di emissione di autofattura per regolarizzazione dello splafonamento | Regulated plafond self invoice |
| TD22 | In caso di estrazione beni da Deposito IVA | VAT deposit |
| TD23 | In caso di estrazione beni da Deposito IVA con versamento dell’IVA | VAT deposit with VAT payment |
| TD24 | Fattura differita – art 21, 4 comma, lett. a), del DPR 633/72, quindi fattura differita di beni e servizi collegata a DDT per i beni o da idonea documentazione di prova dell’effettuazione per le prestazioni di servizio | Deferred invoice with DDT |
| TD25 | Fattura differita di cui all’art. 21, 4 comma, lett. b), del DPR 633/72, quindi fattura differita per operazioni triangolari interne | Deferred invoice for internal triangular operations |
| TD26 | Per la cessione di beni ammortizzabili e per passaggi interni | Sales of assets |
| TD27 | In caso di fatture per auto consumo o per cessioni gratuite senza rivalsa | Free of charge or self-consumption |
Special Considerations
Section titled “Special Considerations”TD16-TD19 (Integration Documents)
Section titled “TD16-TD19 (Integration Documents)”These codes represent integration documents for reverse charge and similar mechanisms. When using these codes:
- They affect the calculation of the executable amount
- Special tax treatment applies
- The invoice represents a self-billing or integration scenario
Default Behavior
Section titled “Default Behavior”If type_document is not specified:
- TD01 is used for standard invoices
- TD04 is used for credit notes (when
is_credit_note: true) - Other types must be explicitly set when needed
Validation
Section titled “Validation”Invalid codes will result in a validation error indicating the list of valid codes.
Example: Complete Invoice with type_document
Section titled “Example: Complete Invoice with type_document”{ "send_after_import": true, "invoice": { "type": "IssuedInvoice", "type_document": "TD01", "number": "FAT-2025-001", "date": "2025-01-26", "due_date": "2025-02-26", "contact_id": 12345, "invoice_lines_attributes": [ { "quantity": 1, "price": 100.0, "description": "Professional services", "taxes_attributes": [ { "name": "IVA", "percent": 22 } ] } ] }}