E-invoice to JSON reader API
Turn an incoming XRechnung, ZUGFeRD / Factur-X or Peppol invoice into plain JSON, checked with the official rules in the same call.
POST https://api.curatedapi.com/v1/validate/einvoice/read
- Version 1
- MCP tool
validate_einvoice_read - Overview
Reads a UBL 2.1 or UN/CEFACT CII invoice, or the XML inside a Factur-X / ZUGFeRD PDF, and returns its data as JSON: parties, addresses, VAT numbers, payment details, lines, VAT breakdown and every total as the file states it. The field names are the same as the creators take, so the JSON can go straight into your system, or back into /v1/create. The matching official rules run on the same document (XRechnung, Peppol BIS, Factur-X or EN 16931, chosen from its specification ID), so you also learn whether the invoice is valid. Amounts are never recalculated; a note says when a line's amount does not match its quantity and price.
- Only the EN 16931 fields the creators' model has are read; attachments, item attributes and EXTENDED-profile extras are left out, and read_notes says when something was.
- PDF/A-3 conformance of a PDF itself is not checked.
Inputs
An invoice that breaks a rule still gets HTTP 200, with "valid": false and the findings (see e-invoice validation).
| Input | Type | Description |
|---|---|---|
pdf |
string | The Factur-X or ZUGFeRD PDF, base64-encoded (at most 6 MiB). |
xml |
string | Or the CII invoice XML, as text. |
Result
Under result in the answer, next to validator and rules (the official artefacts used, with their versions).
| Result | Type | Description |
|---|---|---|
invoice | ['object', 'null'] | The invoice's data, with the same field names the creators take (number, issue_date, seller, buyer, payment, lines …). Amounts, quantities and rates are strings exactly as in the file. Fields the file does not have are left out. null when the document is not a UBL or CII invoice. |
totals | ['object', 'null'] | The totals as the file states them, not recalculated: line_total, allowance_total, charge_total, total_without_vat, vat_total, total_with_vat, prepaid_amount, rounding_amount, amount_due, vat_breakdown and each line's net_amount. |
syntax | ['string', 'null'] | UBL Invoice, UBL CreditNote or UN/CEFACT CII. |
document_type_code | string | BT-3 as found, e.g. 380 (invoice) or 381 (credit note). |
payment_means_code | string | BT-81 as found, e.g. 58 (SEPA transfer). |
read_notes | list of string | What was left out or looks wrong while reading, such as a line whose amount is not quantity × price. |
valid | boolean | true when the document matched a scenario and no check reported an error. |
scenario | ['string', 'null'] | Which set of rules applied, chosen from the document's own type and specification ID; null when none applies. |
document_type | ['string', 'null'] | UBL Invoice, UBL CreditNote or UN/CEFACT CII. |
specification_id | ['string', 'null'] | The CustomizationID (UBL) or guideline ID (CII), BT-24, as found. |
errors | integer | Messages at level error. |
warnings | integer | Messages at level warning. |
notices | integer | Messages at level information. |
error_rules | list of string | The distinct rules that reported an error, sorted. |
checks | list of object | Each check in the order it ran, and whether it passed (a schema failure skips the rules, as in KoSIT's validator). |
messages | list of object | Up to 500 findings. |
messages_truncated | boolean | |
profile | ['string', 'null'] | MINIMUM, BASIC WL, BASIC, EN 16931, EXTENDED or XRECHNUNG. |
pdf | ['object', 'null'] | For a PDF: the embedded file's name, the XMP ConformanceLevel and pdfa_checked (always false). |
Examples
An official sample (xrechnung-01.01a-invoice-ubl.xml)
jq -Rs '{xml: .}' xrechnung-01.01a-invoice-ubl.xml |
curl https://api.curatedapi.com/v1/validate/einvoice/read \
-H "Authorization: Bearer $CURATEDAPI_KEY" \
-H "Content-Type: application/json" \
--data-binary @-
{
"validator": "einvoice/read@1",
"result": {
"valid": true,
"invoice": {
"number": "123456XX",
"issue_date": "2016-04-04",
"currency": "EUR",
"buyer_reference": "04011000-12345-03",
"notes": [
"#ADU#Es gelten unsere Allgem. Geschäftsbedingungen, die Sie unter […] finden."
],
"seller": {
"name": "[Seller name]",
"trading_name": "[Seller trading name]",
"address": {
"line1": "[Seller address line 1]",
"city": "[Seller city]",
"postcode": "12345",
"country": "DE"
},
"vat_id": "DE 123456789",
"registration_id": "[HRA-Eintrag]",
"legal_info": "123/456/7890, HRA-Eintrag in […]",
"electronic_address": {
"id": "[email protected]",
"scheme": "EM"
},
"contact": {
"name": "nicht vorhanden",
"phone": "+49 1234-5678",
"email": "[email protected]"
}
},
"buyer": {
"name": "[Buyer name]",
"address": {
"line1": "[Buyer address line 1]",
"city": "[Buyer city]",
"postcode": "12345",
"country": "DE"
},
"id": "[Buyer identifier]",
"electronic_address": {
"id": "[email protected]",
"scheme": "EM"
}
},
"payment": {
"method": "sepa_credit_transfer",
"iban": "DE79000000001234567890",
"terms": "Zahlbar sofort ohne Abzug."
},
"lines": [
{
"id": "Zeitschrift [...]",
"name": "Zeitschrift [...]",
"description": "Zeitschrift Inland",
"note": "Die letzte Lieferung im Rahmen des abgerechneten Abonnements erfolgt in 12/2016 Lieferung erfolgt / erfolgte direkt vom Verlag",
"quantity": "1",
"unit": "XPP",
"unit_price": "288.79",
"vat_category": "S",
"vat_rate": "7",
"seller_item_id": "246",
"order_line_reference": "6171175.1",
"period": {
"start": "2016-01-01",
"end": "2016-12-31"
}
},
{
"id": "Porto + Versandkosten",
"name": "Porto + Versandkosten",
"quantity": "1",
"unit": "XPP",
"unit_price": "26.07",
"vat_category": "S",
"vat_rate": "7"
}
]
},
"totals": {
"currency": "EUR",
"line_total": "314.86",
"total_without_vat": "314.86",
"vat_total": "22.04",
"total_with_vat": "336.9",
"amount_due": "336.9",
"vat_breakdown": [
{
"category": "S",
"rate": "7",
"taxable_amount": "314.86",
"vat_amount": "22.04"
}
],
"lines": [
{
"id": "Zeitschrift [...]",
"net_amount": "288.79"
},
{
"id": "Porto + Versandkosten",
"net_amount": "26.07"
}
]
},
"syntax": "UBL Invoice",
"document_type_code": "380",
"payment_means_code": "58",
"read_notes": [],
"scenario": "EN16931 XRechnung (UBL Invoice)",
"document_type": "UBL Invoice",
"specification_id": "urn:cen.eu:en16931:2017#compliant#urn:xeinkauf.de:kosit:xrechnung_3.0",
"errors": 0,
"warnings": 0,
"notices": 1,
"error_rules": [],
"checks": [
{
"check": "XML syntax",
"passed": true
},
{
"check": "XML Schema for UBL 2.1 Invoice",
"passed": true
},
{
"check": "Schematron rules for EN16931 (UBL)",
"passed": true
},
{
"check": "Schematron rules for Invoice - CIUS XRechnung (UBL)",
"passed": true
}
],
"messages": [
{
"rule": "BR-DE-TMP-32",
"level": "information",
"message": "[BR-DE-TMP-32] Eine Rechnung sollte zur Angabe des Liefer-/Leistungsdatums entweder BT-72 \"Actual delivery date\", BG-14 \"Invoicing period\" oder in jeder Rechnungsposition BG-26 \"Invoice line period\" enthalten.",
"check": "Schematron rules for Invoice - CIUS XRechnung (UBL)",
"location": "/Q{urn:oasis:names:specification:ubl:schema:xsd:Invoice-2}Invoice[1]"
}
],
"messages_truncated": false,
"profile": "XRECHNUNG",
"pdf": null
},
"rules": [
{
"name": "CEN/TC 434 EN 16931 validation artefacts",
"version": "1.3.17",
"url": "https://github.com/ConnectingEurope/eInvoicing-EN16931/releases/tag/validation-1.3.17"
},
{
"name": "KoSIT validator configuration for XRechnung 3.0.2",
"version": "2026-08-31",
"url": "https://github.com/itplr-kosit/validator-configuration-xrechnung/releases/download/v2026-08-31/xrechnung-3.0.2-validator-configuration-2026-08-31.zip"
},
{
"name": "OpenPeppol BIS Billing 3.0 Schematron (compiled with SchXslt 1.10.1)",
"version": "3.0.22",
"url": "https://github.com/OpenPEPPOL/peppol-bis-invoice-3/releases/tag/3.0.22"
},
{
"name": "Factur-X 1.09.2 / ZUGFeRD 2.5 schemas and Schematron (FNFE-MPE and FeRD), as distributed with Mustang",
"version": "1.09.2",
"url": "https://github.com/ZUGFeRD/mustangproject/tree/1d633ab612856527d536a709ed53bedd2a4ea98c/validator/src/main/resources"
}
]
}
Rules used
- CEN/TC 434 EN 16931 validation artefacts, version 1.3.17
- KoSIT validator configuration for XRechnung 3.0.2, version 2026-08-31
- OpenPeppol BIS Billing 3.0 Schematron (compiled with SchXslt 1.10.1), version 3.0.22
- Factur-X 1.09.2 / ZUGFeRD 2.5 schemas and Schematron (FNFE-MPE and FeRD), as distributed with Mustang, version 1.09.2
A check shows whether the invoice passes the official rule sets listed, at the versions listed. It is not legal or tax advice, and passing does not promise that a tax authority or buyer will accept the invoice. See the terms.
Errors share one format; see errors. Billing, retries and batches work the same for every endpoint.