Series by type, and what AEAT would reject is refused before numbering
A series numbers only its own type, and an invoice AEAT would reject answers 422 before a number is used. Zero-total invoices are accepted and issued paid.
Two changes move failures earlier. A series numbers only the documents of its own type, as the invoicing regulation requires. And with VeriFactu, BeeL. builds the record it will send to AEAT before numbering the invoice and checks it: what used to be an issued invoice with its registration rejected is now a 422, with the invoice still a draft and the number unused. Invoices already issued do not change.
What breaks
- A series numbers only its own type. A series still
UNASSIGNEDnumbers nothing: creating, editing or issuing with it answers422 SERIES_INCOMPATIBLE_DOC_TYPE. Every liveUNASSIGNEDseries was given the type it numbered most (STANDARDwhen it numbered none or there was a tie). A company whose only default was such a series may have no defaultSTANDARDseries now: a standard invoice withoutseries_idanswers422 SERIES_DEFAULT_NOT_FOUNDuntil you create or mark one. Drafts and recurring templates pointing at a series that now has another type fail withSERIES_INCOMPATIBLE_DOC_TYPEuntil you change their series. document_typeis locked once a series has numbered. Changing it answers400 SERIES_DOCUMENT_TYPE_LOCKED_HAS_INVOICES, except to give anUNASSIGNEDseries its type. Listing series withdocument_typeno longer includes theUNASSIGNEDones.- The VeriFactu record is checked before numbering. More than 12 different tax groups on one invoice answers
422 INVOICE_TAX_BREAKDOWN_TOO_LONG; a tax or surcharge rate with more than two decimals,422 INVOICE_TAX_RATE_TOO_MANY_DECIMALS; any other rule of AEAT's validations the record breaks, its specific code or422 VERIFACTU_RECORD_NOT_DECLARABLE, with the AEAT section in the message. - The recipient's
legal_namefits AEAT's 120 characters, counted as AEAT counts them. Under VeriFactu a longer one answers422 FIELD_TOO_LONGat issue. Length is measured in UTF-16 code units: an emoji or any character outside the Basic Multilingual Plane counts as two, so a name that looks like 119 characters can be too long. The operation description sent to AEAT is shortened to its 500-unit limit, never rejected. - An invoice of disbursements only is refused again, with
422 INVOICE_REQUIRES_AT_LEAST_ONE_NORMAL_LINE, a corrective included: put theSUPLIDOline on the invoice of the operation it belongs to. operation_datemore than twenty years old answers422 OPERATION_DATE_TOO_OLD, on create, edit and issue.- A simplified invoice cannot document an operation located outside Spain. A line with
exemption_reasonNO_SUJETA_LOCALIZACION, likeEXENTA_ART_25before it, answers400 SIMPLIFICADA_FORBIDS_CROSS_BORDER, now also when an edit makes the invoiceSIMPLIFIED, when it is issued, and on anR5corrective that adds such a line.
Does this affect you?
- If you pass a
series_idstored long ago, check itsdocument_typewithGET /v1/companies/{company_id}/series/{series_id}. - If you issue standard invoices without
series_id, checkGET /v1/companies/{company_id}/series/defaults. - If your recipients' names can carry emojis or long legal forms, cut them to 120 UTF-16 code units (
string.lengthin JavaScript, Java or C#). - If you create invoices of disbursements only, or that total 0 and then mark them paid, adjust that flow.
What else changed
- The default
SIMPLIFIEDandCORRECTIVEseries are created on first use (codeSorR, or the next free one). Only a missing defaultSTANDARDseries still answersSERIES_DEFAULT_NOT_FOUND, and the issuing readiness reports only that one. - An invoice whose total is 0 is accepted and issued as
PAID, withpayment_dateequal toissue_date, and registered with AEAT with a total of 0.INVOICE_ZERO_AMOUNTis retired. Callingmark-paidormark-senton it answers400: it is already paid. - Fewer asynchronous rejections. These invoices used to reach AEAT and come back
REJECTED; now they fail on the request, so an integration that handlesverifactu.status.updatedsees fewer rejections and more422s.
Endpoints
- POST/v1/companies/{company_id}/invoices422 SERIES_INCOMPATIBLE_DOC_TYPE, INVOICE_REQUIRES_AT_LEAST_ONE_NORMAL_LINE, OPERATION_DATE_TOO_OLD; a total of 0 is accepted
- POST/v1/companies/{company_id}/invoices/{invoice_id}/issue422 INVOICE_TAX_BREAKDOWN_TOO_LONG / INVOICE_TAX_RATE_TOO_MANY_DECIMALS / VERIFACTU_RECORD_NOT_DECLARABLE / FIELD_TOO_LONG before numbering
- PATCH/v1/companies/{company_id}/series/{series_id}400 SERIES_DOCUMENT_TYPE_LOCKED_HAS_INVOICES
- GET/v1/companies/{company_id}/seriesdocument_type returns only the series of that type
Where to go next
Corrective invoices and voids follow the rules of the law
A corrective can no longer rectify more than was invoiced, has a deadline, and can fix the recipient's data; a sent or paid invoice is voided only if issued in error.
Exchange simplified invoices for a full invoice
A new operation issues a full invoice in exchange for simplified invoices when the customer asks for one with their details. With VeriFactu it is now recorded as `F3`.