Skip to content

Official SDKs

thelawin.dev provides official client libraries for 8 programming languages.

Every SDK shares the same shape, so switching languages later doesn't mean relearning the API:

  • Fluent builder: chain methods to assemble an invoice
  • Full type definitions and autocomplete
  • Covers all nine output formats (ZUGFeRD, Factur-X, XRechnung, Peppol, FatturaPA, UBL, CII, PDF, plus auto)
  • Retrieve: pull structured data back out of an existing PDF or XML
  • Logo helpers: pass a file path, the SDK handles Base64 for you
  • Result objects with explicit success / errors, no exceptions on validation failures
  • 388 tests across the 8 SDKs (breakdown in the table below)

Installation

LanguageInstallStatus
TypeScriptnpm install github:steviee/thelawin-clients#path:typescript✅ GitHub
Pythonpip install git+https://github.com/steviee/thelawin-clients.git#subdirectory=python✅ GitHub
Rubygem install thelawin✅ RubyGems
KotlinJitPack or local build✅ GitHub
JavaJitPack or local build✅ GitHub
Swifthttps://github.com/steviee/thelawin-clients.git (SPM)✅ GitHub
DartGit dependency (see Dart docs)✅ GitHub
C#Local build or Git submodule✅ GitHub

Package Registries

Ruby is on RubyGems. All other SDKs install from GitHub. Publication on npm, PyPI, Maven Central, NuGet, and pub.dev follows with the stable release (#102).

Unified Interface

All SDKs follow the same pattern:

client = ThelawinClient(api_key)

result = client.invoice()
  .number("2026-001")
  .date("2026-01-15")
  .seller(name: "Acme GmbH", vat_id: "DE123456789", ...)
  .buyer(name: "Customer AG", ...)
  .addItem(description: "Consulting", quantity: 8, unit: "HUR", unit_price: 150)
  .logoFile("./logo.png")  // Auto Base64 encoding
  .template("minimal")
  .generate()

if result.success:
    result.savePdf("./invoice.pdf")
else:
    for error in result.errors:
        print(f"{error.path}: {error.message}")

Feature Comparison

FeatureTSPythonRubyKotlinJavaSwiftDartC#
/v1/generate
/v1/validate
/v1/retrieve
/v1/account
Async/Await--
Type Safety
Logo from File
Browser Support-------
Tests5752573947493948

Source Code

All SDKs are open source and available on GitHub:

github.com/steviee/thelawin-clients

bash
git clone https://github.com/steviee/thelawin-clients.git

Next Steps

Choose your language:

  • TypeScript - For Node.js and browser applications
  • Python - For Python projects
  • Ruby - For Ruby on Rails and Ruby projects
  • Kotlin - For Kotlin/JVM projects
  • Java - For Java projects
  • Swift - For iOS, macOS, and server-side Swift
  • Dart - For Flutter and Dart projects
  • C# - For .NET projects

ZUGFeRD 2.4 & Factur-X 1.0.8 compliant