Acontplus.Billing 1.2.0

dotnet add package Acontplus.Billing --version 1.2.0
                    
NuGet\Install-Package Acontplus.Billing -Version 1.2.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="Acontplus.Billing" Version="1.2.0" />
                    
For projects that support PackageReference, copy this XML node into the project file to reference the package.
<PackageVersion Include="Acontplus.Billing" Version="1.2.0" />
                    
Directory.Packages.props
<PackageReference Include="Acontplus.Billing" />
                    
Project file
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 Acontplus.Billing --version 1.2.0
                    
#r "nuget: Acontplus.Billing, 1.2.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 Acontplus.Billing@1.2.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=Acontplus.Billing&version=1.2.0
                    
Install as a Cake Addin
#tool nuget:?package=Acontplus.Billing&version=1.2.0
                    
Install as a Cake Tool

Acontplus.Billing

NuGet .NET License: MIT

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 format/checksum verification
  • 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 Program.cs - register Billing services
services.AddSingleton<IWebServiceSri, WebServiceSri>();
services.AddSingleton<IDocumentConverter, DocumentConverter>();
services.AddSingleton<IElectronicDocumentService, ElectronicDocumentService>();
// 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

Parse an SRI-Authorized XML Document
public class DocumentParser
{
    private readonly IElectronicDocumentService _documentService;
    public DocumentParser(IElectronicDocumentService documentService) => _documentService = documentService;

    public ComprobanteElectronico? Parse(string xmlContent)
    {
        var xmlDoc = new XmlDocument();
        xmlDoc.LoadXml(xmlContent);
        return _documentService.TryParseDocument(xmlDoc, out var comprobante, out _) ? comprobante : null;
    }
}
Send Document to SRI
public class DocumentSender
{
    private readonly IWebServiceSri _sriService;
    public DocumentSender(IWebServiceSri sriService) => _sriService = sriService;

    public async Task<ResponseSri> ReceiveAsync(string xmlSigned, string receptionUrl)
        => await _sriService.ReceptionAsync(xmlSigned, receptionUrl);

    public async Task<ResponseSri> AuthorizeAsync(string claveAcceso, string authorizationUrl)
        => await _sriService.AuthorizationAsync(claveAcceso, authorizationUrl);
}
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

  • IWebServiceSri - SRI SOAP web service: document reception, authorization, and XML retrieval
  • IDocumentConverter - XML to HTML/PDF conversion for all document types
  • IXmlDocumentParser - Parse SRI-authorized XML documents
  • IAtsXmlService - Generate ATS (Anexo Transaccional Simplificado) XML
  • IElectronicDocumentService - High-level document management
  • IDocumentValidator - XSD schema validation

Document Models

All document types include complete model classes:

  • ComprobanteElectronico - Base electronic document container
  • InfoFactura - Invoice information
  • InfoLiquidacionCompra - Purchase settlement information
  • InfoNotaCredito - Credit note information
  • InfoNotaDebito - Debit note information with motivos
  • InfoGuiaRemision - Delivery guide information
  • InfoCompRetencion - Withholding information
  • Destinatario - Delivery guide recipients with details
  • DocSustento - 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 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.

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.2.0 85 3/23/2026
1.1.11 111 3/17/2026
1.1.10 90 3/8/2026
1.1.9 110 2/22/2026
1.1.8 132 1/16/2026
1.1.7 112 1/11/2026
1.1.6 209 12/25/2025
1.1.5 168 12/11/2025
1.1.4 184 12/5/2025
1.1.3 225 12/4/2025
1.1.2 222 12/3/2025
1.1.1 196 11/27/2025
1.1.0 218 11/23/2025
1.0.9 416 11/17/2025
1.0.8 410 11/17/2025
1.0.7 413 11/17/2025
1.0.6 311 11/11/2025
1.0.5 295 11/11/2025
1.0.4 222 11/5/2025
Loading failed

Enhanced with cutting-edge C# features, comprehensive SRI integration,
     embedded XSD schemas, XML validation, and enterprise-grade electronic
     invoicing capabilities for Ecuadorian compliance.