Metadata-Version: 2.5
Name: stanzaapi-factur-x-validator
Version: 1.0.0
Summary: Official zero-dependency, high-speed Python client for Factur-X & ZUGFeRD 2.3 EN 16931 E-Invoice Engine
Project-URL: Homepage, https://stanzaapi.com/tools/factur-x-validator
Project-URL: Repository, https://github.com/StanzaAPI/factur-x-validator-python
Author: Stanza
License-Expression: MIT
Keywords: ap-automation,cii,e-invoice-validation,e-invoicing,en16931,factur-x,pdf-a-3,xrechnung,zugferd
Requires-Python: >=3.8
Description-Content-Type: text/markdown

# Factur-X & ZUGFeRD 2.3 EN 16931 E-Invoice Engine — Python SDK

[![PyPI version](https://img.shields.io/pypi/v/stanzaapi-factur-x-validator.svg)](https://pypi.org/project/stanzaapi-factur-x-validator/)
[![Python Versions](https://img.shields.io/pypi/pyversions/stanzaapi-factur-x-validator.svg)](https://pypi.org/project/stanzaapi-factur-x-validator/)
[![License: MIT](https://img.shields.io/badge/License-MIT-yellow.svg)](https://opensource.org/licenses/MIT)
[![Stanza API](https://img.shields.io/badge/Powered%20by-Stanza-blue)](https://stanzaapi.com)

> Sub-5ms Factur-X, ZUGFeRD 2.x and XRechnung e-invoice validation and parsing from PDF/A-3 hybrid files or UN/CEFACT CII XML.

Official, zero-dependency Python 3.8+ client library for **Factur-X & ZUGFeRD 2.3 EN 16931 E-Invoice Engine**, built on the [Stanza Micro-API Network](https://stanzaapi.com). Intended for enterprise data pipelines, backend verification, and sub-5ms edge compute.

* 🌐 **Live Web Playground:** [Test your inputs online](https://stanzaapi.com/tools/factur-x-validator)
* 📚 **API Documentation:** [View full schema on Stanza](https://stanzaapi.com/tools/factur-x-validator)
* ⚡ **Platform Overview:** [Explore the Stanza Developer Network](https://stanzaapi.com)

---

## 📦 Installation

```bash
pip install stanzaapi-factur-x-validator
```

---

## 🚀 Quickstart

```python
import os
from stanzaapi_factur_x_validator import FacturXValidatorClient

# Initialize client (api_key optional for local evaluation)
client = FacturXValidatorClient(
    api_key=os.getenv("STANZA_API_KEY")
)

# Execute deterministic validation
response = client.validate("<CrossIndustryInvoice xmlns=\"urn:un:unece:uncefact:data:standard:CrossIndustryInvoice:100\">...</CrossIndustryInvoice>")

if response.get("success"):
    print("Verification Success:", response["data"])
else:
    print("Validation Error:", response.get("error"), response.get("code"))
```

---

## 📄 Example Response

```json
{
  "success": true,
  "data": {
    "valid": true,
    "profile": "EN16931",
    "invoice_number": "FX-2026-0001"
  }
}
```

---

## ⚙️ Client Options

| Parameter | Type | Default | Description |
| :--- | :--- | :--- | :--- |
| `api_key` | `Optional[str]` | `os.getenv("STANZA_API_KEY")` | Your [Stanza API Key](https://stanzaapi.com). Required for production quotas. |
| `base_url` | `Optional[str]` | `"https://api.stanzaapi.com/factur-x-validator"` | Public edge API base URL. |
| `timeout` | `int` | `15` | Request timeout in seconds. |


---

## 🔗 Useful Links

* [Factur-X & ZUGFeRD 2.3 EN 16931 E-Invoice Engine Interactive Sandbox](https://stanzaapi.com/tools/factur-x-validator)
* [Stanza Developer Directory](https://stanzaapi.com)
* [Source Code & Issue Tracker](https://github.com/StanzaAPI/factur-x-validator-python)

## 📄 License

MIT © Stanza — Powered by [Stanza](https://stanzaapi.com).
