validate_partita_iva
Validate an Italian Partita IVA by checking its 11-digit format and applying the modulo-10 checksum algorithm to ensure syntactic correctness.
Instructions
Validate an Italian Partita IVA for format (11 digits) and modulo-10 checksum.
Call this as an early sanity check on the seller's VAT number before passing it to validate_cedente_prestatore(). Strips whitespace before validation.
Applies the official Agenzia delle Entrate control algorithm: odd-position digits are taken as-is; even-position digits are doubled (subtract 9 if > 9); the last digit must equal (10 - sum % 10) % 10.
On success returns {'valid': true, 'value': '<cleaned_piva>'}. On failure returns {'valid': false, 'value': '', 'error': ''}.
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| partita_iva | Yes | Italian Partita IVA (VAT number) to validate. Must be exactly 11 digits. Whitespace is stripped before validation. |
Output Schema
| Name | Required | Description | Default |
|---|---|---|---|
No arguments | |||