Skip to main content

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​

IssuerTypeCost
FNMT (Fabrica Nacional de Moneda y Timbre)Individual or legal entityFree
CamCert (Camaras de Comercio)CompanyVariable
ACCV (Comunitat Valenciana)RegionalFree

Upload the certificate​

  1. Go to Taxes → Compliance
  2. In the Digital Certificate section, click Upload certificate
  3. Select your .pfx or .p12 file
  4. Enter the certificate password
  5. Click Save certificate and check that Certificate configured appears, with the subject, issuer and expiry date
  6. 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.

Password Encryption

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.
tip

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​

  1. Go to Taxes → Compliance
  2. Save a valid certificate first; automatic submission is disabled without one
  3. Check Test mode (sandbox). To use production, disable it and confirm the change in the dialog
  4. 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)​

  1. The SHA-256 hash of the invoice is calculated (immutable string)
  2. The registration XML is generated according to AEAT specification
  3. The connection is authenticated with your digital certificate
  4. The XML is sent via SOAP to the selected AEAT environment
  5. The response (assigned CSV or error) is stored

Cancellation Flow (invoice cancelled)​

  1. The cancellation hash is calculated with the 5 required fields
  2. The cancellation XML is generated
  3. It is sent to the selected AEAT environment with certificate authentication
  4. 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:

  1. Open the invoice in question
  2. Click on the actions menu (three dots)
  3. Select Submit to AEAT
  4. A confirmation dialog with the hash preview is shown
  5. 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 statusIndicator in the listDescription
PendingMay have no badgeNo confirmed acceptance
SubmittedSubmittedAttempt in progress; no acceptance response confirmed yet
AcceptedAEAT OKAcceptance received; distinguish test acceptance from production
RejectedAEAT ErrorAEAT rejected the record; review the error
ErrorAEAT ErrorSubmission 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:

  1. Open the invoice
  2. Open the actions menu and select Submit to AEAT when the action is available
  3. 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:

ColumnDescription
AEAT Submission StatusStatus of the registration submission (Pending, Submitted, Accepted, Rejected, Error)
AEAT CSVSecure verification code assigned by the AEAT upon accepting the record
AEAT Cancellation StatusStatus 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:

  1. Find the invoice in the list and check its submission status. Pending, Submitted, Rejected and Error do not prove acceptance.
  2. 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.
  3. Distinguish test acceptance from production acceptance. A sandbox record cannot be verified as a production record.
  4. Check that the QR refers to the same invoice: tax ID, number, date and amount. Keep the AEAT message and the PDF you used.
  5. 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.
Expired Certificate

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.

The obligation to submit to the AEAT has staggered deadlines according to RDL 15/2025:

Taxpayer typeDeadline
Companies (S.L., S.A.)January 1, 2027
Freelancers (individual)July 1, 2027
info

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