Formats
An invoice can be submitted in two formats:
- the national Facturae 3.2.2 format, described on this page, or
- the native VERI*FACTU billing record (RegistroAlta), when you already hold the data in AEAT's own structure, see Native VERI*FACTU format.
POST /invoices,
POST /invoices/draft and
PUT /invoices/draft/{uuid}
accept both, selected by Content-Type and, for XML, by the root element of the document:
application/xml: the Facturae XML document (<fe:Facturae>root) or a native VERI*FACTU<RegistroAlta>XML.application/json: an equivalent JSON object whose keys mirror the Facturae element names one-for-one; repeated elements (Invoice,Tax,InvoiceLine,Installment, …) become JSON arrays. JSON is converted to Facturae XML before processing, so the two paths run the identical validation.
Simplified invoices (F2) have their
own endpoints and use the native VERI*FACTU format only.
Facturae 3.2.2
A-Cube validates the document against the official Facturaev3_2_2.xsd schema plus the
business rules required for acceptance. Only single-invoice documents are accepted;
a batch / lote (Modality L) is rejected.
The root element is <fe:Facturae> in namespace
http://www.facturae.gob.es/formato/Versiones/Facturaev3_2_2.xml (FileHeader /
Parties / Invoices top-level object keys in JSON), with three top-level blocks:
| Block | Purpose |
|---|---|
FileHeader | SchemaVersion, Modality (I individual, always, see above), InvoiceIssuerType (EM seller / RE buyer / TE third party), Batch totals |
Parties | SellerParty and BuyerParty, each with TaxIdentification (the NIF/NIE/CIF in TaxIdentificationNumber) and LegalEntity or Individual |
Invoices | a single Invoice with InvoiceHeader (InvoiceNumber, InvoiceDocumentType, InvoiceClass), InvoiceIssueData, TaxesOutputs, InvoiceTotals, Items |
InvoiceDocumentType: FC complete invoice, FA simplified invoice, AF self-billed
invoice. InvoiceClass: OO original, OR corrective, OC summary (and the CO /
CR / CC copies). Corrective invoices are covered in
Credit notes.
Under VERI*FACTU, A-Cube turns each accepted invoice into a billing record (registro de alta), chains it to the previous record through a hash (huella), reports it to AEAT, and returns the invoice as a factura verificable with its QR code. You send the Facturae document; the record building and reporting are handled for you.
Example
The Send invoice page shows this same document in both XML and JSON, side by side. The XML form is below.
Facturae 3.2.2 invoice example (XML)
<?xml version="1.0" encoding="UTF-8"?>
<fe:Facturae xmlns:fe="http://www.facturae.gob.es/formato/Versiones/Facturaev3_2_2.xml" xmlns:ds="http://www.w3.org/2000/09/xmldsig#">
<FileHeader>
<SchemaVersion>3.2.2</SchemaVersion>
<Modality>I</Modality>
<InvoiceIssuerType>EM</InvoiceIssuerType>
<Batch>
<BatchIdentifier>A58818501-FV-2026-0001</BatchIdentifier>
<InvoicesCount>1</InvoicesCount>
<TotalInvoicesAmount><TotalAmount>1452.00</TotalAmount></TotalInvoicesAmount>
<TotalOutstandingAmount><TotalAmount>1452.00</TotalAmount></TotalOutstandingAmount>
<TotalExecutableAmount><TotalAmount>1452.00</TotalAmount></TotalExecutableAmount>
<InvoiceCurrencyCode>EUR</InvoiceCurrencyCode>
</Batch>
</FileHeader>
<Parties>
<SellerParty>
<TaxIdentification>
<PersonTypeCode>J</PersonTypeCode>
<ResidenceTypeCode>R</ResidenceTypeCode>
<TaxIdentificationNumber>A58818501</TaxIdentificationNumber>
</TaxIdentification>
<LegalEntity>
<CorporateName>SupplierOfficialName Ltd.</CorporateName>
<AddressInSpain>
<Address>Calle Mayor 1</Address>
<PostCode>28001</PostCode>
<Town>Madrid</Town>
<Province>Madrid</Province>
<CountryCode>ESP</CountryCode>
</AddressInSpain>
</LegalEntity>
</SellerParty>
<BuyerParty>
<TaxIdentification>
<PersonTypeCode>J</PersonTypeCode>
<ResidenceTypeCode>R</ResidenceTypeCode>
<TaxIdentificationNumber>B12345674</TaxIdentificationNumber>
</TaxIdentification>
<LegalEntity>
<CorporateName>Buyer Official Name</CorporateName>
<AddressInSpain>
<Address>Calle Alcala 20</Address>
<PostCode>28014</PostCode>
<Town>Madrid</Town>
<Province>Madrid</Province>
<CountryCode>ESP</CountryCode>
</AddressInSpain>
</LegalEntity>
</BuyerParty>
</Parties>
<Invoices>
<Invoice>
<InvoiceHeader>
<InvoiceNumber>FV-2026-0001</InvoiceNumber>
<InvoiceDocumentType>FC</InvoiceDocumentType>
<InvoiceClass>OO</InvoiceClass>
</InvoiceHeader>
<InvoiceIssueData>
<IssueDate>2026-01-15</IssueDate>
<InvoiceCurrencyCode>EUR</InvoiceCurrencyCode>
<TaxCurrencyCode>EUR</TaxCurrencyCode>
<LanguageName>es</LanguageName>
</InvoiceIssueData>
<TaxesOutputs>
<Tax>
<TaxTypeCode>01</TaxTypeCode>
<TaxRate>21.00</TaxRate>
<TaxableBase><TotalAmount>1200.00</TotalAmount></TaxableBase>
<TaxAmount><TotalAmount>252.00</TotalAmount></TaxAmount>
</Tax>
</TaxesOutputs>
<InvoiceTotals>
<TotalGrossAmount>1200.00</TotalGrossAmount>
<TotalGrossAmountBeforeTaxes>1200.00</TotalGrossAmountBeforeTaxes>
<TotalTaxOutputs>252.00</TotalTaxOutputs>
<TotalTaxesWithheld>0.00</TotalTaxesWithheld>
<InvoiceTotal>1452.00</InvoiceTotal>
<TotalOutstandingAmount>1452.00</TotalOutstandingAmount>
<TotalExecutableAmount>1452.00</TotalExecutableAmount>
</InvoiceTotals>
<Items>
<InvoiceLine>
<ItemDescription>Servicios de consultoria</ItemDescription>
<Quantity>1</Quantity>
<UnitPriceWithoutTax>1200.00</UnitPriceWithoutTax>
<TotalCost>1200.00</TotalCost>
<GrossAmount>1200.00</GrossAmount>
<TaxesOutputs>
<Tax>
<TaxTypeCode>01</TaxTypeCode>
<TaxRate>21.00</TaxRate>
<TaxableBase><TotalAmount>1200.00</TotalAmount></TaxableBase>
<TaxAmount><TotalAmount>252.00</TotalAmount></TaxAmount>
</Tax>
</TaxesOutputs>
</InvoiceLine>
</Items>
<PaymentDetails>
<Installment>
<InstallmentDueDate>2026-02-14</InstallmentDueDate>
<InstallmentAmount>1452.00</InstallmentAmount>
<PaymentMeans>04</PaymentMeans>
</Installment>
</PaymentDetails>
</Invoice>
</Invoices>
</fe:Facturae>
Native VERI*FACTU format
With Content-Type: application/xml you send a <RegistroAlta> root element
carrying only the business data of the billing record. A-Cube still computes the
hash chain (huella, encadenamiento) and the SistemaInformatico block itself, so
the record you send is never transmitted as-is.
| Element | Required | Notes |
|---|---|---|
IDFactura/IDEmisorFactura | yes | the issuer NIF: must belong to a legal entity you own with customerInvoiceEnabled |
IDFactura/NumSerieFactura | yes | series and number, up to 60 characters |
IDFactura/FechaExpedicionFactura | yes | issue date in AEAT format dd-mm-yyyy (not Facturae's yyyy-mm-dd) |
NombreRazonEmisor | yes | issuer name, up to 120 characters |
TipoFactura | yes | AEAT invoice type: F1, F2, F3, R1 to R5 |
DescripcionOperacion | yes | description of the operation, up to 500 characters |
Destinatarios/IDDestinatario | depends on TipoFactura | NombreRazon plus either NIF or IDOtro (CodigoPais, IDType, ID) for a recipient without a Spanish NIF |
Desglose/DetalleDesglose | yes | one or more tax breakdown lines: TipoImpositivo, BaseImponibleOimporteNoSujeto, CuotaRepercutida, and the optional AEAT codes Impuesto (defaults to 01, IVA), ClaveRegimen, CalificacionOperacion |
CuotaTotal, ImporteTotal | yes | total tax amount and total invoice amount, 2 decimals |
FacturaSinIdentifDestinatarioArt61d | no | S for an invoice issued under art. 6.1.d RD 1619/2012 |
The native format is XML only: application/json on POST /invoices is always read
as Facturae.
Native VERI*FACTU invoice example (XML)
<RegistroAlta>
<IDFactura>
<IDEmisorFactura>A58818501</IDEmisorFactura>
<NumSerieFactura>FV-2026-0001</NumSerieFactura>
<FechaExpedicionFactura>15-01-2026</FechaExpedicionFactura>
</IDFactura>
<NombreRazonEmisor>SupplierOfficialName Ltd.</NombreRazonEmisor>
<TipoFactura>F1</TipoFactura>
<DescripcionOperacion>Servicios de consultoria</DescripcionOperacion>
<Destinatarios>
<IDDestinatario>
<NombreRazon>Buyer Official Name</NombreRazon>
<NIF>B12345674</NIF>
</IDDestinatario>
</Destinatarios>
<Desglose>
<DetalleDesglose>
<TipoImpositivo>21.00</TipoImpositivo>
<BaseImponibleOimporteNoSujeto>1200.00</BaseImponibleOimporteNoSujeto>
<CuotaRepercutida>252.00</CuotaRepercutida>
</DetalleDesglose>
</Desglose>
<CuotaTotal>252.00</CuotaTotal>
<ImporteTotal>1452.00</ImporteTotal>
</RegistroAlta>
See the POST /invoices API reference for
the full request schema.