Documentazione API

Ricezione delle fatture

Entrambi gli endpoint accettano un PDF ZUGFeRD/Factur-X in arrivo — come campo multipart pdf (file) o campo pdfBase64. Nulla viene creato, nulla viene salvato.

POST /v1/read — leggere (deserializzare)

Estrae l'XML CII incorporato e restituisce la fattura come oggetto JSON completo nello schema eunormialo stesso schema che /v1/convert accetta in ingresso (round-trip).

Risposta: {"standard": "facturx", "invoice": {…}, "xml": "…"}. L'XML grezzo è incluso per i campi fuori schema. PDF non leggibile → 422.

POST /v1/validate — convalidare

Convalida il PDF con il doppio gate: veraPDF (PDF/A-3) e lo Schematron EN 16931. Opzionalmente in aggiunta:

CampoDescrizione
kosit=trueValidatore ufficiale KoSIT (XRechnung/DE) come terzo gate.
frCtc=trueRegole CTC francesi (FNFE-MPE) come quarto gate.

Risposta: {"valid": true|false, "verapdf": {…}, "xml": {…}, "kosit": {…}?, "frCtc": {…}?, "sha256": "…"}. Ogni gate riporta result (PASS/FAIL/UNAVAILABLE) e, in caso di FAIL, le failures concrete. Un modulo non installato segnala onestamente UNAVAILABLE — mai un PASS silenzioso.

Prova nel browser: pagina di convalida.

Quickstarts

cURL — /v1/read

curl -X POST https://eunormia.com/v1/read -F 'pdf=@eingang.pdf'

cURL — /v1/validate (+ KoSIT + FR-CTC)

curl -X POST https://eunormia.com/v1/validate \
  -F 'pdf=@eingang.pdf' -F 'kosit=true' -F 'frCtc=true'

C# (HttpClient)

using var client = new HttpClient();
var form = new MultipartFormDataContent {
  { new ByteArrayContent(File.ReadAllBytes("eingang.pdf")), "pdf", "eingang.pdf" }
};
var resp = await client.PostAsync("https://eunormia.com/v1/read", form);
var doc = System.Text.Json.JsonDocument.Parse(await resp.Content.ReadAsStringAsync());
var number = doc.RootElement.GetProperty("invoice").GetProperty("number").GetString();