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
| Language | Install | Status |
|---|---|---|
| TypeScript | npm install github:steviee/thelawin-clients#path:typescript | ✅ GitHub |
| Python | pip install git+https://github.com/steviee/thelawin-clients.git#subdirectory=python | ✅ GitHub |
| Ruby | gem install thelawin | ✅ RubyGems |
| Kotlin | JitPack or local build | ✅ GitHub |
| Java | JitPack or local build | ✅ GitHub |
| Swift | https://github.com/steviee/thelawin-clients.git (SPM) | ✅ GitHub |
| Dart | Git 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
| Feature | TS | Python | Ruby | Kotlin | Java | Swift | Dart | C# |
|---|---|---|---|---|---|---|---|---|
| /v1/generate | ✅ | ✅ | ✅ | ✅ | ✅ | ✅ | ✅ | ✅ |
| /v1/validate | ✅ | ✅ | ✅ | ✅ | ✅ | ✅ | ✅ | ✅ |
| /v1/retrieve | ✅ | ✅ | ✅ | ✅ | ✅ | ✅ | ✅ | ✅ |
| /v1/account | ✅ | ✅ | ✅ | ✅ | ✅ | ✅ | ✅ | ✅ |
| Async/Await | ✅ | ✅ | - | ✅ | - | ✅ | ✅ | ✅ |
| Type Safety | ✅ | ✅ | ✅ | ✅ | ✅ | ✅ | ✅ | ✅ |
| Logo from File | ✅ | ✅ | ✅ | ✅ | ✅ | ✅ | ✅ | ✅ |
| Browser Support | ✅ | - | - | - | - | - | - | - |
| Tests | 57 | 52 | 57 | 39 | 47 | 49 | 39 | 48 |
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.gitNext Steps
Choose your language: