check_ritenuta_acconto
Compute withholding tax (ritenuta d'acconto) for professional invoices. Supports multiple tax types and optional rate or amount overrides.
Instructions
Compute ritenuta d'acconto (withholding tax) for professional invoices.
Use this when issuing professional service invoices (TD01 or TD06) that are subject to withholding tax — typically for self-employed professionals, agents, or freelancers. Also mark the relevant line items with ritenuta='SI' in add_linea_dettaglio(), and pass the returned 'DatiRitenuta' dict to generate_fattura_xml() as dati_ritenuta.
tipo_ritenuta determines the rate: RT01/RT02 = 20% (ritenuta d'acconto, natural/legal persons), RT03 = 26.23% indicative (INPS gestione separata; verify current year), RT04 = 8.50% indicative (ENASARCO seller portion; verify current rates), RT05 = 10.00% indicative (ENPAM; rate varies by category), RT06 = variable rate — aliquota_override or importo_override is required. causale_pagamento: income category code for Mod. 770 (e.g. 'A' professional fees, 'O' occasional). aliquota_override: supply the actual rate (%) for RT06 or to override indicative rates for RT03–RT05. importo_override: supply the exact withholding amount when rate-based computation is imprecise.
Validates: tipo_ritenuta must be in RT01–RT06. RT06 requires aliquota_override or importo_override.
On success returns {'DatiRitenuta': {...}, 'importo_ritenuta': str, 'aliquota_applicata': str, 'imponibile_ritenuta': str, 'description': str, 'legal_ref': str}. On failure returns {'error': ''}.
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| imponibile | Yes | Taxable base amount subject to withholding tax (imponibile della ritenuta). Usually equals the net invoice total for professional services. | |
| tipo_ritenuta | Yes | Ritenuta/contributo type code: RT01 (persone fisiche, 20%), RT02 (persone giuridiche, 20%), RT03 (contributo INPS gestione separata, ~26.23%), RT04 (contributo ENASARCO, ~8.50% seller portion), RT05 (contributo ENPAM, ~10% indicative), RT06 (altro contributo previdenziale, rate=0 — compute amount directly). | |
| causale_pagamento | Yes | Income category code for withholding tax (CausalePagamento). Common values: A (professional fees), B (agent commissions), L (employment), O (occasional work), Q (commissions). See Agenzia delle Entrate Mod. 770 for the complete list. | |
| aliquota_override | No | Override the withholding rate as a percentage (e.g. 4.0 for 4%). Required for RT06 (variable rate). Optional override for RT01–RT05 when the statutory rate differs from the indicative table value. When provided, the table rate is ignored. | |
| importo_override | No | Override the withholding amount directly (e.g. 200.00). Use when the exact amount is known rather than computing from the rate. When both aliquota_override and importo_override are provided, importo_override takes precedence for the amount; aliquota_override is used for the AliquotaRitenuta field. |
Output Schema
| Name | Required | Description | Default |
|---|---|---|---|
No arguments | |||