Generate Factur-X Invoices with Spring Boot

Learn how to easily integrate GoFX into your Spring Boot stack.

Dealing with complex XML generation in Spring Boot 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 Spring Boot 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 Spring Boot 2.5+ / WebClient configured in your environment to make outbound HTTP POST requests to the GoFX API.

> Code Example
HttpClient client = HttpClient.newHttpClient();
HttpRequest request = HttpRequest.newBuilder()
  .uri(URI.create("https://api.gofx.app/v1/invoice/generate"))
  .header("Content-Type", "application/json")
  .POST(HttpRequest.BodyPublishers.ofString(jsonPayload))
  .build();
HttpResponse<byte[]> response = client.send(request, HttpResponse.BodyHandlers.ofByteArray());
Files.write(Paths.get("facture.pdf"), response.body());