> ## Documentation Index
> Fetch the complete documentation index at: https://docs.gobl.org/llms.txt
> Use this file to discover all available pages before exploring further.

# Italy AdE ticket v1.x

Key: `it-ticket-v1`

Module: [github.com/invopop/gobl](https://github.com/invopop/gobl)

## Sources

* [Italian AdE Cassetto Fiscale](https://www.agenziaentrate.gov.it/portale/schede/comunicazioni/fatture-e-corrispettivi)
* [Italian AdE Fattura e Corrispettivi](https://www.agenziaentrate.gov.it/portale/schede/comunicazioni/fatture-e-corrispettivi)

## Correction Definitions

### Invoice Types

The types of invoices that can be created with a preceding definition:

* `corrective`

### Stamp Keys

Stamp keys from the previous invoice that need to be referenced:

* `ade-ref`

## Extensions

### AdE: Exemption Code

> [accordion] it-ticket-exempt
>
> | Code | Name |
> | - | - |
> | `N1` | Excluded pursuant to Art. 15, DPR 633/72 |
> | `N2` | Not subject |
> | `N3` | Not taxable |
> | `N4` | Exempt |
> | `N5` | Margin regime / VAT not exposed |
> | `N6` | Reverse charge |

### AdE: CF Product Key

Product keys are used by AdE CF to differentiate between goods
and services.

> [accordion] it-ticket-product
>
> | Code | Name |
> | - | - |
> | `goods` | Delivery of goods |
> | `services` | Provision of services |

### AdE: Lottery Code

Lottery key is used to identify the lottery number (Codice lotteria).
This lottery code is provided by the customer at the time of purchase.
It is used to identify the customer in the lottery system provided by the Agenzia delle Entrate.

> [accordion] it-ticket-lottery
>
> Pattern: `^[A-Z0-9]{8}$`

### AdE: Line Reference

Reference code provided by the AdE to be able to identify the specific line in credit notes.

> [accordion] it-ticket-line-ref

## Validation Rules

Validation rules check each struct against a set of assertions and report any
failures with a unique code and message.
[Read more about validation](https://docs.gobl.org/overview/validation.md).

> [accordion] bill.Invoice
>
> | Field | Test | Validation Code / Message |
> | - | - | - |
> | Invoice | <ul><li>Can convert to \[EUR]</li></ul> | `GOBL-IT-TICKET-BILL-INVOICE-08` Invoice must be in EUR or provide exchange rate for conversion |
> | `tax` | <ul><li>Present</li></ul> | `GOBL-IT-TICKET-BILL-INVOICE-01` Tax is required |
> | `tax.prices_include` | <ul><li>Present</li></ul> | `GOBL-IT-TICKET-BILL-INVOICE-02` Prices\_include is required |
> | `tax.prices_include` | <ul><li>One of \[VAT]</li></ul> | `GOBL-IT-TICKET-BILL-INVOICE-03` Prices\_include must be VAT |
> | `supplier.tax_id` | <ul><li>Present</li></ul> | `GOBL-IT-TICKET-BILL-INVOICE-04` Supplier tax ID is required |
> | `preceding` | <ul><li>Invoice type in \[corrective]</li><li>Present</li></ul> | `GOBL-IT-TICKET-BILL-INVOICE-05` Preceding documents are required for corrective invoices |
> | `lines[*]` | <ul><li>Line has tax category VAT</li></ul> | `GOBL-IT-TICKET-BILL-INVOICE-06` Line taxes must include VAT category |
> | `lines[*].ext` | <ul><li>Invoice type in \[corrective]</li><li>Ext require \[it-ticket-line-ref]</li></ul> | `GOBL-IT-TICKET-BILL-INVOICE-07` Corrective invoice lines require 'it-ticket-line-ref' extension |

> [accordion] tax.Combo
>
> | Field | Test | Validation Code / Message |
> | - | - | - |
> | `ext` | <ul><li>VAT without percent</li><li>Ext require \[it-ticket-exempt]</li></ul> | `GOBL-IT-TICKET-TAX-COMBO-01` Exempt VAT combo requires 'it-ticket-exempt' extension |
> | `percent` Calculated | <ul><li>Is VAT</li><li>Valid percentage</li></ul> | `GOBL-IT-TICKET-TAX-COMBO-02` Must be a valid value |


This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.