---
title: "Create, Validate & Parse E-Invoice API"
slug: create-validate-parse-e-invoices
url: https://apyhub.com/callable-labs/service/create-validate-parse-e-invoices
provider: Callable Labs
categories: [File Conversion, Finance, Smart Generation]
tags: [e-invoicing, invoice-validation, invoice-parsing, zugferd, xrechnung, peppol]
auth: api_key
version: 0.2.0
service_type: sync
endpoints: 3
atoms: 20-100
mcp: true
---

# Create, Validate & Parse E-Invoice API

Create ZUGFeRD, XRechnung, or Peppol e-invoices, validate XML or PDF documents, and extract invoice data, totals, and rule errors.

## Endpoints

| Method | URL | Description | Atoms |
| --- | --- | --- | --- |
| POST | `https://api.eu.apyhub.com/callable-labs/create-validate-parse-e-invoices/v1/einvoice/create` | What it does Creates an e-invoice from the JSON request body and returns the generated invoice outp… | 100 |
| POST | `https://api.eu.apyhub.com/callable-labs/create-validate-parse-e-invoices/v1/einvoice/validate` | What it does Validates an e-invoice sent as XML or as a base64-encoded XML/PDF document. The respon… | 20 |
| POST | `https://api.eu.apyhub.com/callable-labs/create-validate-parse-e-invoices/v1/einvoice/parse` | What it does Parses an e-invoice from XML or a base64-encoded file and returns a JSON object with t… | 20 |

## Endpoint reference

### Create an e-invoice from JSON

`POST https://api.eu.apyhub.com/callable-labs/create-validate-parse-e-invoices/v1/einvoice/create` · 100 atoms · accepts `application/json` · returns `application/json`

| Parameter | In | Type | Required | Description |
| --- | --- | --- | --- | --- |
| `format` | body | string or null | no | One of: pdf, xml, json, null. Default: `pdf`. |
| `invoice.buyer.city` | body | string | yes | Default: `Munich`. |
| `invoice.buyer.name` | body | string | yes | Default: `Acme GmbH`. |
| `invoice.buyer.email` | body | string or null | no | Default: `ap@engines.example`. |
| `invoice.buyer.street` | body | string or null | no | Default: `Hauptstraße 5`. |
| `invoice.buyer.vat_id` | body | string or null | no | Default: `DE987654321`. |
| `invoice.buyer.country` | body | string | yes | Default: `DE`. |
| `invoice.buyer.postal_code` | body | string | yes | Default: `80331`. |
| `invoice.lines` | body | array of object | yes |  |
| `invoice.lines[].unit` | body | string | no | Default: `HUR`. |
| `invoice.lines[].quantity` | body | number | yes | Default: `12`. |
| `invoice.lines[].vat_rate` | body | number | yes | Default: `19`. |
| `invoice.lines[].unit_price` | body | number | yes | Default: `95`. |
| `invoice.lines[].description` | body | string | yes | Default: `Consulting`. |
| `invoice.lines[].vat_category` | body | string or null | no | One of: S, Z, E, AE, K, G, O, L, M, null. |
| `invoice.number` | body | string | yes | Default: `RE-2026-0042`. |
| `invoice.seller.city` | body | string | yes | Default: `Berlin`. |
| `invoice.seller.name` | body | string | yes | Default: `Callable Labs GmbH`. |
| `invoice.seller.email` | body | string or null | no | Default: `billing@callable.example`. |
| `invoice.seller.phone` | body | string or null | no | Default: `+49 30 1234567`. |
| `invoice.seller.street` | body | string or null | no | Default: `Musterstraße 1`. |
| `invoice.seller.vat_id` | body | string or null | no | VAT identifier (BT-31 / BT-48). Default: `DE123456789`. |
| `invoice.seller.country` | body | string | yes | Default: `DE`. |
| `invoice.seller.tax_number` | body | string or null | no | Seller's national tax number (BT-32). |
| `invoice.seller.postal_code` | body | string | yes | Default: `10115`. |
| `invoice.seller.contact_name` | body | string or null | no | Default: `Ada Lovelace`. |
| `invoice.seller.registration_id` | body | string or null | no |  |
| `invoice.seller.electronic_address` | body | string or null | no |  |
| `invoice.payment` | body | object or null | no |  |
| `invoice.currency` | body | string | no | Default: `EUR`. |
| `invoice.due_date` | body | string or null (date) | no | Default: `2026-10-23`. |
| `invoice.issue_date` | body | string (date) | yes | Default: `2026-09-23`. |
| `invoice.buyer_reference` | body | string or null | no | Default: `PO-7781`. |
| `standard` | body | string | no | One of: zugferd, facturx, xrechnung, peppol. Default: `zugferd`. |

#### Quickstart

Create a minimal e-invoice from the required invoice details and return it as XML.

```bash
curl -X POST "https://api.eu.apyhub.com/callable-labs/create-validate-parse-e-invoices/v1/einvoice/create" \
  -H "apy-token: $APY_TOKEN" \
  -H "Content-Type: application/json" \
  -d '{
  "invoice": {
    "number": "RE-2026-0042",
    "issue_date": "2026-09-23",
    "currency": "EUR",
    "seller": {
      "name": "Callable Labs GmbH",
      "street": "Example Street 1",
      "city": "Berlin",
      "postal_code": "10115",
      "country": "DE",
      "vat_id": "DE123456789"
    },
    "buyer": {
      "name": "Acme GmbH",
      "street": "Example Street 2",
      "city": "Munich",
      "postal_code": "80331",
      "country": "DE"
    },
    "lines": [
      {
        "description": "Consulting",
        "quantity": 12,
        "unit": "HUR",
        "unit_price": 95,
        "vat_rate": 19
      }
    ]
  }
}'
```

#### What you'll get back

Returns a JSON object with fields such as `xml` and `format`; `xml` is the invoice XML, and `format` is the returned format. Other top-level fields like `bytes`, `cache`, `pages`, `engine`, `totals`, `data_uri`, `standard`, `warnings`, `queued_ms`, `render_ms`, `media_type`, and `engine_version` may also be present.

```json
{
  "xml": "<Invoice>...</Invoice>",
  "format": "xml"
}
```

### Validate an e-invoice

`POST https://api.eu.apyhub.com/callable-labs/create-validate-parse-e-invoices/v1/einvoice/validate` · 20 atoms · accepts `application/json` · returns `application/json`

| Parameter | In | Type | Required | Description |
| --- | --- | --- | --- | --- |
| `body` | body | any | yes | The e-invoice to read or validate. Choose XML or Base64 from the dropdown and provide exactly one. |

#### Quickstart

Validate an e-invoice by sending the invoice XML in a JSON body.

```bash
curl -X POST "https://api.eu.apyhub.com/callable-labs/create-validate-parse-e-invoices/v1/einvoice/validate" \
  -H "apy-token: $APY_TOKEN" \
  -H "Content-Type: application/json" \
  -d '{
  "xml": "<?xml version=\"1.0\" encoding=\"UTF-8\"?><rsm:CrossIndustryInvoice xmlns:rsm=\"urn:un:unece:uncefact:data:standard:CrossIndustryInvoice:100\" xmlns:ram=\"urn:un:unece:uncefact:data:standard:ReusableAggregateBusinessInformationEntity:100\" xmlns:udt=\"urn:un:unece:uncefact:data:standard:UnqualifiedDataType:100\"><rsm:ExchangedDocumentContext><ram:GuidelineSpecifiedDocumentContextParameter><ram:ID>urn:cen.eu:en16931:2017</ram:ID></ram:GuidelineSpecifiedDocumentContextParameter></rsm:ExchangedDocumentContext><rsm:ExchangedDocument><ram:ID>INV-001</ram:ID><ram:TypeCode>380</ram:TypeCode><ram:IssueDateTime><udt:DateTimeString format=\"102\">20261007</udt:DateTimeString></ram:IssueDateTime></rsm:ExchangedDocument></rsm:CrossIndustryInvoice>"
}'
```

#### What you'll get back

Returns a JSON object with fields such as `valid` (boolean), `checks` (array), `errors` (array), `syntax` (`cii` or `ubl`), `profile` (string), `standard` (`xrechnung`, `peppol`, `facturx`, `en16931`, or `unknown`), `warnings` (array), `container` (`xml` or `pdf`), `document_type` (`invoice` or `credit_note`), and `specification_id` (string).

```json
{
  "valid": false,
  "standard": "facturx",
  "profile": "Factur-X / ZUGFeRD EN 16931",
  "syntax": "cii",
  "document_type": "invoice",
  "specification_id": "urn:cen.eu:en16931:2017",
  "container": "xml",
  "checks": [
    {
      "name": "xsd",
      "title": "XML Schema (CII D16B (Factur-X EN16931))",
      "passed": false,
      "errors": 1,
      "warnings": 0
    },
    {
      "name": "en16931",
      "title": "EN 16931 business rules (CEN)",
      "version": "1.3.16",
      "passed": false,
      "errors": 7,
      "warnings": 0
    }
  ],
  "errors": [
    {
      "rule": "XSD",
      "check": "xsd",
      "message": "Element '{urn:un:unece:uncefact:data:standard:ReusableAggregateBusinessInformationEntity:100}ApplicableHeaderTradeAgreement': This element is not expected. Expected is ( {urn:un:unece:uncefact:data:standard:ReusableAggregateBusinessInformationEntity:100}IncludedSupplyChainTradeLineItem ).",
      "location": "line 1"
    },
    {
      "rule": "BR-08",
      "check": "en16931",
      "message": "[BR-08]-An Invoice shall contain the Seller postal address (BG-5).",
      "location": "/*:CrossIndustryInvoice[namespace-uri()='urn:un:unece:uncefact:data:standard:CrossIndustryInvoice:100']"
    },
    {
      "rule": "BR-09",
      "check": "en16931",
      "message": "[BR-09]-The Seller postal address (BG-5) shall contain a Seller country code (BT-40).",
      "location": "/*:CrossIndustryInvoice[namespace-uri()='urn:un:unece:uncefact:data:standard:CrossIndustryInvoice:100']"
    },
    {
      "rule": "BR-10",
      "check": "en16931",
      "message": "[BR-10]-An Invoice shall contain the Buyer postal address (BG-8).",
      "location": "/*:CrossIndustryInvoice[namespace-uri()='urn:un:unece:uncefact:data:standard:CrossIndustryInvoice:100']"
    },
    {
      "rule": "BR-11",
      "check": "en16931",
      "message": "[BR-11]-The Buyer postal address shall contain a Buyer country code (BT-55).",
      "location": "/*:CrossIndustryInvoice[namespace-uri()='urn:un:unece:uncefact:data:standard:CrossIndustryInvoice:100']"
    },
    {
      "rule": "BR-16",
      "check": "en16931",
      "message": "[BR-16]-An Invoice shall have at least one Invoice line (BG-25).",
      "location": "/*:CrossIndustryInvoice[namespace-uri()='urn:un:unece:uncefact:data:standard:CrossIndustryInvoice:100']"
    },
    {
      "rule": "BR-CO-15",
      "check": "en16931",
      "message": "[BR-CO-15]-Invoice total amount with VAT (BT-112) = Invoice total amount without VAT (BT-109) + Invoice total VAT amount (BT-110).",
      "location": "/*:CrossIndustryInvoice[namespace-uri()='urn:un:unece:uncefact:data:standard:CrossIndustryInvoice:100']"
    },
    {
      "rule": "BR-CO-26",
      "check": "en16931",
      "message": "[BR-CO-26]-In order for the buyer to automatically identify a supplier, the Seller identifier (BT-29), the Seller legal registration identifier (BT-30) and/or the Seller VAT identifier (BT-31) shall be present.",
      "location": "/*:CrossIndustryInvoice[namespace-uri()='urn:un:unece:uncefact:data:standard:CrossIndustryInvoice:100']/*:SupplyChainTradeTransaction[namespace-uri()='urn:un:unece:uncefact:data:standard:CrossIndustryInvoice:100']/*:ApplicableHeaderTradeAgreement[namespace-uri()='urn:un:unece:uncefact:data:standard:ReusableAggregateBusinessInformationEntity:100']/*:SellerTradeParty[namespace-uri()='urn:un:unece:uncefact:data:standard:ReusableAggregateBusinessInformationEntity:100']"
    }
  ],
  "warnings": []
}
```

### Read an e-invoice into JSON

`POST https://api.eu.apyhub.com/callable-labs/create-validate-parse-e-invoices/v1/einvoice/parse` · 20 atoms · accepts `application/json` · returns `application/json`

| Parameter | In | Type | Required | Description |
| --- | --- | --- | --- | --- |
| `body` | body | any | yes | The e-invoice to read. Choose XML or Base64 from the dropdown and provide exactly one. |

#### Quickstart

Send the e-invoice as XML text or a base64-encoded XML/PDF so the API can parse the document.

```bash
curl -X POST "https://api.eu.apyhub.com/callable-labs/create-validate-parse-e-invoices/v1/einvoice/parse" \
  -H "apy-token: $APY_TOKEN" \
  -H "Content-Type: application/json" \
  -d '{
  "xml": "<?xml version=\"1.0\" encoding=\"UTF-8\"?><rsm:CrossIndustryInvoice xmlns:rsm=\"urn:un:unece:uncefact:data:standard:CrossIndustryInvoice:100\" xmlns:ram=\"urn:un:unece:uncefact:data:standard:ReusableAggregateBusinessInformationEntity:100\" xmlns:udt=\"urn:un:unece:uncefact:data:standard:UnqualifiedDataType:100\"><rsm:ExchangedDocumentContext><ram:GuidelineSpecifiedDocumentContextParameter><ram:ID>urn:cen.eu:en16931:2017</ram:ID></ram:GuidelineSpecifiedDocumentContextParameter></rsm:ExchangedDocumentContext><rsm:ExchangedDocument><ram:ID>INV-001</ram:ID><ram:TypeCode>380</ram:TypeCode><ram:IssueDateTime><udt:DateTimeString format=\"102\">20261007</udt:DateTimeString></ram:IssueDateTime></rsm:ExchangedDocument></rsm:CrossIndustryInvoice>"
}'
```

#### What you'll get back

Returns a JSON object with fields such as `notes` (array of strings), `syntax` (`cii` or `ubl`), `totals` (object), `invoice` (object), `profile` (string), `standard` (`xrechnung`, `peppol`, `facturx`, `en16931`, or `unknown`), `container` (`xml` or `pdf`), `document_type` (`invoice` or `credit_note`), and `specification_id` (string).

```json
{
  "standard": "facturx",
  "profile": "Factur-X / ZUGFeRD EN 16931",
  "syntax": "cii",
  "document_type": "invoice",
  "specification_id": "urn:cen.eu:en16931:2017",
  "container": "xml",
  "invoice": {
    "type": "invoice",
    "number": "INV-001",
    "issue_date": "2026-10-07",
    "currency": "EUR",
    "seller": {
      "name": "ABC GmbH"
    },
    "buyer": {
      "name": "XYZ GmbH"
    },
    "lines": []
  },
  "totals": {
    "line_total": null,
    "tax_total": null,
    "total": null,
    "amount_due": null,
    "vat": []
  },
  "notes": []
}
```

## About

## What it does
E-Invoice Suite creates, validates, and reads EN 16931 e-invoices in JSON, XML, or PDF form. Send invoice data to generate a ZUGFeRD/Factur-X PDF/A-3 file, XRechnung XML, or Peppol BIS Billing 3.0 XML; send an XML or base64-encoded XML/PDF back to validate or parse it.

When you create an invoice, the input includes the invoice header, seller, buyer, line items, and optional payment and reference fields such as currency, issue_date, due_date, buyer_reference, order_reference, and vat_exemption_reason. The response includes the rendered file as XML or a data URI, plus totals, file size, page count for PDF output, warnings, and processing metadata such as cache, engine, and render timing.

Use validation when you need to check an incoming document against XSD, EN 16931, XRechnung, or Peppol rules. The response tells you whether the document is valid and returns the checks performed, structured errors and warnings, the detected syntax, container, profile, standard, document type, and specification ID.

Use parsing when you need invoice data back in JSON. E-Invoice Suite returns the invoice object, totals, notes for content not represented in the core invoice fields, and the detected syntax, container, profile, standard, document type, and specification ID. That makes it useful for accounting pipelines, procurement systems, and public-sector invoicing flows where you need both compliant output and reliable document inspection.

## 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/callable-labs/service/create-validate-parse-e-invoices
