validate_cedente_prestatore
Validate and build the seller (CedentePrestatore) block for FatturaPA invoices. Checks required fields, fiscal regime code, and Italian Partita IVA format.
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.
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.
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 |
|---|---|---|---|
| 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. | |
| denominazione | No | Company name (Denominazione). Mutually exclusive with nome+cognome. | |
| nome | No | First name (Nome), for individual sellers. | |
| cognome | No | Last name (Cognome), for individual sellers. | |
| regime_fiscale | No | Fiscal regime code RF01–RF19. Use get_regime_fiscale_codes() for the complete list. Most companies use RF01 (ordinary regime). | RF01 |
| indirizzo | No | Street address (via, piazza…) of the registered office. | |
| cap | No | Italian postal code (5 digits) or foreign equivalent. | |
| comune | No | City/municipality of the registered office. | |
| nazione | No | ISO 3166-1 two-letter country code of the registered office. | IT |
Output Schema
| Name | Required | Description | Default |
|---|---|---|---|
No arguments | |||