Skip to content

Solución en .NET para obtener el Registro de Compras y Ventas (RCV) del SII (Chile). Utiliza un certificado PFX desde Azure Blob Storage para realizar llamadas autenticadas con HttpClient.

License

Notifications You must be signed in to change notification settings

sergioocode/Sii.RegistroCompraVenta

Repository files navigation

.NET GitHub commit activity GitHub contributors GitHub code size in bytes

Registro de Compras y Ventas (Chile) desde el SII

This solution allows you to query the Registro de Compras y Ventas from Chile's Servicio de Impuestos Internos (SII) using scraping. It authenticates using a digital certificate stored in Azure Blob Storage and retrieves DTE summaries by document state.


📦 Details

Package Reference Version
Azure.Storage.Blobs 12.24.0
Microsoft.Extensions.Azure 1.11.0
Swashbuckle.AspNetCore 8.1.0

📋 Requirements

This project requires the following to run successfully:

  • A valid digital certificate (.pfx) issued for SII services
  • An Azure Storage Account or a local Blob Storage emulator like Azurite to store the certificate file.

🚀 Usage

Once the app is running, you can query purchases or sales:

curl -X GET "http://localhost:5200/api/RegistroCompraVenta/resumen?rut=11222333-8&year=2025&mes=3&operacion=compra" \
  -H "Accept: application/json"
  • rut: RUT of the issuer (e.g., 11222333-8)
  • year: Year between 2023 and current year
  • mes: Month between 1 and 12
  • operacion: COMPRA or VENTA

The result is grouped by document state: REGISTRO, RECLAMADO, PENDIENTE.


⚙️ Configuration

Use appsettings.json or environment variables to configure the certificate source:

{
  "StorageConnection": "UseDevelopmentStorage=true",
  "StorageConnection:ContainerName": "certificados",
  "StorageConnection:BlobName": "certificado1.pfx",
  "StorageConnection:CertPassword": "<your-cert-password>"
}

You may also define these as Azure App Settings if you're deploying the API to the cloud.


📢 Have a question? Found a Bug?

Feel free to file a new issue with a respective title and description in the Sii.RegistroCompraVenta/issues section.


💖 Community and Contributions

If this tool is useful, feel free to contribute ideas or improvements.

PayPal


📘 License

This repository is released under the GNU General Public License v3.0.

About

Solución en .NET para obtener el Registro de Compras y Ventas (RCV) del SII (Chile). Utiliza un certificado PFX desde Azure Blob Storage para realizar llamadas autenticadas con HttpClient.

Topics

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages