Skip to main content

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.
CaseValueDescription
STANDARDF1Standard invoice (Art. 6, 7.2 and 7.3 of RD 1619/2012).
SIMPLIFIEDF2Simplified invoice and invoices without recipient identification (Art. 6.1.d of RD 1619/2012).
REPLACEMENTF3Invoice issued to replace previously declared simplified invoices.
RECTIFICATION_1R1Rectification invoice (Art. 80.1, 80.2 and error based on law).
RECTIFICATION_2R2Rectification invoice (Art. 80.3).
RECTIFICATION_3R3Rectification invoice (Art. 80.4).
RECTIFICATION_4R4Rectification invoice (other cases).
RECTIFICATION_SIMPLIFIEDR5Rectification 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.
CaseValueDescription
SUBSTITUTIVESThe rectification invoice fully replaces the original.
INCREMENTALIThe 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 R1R5.

Tax enums

TaxType

Maps to the AEAT schema type ImpuestoType. Identifies which indirect tax applies to the invoice line.
CaseValueDescription
IVA01Value Added Tax (IVA) — standard Spanish VAT.
IPSI02Tax on Production, Services and Imports (IPSI) of Ceuta and Melilla.
IGIC03General Indirect Tax of the Canary Islands (IGIC).
OTHER05Other 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.
CaseValueDescription
GENERAL01General regime operation (Operación de régimen general).
EXPORT02Export (Exportación).
USED_GOODS03Special regime for used goods, works of art, antiques and collectibles.
INVESTMENT_GOLD04Special regime for investment gold (Oro de inversión).
TRAVEL_AGENCIES05Special regime for travel agencies.
ENTITY_GROUPS06Special regime for groups of entities in VAT (Advanced Level).
CASH_BASIS07Special regime for cash basis accounting (Criterio de caja).
IPSI_IGIC08Operations subject to IPSI / IGIC.
TRAVEL_AGENCY_INTERMEDIARY09Travel agency services acting as intermediaries (D.A 4ª RD1619/2012).
THIRD_PARTY_COLLECTIONS10Collections on behalf of third parties for professional fees or intellectual property rights.
BUSINESS_RENTAL11Business premises rental operations.
PENDING_VAT_PUBLIC_WORKS14Invoice with VAT pending accrual — work certifications to a Public Administration.
PENDING_VAT_SUCCESSIVE15Invoice with VAT pending accrual — successive tract operations.
OSS_IOSS17Operation under OSS or IOSS regimes (Chapter XI, Title IX).
EQUIVALENCE_SURCHARGE18Equivalence surcharge (Recargo de equivalencia).
AGRICULTURE_LIVESTOCK_FISHING19REAGYP — Special Regime for Agriculture, Livestock and Fishing.
SIMPLIFIED20Simplified 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.
CaseValueDescription
SUBJECT_NO_EXEMPT_NO_REVERSES1Subject and not exempt — without reverse charge.
SUBJECT_NO_EXEMPT_REVERSES2Subject and not exempt — with reverse charge (inversión del sujeto pasivo).
NOT_SUBJECT_ARTICLEN1Not subject — Article 7, 14 or other legal grounds.
NOT_SUBJECT_LOCATIONN2Not 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.
CaseValueDescription
E1E1Exempt operation type E1.
E2E2Exempt operation type E2.
E3E3Exempt operation type E3.
E4E4Exempt operation type E4.
E5E5Exempt operation type E5.
E6E6Exempt operation type E6.
E7E7Exempt operation type E7.
E8E8Exempt operation type E8.
use eseperio\verifactu\models\enums\ExemptOperationType;

$detail->exemptOperation = ExemptOperationType::E1;
The specific legal basis for each E1E8 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.
CaseValueDescription
VAT_ID02NIF-IVA — EU VAT identification number.
PASSPORT03Passport (Pasaporte).
ID_IN_COUNTRY_OF_RESIDENCE04Official identity document in the country of residence (IDEnPaisResidencia).
RESIDENCE_CERTIFICATE05Residence certificate (Certificado de Residencia).
OTHER_PROOF_DOCUMENT06Other proof document (Otro documento probatorio).
NOT_REGISTERED07Not 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.
CaseValueDescription
RECIPIENTDThe invoice was issued by the recipient (destinatario).
THIRD_PARTYTThe 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.
CaseValueDescription
ISSUEREThe cancellation was generated by the issuer — the party obliged to issue the cancelled invoice (emisor).
RECIPIENTDGenerated by the recipient (destinatario).
THIRD_PARTYTGenerated 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.
CaseValueDescription
YESSYes ().
NONNo.
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.
CaseValueDescription
SHA_25601SHA-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.

Build docs developers (and LLMs) love