Skip to content

Kotlin SDK

Offizielles Kotlin SDK für thelawin.dev.

Erfordert Kotlin 2.0+ / JDK 17+

Installation

kotlin
// settings.gradle.kts - JitPack Repository hinzufügen
repositories {
    maven { url = uri("https://jitpack.io") }
}

// build.gradle.kts
dependencies {
    implementation("com.github.steviee.thelawin-clients:kotlin:main-SNAPSHOT")
}

Schnellstart

kotlin
val client = ThelawinClient("env_sandbox_xxx")

val result = client.invoice()
    .number("2026-001")
    .date("2026-01-15")
    .seller { name = "Acme GmbH"; vatId = "DE123456789"; city = "Berlin"; country = "DE" }
    .buyer { name = "Kunde AG"; city = "München"; country = "DE" }
    .addItem { description = "Beratung"; quantity = 8; unit = "HUR"; unitPrice = 150.0; vatRate = 19.0 }
    .template("minimal")
    .generate()

when (result) {
    is Success -> result.savePdf("./rechnung.pdf")
    is Failure -> result.errors.forEach { println(it.message) }
}

Vollständige Dokumentation: Kotlin SDK

ZUGFeRD 2.3 & Factur-X 1.0 compliant