Home / How-to guides / E-Invoice to JSON
How to convert XRechnung and Factur-X invoices to JSON
Factur-X, ZUGFeRD, XRechnung, UBL/Peppol, FatturaPA and Facturae invoices as clean JSON, with validation.
Updated 2026-11-24
The problem
European e-invoices come in several standards: CII and UBL in Germany and France, FatturaPA in Italy, Facturae in Spain. Each has its own XML, and Factur-X hides the XML inside a PDF. Reading them all means writing and maintaining several parsers.
Steps
- Open the Actor on Apify. Create a free Apify account if you do not have one. Every account gets free monthly credit, enough to try this on real data. E-Invoice to JSON ↗
- Fill in the input. The input is a small JSON. These are the first fields and example values:
{
"invoiceUrls": [
"https://raw.githubusercontent.com/ZUGFeRD/mustangproject/master/library/src/test/resources/EN16931_Einfach.pdf"
],
"validate": true
}- Run it. Press Start in the console, or call it from the API, a schedule, n8n, Make or Zapier. See the run guide for code you can copy. Run guide (API, n8n, Make, MCP)
- Take the results. Open the Output tab to preview the dataset and download it as JSON, CSV or Excel. Through the API you read the same dataset items.
A tip for this Actor
Check validation.valid before booking an invoice: it flags missing mandatory fields and totals that do not add up. It is not a full Schematron check, so treat a pass as a good sign, not a legal certificate. A plain PDF without embedded XML returns an error and is not charged.
Input fields
| Field | Type | Description |
|---|---|---|
invoiceUrls | array | Direct links to PDF (with embedded XML) or XML invoice files. |
validate | boolean | Add mandatory-field and arithmetic checks. |
Real output sample
First item of 1 from a real run, shortened for display. The full sample is a download on the Actor page.
{
"source": "https://raw.githubusercontent.com/ZUGFeRD/mustangproject/master/library/src/test/resources/EN16931_Einfach.pdf",
"fileType": "pdf",
"syntax": "CII",
"customizationId": "urn:cen.eu:en16931:2017",
"profileId": "EN 16931",
"standard": "Factur-X / ZUGFeRD",
"number": "471102",
"typeCode": "380",
"issueDate": "2024-11-15",
"dueDate": null,
"currency": "EUR",
"buyerReference": null,
"orderReference": null,
"notes": [
"Rechnung gemäß Bestellung vom 01.11.2024.",
"Lieferant GmbH\t\t\t\t\nLieferantenstraße 20\t\t\t\t\n80333 München\t\t\t\t\nDeutschland\t\t\t\t\nGeschäftsführer: Hans Muster\n…"
],
"seller": {
"name": "Lieferant GmbH",
"vatId": "DE123456789",
"legalId": null,
"taxNumber": "201/113/40209",
"street": "Lieferantenstraße 20",
"city": "München",
"postalCode": "80333",
"country": "DE",
"hasContact": false
},
"buyer": {
"name": "Kunden AG Mitte",
"vatId": null,
"legalId": null,
"taxNumber": null,
"street": "Kundenstraße 15",
"city": "Frankfurt",
"postalCode": "69876",
"country": "DE",
"hasContact": false
},
"lines": [
{
"id": "1",
"name": "Trennblätter A4",
"description": null,
"quantity": 20,
"unit": "H87",
"unitPrice": 9.9,
"lineTotal": 198,
"vatCategory": "S",
"vatRate": 19
},
{
"id": "2",
"name": "Joghurt Banane",
"description": null,
"quantity": 50,
"unit": "H87",
"unitPrice": 5.5,
"lineTotal": 275,
"vatCategory": "S",
"vatRate": 7
}
],
"vatBreakdown": [
{
"category": "S",
"rate": 7,
"taxableAmount": 275,
"taxAmount": 19.25,
"exemptionReason": null
},
{
"category": "S",
"rate": 19,
"taxableAmount": 198,
"taxAmount": 37.62,
"exemptionReason": null
}
],
"totals": {
"lineTotal": 473,
"allowanceTotal": 0,
"chargeTotal": 0,
"net": 473,
"tax": 56.87,
"gross": 529.87,
"prepaid": 0,
"payable": 529.87
},
"payment": {
"means": null,
"iban": null,
"bic": null,
"terms": "Zahlbar innerhalb 30 Tagen netto bis 15.12.2024, 3% Skonto innerhalb 10 Tagen bis 25.11.2024"
},
"embeddedFiles": [
"factur-x.xml"
],
"validation": {
"valid": true,
"errors": [],
"warnings": [],
"note": "Basic business-rule checks (EN 16931 arithmetic and mandatory fields). Not a full Schematron validation."
}
}What it costs
Pay per event: invoice is charged $0.01 each. Apify platform usage is billed separately and is usually a few cents per run.
| Results | Result events |
|---|---|
| 100 | $1 |
| 1,000 | $10 |
| 10,000 | $100 |
| 100,000 | $1,000 |
Limits you should know
- It needs a direct link to a PDF with embedded XML or to the XML file. A plain PDF without embedded XML is reported as an error and not charged.
- Validation is not complete: it checks mandatory fields, the arithmetic business rules and the main XRechnung rules. It is not a full Schematron validation or a legal compliance certificate.
- Files that fail to download or parse are not charged.
Questions
Which formats are supported?
Factur-X and ZUGFeRD (PDF/A-3 with embedded XML), XRechnung (UBL and CII), UBL/Peppol BIS 3.0 invoices and credit notes, plain CII XML, FatturaPA (Italy) and Facturae 3.x (Spain).
Does it use OCR or AI?
No. It extracts the embedded XML and parses it, so results are exact. A plain PDF without embedded XML is reported as an error and not charged.
Is the validation complete?
No. It checks mandatory fields, the arithmetic business rules and the main XRechnung rules. It is not a full Schematron validation or a legal compliance certificate.
What is charged?
0.01 USD per invoice read. Files that fail to download or parse are not charged.
Does it store my invoices?
The Actor only downloads the links you give it and returns the data in your own dataset. Delete the dataset when you no longer need it.
Rate it on Apify
Used it? A rating or review on Apify helps other people judge it, and tells us what to fix.