Documentazione API
POST /v1/convert
Crea una fattura ZUGFeRD/Factur-X convalidata (PDF/A-3, EN 16931) da dati di
fatturazione (JSON o XML CII) e un PDF visivo opzionale.
multipart/form-data con questi campi:
| Campo | Tipo | Descrizione |
|---|---|---|
invoice | JSON | Dati nel schema eunormia (campo o file). Obbligatorio salvo passthrough XML. |
xml | file/testo | XML CII pronto (passthrough): incorporato 1:1, verificato dal gate. Allora serve un pdf. |
pdf | file | Il tuo PDF visivo (max 10 MB). Senza PDF, eunormia genera un modello predefinito dai dati. |
options | JSON | Vedi sotto. |
Opzioni
| Opzione | Descrizione |
|---|---|
profile | EN16931 (default), EXTENDED, XRECHNUNG, BASIC, BASICWL, MINIMUM. |
includeUbl | Restituisce anche l'XML UBL 2.1 XRechnung (ubl), sperimentale. |
kosit | Convalida anche con il validatore ufficiale KoSIT (XRechnung/DE). Risultato in report.kosit — informativo, non blocca la consegna. |
frCtc | Verifica anche le regole CTC francesi (FNFE-MPE). Risultato in report.frCtc. |
sandbox | Crea volutamente un campione con filigrana (non consuma contingente). |
Risposta
200: {"pdf": "<base64>", "filename": "…", "report": {…}, "ubl": "…"?}.
Il report contiene verapdf e xml
(sempre PASS — altrimenti nulla viene consegnato),
watermark, sha256 e, se richiesto,
kosit/frCtc. Gli errori di merito restituiscono
422 con error, stage e
details comprensibili — gli scostamenti dei totali non vengono mai
corretti in silenzio.
Quickstarts
cURL — JSON → ZUGFeRD
curl -X POST https://eunormia.com/v1/convert \
-H "Authorization: Bearer eun_live_YOUR_TOKEN" \
-F 'invoice={"number":"RE-2026-0042","issueDate":"2026-07-08","dueDate":"2026-08-07","currency":"EUR","seller":{"name":"Muster GmbH","street":"Musterstraße 1","zip":"4020","city":"Linz","country":"AT","vatId":"ATU12345678"},"buyer":{"name":"Beispiel GmbH","street":"Beispielweg 2","zip":"80331","city":"München","country":"DE","vatId":"DE123456789"},"items":[{"name":"Leistung","quantity":1,"unit":"C62","unitPrice":100.0,"vatPercent":20}]}'
cURL — JSON + PDF → ZUGFeRD
curl -X POST https://eunormia.com/v1/convert \
-H "Authorization: Bearer eun_live_YOUR_TOKEN" \
-F 'invoice=@rechnung.json;type=application/json' \
-F 'pdf=@rechnung.pdf;type=application/pdf'
cURL — XML-Passthrough
curl -X POST https://eunormia.com/v1/convert \
-H "Authorization: Bearer eun_live_YOUR_TOKEN" \
-F 'xml=@factur-x.xml;type=application/xml' \
-F 'pdf=@rechnung.pdf;type=application/pdf'
cURL — XRechnung + KoSIT
curl -X POST https://eunormia.com/v1/convert \
-H "Authorization: Bearer eun_live_YOUR_TOKEN" \
-F 'invoice=@rechnung.json;type=application/json' \
-F 'options={"profile":"XRECHNUNG","kosit":true}'
Python (requests)
import requests, json, base64
invoice = {
"number": "RE-2026-0042", "issueDate": "2026-07-08", "dueDate": "2026-08-07",
"currency": "EUR",
"seller": {"name": "Muster GmbH", "street": "Musterstraße 1", "zip": "4020",
"city": "Linz", "country": "AT", "vatId": "ATU12345678"},
"buyer": {"name": "Beispiel GmbH", "street": "Beispielweg 2", "zip": "80331",
"city": "München", "country": "DE", "vatId": "DE123456789"},
"items": [{"name": "Leistung", "quantity": 1, "unit": "C62",
"unitPrice": 100.0, "vatPercent": 20}]
}
r = requests.post("https://eunormia.com/v1/convert",
headers={"Authorization": "Bearer eun_live_YOUR_TOKEN"},
files={"invoice": (None, json.dumps(invoice))})
r.raise_for_status()
data = r.json()
open(data["filename"], "wb").write(base64.b64decode(data["pdf"]))
print("Gate:", data["report"]["verapdf"]["result"], data["report"]["xml"]["result"])
PHP (cURL)
<?php
$invoice = json_encode([
"number" => "RE-2026-0042", "issueDate" => "2026-07-08", "dueDate" => "2026-08-07",
"currency" => "EUR",
"seller" => ["name"=>"Muster GmbH","street"=>"Musterstraße 1","zip"=>"4020",
"city"=>"Linz","country"=>"AT","vatId"=>"ATU12345678"],
"buyer" => ["name"=>"Beispiel GmbH","street"=>"Beispielweg 2","zip"=>"80331",
"city"=>"München","country"=>"DE","vatId"=>"DE123456789"],
"items" => [["name"=>"Leistung","quantity"=>1,"unit"=>"C62",
"unitPrice"=>100.0,"vatPercent"=>20]]
]);
$ch = curl_init("https://eunormia.com/v1/convert");
curl_setopt_array($ch, [
CURLOPT_RETURNTRANSFER => true,
CURLOPT_HTTPHEADER => ["Authorization: Bearer eun_live_YOUR_TOKEN"],
CURLOPT_POSTFIELDS => ["invoice" => $invoice],
]);
$resp = json_decode(curl_exec($ch), true);
file_put_contents($resp["filename"], base64_decode($resp["pdf"]));
C# (HttpClient)
using System.Net.Http;
using System.Text.Json;
var invoice = File.ReadAllText("rechnung.json");
using var client = new HttpClient();
client.DefaultRequestHeaders.Add("Authorization", "Bearer eun_live_YOUR_TOKEN");
var form = new MultipartFormDataContent { { new StringContent(invoice), "invoice" } };
var resp = await client.PostAsync("https://eunormia.com/v1/convert", form);
var doc = JsonDocument.Parse(await resp.Content.ReadAsStringAsync());
var pdf = Convert.FromBase64String(doc.RootElement.GetProperty("pdf").GetString());
File.WriteAllBytes(doc.RootElement.GetProperty("filename").GetString(), pdf);
Node.js (fetch)
import { readFileSync, writeFileSync } from "node:fs";
const form = new FormData();
form.append("invoice", readFileSync("rechnung.json", "utf8"));
const r = await fetch("https://eunormia.com/v1/convert", {
method: "POST",
headers: { Authorization: "Bearer eun_live_YOUR_TOKEN" },
body: form
});
const data = await r.json();
writeFileSync(data.filename, Buffer.from(data.pdf, "base64"));