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.
Normally Spanish NIFs go without the ISO 'ES' code, although internally the NIF received is normalized to: * eliminate spaces in front and behind. * convert it to uppercase. * with 0 - Unspecified, the initial 'ES' is removed if it has one.
The EU NIF, on the other hand, must have the ISO and the Country Code can also be indicated in IDOother.
| 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. |
In the case of a foreign resident in Spain with a residence certificate:
- If they have a certificate of registration as a citizen of the European Union, this includes the NIE (Foreigner Identification Number), so the value 0 - Unspecified should be used.
- If they do not have an NIE, 5 - CertificateOfResidence should be assigned, and the country code from the document used should be entered.
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 |
TaxRegulationsType
- 0 - Verifactu
- 1 - TicketBai
AdministrativeType
- 0 - Administrative Body
- 1 - Organizational Unit
- 2 - Administrative Office
ChargeDiscountType
- 0 - Charge
- 1 - Discount
- 2 - Third Party Charge
- 3 - Third Party Discount
TaxCategory
- 0 - S - General regime transactions
- 1 - Z - Goods with 0% tax rate
- 2 - E - VAT-exempt
- 3 - AE - Reverse charge
- 4 - O - Transaction not subject to VAT
- 5 - G - Export
- 6 - L - Transaction subject to IGIC
- 7 - M - Transaction subject to IPSI
WithholdingReason
- 1 - Article 75.1.c), first clause, RIRPF – Income from professional activities
- 2 - Article 75.1.c), second clause, RIRPF – Income from agricultural and livestock activities
- 3 - Article 75.1.c), third clause, RIRPF – Income from forestry activities
- 4 - Article 75.1.c), fourth clause, RIRPF – Income from business activities under Article 95.6.2º RIRPF
- 5 - Article 75.1.d), second clause, RIRPF – Capital gains from the exploitation of forestry resources by local residents in public forests
- 6 - Article 75.2.a) RIRPF – Income from the leasing or subleasing of urban premises
- 7 - Article 75.2.b) RIRPF – Income derived from intellectual or industrial property, the provision of technical assistance, the leasing of movable property, businesses, or mines, the subleasing of the aforementioned assets, and the assignment of the right to exploit one's image rights
- 8 - Article 60.1.c) RIS – Remuneration obtained as a result of holding the position of administrator or board member in other companies
- 9 - Article 60.1.d) RIS – Income derived from the assignment of the right to exploit one's image, or from consent or authorization for its use, even when constituting income derived from economic activities
- 10 - Article 60.1.e) RIS – Income derived from the leasing or subleasing of urban real estate, even when constituting income derived from economic activities
- 11 - Other
PayCode
- 1 - Undefined instrument
- 2 - Automated Clearing House (ACH) credit
- 3 - Automated Clearing House (ACH) debit
- 4 - Demand ACH debit reversal
- 5 - Demand ACH credit reversal
- 6 - Demand ACH credit
- 7 - Demand ACH debit
- 8 - Hold
- 9 - National or regional clearing
- 10 - Cash
- 11 - Savings ACH credit reversal
- 12 - Savings ACH debit reversal
- 13 - Savings ACH credit
- 14 - Savings ACH debit
- 15 - Accounting entry credit
- 16 - Accounting entry debit
- 17 - Demand ACH credit for Cash Concentration/Disbursement (CCD)
- 18 - Demand ACH debit for Cash Concentration/Disbursement (CCD)
- 19 - Demand ACH credit for Corporate Trade Payment (CTP)
- 20 - Check
- 21 - Bank check
- 22 - Certified bank check
- 23 - Banker's draft
- 24 - Bill of exchange pending acceptance
- 25 - Certified check
- 26 - Local check
- 27 - ACH debit (demand) for Corporate Trade Payment (CTP)
- 28 - ACH credit (demand) for Corporate Trade Exchange (CTX)
- 29 - ACH debit (demand) for Corporate Trade Exchange (CTX)
- 30 - Credit transfer
- 31 - Debit transfer
- 32 - ACH credit (demand) for Cash Concentration/Disbursement Plus (CCD+)
- 33 - ACH debit (demand) for Cash Concentration/Disbursement Plus (CCD+)
- 34 - Preauthorized ACH payment and deposit (PPD)
- 35 - ACH savings credit for Cash Concentration/Disbursement (CCD)
- 36 - ACH savings debit for Cash Concentration/Disbursement (CCD)
- 37 - ACH savings credit for Corporate Trade Payment (CTP)
- 38 - ACH savings debit for Corporate Trade Payment (CTP)
- 39 - ACH savings credit for Corporate Trade Exchange (CTX)
- 40 - ACH savings debit for Corporate Trade Exchange (CTX)
- 41 - ACH Savings Credit for Cash Consolidation/Disbursement Plus (CCD+)
- 42 - Bank Account Payment
- 43 - ACH Savings Debit for Cash Consolidation/Disbursement Plus (CCD+)
- 44 - Accepted Bill of Exchange
- 45 - Referenced Electronic Banking Credit Transfer
- 46 - Interbank Debit Transfer
- 47 - Electronic Banking Debit Transfer
- 48 - Bank Card
- 49 - Direct Debit
- 50 - Postal Order Payment
- 51 - FR, Standard 6 97-Telereglement CFONB Option A
- 52 - Urgent Business Payment
- 53 - Urgent Treasury Payment
- 54 - Credit Card
- 55 - Debit Card
- 56 - Bank Order
- 57 - Standing Agreement
- 58 - SEPA Credit Transfer
- 59 - Direct Debit SEPA
- 60 - Promissory Note
- 61 - Promissory note signed by the debtor
- 62 - Promissory note signed by the debtor and guaranteed by a bank
- 63 - Promissory note signed by the debtor and guaranteed by a third party
- 64 - Promissory note signed by a bank
- 65 - Promissory note signed by a bank and guaranteed by another bank
- 66 - Signed promissory note
- 67 - Signed and guaranteed promissory note
- 68 - Online payment service
- 69 - Telephone payment
- 70 - Bill of exchange issued by the supplier
- 74 - Bill of exchange issued by the customer
- 75 - Bill of exchange issued by the customer drawn on a bank
- 76 - Bill of exchange issued by the customer, guaranteed by another bank
- 77 - Bill of exchange issued by the customer drawn on a bank and guaranteed
- 78 - Credit transfer with agreed commercial information
- 91 - Non-transferable bank cheque
- 92 - Non-transferable local cheque
- 93 - Reference draft
- 94 - Urgent draft
- 95 - Free-format draft
- 96 - Requested payment method not used
- 97 - Clearing between partners
- 98 - Japanese electronic transfer
- 99 - Mutually defined
ExceptionCodes
| Value | Description |
|---|---|
| 800 | Internal exception occurred in SDH. |
| 801 | A validation rule from the tax administration is not satisfied. |
| 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}' has already been sent. |
| 806 | Deleted sales invoice '{0}' has already been sent. |
| 807 | Deleted sales invoice '{0}' has already been cancelled. |
| 808 | Sales invoice '{0}' already exists. |
| 809 | New sales invoice '{0}' has not been 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 | The seller NIF '{0}' in the sales invoice is different from the SDH company NIF '{1}'. Please contact us to update this data in SDH. |
| 814 | The seller Business Name '{0}' in the sales invoice is different from the SDH company Business Name '{1}'. Please contact us to update this data in SDH. |
| 815 | 'TIN' is empty for Business Name '{0}'. |
| 816 | NIF '{0}' for Business Name '{1}' does not have a valid format. Consider whether it should really be a NIF assigned in Spain and, if not, set the corresponding DocumentType value (2=VATID, 3=Passport, 4=Official identification document, 5=Certificate of residence, 6=Other supporting document). |
| 817 | DNI '{0}' for Business Name '{1}' is not valid. The control character is '{2}' and '{3}' was expected. |
| 818 | CIF '{0}' for Business Name '{1}' is not valid. The control character is '{2}' and '{3}' was expected. |
| 819 | ID '{0}' from country '{2}' for Business Name '{1}' and DocumentType '{3}' does not have a valid format. |
| 820 | ID '{0}' from country '{2}' for Business Name '{1}' returned INVALID_INPUT from the VIES web service. |
| 821 | ID '{0}' from country '{2}' for Business Name '{1}' returned VAT_BLOCKED from the VIES web service. |
| 822 | ID '{0}' from country '{2}' for Business Name '{1}' is not valid according to the VIES web service. |
| 823 | ID '{0}' from country '{2}' for Business Name '{1}' and DocumentType '{3}' does not have a valid format. Country must not be 'ES' or DocumentType must be '{4}' or '{5}'. |
| 824 | TIN '{0}' for Business Name '{1}' is not valid. The AEAT ValidNIF web service returned '{2}'. |
| 825 | ID '{0}' from country '{2}' for Business Name '{1}' and DocumentType '{3}' does not have a valid format. Country must be 'ES' or DocumentType must not be '{4}'. |
| 826 | 'VATKey' '{0}' is not correct. |
| 827 | The number of invoices to query cannot exceed {0}. |
| 828 | The number of invoices to create cannot exceed {0}. |
| 829 | The number of invoices to cancel cannot exceed {0}. |
| 830 | The list of sales invoice identifiers is empty. |
| 831 | The data to process is not a TicketBAI content. |
| 832 | There is no data to process. |
| 833 | TicketBAI keys have more than one value. |
| 834 | Sales invoice data is incorrect: |
| 835 | Country is required for DocumentType {2}. ID '{0}' for Business Name '{1}'. |
| 836 | New sales invoice '{0}' has Transaction Date '{1}', and it must not be '{2}'. |
| 837 | Purchase invoice '{0}' does not exist. |
| 838 | Sales invoice status type '{0}' is not valid. |
| 839 | Purchase invoice status type '{0}' is not valid. |
| 840 | The list of purchase invoice identifiers is empty. |
| 841 | TIN '{0}' for Business Name '{1}' is not valid. The AEAT ValidNIF web service returned '{2}', and TIN '{3}' and Business Name '{4}'. |
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.