A REST API and web-based validation tool for ZuGFeRD and Factur-X e-invoices, built with ASP.NET Core and React.
This project provides a simple, user-friendly interface for validating ZuGFeRD and Factur-X e-invoices (both PDF and XML formats). It wraps the Mustang Project validation engine in a modern web application with both API and UI access.
Purpose: This tool is primarily used for unit testing and quality assurance in the development of Docentric AX, our document generation and distribution solution. It helps ensure that e-invoices generated by Docentric AX comply with ZuGFeRD and Factur-X standards.
- Web UI: Modern React-based interface for uploading and validating invoices
- REST API: Programmatic access for automated testing and integration
- Multiple Formats: Supports PDF (hybrid) and XML (Factur-X, UBL) e-invoice formats
- Extraction and Conversion: Extracts embedded XML from PDF and converts XML to PDF
- Standards Compliance: Validates ZuGFeRD, Factur-X and UBL invoices using Mustang Project CLI 2.26.0
- Docker Ready: Pre-built Docker images available on Docker Hub
- CI/CD: Automated builds and testing with GitHub Actions
- Backend: ASP.NET Core 10 (minimal API)
- Frontend: React + Vite + TypeScript
- UI Components: shadcn/ui with Tailwind CSS
- Validation Engine: Mustang Project CLI 2.26.0 (Java-based)
- Runtime: .NET 10 + OpenJDK 17
The easiest way to run the validator is using Docker:
docker pull docentric/e-invoice-validator:latest
docker run -p 18889:8080 docentric/e-invoice-validator:latestThen open your browser to http://localhost:18889
For local development, you need:
- .NET 10 SDK
- Node.js 20.x or later
- Java Runtime Environment (JRE) 11 or later
- Docker (for containerized deployment)
- Visual Studio 2026 or JetBrains Rider (recommended IDEs)
- Git
-
Clone the repository:
git clone https://github.com/Docentric/docentric-e-invoice-validator.git cd docentric-e-invoice-validator -
Restore dependencies:
dotnet restore src/Docentric.EInvoice.Validator.slnx cd src/WebUI npm install cd ../..
-
Build the solution:
dotnet build src/Docentric.EInvoice.Validator.slnx --configuration Release
-
Run the application:
dotnet run --project src/Server/RestServer.csproj
The application will be available at https://localhost:57456 or http://localhost:57457.
Note: When running locally (not via Docker), ensure you have Java Runtime Environment (JRE) 11 or later installed, as it's required for the Mustang Project validation engine.
To build the Docker image yourself:
# Windows
cd src
.\docker-build.ps1Then run it:
# Windows
.\docker-run.ps1The application will be available at http://localhost:18889.
For detailed API documentation and interactive testing, visit the Swagger UI at:
http://localhost:18889/api/docs/swagger/index.html
The API provides the following endpoints (all POST endpoints accept multipart/form-data with a single file, up to 100 MB, and time out after 300 seconds):
| Endpoint | Description |
|---|---|
POST /api/pdf/validate-zugferd |
Validates a ZuGFeRD / Factur-X PDF |
POST /api/pdf/extract-zugferd-xml |
Extracts the embedded XML from a ZuGFeRD / Factur-X PDF |
POST /api/xml/validate |
Validates a Factur-X or UBL XML file |
POST /api/xml/convert-to-pdf |
Converts a Factur-X or UBL XML file to PDF. Optional query parameter language (en, fr or de, default en) |
GET /api/health |
Reports Java and Mustang CLI availability and versions |
Error responses carry an ErrorCode; see ErrorCode.Examples.md. ReDoc is also available at /api/docs/redoc.
The solution consists of two main components:
ASP.NET Core REST API that:
- Accepts file uploads (PDF or XML)
- Invokes Mustang Project CLI for validation
- Parses validation results
- Returns structured JSON responses
React SPA that:
- Provides a user-friendly upload interface
- Displays validation results
- Calls the REST API
- Built into static assets served from
Server/wwwrootin production
The Docker image bundles:
- .NET 10 runtime
- OpenJDK 17 headless (for Mustang CLI)
Mustang-CLI-2.26.0.jar, published next to the application in/app- Published ASP.NET Core application
- Built React SPA
docentric-e-invoice-validator/
├── .github/
│ ├── copilot-instructions.md
│ ├── prompts/ # Reusable Copilot Chat prompts
│ └── workflows/
│ └── build.yml # GitHub Actions CI/CD pipeline
├── samples/ # Sample e-invoice files for testing
│ ├── ZuGFeRD e-Invoice.pdf
│ ├── factur-x e-invoice.pdf
│ └── *.xml
├── scripts/ # Development scripts
├── src/
│ ├── Directory.Build.props # Shared project properties
│ ├── Docentric.EInvoice.Validator.slnx
│ ├── Dockerfile # Multi-stage Docker build
│ ├── docker-compose.yml
│ ├── Server/ # ASP.NET Core REST API
│ │ ├── RestServer.csproj
│ │ ├── Program.cs
│ │ ├── Mustang-CLI-2.26.0.jar
│ │ ├── Configuration/
│ │ ├── Contracts/
│ │ ├── Endpoints/
│ │ ├── IO/
│ │ └── Services/
│ ├── Server.Tests/ # xUnit v3 tests
│ └── WebUI/ # React + Vite frontend
│ ├── package.json
│ ├── vite.config.ts
│ ├── src/
│ └── ...
├── LICENSE
└── README.md
Pre-built Docker images are automatically published to Docker Hub:
Repository: docentric/e-invoice-validator
Available Tags:
latest- Latest stable release from the main branch20XX.Y.Z- Specific version tagsmain- Latest build from main branchdevelop- Latest development build
Pull Image:
docker pull docentric/e-invoice-validator:latest
docker pull docentric/e-invoice-validator:latest-
Start the backend:
cd src/Server dotnet runThe backend listens on
https://localhost:57456andhttp://localhost:57457. -
Start the frontend (optional, hot reload):
cd src/WebUI npm run devThe frontend dev server runs on
http://localhost:53365with hot reload enabled.
dotnet test src/Docentric.EInvoice.Validator.slnxContributions are welcome! Please feel free to submit issues and pull requests.
This project is licensed under the MIT License - see the LICENSE file for details.
MIT License
Copyright (c) 2026 Docentric d.o.o.
This project builds upon the excellent work of several open-source projects:
- Mustang Project - The ZuGFeRD and Factur-X validation engine that powers this tool
- ASP.NET Core - Microsoft's cross-platform web framework
- React - Facebook's UI library
- Vite - Next-generation frontend build tool
- shadcn/ui - Beautifully designed UI components
- Tailwind CSS - Utility-first CSS framework
Special thanks to the Mustang Project team for creating and maintaining the comprehensive ZuGFeRD/Factur-X validation library.
Docentric contributes to the Dynamics 365 and Power Platform community through free apps, knowledge platforms, and by organizing events that bring professionals together on both local and international levels – proving ourselves as community-first and community-driven Microsoft ISV Partner.
Reach out to us at support@docentric.com if you have any questions or feedback.