The problem
Under Executive Decree 683/25, in force since September 2025, invoices are signed and submitted to the AGT in real time, as JSON, instead of a file sent from time to time. Schools, clinics and companies that already have their own system need to comply without rebuilding it.
The goal is a service those systems call through an API to issue the invoice, and that handles signing, submission, the deadline and the SAF-T file. AutoPropina is the first to integrate.
The approach
- 01
Two sources, compared field by field
The AGT's technical documentation (schemaVersion 2.0) differs from the decree on structural points: the submission identifier, the series now assigned by the AGT, the establishment, the tax nature of each line. I compared the two sources field by field and recorded the documentation's own contradictions, to confirm during homologation.
- 02
RS256 signature over the whole document
Each document is signed as a compact JWS, RS256, over the complete canonical JSON object. Concatenating fields and signing the result, the easiest mistake to make, is exactly what the documentation warns against.
- 03
Queued submission that never loses the answer
The system that requests the invoice gets it back signed straight away; submission runs through queues: register, poll the status at growing intervals, notify by webhook. The notification is stored in the same transaction that applies the AGT's answer, and an error that is not transient is not retried, because it would only burn the deadline.
- 04
Warning before the 24-hour deadline
The AGT allows 24 hours to submit a signed document and, after that, accepts it with a penalty. A job runs every 15 minutes and warns 4 hours ahead, once per document, in the console and by webhook.
- 05
SAF-T (AO) that passes the validator
Each company generates its own SAF-T (AO) 1.01, and the file is validated against the official schema. The validator caught constraints that reading the schema did not reveal, such as the 172-character limit on the Hash, which requires a second key. Either a valid file comes out, or an error does: never a file with documents missing.