Enumerations
SalesInvoiceType
- 0 - New. New invoice
- 1 - Delete. Invoice deletion
- 2 - CorrectNew. Correction after the administration rejects the creation of the invoice
- 3 - CorrectModify. Correction after the administration rejects the modification of the invoice
- 4 - CorrectDelete. Correction of an invoice deletion after the administration rejects it
SalesInvoiceDeliveryStatus
- 0 - Pending. Pending delivery to the administration
- 1 - SendOK. Delivered to the administration with a successful response
- 2 - SendWithError. Delivered to the administration with a Accepted with error response. These do not cause rejection of the billing record.
- 3 - Error. Delivered to the administration with a Rejection. The administration does not store the record. These correspond to errors produced by failing syntactic validations or business rule errors → they should not occur in SDH, since SDH includes the validations published by the administration.
In the cases of SendWithError and Error, action must be taken depending on the error returned by the administration. Therefore, the records must be subsanated and sent again to the administration in order to allow their processing and validation, provided that issuing a corrective invoice (or another mechanism contemplated in the Billing Regulation) does not apply and the invoice is not cancelled. More information here.
PartyDocument
- 0 - Unspecified. Used when a Spanish NIF is provided, which may correspond to an individual, a legal entity, an entity without legal personality, or a NIE.
- The IDOtro block is used when there is no Spanish NIF or NIE.
| IDOtro is composed of the following data |
|---|
| ID, where the identification shown on the available document must be indicated. |
| CodigoPais, optional field referring to the country that issued the identification document indicated in the ID field and following the validations defined in the validation document. |
| IDType, where the type of identification document must be specified using one of the values in the table below. |
| IDType value | Description |
|---|---|
| 2 - VATID | VAT ID. Used when the customer does not have a Spanish NIF but is identified for VAT purposes in another EU country, i.e. is listed in VIES, the intra-Community operators registry. |
| 3 - Passport | Passport. |
| 4 - OfficialIdentificationDocument | Official identification document issued by the country or territory of residence. |
| 5 - CertificateOfResidence | Certificate of residence. |
| 6 - OtherSupportingDocument | Other supporting document. |
| 7 - NotRegistered | In Veri*Factu, Not registered. Only valid for Spanish DNI or NIE and only for natural persons. Only for cases where it is clear that the NIF or NIE is correct (it exists, matches the stated name and surname, and has no typographical errors) and the only issue is that it is not registered in the AEAT census. When sent with this option, the record will appear as accepted with error 2001. This situation may occur, for example, when a person has recently been issued a NIE by the General Directorate of Police and it has not yet been registered with the AEAT. After submitting an invoice with a non-registered recipient, an automatic census process is initiated. If, after the corresponding internal validations, the NIF is considered correct, it will be automatically registered in the AEAT census after approximately 48 hours. After this period, the original invoice information must be sent again using a subsanation creation record type, since the invoice was already accepted and a new creation would not be allowed, indicating the recipient NIF field (instead of the IDOtro block). If the NIF is already registered, it will be accepted and appear as correct. |
List of validations performed
| Validation |
|---|
| If InvoiceType is “F1”, “F3”, “R1”, “R2”, “R3” or “R4”, the Destinatarios group must be completed with at least one recipient. |
| If InvoiceType is “F2” or “R5”, the Destinatarios group must not be completed. |
| If identification is provided via NIF, the NIF must be valid and different from the issuer NIF in the IDFactura group. |
| If the NIF is filled in, the IDOtro group must not exist, and vice versa, but one of the two is mandatory. |
| When one or more recipients are identified via NIF, all NIFs must be valid and different from the issuer NIF. |
| If IDType = “02” (VAT ID), CodigoPais is not required. |
| If IDType = “07” (Not registered), CodigoPais must be “ES”. |
| When identification is provided via IDOtro and IDType = “02”, the identifier must match the VAT ID structure of an EU Member State and be valid. |
| When identification is provided via IDOtro and CodigoPais = “ES”, IDType must be “03” or “07”. |
| When identification is provided via IDOtro and IDType = “02”, InvoiceType must be “F1”, “F3”, “R1”, “R2”, “R3” or “R4”. |
NIFs are validated using the AEAT NIF validation service, except when marked as NotRegistered (documentType = 7). |
| Intra-Community VAT identification is validated using the VIES service. |
CorrectiveKey
- 1 - R1. Corrective invoice (Legal error / Articles 80.1, 80.2 and 80.6 of the VAT Law)
- 2 - R2. Corrective invoice (Article 80.3 of the VAT Law)
- 3 - R3. Corrective invoice (Article 80.4 of the VAT Law)
- 4 - R4. Corrective invoice (Other cases)
- 5 - R5. Corrective invoice for simplified invoices
CorrectiveType
- 1 - S. Corrective invoice by substitution
- 2 - I. Corrective invoice by differences
TaxType
| Value | Veri*Factu | TicketBAI |
|---|---|---|
| 1 | VAT – Value Added Tax | Not applicable |
| 2 | IPSI – Production, Services and Import Tax (Ceuta and Melilla) | Not applicable |
| 3 | IGIC – Canary Islands General Indirect Tax | Not applicable |
| 5 | Other taxes | Not applicable |
VATKey
- 1 - K01. General regime operation
- 2 - K02. Export
- 3 - K03. Operations subject to the special regime for used goods, works of art, antiques and collectors’ items
- 4 - K04. Special regime for investment gold
- 5 - K05. Special regime for travel agencies
- 6 - K06. Special regime for groups of entities for VAT purposes (Advanced level)
- 7 - K07. Special cash accounting regime
- 8 - K08. If the applicable tax is VAT (establishment located in mainland Spain), operations subject to IPSI/IGIC (Tax on Production, Services and Imports / Canary Islands General Indirect Tax).
If the applicable tax is IGIC (establishment located in the Canary Islands), operations subject to IPSI / VAT (Tax on Production, Services and Imports / Value Added Tax) - 9 - K09. Invoicing of services provided by travel agencies acting as intermediaries in the name and on behalf of third parties (Additional Provision 4 of Royal Decree 1619/2012)
- 10 - K10. Collections on behalf of third parties of professional fees or rights derived from industrial property, copyright or other rights on behalf of their partners, associates or members, carried out by companies, associations, professional bodies or other entities that perform these collection functions
| Value | Veri*Factu | TicketBAI |
|---|---|---|
| 11 | K11. Business premises leasing operations | K11. Business premises leasing operations subject to withholding |
| 12 | K11. Business premises leasing operations | K12. Business premises leasing operations not subject to withholding |
| 13 | K11. Business premises leasing operations | K13. Business premises leasing operations subject and not subject to withholding |
| 14 | (If VAT) K14. Invoice with VAT pending accrual for public works certifications where the recipient is a Public Administration | K14. Invoice with VAT pending accrual for public works certifications where the recipient is a Public Administration |
| 15 | (If VAT) K15. Invoice with VAT pending accrual for successive tract operations | K15. Invoice with VAT pending accrual for successive tract operations |
| 17 | (If VAT) K17. Operation subject to one of the regimes provided for in Chapter XI of Title IX (OSS and IOSS) | K17. Operation subject to one of the regimes provided for in Chapter XI of Title IX (OSS and IOSS) |
| 18 and 51 | (If VAT) K18. Equivalence surcharge | K51. Operations under the equivalence surcharge regime |
| 19 | (If VAT) K19. Operations relating to activities included in the Special Regime for Agriculture, Livestock and Fisheries (REAGYP) | K19. Operations relating to activities included in the Special Regime for Agriculture, Livestock and Fisheries (REAGYP) |
| 20 and 52 | (If VAT) K20. Simplified regime | K52. Operations under the simplified regime |
| 14 | (If IGIC) K14. Invoice with IGIC pending accrual for public works certifications where the recipient is a Public Administration | Not applicable |
| 15 | (If IGIC) K15. Invoice with IGIC pending accrual for successive tract operations | Not applicable |
| 17 | (If IGIC) K17. Special retail trader regime | Not applicable |
| 18 | (If IGIC) K18. Special regime for small entrepreneurs or professionals | Not applicable |
| 19 | (If IGIC) K19. Domestic operations exempt due to application of Article 25 of Law 19/1994 | Not applicable |
| 53 | Not applicable | K53. Operations carried out by persons or entities that do not qualify as entrepreneurs or professionals for VAT purposes |
| 54 | Not applicable | K54. Operations carried out from permanent establishments located in the Canary Islands, Ceuta and Melilla |
CauseExemption
- 0 - Unspecified
- When VAT applies:
- 1 - E1. Exempt (Article 20 of the VAT Law)
- 2 - E2. Exempt (Article 21 of the VAT Law)
- 3 - E3. Exempt (Article 22 of the VAT Law)
- 4 - E4. Exempt (Articles 23 and 24 of the VAT Law)
- 5 - E5. Exempt (Article 25 of the VAT Law)
- 6 - E6. Other exemptions
-
When IGIC applies:
- 1 - E1. Exempt (Article 50 of Law 4/2012)
- 2 - E2. Exempt (Article 11 of Law 20/1991)
- 3 - E3. Exempt (Article 12 of Law 20/1991)
- 4 - E4. Exempt (Article 13 of Law 20/1991)
- 5 - E5. Exempt (Article 25 of Law 19/1994)
- 6 - E6. Exempt (Article 47 of Law 19/1994)
Valor Veri*Factu TicketBAI 7 E7. Exempt (Article 110 of Law 4/2012) Not applicable 8 E8. Other exemptions Not applicable
NonExempt
- 0 - Unspecified
- 1 - S1. Taxable and non-exempt operation – without reverse charge
- 2 - S2. Taxable and non-exempt operation – with reverse charge
CauseNotSubject
| Value | Veri*Factu | TicketBAI |
|---|---|---|
| 0 | Unspecified | Unspecified |
| 1 | N1. Not subject (Article 7, Article 14 and others) | OT. Not subject (Article 7) |
| 2 | N2. Not subject – localisation rules | RL. Not subject – localisation |
| 3 | N1. Not subject (Article 7, Article 14 and others) | VT. Sales carried out on behalf of third parties |
| 4 | N2. Not subject – localisation rules (but foreign tax applies) | IE. Not subject in Spain but foreign tax applies |
OperationType
| Value | Veri*Factu | TicketBAI |
|---|---|---|
| -1 | Not applicable | Unspecified |
| 1 | Not applicable | InvoiceBreakdown |
| 2 | Not applicable | DeliveryOfGoods |
| 3 | Not applicable | ProvisionOfServices |
ExceptionCodes
| Valor | Descripción |
|---|---|
| 800 | Internal exception in SDH |
| 801 | Fails an administration validation rule |
| 802 | Sales invoice '{0}' does not exist |
| 803 | Deleted sales invoice '{0}' does not exist |
| 804 | New sales invoice '{0}' does not exist |
| 805 | Sales invoice '{0}' is already sent |
| 806 | Deleted sales invoice '{0}' is already sent |
| 807 | Deleted sales invoice '{0}' is already cancelled |
| 808 | Sales invoice '{0}' already exists |
| 809 | New sales invoice '{0}' is not sent or has been rejected |
| 810 | Sales invoice '{0}' has been deleted |
| 811 | Sales invoice '{0}' has not been deleted |
| 812 | Sales invoice '{0}' has not been rejected |
| 813 | Sales invoice Seller Tin '{0}' is different to the Company Tin '{1}' |
| 814 | Sales invoice Seller BusinessName '{0}' is different to the Company BusinessName '{1}' |
| 815 | TIN es empty for BusinessName '{0}' |
| 816 | NIF '{0}' for BusinessName '{1}' has not valid format |
| 817 | DNI '{0}' for BusinessName '{1}' is not valid. Control character is '{2}' and expected '{3}' |
| 818 | CIF '{0}' for BusinessName '{1}' is not valid. Control character is '{2}' and expected '{3}' |
| 819 | ID '{0}' of country '{2}' for BusinessName '{1}' and DocumentType {3} has not valid format |
| 820 | ID '{0}' of country '{2}' for BusinessName '{1}' has returned INVALID_INPUT from VIES web service |
| 821 | ID '{0}' of country '{2}' for BusinessName '{1}' has returned VAT_BLOCKED from VIES web service |
| 822 | ID '{0}' of country '{2}' for BusinessName '{1}' is not valid |
| 824 | TIN '{0}' for BusinessName '{1}' is not valid. AEAT ValidNIF web service has returned '{2}' and TIN '{3}' and BusinessName '{4}' |
| 825 | Not allowed caracter in value '{0}' of '{1}' |
| 826 | VATKey '{0}' is not correct |
| 827 | The number of invoices to query cannot exceed of |
| 828 | The number of invoices to create cannot exceed of |
| 829 | The number of invoices to cancel cannot exceed of |
| 830 | List of Sales Invoices Identifiers is empty |
| 831 | Data to process is not a TicketBai content |
| 832 | No data to proccess |
| 833 | TicketBAI keys have more than one value |
| 834 | SalesInvoice data incorrect: |
| 835 | Country required for DocumentType {2}. ID '{0}' for BusinessName '{1}' |
Country Codes
Two-character alphanumeric codes according to ISO 3166-1 alpha-2.
- Spain:
ES - EU Member States
| Code | Country |
|---|---|
| FR | France |
| PT | Portugal |
| DE | Germany |
| IT | Italy |
| GB | United Kingdom |
| AT | Austria |
| BE | Belgium |
| BG | Bulgaria |
| HR | Croatia |
| CY | Cyprus |
| CZ | Czech Republic |
| DK | Denmark |
| EE | Estonia |
| FI | Finland |
| GR | Greece |
| HU | Hungary |
| IE | Ireland |
| LV | Latvia |
| LT | Lithuania |
| LU | Luxembourg |
| MT | Malta |
| NL | Netherlands |
| PL | Poland |
| RO | Romania |
| SK | Slovakia |
| SI | Slovenia |
| SE | Sweden |
- All other values are considered non-EU.