validate_cedente_prestatore
Builds and validates the seller (CedentePrestatore) block for FatturaPA invoices, enforcing Italian VAT and tax regime rules. Returns a ready-to-use XML object or a list of validation errors.
Instructions
Validate and build the CedentePrestatore (seller) block for FatturaPA.
Use this as step 4 in the invoice generation workflow, after build_transmission_header() and before validate_cessionario(). Call get_regime_fiscale_codes() first if you need to look up the RF code.
Gruppo IVA (VAT-group) sellers: when id_codice is a VAT-group IdFiscaleIVA, pass codice_fiscale set to the Codice Fiscale of the specific participating member company issuing this invoice, never the group's own CF. This mirrors the buyer-side rule enforced by SdI scarto code 00327 (see mcp_fattura_elettronica_it.sdi.notifications.SCARTO_CODE_REFERENCE); SdI does not publish an equivalent seller-side control code, but the same distinction applies structurally.
Validates: either denominazione or both nome+cognome must be provided (mutually exclusive); regime_fiscale must be a valid RF01–RF19 code; Italian Partita IVA (id_paese='IT') must be exactly 11 digits; codice_fiscale, if provided, must be 16 alphanumeric characters (individuals) or 11 digits (companies/VAT groups).
On success returns {'CedentePrestatore': {...}} ready to pass to generate_fattura_xml(). On failure returns {'error': ''} listing all validation issues joined by '; '.
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| cap | No | Italian postal code (5 digits) or foreign equivalent. | |
| nome | No | First name (Nome), for individual sellers. | |
| comune | No | City/municipality of the registered office. | |
| cognome | No | Last name (Cognome), for individual sellers. | |
| nazione | No | ISO 3166-1 two-letter country code of the registered office. | IT |
| id_paese | Yes | ISO 3166-1 two-letter country code of the seller (e.g. 'IT'). | |
| id_codice | Yes | Partita IVA (11 digits) or foreign VAT number of the seller. | |
| indirizzo | No | Street address (via, piazza…) of the registered office. | |
| denominazione | No | Company name (Denominazione). Mutually exclusive with nome+cognome. | |
| codice_fiscale | No | Codice Fiscale of the seller, optional. Set this when id_codice is a VAT-group (Gruppo IVA) IdFiscaleIVA: value must be the Codice Fiscale of the specific participating member company, never the group's own CF. Emitted as DatiAnagrafici/CodiceFiscale, between IdFiscaleIVA and Anagrafica per the XSD element order. | |
| regime_fiscale | No | Fiscal regime code RF01–RF19. Use get_regime_fiscale_codes() for the complete list. Most companies use RF01 (ordinary regime). | RF01 |
Output Schema
| Name | Required | Description | Default |
|---|---|---|---|
No arguments | |||