Skip to main content
LibreDTE Core supports 12 types of electronic tax documents (Documentos Tributarios Electrónicos) as defined by Chile’s SII (Servicio de Impuestos Internos).

Document Categories

The library provides support for the following document types, each identified by an official SII document code:

Factura Afecta

Code 33 - Electronic invoice (taxable)

Factura Exenta

Code 34 - Electronic invoice (tax-exempt)

Boleta Afecta

Code 39 - Electronic receipt (taxable)

Boleta Exenta

Code 41 - Electronic receipt (tax-exempt)

Liquidación Factura

Code 43 - Electronic invoice settlement

Factura de Compra

Code 46 - Electronic purchase invoice

Guía de Despacho

Code 52 - Electronic delivery guide

Nota de Débito

Code 56 - Electronic debit note

Nota de Crédito

Code 61 - Electronic credit note

Factura Exportación

Code 110 - Electronic export invoice

Nota Débito Exportación

Code 111 - Electronic export debit note

Nota Crédito Exportación

Code 112 - Electronic export credit note

Document Code Enum

All document types are defined in the CodigoDocumento enum:
use libredte\lib\Core\Package\Billing\Component\Document\Enum\CodigoDocumento;

// Access document codes
CodigoDocumento::FACTURA_AFECTA->value; // 33
CodigoDocumento::BOLETA_AFECTA->value; // 39
CodigoDocumento::NOTA_CREDITO->value; // 61
Each document type has its own interface in the Contract\Document namespace, ensuring type safety and clear separation of concerns.

Common Properties

All document types share common functionality through the base DocumentInterface:
  • Document code (código)
  • Document name (nombre)
  • Short name (nombre corto)
  • Alias for programmatic access
  • Associated PHP interface

Using Document Types

You can retrieve document information using the enum methods:
$factura = CodigoDocumento::FACTURA_AFECTA;

// Get official SII code
$codigo = $factura->getCodigo(); // 33

// Get full name
$nombre = $factura->getNombre(); // "Factura electrónica"

// Get short name (without "electrónica")
$nombreCorto = $factura->getNombreCorto(); // "Factura"

// Get alias
$alias = $factura->getAlias(); // "factura_afecta"

// Get associated interface
$interface = $factura->getInterface(); // FacturaAfectaInterface::class

Build docs developers (and LLMs) love