# Peppol E-Invoice Generator & Validator (`ulyssevandamme/peppol-invoice-tools`) Actor

Create Peppol BIS 3.0 UBL invoices and credit notes from simple JSON (VAT and totals computed) and validate any UBL against the official EN 16931 and Peppol rules. For Belgium's e-invoicing mandate.

- **URL**: https://apify.com/ulyssevandamme/peppol-invoice-tools.md
- **Developed by:** [Ulysse Van Damme](https://apify.com/ulyssevandamme) (community)
- **Categories:** Business, Automation
- **Features:** Limited permissions
- **Stats:** 2 total users, 1 monthly users, 100.0% runs succeeded, 0 bookmarks
- **User rating**: No ratings yet

## Pricing

Pay per usage

This Actor is paid per platform usage. The Actor is free to use, and you only pay for the Apify platform usage, which gets cheaper the higher subscription plan you have.

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

## 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

## Peppol BIS 3.0 E-Invoice Generator & Validator

Since **1 January 2026, B2B invoices in Belgium must be sent as structured e-invoices over Peppol**. This actor does the two hard parts:

### 1. Generate compliant UBL invoices from simple JSON

Send invoice data; get back a **Peppol BIS Billing 3.0 UBL XML** (invoice or credit note) that passes the official rules:

- VAT per line, VAT breakdown per category/rate, all totals and rounding computed for you (EN 16931 rules BR-CO-\*)
- Belgian specifics handled: enterprise number → Peppol endpoint `0208:…`, structured payment reference (`+++123/4567/89002+++`), 21/12/6/0% rates
- Reverse charge (`AE`), intra-EU (`K`), exempt (`E`), export (`G`) with the required exemption reasons
- Every generated file is **validated before it is returned**. You get the XML (download link) plus the validation report.

```json
{"invoiceNumber": "2026-0042", "issueDate": "2026-11-01", "dueDate": "2026-12-01", "buyerReference": "PO-7781",
 "paymentReference": "+++123/4567/89002+++",
 "seller": {"name": "My Company BV", "vatNumber": "BE0403170701", "companyId": "0403.170.701", "iban": "BE68539007547034",
            "address": {"street": "Kouter 1", "city": "Gent", "postalCode": "9000", "country": "BE"}},
 "buyer":  {"name": "Customer NV", "vatNumber": "BE0202239951", "companyId": "0202.239.951",
            "address": {"street": "Markt 1", "city": "Roeselare", "postalCode": "8800", "country": "BE"}},
 "lines": [{"description": "Consulting", "quantity": 4, "unitCode": "HUR", "unitPrice": 45, "vatRate": 21},
           {"description": "Books", "quantity": 2, "unitPrice": 18.95, "vatRate": 6}]}
```

### 2. Validate any UBL invoice or credit note

Paste XML or give URLs. Each file is checked against **both official rule sets**:

- **EN 16931** (CEN validation artefacts): the European semantic rules (BR-*, BR-CO-*, BR-CL-\*)
- **Peppol BIS 3.0** (OpenPEPPOL rules): the Peppol-specific rules (PEPPOL-EN16931-\*)

You get `valid: true/false` and every failed rule with its ID, severity, message and XPath location, e.g.
`PEPPOL-EN16931-R003: A buyer reference or purchase order reference MUST be provided.`

### Who uses this

Freelancers and SMEs without an e-invoicing module, developers integrating Peppol into their own software (via the Apify API), accountants checking invoices that a Peppol access point rejected.

This actor creates and checks the invoice files. **Sending** over the Peppol network requires an access point (for example Hermes, which is free in Belgium, or a commercial provider). Upload the generated XML there.

### FAQ

#### How do I create a Peppol invoice without accounting software?

Send the invoice data as JSON (seller, buyer, lines with VAT rate). The actor returns a Peppol BIS Billing 3.0 UBL XML file that you upload to any Peppol access point, such as the free Hermes portal in Belgium.

#### Why was my UBL invoice rejected by the access point?

Paste the XML in validation mode. You get every failed EN 16931 and Peppol BIS 3.0 rule with its ID (for example `PEPPOL-EN16931-R003` for a missing buyer reference), the message and the XPath of the problem.

#### Which rule sets are used?

The official CEN EN 16931 validation artefacts (UBL) and the OpenPEPPOL BIS Billing 3.0 schematron, the same rules access points apply.

#### Does it send the invoice over Peppol?

No. It creates and checks the file. Sending requires a Peppol access point; this tool makes sure the file passes before you upload it.

#### Does it support credit notes and reverse charge?

Yes: invoices and credit notes, VAT categories S, Z, E, AE (reverse charge), K (intra-EU) and G (export), with the required exemption reasons.

**Also searched as:** Peppol e-invoice, UBL invoice generator, e-factuur maken, facture électronique Peppol, XRechnung-compatible UBL, EN 16931 validator.

### Pricing

Pay per invoice generated or validated.

# Actor input Schema

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

Each item: invoiceNumber, issueDate, dueDate, buyerReference, seller{name, vatNumber, companyId, iban, address{street, city, postalCode, country}}, buyer{…}, lines\[{description, quantity, unitPrice, vatRate, vatCategory, unitCode}]. Optional: type ('invoice'|'creditNote'), paymentReference (+++123/4567/89002+++), currency, note, invoiceReference (credit notes). See README.

## `xmlUrls` (type: `array`):

UBL files to validate (URLs). Add one value per line.

## `xmlContents` (type: `array`):

List of XML strings.

## Actor input object example

```json
{
  "invoices": [
    {
      "invoiceNumber": "2026-0001",
      "issueDate": "2026-11-01",
      "dueDate": "2026-12-01",
      "buyerReference": "PO-1",
      "seller": {
        "name": "Example BV",
        "vatNumber": "BE0403170701",
        "companyId": "0403.170.701",
        "iban": "BE68539007547034",
        "address": {
          "street": "Kouter 1",
          "city": "Gent",
          "postalCode": "9000",
          "country": "BE"
        }
      },
      "buyer": {
        "name": "Customer NV",
        "vatNumber": "BE0202239951",
        "companyId": "0202.239.951",
        "address": {
          "street": "Markt 1",
          "city": "Roeselare",
          "postalCode": "8800",
          "country": "BE"
        }
      },
      "lines": [
        {
          "description": "Consulting",
          "quantity": 8,
          "unitCode": "HUR",
          "unitPrice": 95,
          "vatRate": 21
        }
      ]
    }
  ]
}
```

# Actor output Schema

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

All results as a table (also downloadable as JSON, CSV, Excel).

## `files` (type: `string`):

Each generated invoice is stored as <invoiceNumber>.xml; the dataset row has its download link.

# 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": [
        {
            "invoiceNumber": "2026-0001",
            "issueDate": "2026-11-01",
            "dueDate": "2026-12-01",
            "buyerReference": "PO-1",
            "seller": {
                "name": "Example BV",
                "vatNumber": "BE0403170701",
                "companyId": "0403.170.701",
                "iban": "BE68539007547034",
                "address": {
                    "street": "Kouter 1",
                    "city": "Gent",
                    "postalCode": "9000",
                    "country": "BE"
                }
            },
            "buyer": {
                "name": "Customer NV",
                "vatNumber": "BE0202239951",
                "companyId": "0202.239.951",
                "address": {
                    "street": "Markt 1",
                    "city": "Roeselare",
                    "postalCode": "8800",
                    "country": "BE"
                }
            },
            "lines": [
                {
                    "description": "Consulting",
                    "quantity": 8,
                    "unitCode": "HUR",
                    "unitPrice": 95,
                    "vatRate": 21
                }
            ]
        }
    ]
};

// Run the Actor and wait for it to finish
const run = await client.actor("ulyssevandamme/peppol-invoice-tools").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": [{
            "invoiceNumber": "2026-0001",
            "issueDate": "2026-11-01",
            "dueDate": "2026-12-01",
            "buyerReference": "PO-1",
            "seller": {
                "name": "Example BV",
                "vatNumber": "BE0403170701",
                "companyId": "0403.170.701",
                "iban": "BE68539007547034",
                "address": {
                    "street": "Kouter 1",
                    "city": "Gent",
                    "postalCode": "9000",
                    "country": "BE",
                },
            },
            "buyer": {
                "name": "Customer NV",
                "vatNumber": "BE0202239951",
                "companyId": "0202.239.951",
                "address": {
                    "street": "Markt 1",
                    "city": "Roeselare",
                    "postalCode": "8800",
                    "country": "BE",
                },
            },
            "lines": [{
                    "description": "Consulting",
                    "quantity": 8,
                    "unitCode": "HUR",
                    "unitPrice": 95,
                    "vatRate": 21,
                }],
        }] }

# Run the Actor and wait for it to finish
run = client.actor("ulyssevandamme/peppol-invoice-tools").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": [
    {
      "invoiceNumber": "2026-0001",
      "issueDate": "2026-11-01",
      "dueDate": "2026-12-01",
      "buyerReference": "PO-1",
      "seller": {
        "name": "Example BV",
        "vatNumber": "BE0403170701",
        "companyId": "0403.170.701",
        "iban": "BE68539007547034",
        "address": {
          "street": "Kouter 1",
          "city": "Gent",
          "postalCode": "9000",
          "country": "BE"
        }
      },
      "buyer": {
        "name": "Customer NV",
        "vatNumber": "BE0202239951",
        "companyId": "0202.239.951",
        "address": {
          "street": "Markt 1",
          "city": "Roeselare",
          "postalCode": "8800",
          "country": "BE"
        }
      },
      "lines": [
        {
          "description": "Consulting",
          "quantity": 8,
          "unitCode": "HUR",
          "unitPrice": 95,
          "vatRate": 21
        }
      ]
    }
  ]
}' |
apify call ulyssevandamme/peppol-invoice-tools --silent --output-dataset

```

## MCP server setup

```json
{
    "mcpServers": {
        "apify": {
            "type": "http",
            "url": "https://mcp.apify.com/?tools=fetch-actor-details,ulyssevandamme/peppol-invoice-tools"
        }
    }
}
```

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/MUwJVCAZG16seGdtT/builds/4Hi7TdmhRiCcFbKY1/openapi.json
