Skip to content
GitHub

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

    convert(), inspect(), detectXml() and the CanonicalInvoice model, with the BT/BG ids in the comments. ES modules, no native code; runs in Bun, Node 20+ and browsers.

    package 1.2.0
  • HTTP API (OpenAPI 3.1)

    POST /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 with einvoice serve or the Dockerfile.

    API v1 · spec 1.0.0
  • Command line

    Standalone binaries for linux-x64, darwin-arm64 and windows-x64: detect, inspect, convert, match, duplicates, sweep and serve.

    latest release

    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.

SchemaDescribesVersionFile
inspect-resultWhat inspect() and POST /v1/inspect return.v1inspect-result.v1.schema.json
canonical-invoiceOne invoice in the canonical model (CanonicalInvoice).v1canonical-invoice.v1.schema.json
convert-resultWhat convert() and POST /v1/convert return.v1convert-result.v1.schema.json
formatsThe format registry (GET /v1/formats).v1formats.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'