Skip to main content
Glama
FacturX (Factur-X / ZUGFeRD e-invoicing)

FacturX (Factur-X / ZUGFeRD e-invoicing)

FacturX SDK

Official clients for the FacturX API: check an invoice with a dry run, convert it to a Factur-X PDF/A-3 file, validate it — from Python, Node.js, a command line, or an MCP-compatible assistant.

Directory

Package

Registry

What it is

python/

facturx-api

PyPI

Python client and the facturx command (dry-run, convert, validate)

node/

@facturxapi/sdk

npm

Node.js client (ESM, TypeScript types)

mcp/

facturx-mcp

PyPI

MCP server (registry name com.facturxapi/mcp); an npm launcher may follow

examples/

—

—

Runnable examples with their recorded output

Status: alpha. facturx-api and facturx-mcp 0.1.1 are on PyPI (pip install facturx-api, pip install facturx-mcp); @facturxapi/sdk 0.1.1 is on npm (npm install @facturxapi/sdk). See RELEASING.md.

Design choices worth knowing

  • Production by default (from 0.1.2): the host is https://api.facturxapi.com unless you pass base_url / baseUrl or set FACTURX_BASE_URL; it must be https. In 0.1.1 the host is required.

  • A final file is checked, not assumed. A dry run reads the API's generationReadiness; a conversion is only reported as done when the final file is present, not on the HTTP status alone.

  • One idempotency key per operation, and signed download URLs are fetched without your API key.

  • No automatic retry of 409 / 503 answers: the caller decides.

  • The examples in examples/ were recorded against the staging host and say so; they will move to the production host with the first release.

Related MCP server: eleata e-invoice MCP server

Tests (offline, no network, no API key)

cd python && PYTHONPATH=src python -m unittest discover -s tests -v && ruff check .
cd node && npm test
cd mcp && pip install ../python . pytest && pytest tests

Security

See SECURITY.md. Releases use trusted publishing (OIDC): no registry token is stored in this repository.

License

MIT.

Available Tools

4 tools
facturx_convertA
Idempotent

Final conversion: COSTS 1 invoice of the account quota (refunded by the API when no file is produced). Call it only after facturx_dry_run returned ready=true. Writes factur-x.pdf and factur-x.xml into out_dir and returns their paths, sizes, sha256, the verified target and the idempotency_key. If the call fails without an answer, call again with the SAME idempotency_key: the API will not charge twice.

Inputs: invoice (required), out_dir (required), output, idempotency_key, +1 more. Returns: object

facturx_dry_runA
Read-onlyIdempotent

Check a complete ERP invoice JSON WITHOUT producing a file and WITHOUT using quota. Use it first, every time. Returns ready (true only when generationReadiness.status is 'ready'; success=false can still be ready), the readiness detail, request_id and idempotency_key.

Inputs: invoice (required), output, validation_target. Returns: object

facturx_explain_errorA
Read-onlyIdempotent

Explain an EN16931 / France 2026 rule (e.g. BR-CO-15), a business term (e.g. BT-1) or an invoice JSON path (e.g. totals.gross): returns the matching invoice fields from the API's public integration contract (JSON path, BT, rule, CII XPath, requirement). Free, no API key needed. API error codes (409/503 …) are not in this public source yet.

Inputs: code_or_rule (required). Returns: object

facturx_validateA
Read-only

Validate an existing Factur-X PDF or CII XML file from the local disk against validation_target (default en16931, the same target as facturx_dry_run and facturx_convert; pass france_2026 to check the invoice is ready for a French PA, plateforme agréée). Returns valid, validationStatus, profile, target and the first errors as reported by the API. Counts 1 invoice of the account quota when the API returns a report.

Inputs: file_path (required), validation_target. Returns: object

Tool Schema Changelog

Recent tool additions, removals, and schema changes observed during successful MCP inspections.

Loading tool schema changelog…

    TDQS

    A4.4/5.0

    Scored across 4 tools

    Disambiguation5/5

    Each tool has a clearly distinct role: dry-run readiness check on ERP JSON, final file generation, validation of existing PDF/XML files, and error/rule explanation. The descriptions explicitly enforce sequencing (dry_run before convert) and distinguish input types, leaving little room for misselection.

    Naming Consistency5/5

    All tools consistently use the facturx_ prefix followed by snake_case verb or verb_noun names: dry_run, convert, validate, explain_error. The pattern is predictable throughout the small set.

    Tool Count5/5

    Four tools are well scoped for a focused e-invoicing conversion server: preflight, generate, validate, and explain. Each tool earns its place, and there is no redundant or trivial surface.

    Completeness4/5

    The core lifecycle is covered: readiness check, conversion, validation, and error explanation. Minor gaps exist, such as no tool for account/quota status, listing supported validation targets, or extracting invoice fields from an existing file, but these are workaroundable.

    Maintenance

    ActivityMaintained
    ResponsivenessNo recent community issues

    Related MCP Connectors

    Related MCP Servers

    • A
      license
      Not graded
      quality
      B
      maintenance
      InvoiceXML brings e-invoice compliance to your AI agent. Create, validate, convert, render, and extract structured invoices across UBL (Peppol BIS Billing 3.0, used worldwide), CII, Factur-X, ZUGFeRD, and XRechnung, all checked against the EN 16931 standard and official Schematron rules. Ask your assistant to generate a compliant invoice, validate one for errors, or convert between formats, with n
      5
      MIT
    • A
      license
      A
      quality
      D
      maintenance
      Validates EU electronic invoices (Peppol, XRechnung, FatturaPA, etc.) and explains validation error codes, enabling AI coding agents to check invoice validity and get fixes before rejection.
      3
      46 npm
      MIT
    • A
      license
      Not graded
      quality
      B
      maintenance
      Enables AI assistants to locally parse, validate, audit, explain, generate, and convert XRechnung and ZUGFeRD/Factur-X e-invoices using official rule sets, fully offline with no API keys required.
      Apache 2.0
    • A
      license
      A
      quality
      B
      maintenance
      Read and check European e-invoices (Factur-X, ZUGFeRD, XRechnung, UBL, CII) from an AI assistant: contents in plain text plus an EN 16931 consistency check.
      2
      MIT