Generate Factur-X Invoices with Kotlin
Learn how to easily integrate GoFX into your Kotlin stack.
Dealing with complex XML generation in Kotlin can be extremely tedious. GoFX abstracts all the EN16931 complexity away. Send a simple JSON payload and get a perfectly compliant hybrid PDF back in milliseconds.
Ecosystem Focus
Integrating Factur-X / EN16931 within the Kotlin ecosystem is now seamless. Avoid building complex XML DOMs manually and let GoFX handle the heavy lifting. Generate hybrid PDF/A-3 invoices directly via our REST API.
Prerequisites
Ensure you have Kotlin 1.5+ configured in your environment to make outbound HTTP POST requests to the GoFX API.
> Code Example
val client = OkHttpClient()
val body = jsonPayload.toRequestBody("application/json".toMediaType())
val request = Request.Builder()
.url("https://api.gofx.app/v1/invoice/generate")
.post(body)
.build()
client.newCall(request).execute().use { response ->
File("facture.pdf").writeBytes(response.body!!.bytes())
}