get_sdi_filename
Generate the official SDI filename for FatturaPA documents in the format IT{PartitaIVA}_{ProgressivoInvio}.xml. Validates sender VAT and progressivo, zero-padding when needed.
Instructions
Generate the canonical SDI filename for a FatturaPA document.
Use this when you need the official filename independently of generate_fattura_xml() (which also produces the filename). The SDI specification requires the format: IT{PartitaIVA}_{ProgressivoInvio}.xml, e.g. IT01234567890_00001.xml.
Validates: partita_iva_cedente must be exactly 11 digits; progressivo_invio must be 1–10 alphanumeric characters. Purely numeric progressivo shorter than 5 digits is zero-padded to 5 digits (e.g. '1' → '00001').
On success returns {'filename': str, 'partita_iva': str, 'progressivo_invio': str, 'length': int}. On failure returns {'error': ''}.
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| partita_iva_cedente | Yes | Partita IVA of the sender (CedentePrestatore) — 11 digits, without prefix. The SDI prepends 'IT' automatically. | |
| progressivo_invio | Yes | ProgressivoInvio used in DatiTrasmissione — max 10 alphanumeric chars. Zero-padded to 5 digits if purely numeric and shorter than 5 chars. |
Output Schema
| Name | Required | Description | Default |
|---|---|---|---|
No arguments | |||