Acontplus.Billing
1.1.6
dotnet add package Acontplus.Billing --version 1.1.6
NuGet\Install-Package Acontplus.Billing -Version 1.1.6
<PackageReference Include="Acontplus.Billing" Version="1.1.6" />
<PackageVersion Include="Acontplus.Billing" Version="1.1.6" />
<PackageReference Include="Acontplus.Billing" />
paket add Acontplus.Billing --version 1.1.6
#r "nuget: Acontplus.Billing, 1.1.6"
#:package Acontplus.Billing@1.1.6
#addin nuget:?package=Acontplus.Billing&version=1.1.6
#tool nuget:?package=Acontplus.Billing&version=1.1.6
Acontplus.Billing
A comprehensive .NET library for electronic invoicing and digital document handling in Ecuador, fully compliant with SRI (Servicio de Rentas Internas) normatives v2.32. Provides complete support for all electronic document types, XML generation, validation, parsing, and web service integration.
🚀 Features
📋 Complete SRI Document Type Support
All 6 electronic document types according to SRI Ficha Técnica v2.32:
- ✅ Factura (01) - Invoice with embedded XSD schemas (v1.0.0, v1.1.0, v2.0.0, v2.1.0)
- ✅ Liquidación de Compra (03) - Purchase Settlement with XSD validation (v1.0.0)
- ✅ Nota de Crédito (04) - Credit Note with schemas (v1.0.0, v1.1.0)
- ✅ Nota de Débito (05) - Debit Note with XSD validation (v1.0.0)
- ✅ Guía de Remisión (06) - Delivery Guide with schema support (v1.0.0)
- ✅ Comprobante de Retención (07) - Withholding Receipt with schemas (v1.0.0, v2.0.0)
🔧 Core Capabilities
- XML Generation: Complete XML document generation for all SRI document types
- XML Parsing: Robust parsing and deserialization of SRI-authorized documents
- XSD Validation: Embedded XSD schemas for all document types and versions
- SRI Web Services: Full integration with SRI authentication and submission endpoints
- Document Conversion: XML to HTML/PDF rendering for all document types
- ATS Support: Anexo Transaccional Simplificado (ATS) generation and parsing
- Identity Validation: Ecuadorian ID card (cédula) and RUC validation with digit verification
- CAPTCHA Handling: Automated CAPTCHA processing for SRI web interactions
- Token Management: Secure token-based authentication with automatic renewal
- Reimbursement Support: Complete reimbursement (reembolsos) handling
- Payment Methods: Multi-payment method support with installment tracking
- Additional Info: Flexible additional information fields (up to 15 custom fields)
📦 Installation
NuGet Package Manager
Install-Package Acontplus.Billing
.NET CLI
dotnet add package Acontplus.Billing
PackageReference
<ItemGroup>
<PackageReference Include="Acontplus.Billing" Version="1.2.0" />
</ItemGroup>
🎯 Quick Start
1. Register Services
// In Startup.cs or Program.cs
// Services are registered manually or through your DI container
// Example:
services.AddSingleton<ICedulaService, CedulaService>();
services.AddSingleton<IRucService, RucService>();
// Add other services as needed
2. Configuration in appsettings.json
{
"Billing": {
"Environment": "Development",
"ValidateBeforeSend": true,
"DefaultTimeoutSeconds": 30,
"DocumentStoragePath": "Documents",
"CompanyRuc": "0991234567001",
"CompanyLegalName": "ACME COMPANY S.A.",
"CompanyCommercialName": "ACME",
"EnableCaching": true,
"CacheDurationMinutes": 60,
"SriConnection": {
"BaseUrl": "https://celcer.sri.gob.ec/",
"TimeoutSeconds": 30,
"MaxRetryAttempts": 3,
"ValidateSslCertificate": true
}
}
}
3. Usage Examples
Validate Ecuadorian ID Card
public class IdentityValidator
{
private readonly ICedulaService _cedulaService;
public IdentityValidator(ICedulaService cedulaService) => _cedulaService = cedulaService;
public bool ValidateIdentity(string cedula) => _cedulaService.ValidateCedula(cedula);
}
Generate Electronic Invoice XML
public class InvoiceGenerator
{
private readonly IXmlService _xmlService;
public InvoiceGenerator(IXmlService xmlService) => _xmlService = xmlService;
public string GenerateInvoice(ComprobanteElectronico comprobante) => _xmlService.GenerateInvoiceXml(comprobante);
}
Send Document to SRI
public class DocumentSender
{
private readonly ISriWebService _sriService;
public DocumentSender(ISriWebService sriService) => _sriService = sriService;
public async Task<ResponseSri> SendDocumentAsync(string xmlContent, string username, string password)
{
var token = await _sriService.AuthenticateAsync(username, password);
return await _sriService.SendDocumentAsync(xmlContent, token);
}
}
Convert XML to HTML for Display
public class DocumentRenderer
{
private readonly IDocumentConverter _converter;
public DocumentRenderer(IDocumentConverter converter) => _converter = converter;
public string RenderDocument(string xmlContent) => _converter.ConvertToHtml(xmlContent);
}
📚 API Documentation
Document Type Constants
using Acontplus.Billing.Constants;
// Access document type codes
DocumentTypes.Factura; // "01"
DocumentTypes.LiquidacionCompra; // "03"
DocumentTypes.NotaCredito; // "04"
DocumentTypes.NotaDebito; // "05"
DocumentTypes.GuiaRemision; // "06"
DocumentTypes.ComprobanteRetencion; // "07"
// Get document name
var name = DocumentTypes.GetDocumentName("01"); // "Factura"
// Validate document code
bool isValid = DocumentTypes.IsValidDocumentCode("01"); // true
Core Services
ICedulaService,IRucService- Ecuadorian ID and RUC validation with checksum verificationIWebServiceSri- SRI web service authentication and document submissionIDocumentConverter- XML to HTML/PDF conversion for all document typesIXmlDocumentParser- Parse SRI-authorized XML documentsIAtsXmlService- Generate ATS (Anexo Transaccional Simplificado) XMLIElectronicDocumentService- High-level document managementIDocumentValidator- XSD schema validation
Document Models
All document types include complete model classes:
ComprobanteElectronico- Base electronic document containerInfoFactura- Invoice informationInfoLiquidacionCompra- Purchase settlement informationInfoNotaCredito- Credit note informationInfoNotaDebito- Debit note information with motivosInfoGuiaRemision- Delivery guide informationInfoCompRetencion- Withholding informationDestinatario- Delivery guide recipients with detailsDocSustento- Supporting documents with retentions and reimbursements
🤝 Contributing
We welcome contributions! Please see our Contributing Guidelines for details.
Development Setup
git clone https://github.com/acontplus/acontplus-dotnet-libs.git
cd acontplus-dotnet-libs
dotnet restore
dotnet build
📄 License
This project is licensed under the MIT License - see the LICENSE file for details.
🆘 Support
- 📧 Email: proyectos@acontplus.com
- 🐛 Issues: GitHub Issues
- 📖 Documentation: Wiki
👨💻 Author
Ivan Paz - @iferpaz7
🏢 Company
Acontplus - Software solutions
Built with ❤️ for the .NET community
| 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. |
-
net10.0
- Acontplus.Barcode (>= 1.1.1)
- Acontplus.Core (>= 2.1.1)
- Acontplus.Utilities (>= 2.0.5)
- BCrypt.Net-Next (>= 4.0.3)
- Microsoft.Extensions.DependencyInjection (>= 10.0.1)
- Microsoft.Extensions.DependencyInjection.Abstractions (>= 10.0.1)
- SkiaSharp.NativeAssets.Linux (>= 3.116.1)
- System.Drawing.Common (>= 10.0.1)
- 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.1.6 | 24 | 12/25/2025 |
| 1.1.5 | 125 | 12/11/2025 |
| 1.1.4 | 151 | 12/5/2025 |
| 1.1.3 | 191 | 12/4/2025 |
| 1.1.2 | 185 | 12/3/2025 |
| 1.1.1 | 173 | 11/27/2025 |
| 1.1.0 | 188 | 11/23/2025 |
| 1.0.9 | 388 | 11/17/2025 |
| 1.0.8 | 380 | 11/17/2025 |
| 1.0.7 | 382 | 11/17/2025 |
| 1.0.6 | 282 | 11/11/2025 |
| 1.0.5 | 266 | 11/11/2025 |
| 1.0.4 | 193 | 11/5/2025 |
| 1.0.3 | 181 | 11/5/2025 |
| 1.0.2 | 182 | 11/5/2025 |
| 1.0.1 | 187 | 11/5/2025 |
| 1.0.0 | 192 | 11/2/2025 |
Enhanced with cutting-edge C# features, comprehensive SRI integration, embedded XSD schemas, XML validation, token management, and enterprise-grade electronic invoicing capabilities for Ecuadorian compliance.