Documentation Index
Fetch the complete documentation index at: https://mintlify.com/Eseperio/verifactu-php/llms.txt
Use this file to discover all available pages before exploring further.
All enumerations are PHP 8.1 string-backed enums under the namespace eseperio\verifactu\models\enums. Use the enum case directly wherever a typed property is expected — the library serialises each enum to its string value when building XML.
use eseperio\verifactu\models\enums\InvoiceType;
$invoice->invoiceType = InvoiceType::STANDARD; // serialised as "F1"
Invoice type enums
InvoiceType
Maps to the AEAT schema type ClaveTipoFacturaType. Identifies the kind of invoice being registered.
| Case | Value | Description |
|---|
STANDARD | F1 | Standard invoice (Art. 6, 7.2 and 7.3 of RD 1619/2012). |
SIMPLIFIED | F2 | Simplified invoice and invoices without recipient identification (Art. 6.1.d of RD 1619/2012). |
REPLACEMENT | F3 | Invoice issued to replace previously declared simplified invoices. |
RECTIFICATION_1 | R1 | Rectification invoice (Art. 80.1, 80.2 and error based on law). |
RECTIFICATION_2 | R2 | Rectification invoice (Art. 80.3). |
RECTIFICATION_3 | R3 | Rectification invoice (Art. 80.4). |
RECTIFICATION_4 | R4 | Rectification invoice (other cases). |
RECTIFICATION_SIMPLIFIED | R5 | Rectification invoice for simplified invoices. |
use eseperio\verifactu\models\enums\InvoiceType;
$invoice->invoiceType = InvoiceType::STANDARD; // "F1"
$invoice->invoiceType = InvoiceType::RECTIFICATION_1; // "R1"
RectificationType
Maps to the AEAT schema type ClaveTipoRectificativaType. Determines whether a rectification invoice replaces or adjusts the original.
| Case | Value | Description |
|---|
SUBSTITUTIVE | S | The rectification invoice fully replaces the original. |
INCREMENTAL | I | The rectification invoice records only the difference (delta) from the original. |
use eseperio\verifactu\models\enums\RectificationType;
$invoice->rectificationType = RectificationType::SUBSTITUTIVE; // "S"
$invoice->rectificationType = RectificationType::INCREMENTAL; // "I"
RectificationType is only required when invoiceType is one of R1–R5.
Tax enums
TaxType
Maps to the AEAT schema type ImpuestoType. Identifies which indirect tax applies to the invoice line.
| Case | Value | Description |
|---|
IVA | 01 | Value Added Tax (IVA) — standard Spanish VAT. |
IPSI | 02 | Tax on Production, Services and Imports (IPSI) of Ceuta and Melilla. |
IGIC | 03 | General Indirect Tax of the Canary Islands (IGIC). |
OTHER | 05 | Other taxes. |
use eseperio\verifactu\models\enums\TaxType;
$detail->taxType = TaxType::IVA; // most common: "01"
$detail->taxType = TaxType::IGIC; // Canary Islands: "03"
RegimeType
Maps to the AEAT schema type ClaveRegimenType. Specifies the special VAT regime or additional transcendence that applies to an operation. Multiple regime keys can be assigned to a single invoice line.
Codes are not sequential — values 12, 13, and 16 are not defined in the current regulation.
| Case | Value | Description |
|---|
GENERAL | 01 | General regime operation (Operación de régimen general). |
EXPORT | 02 | Export (Exportación). |
USED_GOODS | 03 | Special regime for used goods, works of art, antiques and collectibles. |
INVESTMENT_GOLD | 04 | Special regime for investment gold (Oro de inversión). |
TRAVEL_AGENCIES | 05 | Special regime for travel agencies. |
ENTITY_GROUPS | 06 | Special regime for groups of entities in VAT (Advanced Level). |
CASH_BASIS | 07 | Special regime for cash basis accounting (Criterio de caja). |
IPSI_IGIC | 08 | Operations subject to IPSI / IGIC. |
TRAVEL_AGENCY_INTERMEDIARY | 09 | Travel agency services acting as intermediaries (D.A 4ª RD1619/2012). |
THIRD_PARTY_COLLECTIONS | 10 | Collections on behalf of third parties for professional fees or intellectual property rights. |
BUSINESS_RENTAL | 11 | Business premises rental operations. |
PENDING_VAT_PUBLIC_WORKS | 14 | Invoice with VAT pending accrual — work certifications to a Public Administration. |
PENDING_VAT_SUCCESSIVE | 15 | Invoice with VAT pending accrual — successive tract operations. |
OSS_IOSS | 17 | Operation under OSS or IOSS regimes (Chapter XI, Title IX). |
EQUIVALENCE_SURCHARGE | 18 | Equivalence surcharge (Recargo de equivalencia). |
AGRICULTURE_LIVESTOCK_FISHING | 19 | REAGYP — Special Regime for Agriculture, Livestock and Fishing. |
SIMPLIFIED | 20 | Simplified regime (Régimen simplificado). |
use eseperio\verifactu\models\enums\RegimeType;
$detail->regimeKey = RegimeType::GENERAL; // "01" — most common
$detail->regimeKey = RegimeType::EQUIVALENCE_SURCHARGE; // "18"
OperationQualificationType
Maps to the AEAT schema type CalificacionOperacionType. Qualifies the VAT status of each breakdown line.
| Case | Value | Description |
|---|
SUBJECT_NO_EXEMPT_NO_REVERSE | S1 | Subject and not exempt — without reverse charge. |
SUBJECT_NO_EXEMPT_REVERSE | S2 | Subject and not exempt — with reverse charge (inversión del sujeto pasivo). |
NOT_SUBJECT_ARTICLE | N1 | Not subject — Article 7, 14 or other legal grounds. |
NOT_SUBJECT_LOCATION | N2 | Not subject — due to location rules. |
use eseperio\verifactu\models\enums\OperationQualificationType;
$detail->operationQualification = OperationQualificationType::SUBJECT_NO_EXEMPT_NO_REVERSE; // "S1"
A breakdown detail must specify either operationQualification or exemptOperation — not both.
ExemptOperationType
Maps to the AEAT schema type OperacionExentaType. Identifies the legal basis for a VAT exemption when the operation is exempt.
| Case | Value | Description |
|---|
E1 | E1 | Exempt operation type E1. |
E2 | E2 | Exempt operation type E2. |
E3 | E3 | Exempt operation type E3. |
E4 | E4 | Exempt operation type E4. |
E5 | E5 | Exempt operation type E5. |
E6 | E6 | Exempt operation type E6. |
E7 | E7 | Exempt operation type E7. |
E8 | E8 | Exempt operation type E8. |
use eseperio\verifactu\models\enums\ExemptOperationType;
$detail->exemptOperation = ExemptOperationType::E1;
The specific legal basis for each E1–E8 code is defined in the AEAT Verifactu technical specification. Consult the official AEAT documentation to select the correct exemption code for your operation type.
Identity enums
LegalPersonIdType
Identifies the type of identification document used for a legal person (foreign entity or individual) who does not hold a Spanish NIF.
| Case | Value | Description |
|---|
VAT_ID | 02 | NIF-IVA — EU VAT identification number. |
PASSPORT | 03 | Passport (Pasaporte). |
ID_IN_COUNTRY_OF_RESIDENCE | 04 | Official identity document in the country of residence (IDEnPaisResidencia). |
RESIDENCE_CERTIFICATE | 05 | Residence certificate (Certificado de Residencia). |
OTHER_PROOF_DOCUMENT | 06 | Other proof document (Otro documento probatorio). |
NOT_REGISTERED | 07 | Not registered with Spanish tax authorities (No censado). |
use eseperio\verifactu\models\enums\LegalPersonIdType;
$otherId->idType = LegalPersonIdType::VAT_ID->value; // "02"
ThirdPartyOrRecipientType
Maps to the AEAT schema type TercerosODestinatarioType. Used on an InvoiceSubmission to indicate whether the invoice was issued by the recipient or a third party on behalf of the obliged issuer.
| Case | Value | Description |
|---|
RECIPIENT | D | The invoice was issued by the recipient (destinatario). |
THIRD_PARTY | T | The invoice was issued by a third party (tercero). |
use eseperio\verifactu\models\enums\ThirdPartyOrRecipientType;
$invoice->issuedBy = ThirdPartyOrRecipientType::THIRD_PARTY; // "T"
GeneratorType
Maps to the AEAT schema type GeneradoPorType. Used on an InvoiceCancellation to identify who generated the cancellation record.
| Case | Value | Description |
|---|
ISSUER | E | The cancellation was generated by the issuer — the party obliged to issue the cancelled invoice (emisor). |
RECIPIENT | D | Generated by the recipient (destinatario). |
THIRD_PARTY | T | Generated by a third party (tercero). |
use eseperio\verifactu\models\enums\GeneratorType;
$cancellation->generator = GeneratorType::ISSUER; // "E"
Boolean and hash enums
YesNoType
Maps to the AEAT schema type SiNoType. Used for boolean fields throughout the data model where AEAT requires a "S" / "N" string value rather than a PHP bool.
| Case | Value | Description |
|---|
YES | S | Yes (Sí). |
NO | N | No. |
use eseperio\verifactu\models\enums\YesNoType;
$invoice->simplifiedInvoice = YesNoType::YES; // "S"
$invoice->macrodata = YesNoType::NO; // "N"
$system->onlyVerifactu = YesNoType::YES;
Fields that use YesNoType include: simplifiedInvoice, invoiceWithoutRecipient, macrodata, coupon, noPreviousRecord, previousRejection, onlyVerifactu, multipleObligations, hasMultipleObligations, and others.
HashType
Maps to the AEAT schema type TipoHuellaType. Identifies the hashing algorithm used to compute the huella (fingerprint). Currently only SHA-256 is defined.
| Case | Value | Description |
|---|
SHA_256 | 01 | SHA-256 hash algorithm. |
use eseperio\verifactu\models\enums\HashType;
$invoice->hashType = HashType::SHA_256; // "01"
The library sets hashType automatically when generating hashes via HashGeneratorService. You do not need to set this manually unless you are constructing records by hand.