UruFacturaSDK 1.0.0
dotnet add package UruFacturaSDK --version 1.0.0
NuGet\Install-Package UruFacturaSDK -Version 1.0.0
This command is intended to be used within the Package Manager Console in Visual Studio, as it uses the NuGet module's version of Install-Package.
<PackageReference Include="UruFacturaSDK" Version="1.0.0" />
For projects that support PackageReference, copy this XML node into the project file to reference the package.
<PackageVersion Include="UruFacturaSDK" Version="1.0.0" />
<PackageReference Include="UruFacturaSDK" />
For projects that support Central Package Management (CPM), copy this XML node into the solution Directory.Packages.props file to version the package.
paket add UruFacturaSDK --version 1.0.0
The NuGet Team does not provide support for this client. Please contact its maintainers for support.
#r "nuget: UruFacturaSDK, 1.0.0"
#r directive can be used in F# Interactive and Polyglot Notebooks. Copy this into the interactive tool or source code of the script to reference the package.
#:package UruFacturaSDK@1.0.0
#:package directive can be used in C# file-based apps starting in .NET 10 preview 4. Copy this into a .cs file before any lines of code to reference the package.
#addin nuget:?package=UruFacturaSDK&version=1.0.0
#tool nuget:?package=UruFacturaSDK&version=1.0.0
The NuGet Team does not provide support for this client. Please contact its maintainers for support.
UruFacturaSDK 🇺🇾
La vía rápida hacia la Facturación Electrónica en Uruguay
UruFactura SDK es una librería open-source .Net 10 C# de alto nivel diseñada para simplificar la integración de sistemas locales con el ecosistema de la DGI. Olvídate de lidiar con la complejidad manual de los sobres SOAP o la estructura rígida de los esquemas XML; esta herramienta actúa como un puente amigable entre tu lógica de negocio y los requisitos impositivos uruguayos.
🚀 Características Principales
| Característica | Detalle |
|---|---|
| Generación de CFE | Crea e-Tickets, e-Facturas, e-Remitos y sus notas de corrección con objetos simples, cumpliendo el formato XML vigente de la DGI. |
| Firma Digital XAdES-BES | Módulo integrado para la firma electrónica usando certificados estándar .p12 / .pfx. |
| Comunicación SOAP | Cliente SOAP optimizado para envío de comprobantes, consulta de estados y envío del Reporte Diario. |
| Gestión de CAE | Control inteligente de Constancias de Autorización de Emisión con alertas de vencimiento y rango. |
| Representación Impresa | Generador de PDFs (A4 y térmico 80mm) con código QR y sellos de seguridad según normativa. |
📦 Estructura del Proyecto
UruFacturaSDK/
├── src/
│ └── UruFacturaSDK/
│ ├── Configuration/ # UruFacturaConfig
│ ├── Enums/ # TipoCfe, TipoIva, FormaPago, Moneda, Ambiente
│ ├── Exceptions/ # Excepciones tipadas del SDK
│ ├── Models/ # Cfe, Cae, Receptor, LineaDetalle, RespuestaDgi
│ ├── Xml/ # CfeXmlBuilder (generación XML DGI)
│ ├── Signature/ # CfeFirmante (XAdES-BES)
│ ├── Soap/ # DgiSoapClient (comunicación con DGI)
│ ├── Cae/ # CaeManager (gestión de CAE)
│ ├── Pdf/ # CfePdfGenerator (PDF A4 y térmico)
│ └── UruFacturaClient.cs # Facade principal del SDK
└── tests/
└── UruFacturaSDK.Tests/ # Tests unitarios xUnit
🛠️ Uso Rápido
1. Configurar el cliente
var config = new UruFacturaConfig
{
RutEmisor = "210000000012",
RazonSocialEmisor = "Mi Empresa S.A.",
DomicilioFiscal = "Av. 18 de Julio 1234",
Ciudad = "Montevideo",
Departamento = "Montevideo",
Ambiente = Ambiente.Homologacion,
RutaCertificado = "/ruta/al/certificado.p12",
PasswordCertificado = "mi_password",
};
using var client = new UruFacturaClient(config);
2. Crear y enviar un e-Ticket
using UruFacturaSDK.Models; // Cae, LineaDetalle, Receptor, RefCfe
// Registrar CAE
client.Cae.RegistrarCae(new Models.Cae
{
NroSerie = "CAE2025001",
TipoCfe = TipoCfe.ETicket,
RangoDesde = 1,
RangoHasta = 1000,
FechaVencimiento = new DateTime(2026, 12, 31),
});
// Crear comprobante
var eticket = client.CrearETicket();
eticket.Numero = 1;
eticket.Detalle.Add(new LineaDetalle
{
NroLinea = 1,
NombreItem = "Servicio de consultoría",
Cantidad = 1,
PrecioUnitario = 1000m,
IndFactIva = TipoIva.Basico,
});
// Generar XML, firmar y enviar
var xmlFirmado = client.GenerarYFirmar(eticket);
var respuesta = await client.EnviarCfeAsync(eticket);
if (respuesta.Exitoso)
Console.WriteLine($"✅ Aceptado: {respuesta.Mensaje}");
3. Generar PDF
// PDF A4
byte[] pdfA4 = client.GenerarPdfA4(eticket);
await File.WriteAllBytesAsync("eticket.pdf", pdfA4);
// PDF Térmico (ticket 80mm)
byte[] pdfTermico = client.GenerarPdfTermico(eticket);
await File.WriteAllBytesAsync("eticket_termico.pdf", pdfTermico);
4. Nota de crédito con referencia
var nc = client.CrearNotaCreditoETicket();
nc.Numero = 1;
nc.Referencias.Add(new RefCfe
{
TipoCfe = TipoCfe.ETicket,
Serie = "A",
NroCfe = 42,
FechaCfe = new DateTime(2025, 6, 15),
Razon = "Devolución de mercadería",
});
nc.Detalle.Add(new LineaDetalle
{
NroLinea = 1,
NombreItem = "Devolución producto",
Cantidad = 1,
PrecioUnitario = 500m,
IndFactIva = TipoIva.Basico,
});
5. Verificar estado de CAEs
var advertencias = client.Cae.ObtenerAdvertencias();
foreach (var advertencia in advertencias)
Console.WriteLine(advertencia);
Console.WriteLine(client.Cae.ResumenEstado());
📄 Tipos de CFE soportados
| Código | Tipo |
|---|---|
| 101 | e-Ticket |
| 102 | Nota de Crédito e-Ticket |
| 103 | Nota de Débito e-Ticket |
| 111 | e-Factura |
| 112 | Nota de Crédito e-Factura |
| 113 | Nota de Débito e-Factura |
| 121 | e-Factura de Exportación |
| 122 | Nota de Crédito e-Factura Exportación |
| 123 | Nota de Débito e-Factura Exportación |
| 131 | e-Remito Despachante |
| 151 | e-Resguardo |
| 181 | e-Remito |
| 182 | Nota de Crédito e-Remito |
🔧 Requisitos
- .NET 10 SDK
- Certificado digital DGI (
.p12/.pfx) - CAE vigente emitido por la DGI
🧪 Tests
dotnet test tests/UruFacturaSDK.Tests/
📝 Licencia
MIT — ver LICENSE
| Product | Versions Compatible and additional computed target framework versions. |
|---|---|
| .NET | net10.0 is compatible. net10.0-android was computed. net10.0-browser was computed. net10.0-ios was computed. net10.0-maccatalyst was computed. net10.0-macos was computed. net10.0-tvos was computed. net10.0-windows was computed. |
Compatible target framework(s)
Included target framework(s) (in package)
Learn more about Target Frameworks and .NET Standard.
-
net10.0
- QuestPDF (>= 2026.2.4)
- SkiaSharp (>= 3.119.2)
- SkiaSharp.NativeAssets.Linux.NoDependencies (>= 3.119.2)
- System.Security.Cryptography.Pkcs (>= 10.0.6)
- System.Security.Cryptography.Xml (>= 10.0.6)
- ZXing.Net (>= 0.16.11)
- ZXing.Net.Bindings.SkiaSharp (>= 0.16.22)
NuGet packages
This package is not used by any NuGet packages.
GitHub repositories
This package is not used by any popular GitHub repositories.
| Version | Downloads | Last Updated |
|---|---|---|
| 1.0.0 | 225 | 4/18/2026 |