PHPackages                             aalonzolu/digifact - PHPackages - PHPackages  [Skip to content](#main-content)[PHPackages](/)[Directory](/)[Categories](/categories)[Trending](/trending)[Leaderboard](/leaderboard)[Changelog](/changelog)[Analyze](/analyze)[Collections](/collections)[Log in](/login)[Sign up](/register)

1. [Directory](/)
2. /
3. [API Development](/categories/api)
4. /
5. aalonzolu/digifact

ActiveLibrary[API Development](/categories/api)

aalonzolu/digifact
==================

PHP SDK for Digifact FEL Guatemala e-invoicing API (v2)

v2.2.3(4w ago)034MITPythonPHP &gt;=8.1CI passing

Since Nov 19Pushed 4w ago1 watchersCompare

[ Source](https://github.com/aalonzolu/digifact)[ Packagist](https://packagist.org/packages/aalonzolu/digifact)[ RSS](/packages/aalonzolu-digifact/feed)WikiDiscussions main Synced 5d ago

READMEChangelogDependencies (2)Versions (14)Used By (0)

Digifact FEL SDK
================

[](#digifact-fel-sdk)

SDKs para la API Digifact FEL NUC GT — facturación electrónica SAT Guatemala.

SDKPaqueteVersión mínima[Python](./python/)[`digifact-sdk`](https://pypi.org/p/digifact-sdk) (PyPI)Python 3.10+[JavaScript](./javascript/)[`digifact-sdk`](https://www.npmjs.com/package/digifact-sdk) (npm)Node 18+[PHP](./php/)[`aalonzolu/digifact`](https://packagist.org/packages/aalonzolu/digifact) (Packagist)PHP 8.1+[C# / .NET](./dotnet/)[`Digifact.Fel`](https://www.nuget.org/packages/Digifact.Fel) (NuGet).NET 8+Instalación rápida
------------------

[](#instalación-rápida)

```
# Python
pip install digifact-sdk

# JavaScript
npm install digifact-sdk

# PHP
composer require aalonzolu/digifact

# C# / .NET
dotnet add package Digifact.Fel
```

Uso básico (los 4 SDKs)
-----------------------

[](#uso-básico-los-4-sdks)

```
# Python
from digifact_sdk import DigifactClient

client = DigifactClient(
    taxid="12345678",
    username="FELUSER",
    password="...",
    environment="test",   # o "production"
)
result = client.invoice("CF", [
    {"description": "Servicio", "qty": 1, "price": 100},
])
print(result.auth_number)
```

```
// JavaScript
import { DigifactClient } from 'digifact-sdk';

const client = new DigifactClient({
  taxid: '12345678', username: 'FELUSER', password: '...', environment: 'test',
});
const result = await client.invoice('CF', [
  { description: 'Servicio', qty: 1, price: 100 },
]);
console.log(result.authNumber);
```

```
// PHP
use Digifact\Fel\DigifactClient;

$client = new DigifactClient([
  'taxid' => '12345678', 'username' => 'FELUSER',
  'password' => '...', 'environment' => 'test',
]);
$result = $client->invoice('CF', [
  ['description' => 'Servicio', 'qty' => 1, 'price' => 100],
]);
echo $result->authNumber;
```

```
// C# / .NET
using Digifact.Fel;

using var client = new DigifactClient(new DigifactOptions {
  Taxid = "12345678", Username = "FELUSER",
  Password = "...", Environment = "test",
});
var result = await client.InvoiceAsync("CF", new[] {
  new LineItem { Description = "Servicio", Qty = 1, Price = 100 },
});
Console.WriteLine(result.AuthNumber);
```

Tipos de DTE soportados
-----------------------

[](#tipos-de-dte-soportados)

MétodoDTEDescripción`invoice()`FACTFactura de consumidor final o NIT`invoice()`FCAMFactura cambiaria con cuotas`invoice()`NABNNota de abono`invoice()`FESPFactura especial (retención)`invoice()`RDONRecibo por donación`invoice()`RECIRecibo de colegiatura`invoice()`FPEQFactura pequeño contribuyente`debitNote()`NDEBNota de débito`creditNote()`NCRENota de crédito parcial`creditNoteTotal()`—Nota de crédito total (anulación)`cancel()`—Anulación de DTE`fuelInvoice()`FACT+CombustibleFactura con IVA + impuesto PETROLEO`ccaInvoice()`FACT+CCACobro por cuenta ajena`lookupNit()`—Consulta nombre/dirección de un NIT en SAT`getDte()`—Descarga un DTE ya emitidoConfiguración del cliente (común a los 4 SDKs)
----------------------------------------------

[](#configuración-del-cliente-común-a-los-4-sdks)

Ordenados de más usados a menos usados.

ParámetroRequeridoDescripción`taxid` / `Taxid`✔NIT del emisor.`username` / `Username`✔Usuario Digifact (la parte después de `GT..`).`password` / `Password`✔\*Contraseña. \*O bien `token`.`token` / `Token`✔\*Bearer token preobtenido. \*O bien `password`.`environment` / `Environment``"test"` (default) o `"production"`.`seller_name` / `SellerName`Nombre del emisor. Para NIT individual es el nombre de la persona; para S.A. / S.E. es la razón social. Auto-consulta en SAT si se omite.`seller_address` / `SellerAddress`Dirección del emisor. Auto-consulta en SAT si se omite.`branch_code` / `BranchCode`Código del establecimiento (RTU). Default `"1"`.`branch_name` / `BranchName`Nombre comercial de la sucursal, el mismo que aparece en la patente de comercio. Default `"ESTABLECIMIENTO PRINCIPAL"`.`afiliacion_iva` / `AfiliacionIva``"GEN"` (default), `"PEQ"` o `"EXE"`.`tipo_frase` / `TipoFrase`Override global de `TipoFrase` (raramente necesario).`escenario` / `Escenario`Override global de `CodigoEscenario` (raramente necesario).`petroleo_rates` / `PetroleoRates`Mapa código→tarifa PETROLEO para `fuelInvoice()` (sólo gasolineras).`timeout` / `Timeout`Timeout HTTP. Default 120s (JS: 120000 ms).`tipo_personeria` / `TipoPersoneria`Código de personería del RTU. Sólo aplica a RDON. Default `"1"`.Ver detalles y ejemplos por lenguaje en los READMEs respectivos.

Variables de entorno
--------------------

[](#variables-de-entorno)

```
DIGIFACT_TAXID=12345678
DIGIFACT_USERNAME=FELUSER
DIGIFACT_PASSWORD=...
```

Estructura del repositorio
--------------------------

[](#estructura-del-repositorio)

```
digifact-sdk/
├── python/          SDK Python — pyproject.toml, digifact_sdk/
├── javascript/      SDK JavaScript — package.json, src/
├── php/             SDK PHP — composer.json, src/
├── dotnet/          SDK C#/.NET — Digifact.Fel.csproj, *.cs
├── docs/            Documentación y colección Postman
│   └── postman/     Colección y ambiente para Postman
├── scripts/         Herramientas de validación y smoke tests
└── .github/
    └── workflows/
        ├── ci.yml       Tests en cada push/PR
        └── publish.yml  Publicación a PyPI/npm/Packagist/NuGet al hacer tag

```

Publicar una release
--------------------

[](#publicar-una-release)

```
# Actualizar versiones en pyproject.toml y package.json, luego:
git tag v1.2.3
git push origin v1.2.3
```

El workflow `publish.yml` se activa automáticamente y publica los cuatro paquetes.

Documentación adicional
-----------------------

[](#documentación-adicional)

- [Python SDK](./python/README.md)
- [JavaScript SDK](./javascript/README.md)
- [PHP SDK](./php/README.md)
- [C# / .NET SDK](./dotnet/README.md)
- [Documentación SAT](./docs/documentacion_sat.md)
- [Colección Postman](./docs/postman/)

###  Health Score

48

—

FairBetter than 94% of packages

Maintenance94

Actively maintained with recent releases

Popularity9

Limited adoption so far

Community7

Small or concentrated contributor base

Maturity70

Established project with proven stability

 Bus Factor1

Top contributor holds 100% of commits — single point of failure

How is this calculated?**Maintenance (25%)** — Last commit recency, latest release date, and issue-to-star ratio. Uses a 2-year decay window.

**Popularity (30%)** — Total and monthly downloads, GitHub stars, and forks. Logarithmic scaling prevents top-heavy scores.

**Community (15%)** — Contributors, dependents, forks, watchers, and maintainers. Measures real ecosystem engagement.

**Maturity (30%)** — Project age, version count, PHP version support, and release stability.

###  Release Activity

Cadence

Every ~164 days

Recently: every ~3 days

Total

13

Last Release

28d ago

Major Versions

1.2.0 → v2.0.22026-03-27

PHP version history (2 changes)v1.0.1PHP &gt;=5.4.0

v2.0.2PHP &gt;=8.1

### Community

Maintainers

![](https://www.gravatar.com/avatar/860e51ee755b1838ef4a421d3070ba03b57b7bfb3485f85ee5a41ee59bf75456?d=identicon)[aalonzolu](/maintainers/aalonzolu)

---

Top Contributors

[![aalonzolu](https://avatars.githubusercontent.com/u/5524124?v=4)](https://github.com/aalonzolu "aalonzolu (55 commits)")

---

Tags

e-invoicingsatfacturaGuatemalafeldigifact

###  Code Quality

TestsPHPUnit

### Embed Badge

![Health badge](/badges/aalonzolu-digifact/health.svg)

```
[![Health](https://phpackages.com/badges/aalonzolu-digifact/health.svg)](https://phpackages.com/packages/aalonzolu-digifact)
```

###  Alternatives

[twilio/sdk

A PHP wrapper for Twilio's API

1.6k92.9M272](/packages/twilio-sdk)[knplabs/github-api

GitHub API v3 client

2.2k15.8M187](/packages/knplabs-github-api)[facebook/php-business-sdk

PHP SDK for Facebook Business

90121.9M34](/packages/facebook-php-business-sdk)[meilisearch/meilisearch-php

PHP wrapper for the Meilisearch API

73813.7M114](/packages/meilisearch-meilisearch-php)[google/common-protos

Google API Common Protos for PHP

173103.7M50](/packages/google-common-protos)[hubspot/api-client

Hubspot API client

23414.2M16](/packages/hubspot-api-client)

PHPackages © 2026

[Directory](/)[Categories](/categories)[Trending](/trending)[Changelog](/changelog)[Analyze](/analyze)
