Verfügbar

Parser API

Extrahiere strukturierte Daten aus E-Rechnungen. Konvertiere komplexe XML-Strukturen in einfach zu verarbeitendes JSON - unterstützt 14 europäische Länder.

Production Ready

Endpoints

POST/api/v1/invoice/parseAuto-Detect

Erkennt automatisch das E-Rechnungsformat und das Land, dann wird das Dokument geparst. Das Land wird primär aus dem Dokumentinhalt (Verkäuferadresse) extrahiert.

Request

Content-Type: multipart/form-data
Body: file (E-Rechnungsdatei als XML oder PDF)

Hinweis: Dieser Endpoint gibt zusätzlich ein detection-Objekt mit Informationen zur Format-Erkennung zurück (Format, Version, Confidence-Score).

POST/api/v1/invoice/{countryCode}/{format}/parse

Parst eine E-Rechnung mit expliziter Angabe von Land und Format. Nutze diesen Endpoint, wenn du das Format bereits kennst und die Auto-Erkennung überspringen möchtest.

Path-Parameter

countryCode
required

ISO 3166-1 Alpha-2 Ländercode (z.B. DE, AT, FR)

format
required

Format-Identifier (z.B. XRECHNUNG, ZUGFERD, FACTURX)

XRechnung (Deutschland)

/api/v1/invoice/DE/XRECHNUNG/parse

ZUGFeRD (Deutschland)

/api/v1/invoice/DE/ZUGFERD/parse

Factur-X (Frankreich)

/api/v1/invoice/FR/FACTURX/parse

FatturaPA (Italien)

/api/v1/invoice/IT/FATTURAPA/parse

Authentifizierung

Alle API-Requests erfordern einen Bearer Token im Authorization Header.

Authorization: Bearer sk_test_xxx
sk_test_*

Test-Keys für Entwicklung und Testing

sk_live_*

Live-Keys für Produktionsumgebung

Code-Beispiele

Automatische Erkennung von Format und Land aus dem Dokument.

bash
1curl -X POST 'https://api.invoice.xhub.io/api/v1/invoice/parse' \
2 -H 'Authorization: Bearer sk_test_xxx' \
3 -H 'Content-Type: multipart/form-data' \
4 -F 'file=@rechnung.xml'

Response Schema

Die API gibt ein normalisiertes JSON-Schema zurück, unabhängig vom Quellformat.

Auto-DetectResponse mit Detection-Objekt

Der Auto-Detect Endpoint (/api/v1/invoice/parse) gibt zusätzlich ein detection-Objekt zurück mit Informationen zur automatischen Format-Erkennung.

json
1{
2 "success": true,
3 "invoice": {
4 "invoiceNumber": "RE-2025-001",
5 "type": "invoice",
6 "issueDate": "2025-01-15",
7 "dueDate": "2025-02-15",
8 "deliveryDate": "2025-01-10",
9 "seller": {
10 "name": "Meine Firma GmbH",
11 "street": "Musterstraße 1",
12 "city": "Berlin",
13 "postalCode": "10115",
14 "country": "DE",
15 "taxId": "DE123456789",
16 "vatId": "DE123456789",
17 "email": "rechnung@meinefirma.de",
18 "phone": "+49 30 12345678"
19 },
20 "buyer": {
21 "name": "Kunde AG",
22 "street": "Kundenweg 42",
23 "city": "München",
24 "postalCode": "80331",
25 "country": "DE",
26 "taxId": "DE987654321",
27 "vatId": "DE987654321",
28 "email": "einkauf@kunde.de",
29 "phone": "+49 89 87654321"
30 },
31 "items": [
32 {
33 "position": 1,
34 "description": "Softwarelizenz Enterprise",
35 "articleNumber": "SW-ENT-001",
36 "quantity": 1,
37 "unit": "C62",
38 "unitPrice": 1500.00,
39 "taxRate": 19,
40 "taxCategoryCode": "S",
41 "netAmount": 1500.00,
42 "taxAmount": 285.00,
43 "grossAmount": 1785.00
44 }
45 ],
46 "currency": "EUR",
47 "subtotal": 1500.00,
48 "total": 1785.00,
49 "taxSummary": [
50 {
51 "taxRate": 19,
52 "taxCategoryCode": "S",
53 "taxableAmount": 1500.00,
54 "taxAmount": 285.00
55 }
56 ],
57 "paymentTerms": {
58 "dueDate": "2025-02-15",
59 "paymentTermsText": "Zahlbar innerhalb von 30 Tagen"
60 },
61 "notes": "Vielen Dank für Ihren Auftrag!"
62 },
63 "detection": {
64 "format": "XRECHNUNG",
65 "formatVersion": "3.0.2",
66 "countryCode": "DE",
67 "confidence": 98,
68 "formatMethod": "namespace_analysis",
69 "countrySource": "seller_address",
70 "isAmbiguous": false,
71 "alternativeCountries": []
72 },
73 "hash": "sha256:a1b2c3d4e5f6...",
74 "errors": [],
75 "warnings": []
76}

Detection-Objekt Felder

format

Erkanntes Format (XRECHNUNG, ZUGFERD, FACTURX, ...)

formatVersion

Erkannte Formatversion (z.B. "3.0.2")

countryCode

Erkannter Ländercode (ISO 3166-1 Alpha-2)

confidence

Konfidenz der Erkennung (0-100)

formatMethod

Methode der Format-Erkennung (z.B. "namespace_analysis")

countrySource

Quelle der Ländererkennung (z.B. "seller_address")

isAmbiguous

Ob die Erkennung mehrdeutig war

alternativeCountries

Alternative Länder bei mehrdeutiger Erkennung

Response für Format-spezifischen Endpoint

Der Format-spezifische Endpoint (/api/v1/invoice/{countryCode}/{format}/parse) gibt dieselbe Response zurück, jedoch ohne das detection-Objekt.

json
1{
2 "success": true,
3 "invoice": {
4 "invoiceNumber": "RE-2025-001",
5 "type": "invoice",
6 "issueDate": "2025-01-15",
7 "dueDate": "2025-02-15",
8 "deliveryDate": "2025-01-10",
9 "seller": {
10 "name": "Meine Firma GmbH",
11 "street": "Musterstraße 1",
12 "city": "Berlin",
13 "postalCode": "10115",
14 "country": "DE",
15 "taxId": "DE123456789",
16 "vatId": "DE123456789",
17 "email": "rechnung@meinefirma.de",
18 "phone": "+49 30 12345678"
19 },
20 "buyer": {
21 "name": "Kunde AG",
22 "street": "Kundenweg 42",
23 "city": "München",
24 "postalCode": "80331",
25 "country": "DE",
26 "taxId": "DE987654321",
27 "vatId": "DE987654321",
28 "email": "einkauf@kunde.de",
29 "phone": "+49 89 87654321"
30 },
31 "items": [
32 {
33 "position": 1,
34 "description": "Softwarelizenz Enterprise",
35 "articleNumber": "SW-ENT-001",
36 "quantity": 1,
37 "unit": "C62",
38 "unitPrice": 1500.00,
39 "taxRate": 19,
40 "taxCategoryCode": "S",
41 "netAmount": 1500.00,
42 "taxAmount": 285.00,
43 "grossAmount": 1785.00
44 }
45 ],
46 "currency": "EUR",
47 "subtotal": 1500.00,
48 "total": 1785.00,
49 "taxSummary": [
50 {
51 "taxRate": 19,
52 "taxCategoryCode": "S",
53 "taxableAmount": 1500.00,
54 "taxAmount": 285.00
55 }
56 ],
57 "paymentTerms": {
58 "dueDate": "2025-02-15",
59 "paymentTermsText": "Zahlbar innerhalb von 30 Tagen"
60 },
61 "notes": "Vielen Dank für Ihren Auftrag!"
62 },
63 "format": "XRECHNUNG_3.0.2",
64 "hash": "sha256:a1b2c3d4e5f6...",
65 "errors": [],
66 "warnings": []
67}

Error Responses

400 Bad Request
json
1{
2 "error": "BAD_REQUEST",
3 "message": "Invalid file format or malformed request"
4}
401 Unauthorized
json
1{
2 "error": "UNAUTHORIZED",
3 "message": "Invalid or missing API key"
4}
403 Forbidden
json
1{
2 "error": "FORBIDDEN",
3 "message": "Your API key does not have permission for this operation"
4}
429 Quota Exceeded
json
1{
2 "error": "QUOTA_EXCEEDED",
3 "message": "Monthly quota exceeded",
4 "quota": {
5 "limit": 100,
6 "used": 100,
7 "resetsAt": "2025-02-01T00:00:00Z"
8 }
9}
500 Internal Server Error
json
1{
2 "error": "INTERNAL_ERROR",
3 "message": "An unexpected error occurred"
4}

Unterstützte Länder & Formate

Für den Format-spezifischen Endpoint nutze diese Kombinationen aus countryCode und format.

DEDeutschland
XRECHNUNG 3.0ZUGFERD 2.3
ATÖsterreich
EBINTERFACE
CHSchweiz
QR-BILL
FRFrankreich
FACTUR-X
ITItalien
FATTURAPA
ESSpanien
FACTURAE
NLNiederlande
UBL
BEBelgien
UBL
PTPortugalQ2.2026
CIUS-PTUBL
PLPolenQ2.2026
KSEFUBL
CZTschechienQ2.2026
ISDOCUBL
HUUngarnQ2.2026
NAVUBL
RORumänienQ2.2026
EFACTURAUBL
BGBulgarienQ2.2026
UBLCII

= Verfügbar | Q2.2026 = Geplant

Features

XML zu JSON

Extrahiere strukturierte JSON-Daten aus XRechnung, ZUGFeRD und UBL XML

Alle Formate

Unterstützung für XRechnung 2.x/3.x, ZUGFeRD 2.x, Factur-X, UBL

PDF Extraktion

Extrahiere eingebettetes XML aus ZUGFeRD/Factur-X PDFs automatisch

14 Länder

Unterstützung für DE, [Q2.2026 AT, CH, FR, IT, ES, NL, BE, PT, PL, CZ, HU, RO, BG]

Normalisiertes Schema

Einheitliches JSON-Schema unabhängig vom Quellformat

Batch Processing

Verarbeite mehrere Rechnungen in einem Request

Weitere APIs

Kombiniere die Parser API mit der Validator API zur Validierung oder der Creator API zur Erstellung von E-Rechnungen.