Deliverables
The interface is the product: the types, the schemas, the HTTP API, the command line and the evidence behind them. Each one is generated from the same TypeScript sources, so they cannot drift apart.
Versions: package 1.2.0, JSON Schema v1, HTTP API /v1. See Deliverables and versioning for the compatibility promise.
TypeScript types and library
package 1.2.0convert(),inspect(),detectXml()and theCanonicalInvoicemodel, with the BT/BG ids in the comments. ES modules, no native code; runs in Bun, Node 20+ and browsers.HTTP API (OpenAPI 3.1)
API v1 · spec 1.0.0POST /v1/convert,/v1/inspect,/v1/detect,GET /v1/formats,/v1/schemas/{name}. Errors are RFC 9457 problems in the CLI's exit-code categories. Run it witheinvoice serveor the Dockerfile.Command line
Standalone binaries for linux-x64, darwin-arm64 and windows-x64:
latest releasedetect,inspect,convert,match,duplicates,sweepandserve.Asks api.github.com for the file list. Nothing is requested until you press the button.
Browser converter
Drop a file, get the JSON and the rebuilt invoice. Everything runs in the tab; nothing is uploaded.
Conformance checklist
Per format: fixtures, parser, real samples, mapping source and validation, generated from the code on every build.
Corpus results
Detection and conversion over public sample collections, run weekly and never on a pull request.
JSON Schemas
Draft 2020-12, generated from the types, published at stable URLs. Objects are open, so a payload from a newer minor release still validates against an older schema.
| Schema | Describes | Version | File |
|---|---|---|---|
inspect-result | What inspect() and POST /v1/inspect return. | v1 | inspect-result.v1.schema.json |
canonical-invoice | One invoice in the canonical model (CanonicalInvoice). | v1 | canonical-invoice.v1.schema.json |
convert-result | What convert() and POST /v1/convert return. | v1 | convert-result.v1.schema.json |
formats | The format registry (GET /v1/formats). | v1 | formats.json |
Run the API
einvoice serve --port 8080 --cors
docker build -t einvoice-api . && docker run --rm -p 8080:8080 einvoice-api
curl -X POST --data-binary @invoice.xml -H 'Content-Type: application/xml' \
'http://localhost:8080/v1/convert?relations=true'