Tec Fattura24 Connector is the Tecnoacquisti module that connects PrestaShop to Fattura24 without manual intervention. Each order is sent to the billing service when it reaches the configured status, with independent rules for each type of tax or commercial document.
How it works
The module listens to the actionOrderStatusUpdate hook of PrestaShop. When an order changes status, the connector checks if there is an active rule for that status and, if so, generates the XML document and sends it to Fattura24 via the SaveDocument API. The entire flow is logged in a dedicated table, accessible directly from the order page in the back office.
Supported document types
| Code | Document type | Typical use |
|---|---|---|
FE |
Electronic invoice | Italian electronic invoicing with SDI/PEC. |
I |
Invoice | Standard Fattura24 invoice. |
I-force |
Forced invoice | Forced invoice flow Fattura24. |
R |
Receipt | Flow of receipts for B2C sales. |
C |
Customer order | Non-fiscal commercial document with e-commerce numbering. |
Main features
- Independent document rules: each document type has its own trigger status, numbering, template, and sending options.
- API key test: verification button from the configuration page before activating rules in production.
- Email sending from Fattura24: optional per rule type, can be disabled during testing.
- Mark as paid: writes
Paid=truein the payment node of Fattura24 when the order is confirmed. - Zero amount orders: configurable management per rule (can be enabled for free or zero-balance orders).
- Custom numbering: for customer orders (
C), number built with configurable tokens: year, order ID, shop code, order reference. - Idempotence:
idRequestunique for document type, order, and shop, to avoid duplicates in case of retry. - MySQL Lock: named lock to prevent concurrent submissions of the same order and document type.
- ArteInvoice integration: automatic reading of SDI and PEC fields from the billing address when available.
- Debug log: optional via
PrestaShopLogger, to be activated only during testing or diagnosis.
Configuration
From the module configuration page, first set the common API parameters, then the document rules.
| Field | Description |
|---|---|
| API Key | Fattura24 key, displayed masked. Leave unchanged to preserve the saved value. |
| HTTP Timeout | Seconds to wait for API responses. Values outside the range 5–120 are normalized to 60. |
| Debug log | Writes diagnostic messages to PrestaShopLogger. Enable only during testing. |
| Numbering ID | Optional Fattura24 numbering ID. Empty = default account numbering. |
| Template ID | Optional Fattura24 template ID. Empty = default account template. |
| Shop code | Short code for document numbering in multi-shop environments. Default: SHOP + shop ID. |
Order panel in the back office
The PrestaShop order page shows for each order:
- The active document rules and their trigger statuses.
- The submission history with status (
pending,sent,error), Fattura24 document ID, API response, and attempt counter. - The Send or retry button for each enabled document type, with a token dependent on the authenticated operator.
Submission flow
- The order changes status in PrestaShop.
- The module identifies the active rules whose trigger corresponds to the new status.
- For each rule, zero amount orders are skipped unless explicitly enabled.
- A MySQL lock is acquired for order, shop, and document type.
- A row is created or updated in
tecfattura24_document. - The module generates the XML document with billing address, product lines, discounts, shipping, and payment.
- The
SaveDocumentAPI of Fattura24 is called. - In case of success, the row is marked
sent; in case of error, it is markederrorand manual retry is available.
Requirements
- PrestaShop 1.7.8.11 or later (tested up to 9.1).
- Enabled PHP cURL extension.
- Valid Fattura24 API key.
- At least one enabled document rule with configured order status.
- Billing address data compatible with the chosen document type in Fattura24.
C or R and the email and paid options disabled.Regulations and responsibilities
Before using in production, it is necessary to verify the Fattura24 API regulations and the Fattura24 e-commerce regulations. The merchant remains responsible for the tax correctness of the data sent, the status of documents in Fattura24, and the SDI outcomes for electronic invoicing.
License and support
Module developed by Tecnoacquisti.com — Arte e Informatica by Loris Modena and C. s.a.s.
For assistance: helpdesk@tecnoacquisti.com or visit tecnoacquisti.com.