This page documents all COM-visible objects exposed by the VeriFactu COM Interop assembly (Documentation Index
Fetch the complete documentation index at: https://mintlify.com/mdiago/VeriFactu/llms.txt
Use this file to discover all available pages before exploring further.
Verifactu.Com). These objects mirror the .NET API but are designed for use from COM-compatible environments such as Excel VBA, Access VBA, and VB6. All validation rules and AEAT communication logic are identical to the .NET library — the COM layer is a thin, type-safe wrapper.
For practical usage examples see the VBA / Excel guide.
VfInvoice
ProgId:Verifactu.VfInvoiceInterface:
IVfInvoiceGUID:
BBADB0CE-A83F-455C-8BCE-1D5E200BF5BC
The central object for creating, submitting, and cancelling VERI*FACTU invoice records. Each instance represents a single invoice. Tax lines are accumulated with InsertTaxItem; the final totals are computed automatically when reading TotalAmount or calling Send().
Properties
Invoice type code. Corresponds to AEAT list L2. Defaults to
"F1" if not set.| Value | Description |
|---|---|
F1 | Standard invoice |
F2 | Simplified invoice (ticket) |
F3 | Invoice replacing simplified invoices |
R1 | Rectificative — legal basis error |
R2 | Rectificative — art. 80.3 |
R3 | Rectificative — art. 80.4 |
R4 | Rectificative — other |
R5 | Simplified rectificative |
Identifies whether a rectificative invoice corrects by substitution (
S) or by difference (I). Only relevant when InvoiceType starts with R. Corresponds to AEAT list L3. Defaults to "NA" (not applicable) if not set.Invoice identifier (número de factura). Must be unique per seller per day.
Invoice issue date.
Seller fiscal identifier (NIF, VAT number, DUNS, etc.).
Seller name or company name (razón social).
Buyer fiscal identifier. Use the fiscal ID if one exists (NIF, VAT number, DUNS).
Buyer name or company name.
ISO 3166-1 alpha-2 country code of the buyer (e.g.
"ES", "FR", "DE"). Required for non-Spanish buyers.Buyer identifier type code. Corresponds to AEAT list L7. Defaults to
2 (NIF) if not set.| Value | Description |
|---|---|
2 | NIF (default for Spanish buyers) |
3 | Pasaporte |
4 | Documento oficial de residencia |
5 | Certificado de residencia fiscal |
6 | Otro documento probatorio |
7 | No censado |
Computed total amount: sum of all tax bases + total tax output − total tax withheld. Triggers recalculation on every read. Read-only.
Computed sum of all
TaxAmount values across all VfTaxItem lines. Read-only.Computed sum of all
TaxAmountSurcharge values across all VfTaxItem lines (recargo de equivalencia). Read-only.Computed total of withheld taxes (retenciones). Read-only.
Free-text invoice description (concepto / descripción de la operación).
Methods
Sets the operation date when it differs from the invoice issue date. Optional.
Marks the invoice as issued by a third party or by the buyer (autofactura). Corresponds to AEAT list L6.
"D"— Issued by the buyer (destinatario) — autofactura. Currently supported."T"— Issued by a third party. Not yet implemented; throwsNotImplementedException.
Adds a
VfTaxItem tax line to the invoice. Multiple tax lines can be added (e.g. different VAT rates, or IVA + recargo de equivalencia).Removes the tax line at the given zero-based index.
Adds a
VfRectificationItem reference to a previously-issued invoice that this invoice rectifies. Used with InvoiceType starting with R.Removes the rectification reference at the given zero-based index.
Sets the substitution data for R-type invoices corrected by substitution (
RectificationType = "S"). The taxItem carries the TaxBase, TaxAmount, and TaxAmountSurcharge of the original (replaced) invoice. InvoiceType must start with R or an ArgumentException is thrown.Builds the VERI*FACTU
RegistroAlta XML, signs it with the configured certificate, chains it to the blockchain, and submits it to the AEAT web service. Returns a VfInvoiceResult with the operation outcome.Builds the VERI*FACTU
RegistroAnulacion XML and submits it to the AEAT web service to cancel a previously submitted invoice. Returns a VfInvoiceResult with the operation outcome.Returns the full VERI*FACTU
RegistroAlta XML as a UTF-8 string without sending it. Useful for previewing or storing the XML locally before submission.Returns the full VERI*FACTU
RegistroAnulacion XML as a UTF-8 string without sending it.Returns the AEAT validation URL for the invoice. This URL encodes the QR content and can be opened in a browser to verify the invoice on the AEAT portal.
Generates the AEAT validation QR code as a bitmap and saves it to the file path specified by
path.Returns the AEAT validation QR code bitmap as a raw byte array. Useful when you want to embed the image without writing to disk.
Validates the given NIF/name combination against the AEAT’s online NIF validation service. Returns
null (or an empty string) if the NIF is valid, or a newline-separated string of error descriptions if validation fails.VfTaxItem
ProgId:Verifactu.VfTaxItemInterface:
IVfTaxItemGUID:
F861507A-AFB0-4922-B694-554112103F75
Represents a single tax breakdown line on an invoice. Pass instances to VfInvoice.InsertTaxItem(). Numeric fields use float for COM compatibility (values are rounded to 2 decimal places internally when added to the invoice).
Properties
Applicable tax code. Corresponds to AEAT list L1. Defaults to
"01" (IVA) if not set.| Value | Description |
|---|---|
01 | IVA — Impuesto sobre el Valor Añadido (default) |
02 | IPSI — Impuesto sobre la Producción, los Servicios y la Importación (Ceuta y Melilla) |
03 | IGIC — Impuesto General Indirecto Canario |
05 | Otros |
Tax regime (régimen / clave de régimen). Corresponds to AEAT lists L8A / L8B. Defaults to
"01" (régimen general) if not set. Common values: "01" (general), "02" (exportaciones), "05" (agencias de viajes), "07" (criterio de caja), etc.Operation qualification (calificación de operación). Corresponds to AEAT list L9. Defaults to
"S1" (sujeta y no exenta — no inversión sujeto pasivo) if not set. Common values: "S1" (sujeta no exenta), "S2" (sujeta no exenta — inversión sujeto pasivo), "N1" (no sujeta art. 7), "N2" (no sujeta otros), "E1"–"E6" (exenta).Exemption cause (causa de exención). Corresponds to AEAT list L10. Defaults to
"NA" if not set. Only relevant when TaxType indicates an exempt operation (E1–E6).Taxable base amount (base imponible) in euros.
Tax rate as a percentage (tipo impositivo), e.g.
21 for 21% IVA, 10 for 10% IVA, 4 for super-reduced rate.Tax quota amount in euros (cuota del impuesto). Must equal
TaxBase × TaxRate / 100 (rounded to 2 decimals).Equivalence surcharge rate as a percentage (tipo del recargo de equivalencia), e.g.
5.2 for the 21% IVA surcharge. Leave at 0 if not applicable.Equivalence surcharge quota in euros (cuota del recargo de equivalencia). Must equal
TaxBase × TaxRateSurcharge / 100. Leave at 0 if not applicable.VfRectificationItem
ProgId:Verifactu.VfRectificationItemInterface:
IVfRectificationItemGUID:
119A584F-681D-4DE0-BBC1-929057B7F992
Identifies an original invoice being rectified. Add instances to a rectificative VfInvoice via InsertRectificationItem(). Multiple references can be added if the rectification covers more than one original invoice.
Properties
Invoice identifier of the original invoice being rectified (número de la factura rectificada).
Issue date of the original invoice being rectified (fecha de la factura rectificada).
VfInvoiceResult
ProgId:Verifactu.VfInvoiceResultInterface:
IVfInvoiceResultGUID:
674199D6-27FE-4C42-B980-0BEC549CF304
Returned by VfInvoice.Send() and VfInvoice.Delete(). Contains the full outcome of the AEAT web service call.
Properties
Operation result code.
| Value | Meaning |
|---|---|
"0" | Success — the AEAT accepted the record |
"9001" | Local exception (network error, config error, etc.) |
"9002:..." | SOAP fault returned by the AEAT (fault code appended after the colon) |
"9009" | Unknown error |
| Other | AEAT application-level error code (see ResultMessage for details) |
Human-readable description.
"OK" on success; error description on failure. For AEAT errors this contains the AEAT’s DescripcionErrorRegistro field.Código Seguro de Verificación assigned by the AEAT when the record is accepted (
ResultCode = "0"). Store this value — it is the authoritative reference for the submitted record. Empty when the submission failed.Raw XML body of the AEAT web service response. Populated on both success and AEAT-level errors. Useful for audit logging and detailed error diagnostics. Empty on local exceptions (
9001).VfSettings
ProgId:Verifactu.VfSettingsInterface:
IVfSettingsGUID:
F04D6533-AAC5-453B-A19D-BB76711ED404
Configuration object that mirrors Settings.Current in the .NET library. Use it to configure the certificate, storage paths, AEAT endpoints, and billing software metadata before calling Send() or Delete(). Call Save() to persist settings to disk; they are loaded automatically on the next process start.
For a full description of every property see Configuration / Settings.
Properties — Certificate
Path to the
.pfx certificate file. Used together with CertificatePassword to load the certificate from the filesystem.Password for the
.pfx certificate file. Only required when loading from a file via CertificatePath.Serial number of the certificate in the Windows certificate store. Mutually exclusive with
CertificatePath.SHA-1 thumbprint (huella digital) of the certificate in the Windows certificate store. Mutually exclusive with
CertificatePath.Properties — Storage Paths
Directory used as the incoming message tray. Responses received from the AEAT are stored here.
Directory used as the outgoing message tray. A copy of every submission sent to the AEAT is stored here.
Directory where the per-issuer blockchain files are stored. These files maintain the cryptographic chain of invoice records required by VERI*FACTU.
Directory where issued invoice records are persisted locally.
Directory for system message logs.
Properties — AEAT Endpoints & Algorithm
Base URL prefix for the AEAT VERI*FACTU submission web service (alta and anulación).
Base URL prefix for the AEAT VERI*FACTU validation web service.
Hash algorithm code for blockchain record fingerprints. Corresponds to AEAT list L12. Defaults to
"01" (SHA-256).Text encoding used as input to the hash function (e.g.
"UTF-8").Schema version. Alfanumérico(3), list L15. Current value:
"1.0".Properties — Billing Software (SistemaInformatico)
These properties identify the invoicing software to the AEAT and are included in every submitted record.
Name/company name of the billing software producer. Up to 120 characters.
NIF of the billing software producer. FormatoNIF(9).
Name given by the producer to the billing software. Up to 30 characters.
Software system ID code. Up to 2 characters.
Software version string. Up to 50 characters.
Installation number, uniquely identifying this software installation for this taxpayer. Up to 100 characters.
"S" if the software can only operate in VERI*FACTU mode; "N" otherwise. List L4."S" if the software can handle multiple taxpayers; "N" if it can only handle one. List L4."S" if the software is currently managing more than one taxpayer; "N" otherwise. Determined automatically by the software. List L4.Properties — Validation Flags
When
true, the online NIF validation call to the AEAT census service is skipped. Useful for testing or offline scenarios.When
true, the online VAT number validation against the EU VIES registry is skipped.When
true, the system message log is active and entries are written to LogPath.Methods
Applies the current property values to
Settings.Current and persists them to the XML configuration file on disk.Reads
Settings.Current into this object’s properties, refreshing all values from the in-memory (or previously loaded) configuration.Overrides the default configuration file path. Call this before
Load() or Save() to use a custom configuration file location.Reads all blockchain files from
BlockchainPath into memory. Call this once at application startup if your process needs to resume an existing blockchain state. Throws InvalidOperationException if BlockchainPath is not a valid directory.VfInvoiceQuery
ProgId:Verifactu.VfInvoiceQueryInterface:
IVfInvoiceQueryGUID:
9279A76F-E672-4128-899F-A2B3CCB8E6C0
Allows querying invoices registered with the AEAT for a given seller, year, and month. Results are returned as an array of VfInvoice objects accessible through GetInvoicesCount() and GetInvoice(index).
Properties
Seller NIF or fiscal identifier whose invoices are to be queried.
Seller name associated with
SellerID.Four-digit year to query (e.g.
"2024").Two-digit month to query (e.g.
"01" through "12").Methods
Queries the AEAT for issued (sales) invoices matching
SellerID, Year, and Month. Populates the internal Invoices array. Call GetInvoicesCount() and GetInvoice(index) to iterate results.Queries the AEAT for received (purchase) invoices matching
SellerID, Year, and Month. Populates the internal Invoices array.Returns the number of invoices in the result set from the last
GetSales() or GetPurchases() call. Returns 0 if no query has been executed yet.Returns the
VfInvoice at the given zero-based index from the last query result. Throws ArgumentOutOfRangeException if index is out of range.