Skip to main content
The Billing Package is the central component of LibreDTE Core, providing functionality for creating, sending, and querying electronic tax documents (DTE) in Chile.

Package Components

The billing package (billing) contains seven specialized components:

Document

Create, manipulate, and render tax documents

Integration

Integrate with SII (Servicio de Impuestos Internos)

Exchange

Send and receive tax documents

Identifier

Manage document folios (CAF)

Book

Sales and purchase books management

Trading Parties

Manage issuers, receivers, and commercial parties

Ownership Transfer

Handle ownership transfer documents

Getting Started

The BillingPackage class provides access to all components:
use libredte\lib\Core\Package\Billing\BillingPackage;

// Access components through the package
$documentComponent = $billingPackage->getDocumentComponent();
$integrationComponent = $billingPackage->getIntegrationComponent();
$exchangeComponent = $billingPackage->getExchangeComponent();

Main Methods

getComponents
array
Returns an associative array of all available components with their keys:
  • book: BookComponentInterface
  • document: DocumentComponentInterface
  • exchange: ExchangeComponentInterface
  • identifier: IdentifierComponentInterface
  • integration: IntegrationComponentInterface
  • ownership_transfer: OwnershipTransferComponentInterface
  • trading_parties: TradingPartiesComponentInterface
getBookComponent
BookComponentInterface
Returns the book component for managing sales and purchase books
getDocumentComponent
DocumentComponentInterface
Returns the document component for creating and managing tax documents
getExchangeComponent
ExchangeComponentInterface
Returns the exchange component for sending and receiving documents
getIdentifierComponent
IdentifierComponentInterface
Returns the identifier component for managing folios (CAF)
getIntegrationComponent
IntegrationComponentInterface
Returns the integration component for SII communication
getOwnershipTransferComponent
OwnershipTransferComponentInterface
Returns the ownership transfer component
getTradingPartiesComponent
TradingPartiesComponentInterface
Returns the trading parties component for managing commercial entities

Architecture

The billing package follows a component-based architecture where each component:
  • Implements a specific domain responsibility
  • Contains multiple workers that handle specific tasks
  • Provides a clean interface for accessing functionality
  • Can be used independently or in combination with other components

Source Reference

Namespace: libredte\lib\Core\Package\Billing\BillingPackage Location: /workspace/source/src/Package/Billing/BillingPackage.php:54

Build docs developers (and LLMs) love