Parser API
Extrahiere strukturierte Daten aus E-Rechnungen. Konvertiere komplexe XML-Strukturen in einfach zu verarbeitendes JSON - unterstützt 37 Länder.
Endpoints
/api/v1/invoice/parseAuto-DetectErkennt 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: application/jsonBody: data (E-Rechnungsdatei Base64-kodiert, XML oder PDF — Pflicht) und optional filenameDieser Endpoint gibt zusätzlich ein detection -Objekt mit Informationen zur Format-Erkennung zurück (Format, Version, Confidence-Score).
/api/v1/invoice/{countryCode}/{format}/parseParst 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
countryCodeISO 3166-1 Alpha-2 Ländercode (z.B. DE, AT, FR)
formatFormat-Identifier (z.B. XRECHNUNG, ZUGFERD, FACTURX)
Alle Parse-Routen
65 Kombinationen aus Land und Format in 37 Ländern, erzeugt aus der OpenAPI-Spec. Die Auto-Detect-Route braucht keine davon.
Auto-Detect
/api/v1/invoice/parseDeutschland (DE)
/api/v1/invoice/de/xrechnung/parseXRechnung/api/v1/invoice/de/zugferd/parseZUGFeRD
Österreich (AT)
/api/v1/invoice/at/cii/parseCII/api/v1/invoice/at/ebinterface/parseebInterface/api/v1/invoice/at/ubl/parseUBL/api/v1/invoice/at/zugferd/parseZUGFeRD
Schweiz (CH)
/api/v1/invoice/ch/cii/parseCII/api/v1/invoice/ch/ubl/parseUBL/api/v1/invoice/ch/zugferd/parseZUGFeRD
Frankreich (FR)
/api/v1/invoice/fr/cii/parseCII/api/v1/invoice/fr/facturx/parseFactur-X/api/v1/invoice/fr/ubl/parseUBL
Italien (IT)
/api/v1/invoice/it/cii/parseCII/api/v1/invoice/it/fatturapa/parseFatturaPA/api/v1/invoice/it/ubl/parseUBL
Spanien (ES)
/api/v1/invoice/es/cii/parseCII/api/v1/invoice/es/facturae/parseFacturae/api/v1/invoice/es/ubl/parseUBL
Niederlande (NL)
/api/v1/invoice/nl/cii/parseCII/api/v1/invoice/nl/ubl/parseUBL
Belgien (BE)
/api/v1/invoice/be/cii/parseCII/api/v1/invoice/be/facturx/parseFactur-X/api/v1/invoice/be/ubl/parseUBL
Polen (PL)
/api/v1/invoice/pl/ksef/parseKSeF/api/v1/invoice/pl/peppol-ubl/parsePeppol UBL/api/v1/invoice/pl/ubl/parseUBL
Portugal (PT)
/api/v1/invoice/pt/peppol-ubl/parsePeppol UBL/api/v1/invoice/pt/saft/parseSAF-T/api/v1/invoice/pt/ubl/parseUBL
Vereinigte Arabische Emirate (AE)
/api/v1/invoice/ae/ubl/parseUBL
Australien (AU)
/api/v1/invoice/au/ubl/parseUBL
Bulgarien (BG)
/api/v1/invoice/bg/cii/parseCII/api/v1/invoice/bg/ubl/parseUBL
Zypern (CY)
/api/v1/invoice/cy/ubl/parseUBL
Tschechien (CZ)
/api/v1/invoice/cz/isdoc/parseISDOC/api/v1/invoice/cz/ubl/parseUBL
Dänemark (DK)
/api/v1/invoice/dk/ubl/parseUBL
Estland (EE)
/api/v1/invoice/ee/ubl/parseUBL
Finnland (FI)
/api/v1/invoice/fi/ubl/parseUBL
Großbritannien (GB)
/api/v1/invoice/gb/ubl/parseUBL
Griechenland (GR)
/api/v1/invoice/gr/mydata/parsemyDATA/api/v1/invoice/gr/ubl/parseUBL
Kroatien (HR)
/api/v1/invoice/hr/peppol-ubl/parsePeppol UBL/api/v1/invoice/hr/ubl/parseUBL
Ungarn (HU)
/api/v1/invoice/hu/nav/parseNAV/api/v1/invoice/hu/ubl/parseUBL
Irland (IE)
/api/v1/invoice/ie/ubl/parseUBL
Island (IS)
/api/v1/invoice/is/ubl/parseUBL
Japan (JP)
/api/v1/invoice/jp/ubl/parseUBL
Liechtenstein (LI)
/api/v1/invoice/li/ubl/parseUBL
Litauen (LT)
/api/v1/invoice/lt/ubl/parseUBL
Luxemburg (LU)
/api/v1/invoice/lu/ubl/parseUBL
Lettland (LV)
/api/v1/invoice/lv/ubl/parseUBL
Malta (MT)
/api/v1/invoice/mt/ubl/parseUBL
Norwegen (NO)
/api/v1/invoice/no/ubl/parseUBL
Neuseeland (NZ)
/api/v1/invoice/nz/ubl/parseUBL
Oman (OM)
/api/v1/invoice/om/ubl/parseUBL
Rumänien (RO)
/api/v1/invoice/ro/cii/parseCII/api/v1/invoice/ro/efactura/parsee-Factura/api/v1/invoice/ro/peppol-ubl/parsePeppol UBL/api/v1/invoice/ro/ubl/parseUBL
Schweden (SE)
/api/v1/invoice/se/ubl/parseUBL
Slowenien (SI)
/api/v1/invoice/si/ubl/parseUBL
Slowakei (SK)
/api/v1/invoice/sk/peppol-ubl/parsePeppol UBL/api/v1/invoice/sk/ubl/parseUBL
Authentifizierung
Alle API-Requests erfordern einen Bearer Token im Authorization Header.
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.
1curl -X POST 'https://service.invoice-api.xhub.io/api/v1/invoice/parse' \2 -H 'Authorization: Bearer sk_test_xxx' \3 -H 'Content-Type: application/json' \4 -d '{5 "data": "'$(base64 -i rechnung.xml)'",6 "filename": "rechnung.xml"7 }'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.
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 "countryCode": "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 "countryCode": "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.0044 }45 ],46 "currency": "EUR",47 "subtotal": 1500.00,48 "total": 1785.00,49 "taxSummary": [50 {51 "taxRate": 19,52 "taxCategoryCode": "S",53 "netAmount": 1500.00,54 "taxAmount": 285.0055 }56 ],57 "paymentTerms": {58 "dueDays": 30,59 "description": "Zahlbar innerhalb von 30 Tagen"60 },61 "notes": "Vielen Dank für Ihren Auftrag!"62 },63 "detection": {64 "format": "XRECHNUNG_UBL",65 "formatVersion": "3.0.2",66 "countryCode": "DE",67 "confidence": 98,68 "formatMethod": "NAMESPACE",69 "countrySource": "DOCUMENT",70 "isAmbiguous": false,71 "alternativeCountries": []72 },73 "hash": "9f2c1b7d4e8a03f5c6b9d0e1a2f3c4b5d6e7f8a9b0c1d2e3f4a5b6c7d8e9f0a1",74 "errors": [],75 "warnings": []76}Detection-Objekt Felder
formatErkanntes Format (XRECHNUNG_UBL, XRECHNUNG_CII, ZUGFERD_EN16931, FACTUR_X_EN16931, FATTURAPA, …)
formatVersionErkannte Formatversion (z.B. "3.0.2")
countryCodeErkannter Ländercode (ISO 3166-1 Alpha-2)
confidenceKonfidenz der Erkennung (0-100)
formatMethodMethode der Format-Erkennung: NAMESPACE, ROOT_ELEMENT, CUSTOMIZATION_ID, PROFILE_ID oder HEURISTIC
countrySourceQuelle der Ländererkennung: DOCUMENT, FORMAT_MAPPING oder UNKNOWN
isAmbiguousOb die Erkennung mehrdeutig war
alternativeCountriesAlternative 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.
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 "countryCode": "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 "countryCode": "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.0044 }45 ],46 "currency": "EUR",47 "subtotal": 1500.00,48 "total": 1785.00,49 "taxSummary": [50 {51 "taxRate": 19,52 "taxCategoryCode": "S",53 "netAmount": 1500.00,54 "taxAmount": 285.0055 }56 ],57 "paymentTerms": {58 "dueDays": 30,59 "description": "Zahlbar innerhalb von 30 Tagen"60 },61 "notes": "Vielen Dank für Ihren Auftrag!"62 },63 "format": "XRECHNUNG_UBL",64 "hash": "9f2c1b7d4e8a03f5c6b9d0e1a2f3c4b5d6e7f8a9b0c1d2e3f4a5b6c7d8e9f0a1",65 "errors": [],66 "warnings": []67}Error Responses
1{2 "success": false,3 "detection": {4 "format": null,5 "countryCode": null,6 "confidence": 12,7 "formatMethod": "HEURISTIC",8 "countrySource": "UNKNOWN",9 "isAmbiguous": false,10 "alternativeCountries": []11 },12 "error": "FORMAT_NOT_DETECTED",13 "message": "Could not reliably detect the document format. Please use the explicit parse endpoint with country and format parameters."14}1{2 "error": "UNAUTHORIZED",3 "message": "Invalid or missing API key"4}1{2 "error": "FORBIDDEN",3 "message": "Your API key does not have permission for this operation"4}1{2 "error": "QUOTA_EXCEEDED",3 "message": "Usage limit reached for xrechnung:de:parse",4 "quota": {5 "current": 100,6 "limit": 100,7 "period": "monthly"8 }9}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.
= Verfügbar
Features
XML zu JSON
Extrahiere strukturierte JSON-Daten aus XRechnung, ZUGFeRD und UBL XML
Alle Formate
XRechnung, ZUGFeRD, Factur-X, FatturaPA, Facturae, ebInterface, UBL, Peppol UBL, CII und die nationalen Formate KSeF, SAF-T, ISDOC, NAV, myDATA und e-Factura
PDF Extraktion
Extrahiere eingebettetes XML aus ZUGFeRD/Factur-X PDFs automatisch
37 Länder
Unterstützung für AE, AT, AU, BE, BG, CH, CY, CZ, DE, DK, EE, ES, FI, FR, GB, GR, HR, HU, IE, IS, IT, JP, LI, LT, LU, LV, MT, NL, NO, NZ, OM, PL, PT, RO, SE, SI, SK
Normalisiertes Schema
Einheitliches JSON-Schema unabhängig vom Quellformat
Ein Dokument pro Request
Der Parse-Body nimmt genau ein data-Feld; für Stapel rufe den Endpoint je Dokument auf
Weitere APIs
Kombiniere die Parser API mit der Validator API zur Validierung oder der Creator API zur Erstellung von E-Rechnungen.