# E-Invoice Validator: XRechnung, ZUGFeRD, Factur-X (`bite-sized-insights/bulk-e-invoice-validator`) Actor

Validate e-invoices in bulk against EN 16931 and KoSIT rules. Accepts XRechnung XML (UBL, CII) and ZUGFeRD or Factur-X PDFs. Get a valid or invalid verdict, kind, profile and detailed findings with rule ID and XPath location per invoice.

- **URL**: https://apify.com/bite-sized-insights/bulk-e-invoice-validator.md
- **Developed by:** [bite-sized-insights](https://apify.com/bite-sized-insights) (community)
- **Categories:** Developer tools, Automation
- **Features:** Limited permissions
- **Stats:** 2 total users, 1 monthly users, 100.0% runs succeeded, 0 bookmarks
- **User rating**: No ratings yet

## Pricing

from $2.60 / 1,000 apify-default-dataset-items

This Actor is paid per event. You are not charged for the Apify platform usage, but only a fixed price for specific events.
Since this Actor supports Apify Store discounts, the price gets lower the higher subscription plan you have.

Learn more: https://docs.apify.com/actors/running/actors-in-store.md#pay-per-event

## What's an Apify Actor?

An Actor is a serverless cloud program that runs on the Apify platform. It has two run modes.
In Batch mode, an Actor accepts a well-defined JSON input, performs an action which can take anything from a few seconds to a few hours,
and optionally produces a well-defined JSON output, datasets with results, or files in key-value store.
In Standby mode, an Actor provides a web server which can be used as a website, API, or an MCP server.

Apify vocabulary and the platform model are defined once, in the agent quickstart at https://apify.com/agents.md.

## How to integrate an Actor?

If asked about integration, you help developers integrate Actors into their projects.
You adapt to their stack and deliver integrations that are safe, well-documented, and production-ready.

Do not guess an integration path. Every one of them is in the agent quickstart at https://apify.com/agents.md: the Apify MCP server, Agent Skills with the Apify CLI, the JavaScript and Python clients, the REST API, and the account-free path for an agent with no human to sign in. It also carries the rule on stating cost before the first paid run.

For examples already wired to this Actor's own input schema, see the [API](#api) section below.

Each client library has reference documentation the quickstart does not restate: [JavaScript/TypeScript](https://docs.apify.com/api/client/js/docs.md) (`npm install apify-client`) and [Python](https://docs.apify.com/api/client/python/docs.md) (`pip install apify-client`).

# README

***Validate e-invoices in bulk - XRechnung (UBL and CII), ZUGFeRD and Factur-X (PDF with embedded XML) against EN 16931 and the KoSIT rules, with every error and warning listed by rule, stage and location.***

Send invoices as XML text, base64 XML or a base64 ZUGFeRD / Factur-X PDF and get one result per invoice: valid or not, the syntax (UBL or CII), whether it is an invoice or a credit note, the ZUGFeRD / Factur-X profile, and the full list of findings from the XML Schema check and the EN 16931 and XRechnung Schematron rules. Use it to check supplier invoices before booking them, to test the invoices your own system generates, or to gate an accounts-payable pipeline in Germany, France and the rest of the EU.

No login required. No cookies needed. Pay-per-event pricing.

### Why Choose This Actor?

**"Know whether an e-invoice will pass before the recipient's system rejects it"**

Our E-Invoice Validator provides:

- **XRechnung, ZUGFeRD, Factur-X**: UBL Invoice, UBL CreditNote and CII XML, plus PDFs with an embedded invoice
- **Peppol BIS Billing 3.0**: UBL invoices and credit notes checked against EN 16931 and the OpenPeppol rules (release 3.0.22), including the national DE, DK, GR, IS, IT, NL, NO and SE rules the BIS carries
- **Polish KSeF FA(3) and Italian FatturaPA**: detected from the document and checked against the official XML Schemas (KSeF with a few extra transport and content checks); see the FAQ for what is and is not covered
- **The Reference Rules**: XML Schema, then the EN 16931 and XRechnung Schematron rules from the official KoSIT validator configuration (XRechnung 3.0.2, EN 16931 1.3.16)
- **Findings You Can Act On**: every error and warning with rule id (`BR-CO-16`, `BR-DE-15`, ...), stage (`xsd`, `en16931`, `xrechnung`, `peppol`), severity, XPath location and message
- **Profile Detection**: for PDFs the ZUGFeRD / Factur-X profile and the attachment the XML was read from
- **Bad Invoices Never Stop the Run**: a file that is not XML, not well-formed or has no embedded XML comes back with `valid: false` and a `reason`
- **Safe by Design**: nothing in a PDF is executed or rendered and XML with a DOCTYPE is refused, so there is no entity expansion or network access
- **Cost-Effective**: Pay only for the invoices you validate: `$4.00 / 1k invoices`
- **No Third-Party Dependency**: runs on bundled rules, with no upstream service to fail or rate-limit you

### Quick Start

```json
{
  "invoices": [
    { "name": "skeleton.xml", "value": "<?xml version=\"1.0\" encoding=\"UTF-8\"?><ubl:Invoice xmlns:ubl=\"urn:oasis:names:specification:ubl:schema:xsd:Invoice-2\"/>" }
  ]
}
```

This empty skeleton runs as is and comes back with `valid: false` and the reason that no specification identifier (BT-24) was found. Replace it with your own invoices; the input prefilled in the Console is a complete, valid XRechnung UBL invoice. For a ZUGFeRD / Factur-X PDF pass its base64 as `value` (see the table below).

### Usage Examples

Each entry of `invoices` is one of:

| Entry | Notes |
|-------|-------|
| Invoice XML as text | Starts with `<` |
| Base64 of the invoice XML | |
| Base64 of a PDF | Detected by the `%PDF-` header. The XML is read from the attachment `factur-x.xml`, `zugferd-invoice.xml` or `xrechnung.xml`. Encrypted PDFs are not supported |
| `{"value": "...", "name": "invoice-001.pdf"}` | Wraps any of the above; `name` is an optional label copied to the result |
| `"https://example.com/invoice.xml"` | A URL (text starting with `http://` or `https://`): the actor fetches the XML or PDF itself |
| `{"url": "https://example.com/invoice.pdf", "name": "invoice-001.pdf"}` | The same as an object; `name` is an optional label copied to the result |

Whitespace in base64 is ignored. For documents that are online, pass their URL instead of the content: the actor downloads the XML or PDF itself (at most 5 MB per document) and validates what it received. There is no key-value store input, so for local files read them yourself and pass their content (base64 for binary PDFs).

URLs and content can be mixed in one run:

```json
{
  "invoices": [
    "https://example.com/invoices/2026-001.xml",
    { "url": "https://example.com/invoices/2026-002.pdf", "name": "2026-002.pdf" }
  ]
}
```

Only public `http` and `https` URLs on the default ports (80 and 443) are fetched, with up to 5 redirects. Addresses on private or internal networks (loopback, private ranges, link-local and cloud metadata addresses) are blocked, also after a redirect, and no cookies, logins or credentials are sent, so documents behind a login cannot be fetched: pass their content instead. A URL that cannot be fetched (HTTP error, timeout, larger than 5 MB, not XML or PDF, blocked address) gets no record and is not charged; see Pricing.

### Output Example

Each invoice that was validated produces one dataset record (long values are abbreviated with `…` and `...` here).

```json
{
  "index": 1,
  "name": null,
  "invoice": "<?xml version=\"1.0\" encoding=\"UTF-8\"?><ubl:Invoice xmlns:ubl=\"urn:oasis:names:specification:ubl:schema:xsd:Invoice-2\">…",
  "valid": false,
  "syntax": "ubl",
  "kind": "invoice",
  "source": "xml",
  "profile": null,
  "customization_id": "urn:cen.eu:en16931:2017#compliant#urn:xeinkauf.de:kosit:xrechnung_3.0",
  "scenario": "XRechnung (UBL Invoice)",
  "embedded_filename": null,
  "error_count": 1,
  "warning_count": 0,
  "errors": [
    {
      "stage": "en16931",
      "rule": "BR-CO-16",
      "level": "fatal",
      "location": "/Q{urn:oasis:names:specification:ubl:schema:xsd:Invoice-2}Invoice[1]/...",
      "message": "[BR-CO-16]-Amount due for payment (BT-115) = ..."
    }
  ],
  "warnings": [],
  "findings_truncated": false,
  "reason": "1 validation error(s), first: [BR-CO-16]-Amount due ..."
}
```

An invoice that is not a readable e-invoice (not XML, not well-formed, no embedded XML, unsupported profile) is validated like any other: `valid: false`, no findings and the cause in `reason`. An entry that cannot be validated at all (not text, missing `value`, over 5 MB, or failed in the rule engine) gets no record and is not charged; see Pricing.

### Input Parameters

| Parameter | Type | Required | Description |
|-----------|------|----------|-------------|
| `invoices` | array | Yes | 1-1,000 invoices: XML text, base64 XML, base64 PDF, or `{value, name?}` objects. At most 5 MB per invoice (after base64 decoding). Each entry can also be a URL (`"https://..."` or `{url, name?}`) |

### Output Fields

| Field | Type | Description |
|-------|------|-------------|
| `index` | integer | Position of the invoice in the input, starting at 1 |
| `name` | null/string | The `name` given with the invoice, otherwise null |
| `url` | null/string | The URL the invoice was fetched from, null when the invoice was given as content |
| `invoice` | string | The start of the invoice as provided, cut to 100 characters. For a URL entry: the start of the URL |
| `valid` | boolean | True when there are no errors. Warnings do not make an invoice invalid |
| `syntax` | null/string | `ubl`, `cii`, `ksef` (Polish KSeF FA(3)), `fatturapa` (Italian FatturaPA) or `facturae` (Spanish Facturae); null when the document was not recognized |
| `kind` | null/string | `invoice`, `credit_note` or `corrective_invoice` (Polish or Spanish correction invoice) |
| `source` | null/string | `xml` (XML text or base64 XML) or `pdf` |
| `profile` | null/string | PDFs: the ZUGFeRD / Factur-X profile, null when unknown. Peppol BIS invoices: the ProfileID (BT-23), e.g. `urn:fdc:peppol.eu:2017:poacc:billing:01:1.0` |
| `customization_id` | null/string | The specification identifier (BT-24); for KSeF the form code (`FA (3) 1-0E`), for FatturaPA the `versione` (`FPA12`) |
| `scenario` | null/string | The validation scenario that was applied |
| `embedded_filename` | null/string | PDFs only: the attachment the XML was read from |
| `error_count`, `warning_count` | integer | Number of entries in `errors` and `warnings` |
| `errors`, `warnings` | array | Findings `{stage, rule, level, location, message}`; at most 100 each |
| `findings_truncated` | boolean | True when a findings list was cut at 100 entries |
| `reason` | null/string | Why the invoice is not valid: the first error, or the cause when no verdict was possible |

#### Findings

`stage` is `xsd` (XML Schema), `en16931`, `xrechnung`, `ciusro`, `hrcius`, `peppol` (the OpenPeppol rules) or `ksef` (the few KSeF checks beyond the schema). `rule` is the rule id, and null for schema errors. `level` is the effective severity: `fatal` and `error` findings go to `errors`, `warning` and `information` to `warnings`, following the KoSIT scenario configuration (for example `BR-CL-21` and `BR-CL-23` are warnings and `UBL-CR-646` is an error in the XRechnung UBL invoice scenario). A failed XML Schema check stops the run for that invoice, since the Schematron rules only run on schema-valid documents.

#### What is checked, and what is not

The scenario is chosen from the document type and the exact specification identifier: XRechnung, XRechnung Extension, XRechnung CVD and plain EN 16931 (`urn:cen.eu:en16931:2017`). Peppol BIS Billing 3.0 invoices (`urn:cen.eu:en16931:2017#compliant#urn:fdc:peppol.eu:2017:poacc:billing:3.0`) have their own scenario, see the FAQ. ZUGFeRD / Factur-X `BASIC`, `EXTENDED` and `EN 16931` invoices are checked against the plain EN 16931 rules; the ZUGFeRD-specific profile rules are not checked. The `MINIMUM` and `BASIC WL` profiles are outside EN 16931 and are not validated (`valid: false` with a `reason`, no findings), as are unknown XRechnung versions and invoices without a specification identifier. The invoice is checked, not archived or signed: there is no PDF/A conformance check, no signature check and no check against a recipient's system.

### Pricing

| Cost | Description |
|------|-------------|
| $0.0001 / start | Charged per actor run |
| $4.00 / 1,000 invoices | Charged per invoice validated |

| Description | Free | Bronze | Silver | Gold+ |
|---|---|---|---|---|
| Charged per invoice validated | $4.00 / 1,000 invoices | $3.80 / 1,000 invoices | $3.40 / 1,000 invoices | $2.60 / 1,000 invoices |

Gold, Platinum and Diamond share one price. The price depends on your Apify subscription plan and applies automatically.

Every record in the dataset is charged, valid or not. Entries that were never validated are not charged: an entry that is not text or has no `value`, an invoice over 5 MB and an invoice the validation engine failed on are left out of the dataset and listed in the `FAILED_RECORDS` record of the run's key-value store (with the start of the input, so the record stays small). Retrying them will not change the outcome, so the run does not fail for them. Entries that could not be checked for a temporary reason are also not charged, and the run ends with a message so you can retry them. The same applies to a URL that could not be fetched (HTTP error, timeout, larger than 5 MB, neither XML nor PDF, blocked address, too many redirects): it is listed in `FAILED_RECORDS` with the error code `fetch_failed` and a short reason, and is not charged.

### API Integration

#### cURL

```bash
curl -X POST "https://api.apify.com/v2/acts/bite-sized-insights~bulk-e-invoice-validator/runs?token=YOUR_API_TOKEN" \
  -H "Content-Type: application/json" \
  -d '{"invoices": [{"name": "invoice-001.xml", "value": "<?xml version=\"1.0\" encoding=\"UTF-8\"?><ubl:Invoice xmlns:ubl=\"urn:oasis:names:specification:ubl:schema:xsd:Invoice-2\"/>"}]}'
```

#### Python

```python
import base64
from pathlib import Path

from apify_client import ApifyClient

client = ApifyClient("YOUR_API_TOKEN")

pdf = base64.b64encode(Path("rechnung.pdf").read_bytes()).decode()
run = client.actor("bite-sized-insights/bulk-e-invoice-validator").call(
    run_input={"invoices": [{"name": "rechnung.pdf", "value": pdf}]}
)

for item in client.dataset(run["defaultDatasetId"]).iterate_items():
    print(f"{item['name']}: valid={item['valid']} errors={item['error_count']} profile={item['profile']}")
    for finding in item["errors"]:
        print(f"  {finding['rule']}: {finding['message']}")
```

#### JavaScript

```javascript
import { ApifyClient } from 'apify-client';
import { readFileSync } from 'node:fs';

const client = new ApifyClient({ token: 'YOUR_API_TOKEN' });

const run = await client.actor('bite-sized-insights/bulk-e-invoice-validator').call({
    invoices: [{ name: 'invoice-001.xml', value: readFileSync('invoice-001.xml', 'utf8') }],
});

const { items } = await client.dataset(run.defaultDatasetId).listItems();
items.forEach(item => {
    console.log(`${item.name}: valid=${item.valid} errors=${item.error_count}`);
});
```

### Use Cases

- **Accounts Payable**: Reject non-compliant supplier e-invoices before they reach booking or approval
- **ERP and Billing Testing**: Check the XRechnung and Factur-X files your system generates against the reference rules in CI or before a release
- **Public Sector Billing**: Verify XRechnung invoices before submitting them to a German public-sector portal
- **E-Invoicing Migration**: Batch-check an archive of PDF invoices to see which already carry a valid embedded ZUGFeRD / Factur-X XML
- **Service Providers**: Add a validation step with a clear findings list to an invoice-exchange or conversion service

### FAQ

#### Is the verdict the same as the KoSIT validator's?

For XRechnung and plain EN 16931 invoices the same configuration is used (XRechnung 3.0.2, EN 16931 1.3.16): XML Schema, then the EN 16931 and XRechnung Schematron rules with the scenario's severity overrides. ZUGFeRD / Factur-X profile-specific rules are not part of that configuration and are not checked.

#### Does it support Peppol BIS Billing 3.0?

Yes, for UBL invoices and credit notes with the specification identifier `urn:cen.eu:en16931:2017#compliant#urn:fdc:peppol.eu:2017:poacc:billing:3.0`: XML Schema, then the EN 16931 rules, then the OpenPeppol rules of release 3.0.22 (`PEPPOL-EN16931-*`, finding stage `peppol`), including the national DE, DK, GR, IS, IT, NL, NO and SE rules the BIS carries (they apply by the countries of the parties). The result carries the ProfileID in `profile` and the scenario `Peppol BIS Billing 3.0 (UBL Invoice)` or `(UBL CreditNote)`. Not covered: Peppol BIS in CII (the BIS has no CII binding), other Peppol identifiers such as extensions or self-billing (`valid: false` with a `reason`, never silently checked against plain EN 16931), the SBDH envelope, Peppol network delivery and participant lookups. An XRechnung invoice sent over Peppol carries its own XRechnung identifier and is validated as XRechnung.

#### Does it validate Polish KSeF (FA(3)) and Italian FatturaPA invoices?

Yes, the format is detected from the document. KSeF FA(3) invoices are checked against the official XML Schema plus a few KSeF checks (UTF-8 without BOM, no processing instructions, NIP check digit, duplicate line numbers, issue date not in the future). FatturaPA (1.2 for PA and private customers, and the simplified invoice) is checked against the official XML Schema only: there are no SDI business rules and no `.p7m` files (send the XML inside). A valid result is a pre-flight result, not an acceptance by KSeF or SDI.

#### What are the size limits?

5 MB per invoice after base64 decoding (the XML, or the embedded XML for a PDF). Larger invoices are not validated or charged (see Pricing). One run takes up to 1,000 invoices; the platform also limits the total size of the run input (about 9 MB for an API call), so send PDFs in several runs. Runs are split into backend requests automatically.

#### What happens to an entry that is not text, has no value or is too large?

It is skipped, with no dataset record and no charge (details under Pricing). The `index` of the other records still counts the skipped entries.

#### Which URLs can I pass, and what happens when one cannot be fetched?

Public `http://` and `https://` URLs (ports 80 and 443, up to 5 redirects, at most 5 MB per document, no login or cookies). The document must be XML or a PDF. Addresses on private or internal networks are blocked for safety. The actor fetches all URLs first and then validates the content, so very slow servers can cost time: a URL that does not fit into the time left of the run counts as not fetched. A URL that cannot be fetched is skipped with no dataset record and no charge, and is listed in `FAILED_RECORDS` with the error code `fetch_failed` (the `index` of the other records still counts it). Run it again once the document is reachable.

#### What happens to an invoice that is not valid XML?

The run continues. That invoice gets `valid: false`, no findings and a `reason` such as "not well-formed XML" or "no embedded invoice XML", and it is counted like any other invoice.

#### Are the results in the same order as my input?

Yes. The record with `index: N` belongs to invoice number N of the input.

#### Is my data stored or shared anywhere?

No. Input is processed for the duration of the run only and results are written to your own private run dataset, same as any other Apify actor.

### Free plan

Free-plan users get 5 runs in total. Each free run validates only the first 10 entries of your input (the rest is ignored without an error) and returns at most 10 results. Console test runs have the same cap.

### Related Actors

- [bulk email checker](https://apify.com/bite-sized-insights/validator-email) - Check deliverability and syntax in bulk.
- [email, phone, IBAN and BIC validator](https://apify.com/bite-sized-insights/bulk-email-phone-iban-bic-validator) - Validate mixed lists in one run.
- [check phone numbers in bulk](https://apify.com/bite-sized-insights/validator-phone) - Normalize to E.164 and detect line types.

### Disclaimer

This actor validates invoices against format and rule sets and does not give legal or tax advice. A valid result means no rule violation was found by the checks described above; it does not guarantee that a recipient's system accepts the invoice. Rules change over time; results reflect the version of the actor you run.

Attribution: the Peppol BIS Billing 3.0 validation rules are published by OpenPeppol AISBL (copyright OpenPeppol AISBL) and are built on the CEN EN 16931 validation artefacts (EUPL-1.2). Not affiliated with, endorsed by or certified by OpenPeppol AISBL. Peppol is a name of OpenPeppol AISBL; it is used here only to describe the format this actor validates. This actor is not a Peppol Access Point or Service Provider and does not send or receive documents over the Peppol network.

***

**Need help?** Open an issue on the actor's repository or contact support through Apify Console.

# Actor input Schema

## `invoices` (type: `array`):

Invoices to validate (free and test runs: first 10). An entry is the invoice as XML text, base64 of the XML or base64 of a ZUGFeRD / Factur-X PDF, or an object {"value", "name"} with an optional label that is copied to the result. Or a URL: a text starting with http:// or https://, or an object {"url", "name"}; the actor fetches the XML or PDF itself (public addresses only, ports 80 and 443, no login or cookies, at most 5 MB). At most 5 MB per invoice and 1,000 invoices per run; the platform also limits the total input size (about 9 MB), so split large PDFs over several runs.

## Actor input object example

```json
{
  "invoices": [
    "<?xml version=\"1.0\" encoding=\"UTF-8\"?><ubl:Invoice xmlns:ubl=\"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:xeinkauf.de:kosit:xrechnung_3.0</cbc:CustomizationID><cbc:ProfileID>urn:fdc:peppol.eu:2017:poacc:billing:01:1.0</cbc:ProfileID><cbc:ID>1234/78/901</cbc:ID><cbc:IssueDate>2016-06-16</cbc:IssueDate><cbc:InvoiceTypeCode>380</cbc:InvoiceTypeCode><cbc:DocumentCurrencyCode>EUR</cbc:DocumentCurrencyCode><cbc:BuyerReference>04011000-12348-91</cbc:BuyerReference><cac:AccountingSupplierParty><cac:Party><cbc:EndpointID schemeID=\"EM\">seller@email.de</cbc:EndpointID><cac:PartyName><cbc:Name>[Seller trading name]</cbc:Name></cac:PartyName><cac:PostalAddress><cbc:StreetName>[Seller address line 1]</cbc:StreetName><cbc:AdditionalStreetName>[Seller address line 2]</cbc:AdditionalStreetName><cbc:CityName>[Seller city]</cbc:CityName><cbc:PostalZone>12345</cbc:PostalZone><cac:Country><cbc:IdentificationCode>DE</cbc:IdentificationCode></cac:Country></cac:PostalAddress><cac:PartyTaxScheme><cbc:CompanyID>12/345/67890</cbc:CompanyID><cac:TaxScheme><cbc:ID>???</cbc:ID></cac:TaxScheme></cac:PartyTaxScheme><cac:PartyLegalEntity><cbc:RegistrationName>[Seller name]</cbc:RegistrationName><cbc:CompanyID>VR 12345 Nz</cbc:CompanyID><cbc:CompanyLegalForm>Vorstand: [...] (Vorsitzender), […] (Stellvertreterin), Dr. […] (Schatzmeister); Beirat: […] (Vorsitzender); Geschäftsführung: […], AG […], FA für Körperschaften […]</cbc:CompanyLegalForm></cac:PartyLegalEntity><cac:Contact><cbc:Name>[…]</cbc:Name><cbc:Telephone>+49 (0)12-345678-90</cbc:Telephone><cbc:ElectronicMail>mail@seller.eu</cbc:ElectronicMail></cac:Contact></cac:Party></cac:AccountingSupplierParty><cac:AccountingCustomerParty><cac:Party><cbc:EndpointID schemeID=\"EM\">buyer@info.de</cbc:EndpointID><cac:PostalAddress><cbc:StreetName>[Buyer address line 1]</cbc:StreetName><cbc:AdditionalStreetName>[Buyer address line 2]</cbc:AdditionalStreetName><cbc:CityName>[Buyer city]</cbc:CityName><cbc:PostalZone>12345</cbc:PostalZone><cac:Country><cbc:IdentificationCode>DE</cbc:IdentificationCode></cac:Country></cac:PostalAddress><cac:PartyLegalEntity><cbc:RegistrationName>[Buyer name]</cbc:RegistrationName></cac:PartyLegalEntity><cac:Contact><cbc:Name>[Buyer contact person]</cbc:Name></cac:Contact></cac:Party></cac:AccountingCustomerParty><cac:PaymentMeans><cbc:PaymentMeansCode>58</cbc:PaymentMeansCode><cac:PayeeFinancialAccount><cbc:ID>DE79000000001234567890</cbc:ID></cac:PayeeFinancialAccount></cac:PaymentMeans><cac:PaymentTerms><cbc:Note>Wir möchten Sie bitten, die Teilnahmegebühr iHv. 120,00 € innerhalb von 14 Tagen auf das oben genannte Konto unter Angabe der Rechnungsnummer 1234/78/901 zu überweisen.</cbc:Note></cac:PaymentTerms><cac:TaxTotal><cbc:TaxAmount currencyID=\"EUR\">0</cbc:TaxAmount><cac:TaxSubtotal><cbc:TaxableAmount currencyID=\"EUR\">120</cbc:TaxableAmount><cbc:TaxAmount currencyID=\"EUR\">0</cbc:TaxAmount><cac:TaxCategory><cbc:ID>O</cbc:ID><cbc:Percent>0</cbc:Percent><cbc:TaxExemptionReason>als gemeinnützig anerkannt</cbc:TaxExemptionReason><cac:TaxScheme><cbc:ID>VAT</cbc:ID></cac:TaxScheme></cac:TaxCategory></cac:TaxSubtotal></cac:TaxTotal><cac:LegalMonetaryTotal><cbc:LineExtensionAmount currencyID=\"EUR\">120</cbc:LineExtensionAmount><cbc:TaxExclusiveAmount currencyID=\"EUR\">120</cbc:TaxExclusiveAmount><cbc:TaxInclusiveAmount currencyID=\"EUR\">120</cbc:TaxInclusiveAmount><cbc:PayableAmount currencyID=\"EUR\">120</cbc:PayableAmount></cac:LegalMonetaryTotal><cac:InvoiceLine><cbc:ID>Teilnahmegebühr</cbc:ID><cbc:InvoicedQuantity unitCode=\"XPP\">1</cbc:InvoicedQuantity><cbc:LineExtensionAmount currencyID=\"EUR\">120</cbc:LineExtensionAmount><cac:Item><cbc:Description>Anmeldung von […]</cbc:Description><cbc:Name>Teilnahmegebühr</cbc:Name><cac:ClassifiedTaxCategory><cbc:ID>O</cbc:ID><cac:TaxScheme><cbc:ID>VAT</cbc:ID></cac:TaxScheme></cac:ClassifiedTaxCategory></cac:Item><cac:Price><cbc:PriceAmount currencyID=\"EUR\">120</cbc:PriceAmount></cac:Price></cac:InvoiceLine></ubl:Invoice>"
  ]
}
```

# Actor output Schema

## `results` (type: `string`):

Per-invoice results: verdict, syntax, kind, profile and the validation findings

# API

You can run this Actor programmatically using our API. Below are code examples in JavaScript, Python, and CLI, as well as the OpenAPI specification and MCP server setup.

## JavaScript example

```javascript
import { ApifyClient } from 'apify-client';

// Initialize the ApifyClient with your Apify API token
// Replace the '<YOUR_API_TOKEN>' with your token
const client = new ApifyClient({
    token: '<YOUR_API_TOKEN>',
});

// Prepare Actor input
const input = {
    "invoices": [
        "<?xml version=\"1.0\" encoding=\"UTF-8\"?><ubl:Invoice xmlns:ubl=\"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:xeinkauf.de:kosit:xrechnung_3.0</cbc:CustomizationID><cbc:ProfileID>urn:fdc:peppol.eu:2017:poacc:billing:01:1.0</cbc:ProfileID><cbc:ID>1234/78/901</cbc:ID><cbc:IssueDate>2016-06-16</cbc:IssueDate><cbc:InvoiceTypeCode>380</cbc:InvoiceTypeCode><cbc:DocumentCurrencyCode>EUR</cbc:DocumentCurrencyCode><cbc:BuyerReference>04011000-12348-91</cbc:BuyerReference><cac:AccountingSupplierParty><cac:Party><cbc:EndpointID schemeID=\"EM\">seller@email.de</cbc:EndpointID><cac:PartyName><cbc:Name>[Seller trading name]</cbc:Name></cac:PartyName><cac:PostalAddress><cbc:StreetName>[Seller address line 1]</cbc:StreetName><cbc:AdditionalStreetName>[Seller address line 2]</cbc:AdditionalStreetName><cbc:CityName>[Seller city]</cbc:CityName><cbc:PostalZone>12345</cbc:PostalZone><cac:Country><cbc:IdentificationCode>DE</cbc:IdentificationCode></cac:Country></cac:PostalAddress><cac:PartyTaxScheme><cbc:CompanyID>12/345/67890</cbc:CompanyID><cac:TaxScheme><cbc:ID>???</cbc:ID></cac:TaxScheme></cac:PartyTaxScheme><cac:PartyLegalEntity><cbc:RegistrationName>[Seller name]</cbc:RegistrationName><cbc:CompanyID>VR 12345 Nz</cbc:CompanyID><cbc:CompanyLegalForm>Vorstand: [...] (Vorsitzender), […] (Stellvertreterin), Dr. […] (Schatzmeister); Beirat: […] (Vorsitzender); Geschäftsführung: […], AG […], FA für Körperschaften […]</cbc:CompanyLegalForm></cac:PartyLegalEntity><cac:Contact><cbc:Name>[…]</cbc:Name><cbc:Telephone>+49 (0)12-345678-90</cbc:Telephone><cbc:ElectronicMail>mail@seller.eu</cbc:ElectronicMail></cac:Contact></cac:Party></cac:AccountingSupplierParty><cac:AccountingCustomerParty><cac:Party><cbc:EndpointID schemeID=\"EM\">buyer@info.de</cbc:EndpointID><cac:PostalAddress><cbc:StreetName>[Buyer address line 1]</cbc:StreetName><cbc:AdditionalStreetName>[Buyer address line 2]</cbc:AdditionalStreetName><cbc:CityName>[Buyer city]</cbc:CityName><cbc:PostalZone>12345</cbc:PostalZone><cac:Country><cbc:IdentificationCode>DE</cbc:IdentificationCode></cac:Country></cac:PostalAddress><cac:PartyLegalEntity><cbc:RegistrationName>[Buyer name]</cbc:RegistrationName></cac:PartyLegalEntity><cac:Contact><cbc:Name>[Buyer contact person]</cbc:Name></cac:Contact></cac:Party></cac:AccountingCustomerParty><cac:PaymentMeans><cbc:PaymentMeansCode>58</cbc:PaymentMeansCode><cac:PayeeFinancialAccount><cbc:ID>DE79000000001234567890</cbc:ID></cac:PayeeFinancialAccount></cac:PaymentMeans><cac:PaymentTerms><cbc:Note>Wir möchten Sie bitten, die Teilnahmegebühr iHv. 120,00 € innerhalb von 14 Tagen auf das oben genannte Konto unter Angabe der Rechnungsnummer 1234/78/901 zu überweisen.</cbc:Note></cac:PaymentTerms><cac:TaxTotal><cbc:TaxAmount currencyID=\"EUR\">0</cbc:TaxAmount><cac:TaxSubtotal><cbc:TaxableAmount currencyID=\"EUR\">120</cbc:TaxableAmount><cbc:TaxAmount currencyID=\"EUR\">0</cbc:TaxAmount><cac:TaxCategory><cbc:ID>O</cbc:ID><cbc:Percent>0</cbc:Percent><cbc:TaxExemptionReason>als gemeinnützig anerkannt</cbc:TaxExemptionReason><cac:TaxScheme><cbc:ID>VAT</cbc:ID></cac:TaxScheme></cac:TaxCategory></cac:TaxSubtotal></cac:TaxTotal><cac:LegalMonetaryTotal><cbc:LineExtensionAmount currencyID=\"EUR\">120</cbc:LineExtensionAmount><cbc:TaxExclusiveAmount currencyID=\"EUR\">120</cbc:TaxExclusiveAmount><cbc:TaxInclusiveAmount currencyID=\"EUR\">120</cbc:TaxInclusiveAmount><cbc:PayableAmount currencyID=\"EUR\">120</cbc:PayableAmount></cac:LegalMonetaryTotal><cac:InvoiceLine><cbc:ID>Teilnahmegebühr</cbc:ID><cbc:InvoicedQuantity unitCode=\"XPP\">1</cbc:InvoicedQuantity><cbc:LineExtensionAmount currencyID=\"EUR\">120</cbc:LineExtensionAmount><cac:Item><cbc:Description>Anmeldung von […]</cbc:Description><cbc:Name>Teilnahmegebühr</cbc:Name><cac:ClassifiedTaxCategory><cbc:ID>O</cbc:ID><cac:TaxScheme><cbc:ID>VAT</cbc:ID></cac:TaxScheme></cac:ClassifiedTaxCategory></cac:Item><cac:Price><cbc:PriceAmount currencyID=\"EUR\">120</cbc:PriceAmount></cac:Price></cac:InvoiceLine></ubl:Invoice>"
    ]
};

// Run the Actor and wait for it to finish
const run = await client.actor("bite-sized-insights/bulk-e-invoice-validator").call(input);

// Fetch and print Actor results from the run's dataset (if any)
console.log('Results from dataset');
console.log(`💾 Check your data here: https://console.apify.com/storage/datasets/${run.defaultDatasetId}`);
const { items } = await client.dataset(run.defaultDatasetId).listItems();
items.forEach((item) => {
    console.dir(item);
});

// 📚 Want to learn more 📖? Go to → https://docs.apify.com/api/client/js/docs

```

## Python example

```python
from apify_client import ApifyClient

# Initialize the ApifyClient with your Apify API token
# Replace '<YOUR_API_TOKEN>' with your token.
client = ApifyClient("<YOUR_API_TOKEN>")

# Prepare the Actor input
run_input = { "invoices": ["<?xml version=\"1.0\" encoding=\"UTF-8\"?><ubl:Invoice xmlns:ubl=\"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:xeinkauf.de:kosit:xrechnung_3.0</cbc:CustomizationID><cbc:ProfileID>urn:fdc:peppol.eu:2017:poacc:billing:01:1.0</cbc:ProfileID><cbc:ID>1234/78/901</cbc:ID><cbc:IssueDate>2016-06-16</cbc:IssueDate><cbc:InvoiceTypeCode>380</cbc:InvoiceTypeCode><cbc:DocumentCurrencyCode>EUR</cbc:DocumentCurrencyCode><cbc:BuyerReference>04011000-12348-91</cbc:BuyerReference><cac:AccountingSupplierParty><cac:Party><cbc:EndpointID schemeID=\"EM\">seller@email.de</cbc:EndpointID><cac:PartyName><cbc:Name>[Seller trading name]</cbc:Name></cac:PartyName><cac:PostalAddress><cbc:StreetName>[Seller address line 1]</cbc:StreetName><cbc:AdditionalStreetName>[Seller address line 2]</cbc:AdditionalStreetName><cbc:CityName>[Seller city]</cbc:CityName><cbc:PostalZone>12345</cbc:PostalZone><cac:Country><cbc:IdentificationCode>DE</cbc:IdentificationCode></cac:Country></cac:PostalAddress><cac:PartyTaxScheme><cbc:CompanyID>12/345/67890</cbc:CompanyID><cac:TaxScheme><cbc:ID>???</cbc:ID></cac:TaxScheme></cac:PartyTaxScheme><cac:PartyLegalEntity><cbc:RegistrationName>[Seller name]</cbc:RegistrationName><cbc:CompanyID>VR 12345 Nz</cbc:CompanyID><cbc:CompanyLegalForm>Vorstand: [...] (Vorsitzender), […] (Stellvertreterin), Dr. […] (Schatzmeister); Beirat: […] (Vorsitzender); Geschäftsführung: […], AG […], FA für Körperschaften […]</cbc:CompanyLegalForm></cac:PartyLegalEntity><cac:Contact><cbc:Name>[…]</cbc:Name><cbc:Telephone>+49 (0)12-345678-90</cbc:Telephone><cbc:ElectronicMail>mail@seller.eu</cbc:ElectronicMail></cac:Contact></cac:Party></cac:AccountingSupplierParty><cac:AccountingCustomerParty><cac:Party><cbc:EndpointID schemeID=\"EM\">buyer@info.de</cbc:EndpointID><cac:PostalAddress><cbc:StreetName>[Buyer address line 1]</cbc:StreetName><cbc:AdditionalStreetName>[Buyer address line 2]</cbc:AdditionalStreetName><cbc:CityName>[Buyer city]</cbc:CityName><cbc:PostalZone>12345</cbc:PostalZone><cac:Country><cbc:IdentificationCode>DE</cbc:IdentificationCode></cac:Country></cac:PostalAddress><cac:PartyLegalEntity><cbc:RegistrationName>[Buyer name]</cbc:RegistrationName></cac:PartyLegalEntity><cac:Contact><cbc:Name>[Buyer contact person]</cbc:Name></cac:Contact></cac:Party></cac:AccountingCustomerParty><cac:PaymentMeans><cbc:PaymentMeansCode>58</cbc:PaymentMeansCode><cac:PayeeFinancialAccount><cbc:ID>DE79000000001234567890</cbc:ID></cac:PayeeFinancialAccount></cac:PaymentMeans><cac:PaymentTerms><cbc:Note>Wir möchten Sie bitten, die Teilnahmegebühr iHv. 120,00 € innerhalb von 14 Tagen auf das oben genannte Konto unter Angabe der Rechnungsnummer 1234/78/901 zu überweisen.</cbc:Note></cac:PaymentTerms><cac:TaxTotal><cbc:TaxAmount currencyID=\"EUR\">0</cbc:TaxAmount><cac:TaxSubtotal><cbc:TaxableAmount currencyID=\"EUR\">120</cbc:TaxableAmount><cbc:TaxAmount currencyID=\"EUR\">0</cbc:TaxAmount><cac:TaxCategory><cbc:ID>O</cbc:ID><cbc:Percent>0</cbc:Percent><cbc:TaxExemptionReason>als gemeinnützig anerkannt</cbc:TaxExemptionReason><cac:TaxScheme><cbc:ID>VAT</cbc:ID></cac:TaxScheme></cac:TaxCategory></cac:TaxSubtotal></cac:TaxTotal><cac:LegalMonetaryTotal><cbc:LineExtensionAmount currencyID=\"EUR\">120</cbc:LineExtensionAmount><cbc:TaxExclusiveAmount currencyID=\"EUR\">120</cbc:TaxExclusiveAmount><cbc:TaxInclusiveAmount currencyID=\"EUR\">120</cbc:TaxInclusiveAmount><cbc:PayableAmount currencyID=\"EUR\">120</cbc:PayableAmount></cac:LegalMonetaryTotal><cac:InvoiceLine><cbc:ID>Teilnahmegebühr</cbc:ID><cbc:InvoicedQuantity unitCode=\"XPP\">1</cbc:InvoicedQuantity><cbc:LineExtensionAmount currencyID=\"EUR\">120</cbc:LineExtensionAmount><cac:Item><cbc:Description>Anmeldung von […]</cbc:Description><cbc:Name>Teilnahmegebühr</cbc:Name><cac:ClassifiedTaxCategory><cbc:ID>O</cbc:ID><cac:TaxScheme><cbc:ID>VAT</cbc:ID></cac:TaxScheme></cac:ClassifiedTaxCategory></cac:Item><cac:Price><cbc:PriceAmount currencyID=\"EUR\">120</cbc:PriceAmount></cac:Price></cac:InvoiceLine></ubl:Invoice>"] }

# Run the Actor and wait for it to finish
run = client.actor("bite-sized-insights/bulk-e-invoice-validator").call(run_input=run_input)

# Fetch and print Actor results from the run's dataset (if there are any)
print(f"💾 Check your data here: https://console.apify.com/storage/datasets/{run.default_dataset_id}")
for item in client.dataset(run.default_dataset_id).iterate_items():
    print(item)

# 📚 Want to learn more 📖? Go to → https://docs.apify.com/api/client/python/docs/quick-start

```

## CLI example

```bash
echo '{
  "invoices": [
    "<?xml version=\\"1.0\\" encoding=\\"UTF-8\\"?><ubl:Invoice xmlns:ubl=\\"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:xeinkauf.de:kosit:xrechnung_3.0</cbc:CustomizationID><cbc:ProfileID>urn:fdc:peppol.eu:2017:poacc:billing:01:1.0</cbc:ProfileID><cbc:ID>1234/78/901</cbc:ID><cbc:IssueDate>2016-06-16</cbc:IssueDate><cbc:InvoiceTypeCode>380</cbc:InvoiceTypeCode><cbc:DocumentCurrencyCode>EUR</cbc:DocumentCurrencyCode><cbc:BuyerReference>04011000-12348-91</cbc:BuyerReference><cac:AccountingSupplierParty><cac:Party><cbc:EndpointID schemeID=\\"EM\\">seller@email.de</cbc:EndpointID><cac:PartyName><cbc:Name>[Seller trading name]</cbc:Name></cac:PartyName><cac:PostalAddress><cbc:StreetName>[Seller address line 1]</cbc:StreetName><cbc:AdditionalStreetName>[Seller address line 2]</cbc:AdditionalStreetName><cbc:CityName>[Seller city]</cbc:CityName><cbc:PostalZone>12345</cbc:PostalZone><cac:Country><cbc:IdentificationCode>DE</cbc:IdentificationCode></cac:Country></cac:PostalAddress><cac:PartyTaxScheme><cbc:CompanyID>12/345/67890</cbc:CompanyID><cac:TaxScheme><cbc:ID>???</cbc:ID></cac:TaxScheme></cac:PartyTaxScheme><cac:PartyLegalEntity><cbc:RegistrationName>[Seller name]</cbc:RegistrationName><cbc:CompanyID>VR 12345 Nz</cbc:CompanyID><cbc:CompanyLegalForm>Vorstand: [...] (Vorsitzender), […] (Stellvertreterin), Dr. […] (Schatzmeister); Beirat: […] (Vorsitzender); Geschäftsführung: […], AG […], FA für Körperschaften […]</cbc:CompanyLegalForm></cac:PartyLegalEntity><cac:Contact><cbc:Name>[…]</cbc:Name><cbc:Telephone>+49 (0)12-345678-90</cbc:Telephone><cbc:ElectronicMail>mail@seller.eu</cbc:ElectronicMail></cac:Contact></cac:Party></cac:AccountingSupplierParty><cac:AccountingCustomerParty><cac:Party><cbc:EndpointID schemeID=\\"EM\\">buyer@info.de</cbc:EndpointID><cac:PostalAddress><cbc:StreetName>[Buyer address line 1]</cbc:StreetName><cbc:AdditionalStreetName>[Buyer address line 2]</cbc:AdditionalStreetName><cbc:CityName>[Buyer city]</cbc:CityName><cbc:PostalZone>12345</cbc:PostalZone><cac:Country><cbc:IdentificationCode>DE</cbc:IdentificationCode></cac:Country></cac:PostalAddress><cac:PartyLegalEntity><cbc:RegistrationName>[Buyer name]</cbc:RegistrationName></cac:PartyLegalEntity><cac:Contact><cbc:Name>[Buyer contact person]</cbc:Name></cac:Contact></cac:Party></cac:AccountingCustomerParty><cac:PaymentMeans><cbc:PaymentMeansCode>58</cbc:PaymentMeansCode><cac:PayeeFinancialAccount><cbc:ID>DE79000000001234567890</cbc:ID></cac:PayeeFinancialAccount></cac:PaymentMeans><cac:PaymentTerms><cbc:Note>Wir möchten Sie bitten, die Teilnahmegebühr iHv. 120,00 € innerhalb von 14 Tagen auf das oben genannte Konto unter Angabe der Rechnungsnummer 1234/78/901 zu überweisen.</cbc:Note></cac:PaymentTerms><cac:TaxTotal><cbc:TaxAmount currencyID=\\"EUR\\">0</cbc:TaxAmount><cac:TaxSubtotal><cbc:TaxableAmount currencyID=\\"EUR\\">120</cbc:TaxableAmount><cbc:TaxAmount currencyID=\\"EUR\\">0</cbc:TaxAmount><cac:TaxCategory><cbc:ID>O</cbc:ID><cbc:Percent>0</cbc:Percent><cbc:TaxExemptionReason>als gemeinnützig anerkannt</cbc:TaxExemptionReason><cac:TaxScheme><cbc:ID>VAT</cbc:ID></cac:TaxScheme></cac:TaxCategory></cac:TaxSubtotal></cac:TaxTotal><cac:LegalMonetaryTotal><cbc:LineExtensionAmount currencyID=\\"EUR\\">120</cbc:LineExtensionAmount><cbc:TaxExclusiveAmount currencyID=\\"EUR\\">120</cbc:TaxExclusiveAmount><cbc:TaxInclusiveAmount currencyID=\\"EUR\\">120</cbc:TaxInclusiveAmount><cbc:PayableAmount currencyID=\\"EUR\\">120</cbc:PayableAmount></cac:LegalMonetaryTotal><cac:InvoiceLine><cbc:ID>Teilnahmegebühr</cbc:ID><cbc:InvoicedQuantity unitCode=\\"XPP\\">1</cbc:InvoicedQuantity><cbc:LineExtensionAmount currencyID=\\"EUR\\">120</cbc:LineExtensionAmount><cac:Item><cbc:Description>Anmeldung von […]</cbc:Description><cbc:Name>Teilnahmegebühr</cbc:Name><cac:ClassifiedTaxCategory><cbc:ID>O</cbc:ID><cac:TaxScheme><cbc:ID>VAT</cbc:ID></cac:TaxScheme></cac:ClassifiedTaxCategory></cac:Item><cac:Price><cbc:PriceAmount currencyID=\\"EUR\\">120</cbc:PriceAmount></cac:Price></cac:InvoiceLine></ubl:Invoice>"
  ]
}' |
apify call bite-sized-insights/bulk-e-invoice-validator --silent --output-dataset

```

## MCP server setup

```json
{
    "mcpServers": {
        "apify": {
            "type": "http",
            "url": "https://mcp.apify.com/?tools=fetch-actor-details,bite-sized-insights/bulk-e-invoice-validator"
        }
    }
}
```

The hosted server signs you in with OAuth on first connect, so no API token belongs in this config. Clients without OAuth support can send an `Authorization: Bearer <APIFY_API_TOKEN>` header instead, using a token from API & Integrations in Apify Console (https://console.apify.com/settings/integrations).

## OpenAPI specification

Download the OpenAPI definition: https://api.apify.com/v2/actors/djed6lYDXnMnxcZGr/builds/XXCEvi8d6W5uvoxMH/openapi.json
