---
title: Parse E-Invoice XML to JSON API
slug: parse-e-invoice-xml
url: https://apyhub.com/martin10291/service/parse-e-invoice-xml
provider: Martin Petrov
categories: [Ingestion Kit, Document Intelligence Kit, Verification Kit]
tags: [e-invoicing, invoice-parsing, xml-extraction, zugferd, factur-x, ubl]
auth: api_key
version: 1.0
service_type: sync
endpoints: 1
atoms: 100
mcp: true
---

# Parse E-Invoice XML to JSON API

E-invoice XML to JSON API: send XRechnung, ZUGFeRD or UBL files and get parties, totals, VAT and line items, with checks. Free tier, no card.

## Endpoints

| Method | URL | Description | Atoms |
| --- | --- | --- | --- |
| POST | `https://api.eu.apyhub.com/martin10291/parse-e-invoice-xml/e-invoice-reader` | What it does Reads an XRechnung, ZUGFeRD, Factur-X or UBL e-invoice and returns the invoice and its… | 100 |

## Endpoint reference

### E-Invoice Reader - XRechnung, ZUGFeRD, Factur-X, UBL to JSON

`POST https://api.eu.apyhub.com/martin10291/parse-e-invoice-xml/e-invoice-reader` · 100 atoms · accepts `application/json` · returns `application/json`

| Parameter | In | Type | Required | Description |
| --- | --- | --- | --- | --- |
| `xml` | body | string | no | E-invoice XML as text. Required if fileContent is not sent. Example: `<?xml version="1.0" encoding="UTF-8"?><Invoice xmlns="urn:oasis:names:specifica…`. |
| `fileName` | body | string | no | File name returned in sourceFile. Default: invoice. Example: `invoice.xml`. |
| `fileContent` | body | string | no | Base64 of the XML, or of a PDF with the invoice XML inside. Required if xml is not sent. Used instead of xml when both are sent. Max 10 MB file. Example: `PEludm9pY2UgLi4uPg==`. |

#### Quickstart

Send a UBL invoice as XML text.

```bash
curl -X POST "https://api.eu.apyhub.com/martin10291/parse-e-invoice-xml/e-invoice-reader" \
  -H "apy-token: $APY_TOKEN" \
  -H "Content-Type: application/json" \
  -d '{"xml": "<?xml version=\"1.0\" encoding=\"UTF-8\"?><Invoice xmlns=\"urn:oasis:names:specification:ubl:schema:xsd:Invoice-2\" xmlns:cac=\"urn:oasis:names:specification:ubl:schema:xsd:CommonAggregateComponents-2\" xmlns:cbc=\"urn:oasis:names:specification:ubl:schema:xsd:CommonBasicComponents-2\"><cbc:CustomizationID>urn:cen.eu:en16931:2017#compliant#urn:fdc:peppol.eu:2017:poacc:billing:3.0</cbc:CustomizationID><cbc:ID>U-1</cbc:ID><cbc:IssueDate>2026-11-15</cbc:IssueDate><cbc:InvoiceTypeCode>380</cbc:InvoiceTypeCode><cbc:DocumentCurrencyCode>EUR</cbc:DocumentCurrencyCode><cac:AccountingSupplierParty><cac:Party><cac:PartyName><cbc:Name>Acme</cbc:Name></cac:PartyName><cac:PartyLegalEntity><cbc:RegistrationName>Acme</cbc:RegistrationName></cac:PartyLegalEntity></cac:Party></cac:AccountingSupplierParty><cac:AccountingCustomerParty><cac:Party><cac:PartyName><cbc:Name>Client</cbc:Name></cac:PartyName><cac:PartyLegalEntity><cbc:RegistrationName>Client</cbc:RegistrationName></cac:PartyLegalEntity></cac:Party></cac:AccountingCustomerParty><cac:TaxTotal><cbc:TaxAmount currencyID=\"EUR\">28.50</cbc:TaxAmount><cac:TaxSubtotal><cbc:TaxableAmount currencyID=\"EUR\">150.00</cbc:TaxableAmount><cbc:TaxAmount currencyID=\"EUR\">28.50</cbc:TaxAmount><cac:TaxCategory><cbc:ID>S</cbc:ID><cbc:Percent>19</cbc:Percent></cac:TaxCategory></cac:TaxSubtotal></cac:TaxTotal><cac:LegalMonetaryTotal><cbc:LineExtensionAmount currencyID=\"EUR\">150.00</cbc:LineExtensionAmount><cbc:TaxExclusiveAmount currencyID=\"EUR\">150.00</cbc:TaxExclusiveAmount><cbc:TaxInclusiveAmount currencyID=\"EUR\">178.50</cbc:TaxInclusiveAmount><cbc:PayableAmount currencyID=\"EUR\">178.50</cbc:PayableAmount></cac:LegalMonetaryTotal><cac:InvoiceLine><cbc:ID>1</cbc:ID><cbc:InvoicedQuantity unitCode=\"C62\">1.5</cbc:InvoicedQuantity><cbc:LineExtensionAmount currencyID=\"EUR\">150.00</cbc:LineExtensionAmount><cac:Item><cbc:Name>Work</cbc:Name><cac:ClassifiedTaxCategory><cbc:ID>S</cbc:ID><cbc:Percent>19</cbc:Percent></cac:ClassifiedTaxCategory></cac:Item><cac:Price><cbc:PriceAmount currencyID=\"EUR\">100.00</cbc:PriceAmount></cac:Price></cac:InvoiceLine></Invoice>"}'
```

#### What you'll get back

Returns a JSON object with `count` and `items`. The first item is the invoice and the second is its only line. The `checks` list below is shortened.

```json
{
  "count": 2,
  "items": [
    {
      "type": "invoice",
      "number": "U-1",
      "documentType": "Invoice",
      "standard": "Peppol BIS",
      "syntax": "UBL 2.1",
      "profile": "urn:cen.eu:en16931:2017#compliant#urn:fdc:peppol.eu:2017:poacc:billing:3.0",
      "source": "XML",
      "sourceFile": "invoice",
      "issueDate": "2026-11-15",
      "dueDate": "",
      "deliveryDate": "",
      "currency": "EUR",
      "buyerReference": "",
      "orderReference": "",
      "paymentReference": "",
      "paymentTerms": "",
      "iban": "",
      "bic": "",
      "accountName": "",
      "seller": {
        "city": "",
        "contact": "",
        "country": "",
        "email": "",
        "name": "Acme",
        "phone": "",
        "postcode": "",
        "street": "",
        "vatId": ""
      },
      "buyer": {
        "city": "",
        "contact": "",
        "country": "",
        "email": "",
        "name": "Client",
        "phone": "",
        "postcode": "",
        "street": "",
        "vatId": ""
      },
      "notes": [],
      "lineCount": 1,
      "totals": {
        "lines": 150,
        "net": 150,
        "vat": 28.5,
        "gross": 178.5,
        "payable": 178.5,
        "allowances": null,
        "charges": null,
        "prepaid": null
      },
      "vatBreakdown": [
        {
          "category": "S",
          "percent": 19,
          "base": 150,
          "amount": 28.5,
          "reason": ""
        }
      ],
      "checks": [
        {
          "check": "Mandatory invoice fields present",
          "ok": true,
          "detail": "all present"
        },
        {
          "check": "Dates are valid calendar dates",
          "ok": true,
          "detail": "valid"
        }
      ],
      "allChecksOk": true
    },
    {
      "type": "line",
      "invoice": "U-1",
      "lineId": "1",
      "name": "Work",
      "description": "",
      "sellerItemId": "",
      "buyerItemId": "",
      "quantity": 1.5,
      "unitCode": "C62",
      "unit": "piece",
      "unitPrice": 100,
      "netAmount": 150,
      "vatCategory": "S",
      "vatPercent": 19
    }
  ]
}
```

## About

## What it does
This Parse E-Invoice XML to JSON API takes an electronic invoice and returns it as JSON. Send XRechnung, ZUGFeRD, Factur-X or UBL invoices. You get the parties, totals, VAT breakdown and every line item.

Send the XML text in `xml`. You can also send a Base64 file in `fileContent`, either XML or a PDF with the invoice XML inside. If you send both, the API reads `fileContent`. Use `fileName` to label the result with your file name. Files can be up to 10 MB.

The first item in the response is the invoice. The items after it are the lines. The invoice item also has `checks` for required fields, dates, codes, amounts and IBANs. `allChecksOk` is `false` when a check fails, so review those invoices before you pay them.

Teams use the e-invoice parser API to import supplier invoices into an ERP, convert XRechnung to JSON for accounting tools, and flag wrong totals before approval.

It does not read scanned or plain PDF invoices, and its checks are not a full EN 16931 validation. For those PDFs, try the [Invoice Data Extraction API](https://apyhub.com/apyhub/service/extract-invoice-data). To check a payee account on its own, use the [IBAN Validation API](https://apyhub.com/apyhub/service/validate-iban).

## Usage

Base URL: `https://api.eu.apyhub.com` (default region — see
`GET https://apyhub.com/api/public/regions` for the rest).

Authenticate with an ApyHub API key in the `apy-token` header.
Full docs and a live playground: https://apyhub.com/martin10291/service/parse-e-invoice-xml
