VeriFactu Phase 3: Submission to AEAT
What is Phase 3
VeriFactu Phase 3 is the automatic submission of invoicing records to the Tax Agency (AEAT) using SOAP/XML messages. It complements the previous phases (SHA-256 hash and QR) with the effective transmission of each invoice registration and cancellation to AEAT's VeriFactu service.
With this phase active, Frihet generates the XML according to Order HAC/1177/2024, and sends it to AEAT through a connection authenticated with your digital certificate. Everything happens in the background, without manual intervention.
Digital Certificate
To submit records to the AEAT, you need a valid digital certificate. Frihet accepts certificates in .pfx or .p12 format.
Where to obtain a certificate
| Issuer | Type | Cost |
|---|---|---|
| FNMT (Fabrica Nacional de Moneda y Timbre) | Individual or legal entity | Free |
| CamCert (Camaras de Comercio) | Company | Variable |
| ACCV (Comunitat Valenciana) | Regional | Free |
Upload the certificate
- Go to Taxes → Compliance
- In the Digital Certificate section, click Upload certificate
- Select your
.pfxor.p12file - Enter the certificate password
- Click Save certificate and check that Certificate configured appears, with the subject, issuer and expiry date
- Review any tax ID mismatch or expiry warning before submitting records
Upload a file accessible on your computer or phone. Having a certificate installed in your browser or macOS Keychain does not configure it in Frihet automatically; you need the .pfx or .p12 file and its password.
Your certificate password is encrypted with AES-256-GCM before storage. It is never stored in plain text.
Sandbox vs Production
When configuring VeriFactu for the first time, test mode is enabled and automatic submission is disabled. Review both controls before issuing invoices.
The Test mode (sandbox) toggle in Taxes → Compliance allows submitting records to the AEAT's test environment before activating real submission.
- Sandbox: records are sent to the test endpoint. The AEAT validates them but does not officially register them. Useful for verifying that the certificate and data are correct.
- Production: records are sent to the official endpoint. An acceptance response confirms registration in the VeriFactu production environment.
Activate sandbox mode during the first few days to confirm that your certificate works correctly and that data is generated without errors.
Automatic Submission
Activation
- Go to Taxes → Compliance
- Save a valid certificate first; automatic submission is disabled without one
- Check Test mode (sandbox). To use production, disable it and confirm the change in the dialog
- Enable Auto-submit to AEAT
This control applies when issuing or cancelling invoices. Enabling it does not prove that earlier invoices were submitted. Check the result of each submission in the selected environment:
Registration Flow (invoice issued)
- The SHA-256 hash of the invoice is calculated (immutable string)
- The registration XML is generated according to AEAT specification
- The connection is authenticated with your digital certificate
- The XML is sent via SOAP to the selected AEAT environment
- The response (assigned CSV or error) is stored
Cancellation Flow (invoice cancelled)
- The cancellation hash is calculated with the 5 required fields
- The cancellation XML is generated
- It is sent to the selected AEAT environment with certificate authentication
- The response and cancellation status are stored
Submission is processed in the background. You can keep working and check its result afterwards.
Manual Submission
If automatic submission is not active, or if you need to resubmit a specific invoice:
- Open the invoice in question
- Click on the actions menu (three dots)
- Select Submit to AEAT
- A confirmation dialog with the hash preview is shown
- Confirm to initiate the submission
Manual submission follows the same technical flow as automatic submission.
Submission Statuses
Submission statuses distinguish an attempt in progress from its result:
| Record status | Indicator in the list | Description |
|---|---|---|
| Pending | May have no badge | No confirmed acceptance |
| Submitted | Submitted | Attempt in progress; no acceptance response confirmed yet |
| Accepted | AEAT OK | Acceptance received; distinguish test acceptance from production |
| Rejected | AEAT Error | AEAT rejected the record; review the error |
| Error | AEAT Error | Submission failed; review the error |
Check the status
Check the indicator in the invoice list or its mobile card. Statuses and the CSV are also included in the expanded ledger.
The AEAT OK badge does not by itself identify the submission environment. A production registration claim requires checking the response saved for that invoice and its environment; see PDF indicators.
Automatic Retries
When a submission fails due to a technical error (timeout, network error, AEAT service unavailable), Frihet automatically retries:
- Frequency: every 15 minutes
- Maximum attempts: 3
- After 3 failures: the status remains as Error and requires manual intervention
To manually retry an invoice with an Error status:
- Open the invoice
- Open the actions menu and select Submit to AEAT when the action is available
- A new submission attempt is executed
Indicators in PDF
The PDF identifies an invoice as VERI*FACTU / verifiable in production only when it retains an AEAT acceptance response matching that invoice and an explicit production environment. Submitted status, a hash or an isolated CSV is not sufficient.
- Accepted in production with complete evidence: production verification QR and wording identifying a verifiable invoice.
- Accepted in sandbox with complete evidence: test-environment QR and notice, without claiming production verification.
- No confirmed submission, with a known environment: tax QR and a notice that submission is not confirmed.
- Unknown historical environment or insufficient data: no verification QR or claim of production registration.
The information comes from the submission saved for that invoice. Later changing the account's mode or downloading the PDF again does not submit that invoice or turn a test into production. See the QR presentation details.
Expanded Ledger
With Phase 3 active, the ledger of issued invoices includes 3 additional columns:
| Column | Description |
|---|---|
| AEAT Submission Status | Status of the registration submission (Pending, Submitted, Accepted, Rejected, Error) |
| AEAT CSV | Secure verification code assigned by the AEAT upon accepting the record |
| AEAT Cancellation Status | Status of the cancellation submission (if applicable) |
These columns are added to the end of the exported CSV, after the 12 standard columns.
Troubleshooting
The QR does not verify the invoice
A QR code or SHA-256 hash does not prove submission. If AEAT says the invoice is not VERI*FACTU or cannot find it:
- Find the invoice in the list and check its submission status. Pending, Submitted, Rejected and Error do not prove acceptance.
- Open Taxes → Compliance and review the certificate, test mode and automatic submission. Current settings do not prove which environment was used for an earlier invoice.
- Distinguish test acceptance from production acceptance. A sandbox record cannot be verified as a production record.
- Check that the QR refers to the same invoice: tax ID, number, date and amount. Keep the AEAT message and the PDF you used.
- If historical submission data is missing or the status and verification result disagree, contact support with the invoice number and the observed result. Do not include your certificate or its password in the ticket, or duplicate the invoice to try to fix it.
The official AEAT invoice checking guide explains that an invoice may not be found because of a delay or an issuance error. That message calls for checking the submission; it does not by itself establish the cause.
"Certificate not configured"
No digital certificate has been uploaded. Go to Taxes → Compliance and upload your .pfx or .p12 file.
"Tax ID not configured"
The tax profile does not have a Tax ID. Go to Settings → Tax profile and complete your tax identifier.
SOAP Error / Connection Error
Possible causes:
- Expired certificate: verify the validity date of your certificate. FNMT certificates have a validity of 4 years.
- Incorrect password: re-upload the certificate with the correct password.
- AEAT service unavailable: the AEAT has maintenance windows. The system will automatically retry.
- Incomplete tax data: verify that your Tax ID, tax address, and company data are complete.
An expired certificate blocks all submissions. Renew your certificate with FNMT or CamCert before the expiration date.
Invoice rejected by AEAT
The AEAT may reject a record due to:
- Issuer's Tax ID does not match the certificate
- Incorrect date format
- Invalid invoice type for the operation
Review the error message in the invoice details. Check the cause before submitting again. Do not change the fiscal data of an issued invoice to force acceptance; ask for help if a correction is required.
Legal Calendar
The obligation to submit to the AEAT has staggered deadlines according to RDL 15/2025:
| Taxpayer type | Deadline |
|---|---|
| Companies (S.L., S.A.) | January 1, 2027 |
| Freelancers (individual) | July 1, 2027 |
Frihet already supports submission to the AEAT. It is recommended to activate sandbox mode in advance to validate the configuration before the obligation comes into force.
Relation to other phases
- Phase 1 (SHA-256 Hash): automatically calculated for each invoice. It is the basis of the record. See VeriFactu.
- Phase 2 (AEAT QR): the QR code in the PDF links to the AEAT's electronic headquarters for verification.
- Phase 3 (AEAT Submission): this page. Effective transmission of the record to the AEAT via SOAP/XML.
Previous: VeriFactu | Next: Immutability and Record-keeping