> ## Documentation Index
> Fetch the complete documentation index at: https://docs.e-invoice.be/llms.txt
> Use this file to discover all available pages before exploring further.

# Create e-invoices

> Validate, create and send an invoice on the Peppol network with the e-invoice.be API.

## Overview

With the e-invoice.be API you create an [invoice](https://docs.e-invoice.be/glossary.md#invoice) from JSON. The API converts the JSON to UBL that complies with the European e-invoicing standard (EN 16931) and transmits the document on the Peppol network.

## Before you start

> [!NOTE]
>
> Develop and test with a sandbox company. A sandbox company runs in test mode: the API sends each document as UBL XML to the contact email address of the company, and nothing goes to the Peppol network. The API host and the endpoints are the same as for a production company. See [Test mode and sandbox companies](https://docs.e-invoice.be/environments.md).

You need the API key of the company. See [Authentication](https://docs.e-invoice.be/authentication.md).

## Workflow

To send an e-invoice, do these steps:

1. **Validate** the JSON invoice data while you develop.
2. **Create** the document. The API accepts only an invoice that it can convert to valid UBL BIS Billing 3.0.
3. **Send** the document. A production company sends on the Peppol network. A sandbox company sends an email.

> [!NOTE]
>
> Validation is not a separate mandatory call. `POST /api/documents/` rejects a payload that does not pass the same rules. Use `POST /api/validate/json` while you develop, because it returns all rule failures and the generated UBL.

## Validate the invoice data

The examples on this page use this payload:

```json Invoice theme={null}
{
  "document_type": "INVOICE",
  "invoice_id": "INV-2026-001",
  "invoice_date": "2026-10-01",
  "due_date": "2026-10-31",
  "currency": "EUR",
  "purchase_order": "PO-12345",
  "vendor_name": "E-INVOICE BV",
  "vendor_tax_id": "BE1018265814",
  "vendor_address": "Brusselsesteenweg 119/A, 1980 Zemst, BE",
  "vendor_email": "billing@e-invoice.be",
  "customer_name": "OpenPeppol VZW",
  "customer_tax_id": "BE0848934496",
  "customer_address": "Robert Schumanplein 6 bus 5, 1040 Brussel, BE",
  "items": [
    {
      "description": "Professional services",
      "quantity": 10,
      "unit": "C62",
      "unit_price": 100.00,
      "amount": 1000.00,
      "tax_rate": 21.00
    }
  ],
  "subtotal": 1000.00,
  "total_tax": 210.00,
  "invoice_total": 1210.00,
  "amount_due": 1210.00,
  "payment_term": "Payment within 30 days",
  "payment_details": [
    {
      "iban": "BE68539007547034",
      "swift": "GEBABEBB",
      "payment_reference": "INV-2026-001"
    }
  ]
}
```

Replace the vendor fields with the data of your company. The API rejects a document if the Peppol ID of the vendor is not one of the `peppol_ids` of your company.

`POST /api/validate/json` does not create a document and does not check the vendor. Thus you can validate the example without changes.

```bash cURL theme={null}
curl -X POST "https://api.e-invoice.be/api/validate/json" \
  -H "Authorization: Bearer $E_INVOICE_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{
  "document_type": "INVOICE",
  "invoice_id": "INV-2026-001",
  "invoice_date": "2026-10-01",
  "due_date": "2026-10-31",
  "currency": "EUR",
  "purchase_order": "PO-12345",
  "vendor_name": "E-INVOICE BV",
  "vendor_tax_id": "BE1018265814",
  "vendor_address": "Brusselsesteenweg 119/A, 1980 Zemst, BE",
  "vendor_email": "billing@e-invoice.be",
  "customer_name": "OpenPeppol VZW",
  "customer_tax_id": "BE0848934496",
  "customer_address": "Robert Schumanplein 6 bus 5, 1040 Brussel, BE",
  "items": [
    {
      "description": "Professional services",
      "quantity": 10,
      "unit": "C62",
      "unit_price": 100.00,
      "amount": 1000.00,
      "tax_rate": "21.00"
    }
  ],
  "subtotal": 1000.00,
  "total_tax": 210.00,
  "invoice_total": 1210.00,
  "amount_due": 1210.00,
  "payment_term": "Payment within 30 days",
  "payment_details": [
    {
      "iban": "BE68539007547034",
      "swift": "GEBABEBB",
      "payment_reference": "INV-2026-001"
    }
  ]
}'
```

```javascript Node.js theme={null}
const invoice = {
  document_type: "INVOICE",
  invoice_id: "INV-2026-001",
  invoice_date: "2026-10-01",
  due_date: "2026-10-31",
  currency: "EUR",
  purchase_order: "PO-12345",
  vendor_name: "E-INVOICE BV",
  vendor_tax_id: "BE1018265814",
  vendor_address: "Brusselsesteenweg 119/A, 1980 Zemst, BE",
  vendor_email: "billing@e-invoice.be",
  customer_name: "OpenPeppol VZW",
  customer_tax_id: "BE0848934496",
  customer_address: "Robert Schumanplein 6 bus 5, 1040 Brussel, BE",
  items: [
    {
      description: "Professional services",
      quantity: 10,
      unit: "C62",
      unit_price: 100.00,
      amount: 1000.00,
      tax_rate: "21.00"
    }
  ],
  subtotal: 1000.00,
  total_tax: 210.00,
  invoice_total: 1210.00,
  amount_due: 1210.00,
  payment_term: "Payment within 30 days",
  payment_details: [
    {
      iban: "BE68539007547034",
      swift: "GEBABEBB",
      payment_reference: "INV-2026-001"
    }
  ]
};

const response = await fetch("https://api.e-invoice.be/api/validate/json", {
  method: "POST",
  headers: {
    Authorization: `Bearer ${process.env.E_INVOICE_API_KEY}`,
    "Content-Type": "application/json",
  },
  body: JSON.stringify(invoice),
});

const result = await response.json();
if (!response.ok) {
  throw new Error(`HTTP ${response.status}: ${JSON.stringify(result)}`);
}
console.log(result);
```

```python Python theme={null}
import os

import requests

invoice = {
  "document_type": "INVOICE",
  "invoice_id": "INV-2026-001",
  "invoice_date": "2026-10-01",
  "due_date": "2026-10-31",
  "currency": "EUR",
  "purchase_order": "PO-12345",
  "vendor_name": "E-INVOICE BV",
  "vendor_tax_id": "BE1018265814",
  "vendor_address": "Brusselsesteenweg 119/A, 1980 Zemst, BE",
  "vendor_email": "billing@e-invoice.be",
  "customer_name": "OpenPeppol VZW",
  "customer_tax_id": "BE0848934496",
  "customer_address": "Robert Schumanplein 6 bus 5, 1040 Brussel, BE",
  "items": [
    {
      "description": "Professional services",
      "quantity": 10,
      "unit": "C62",
      "unit_price": 100.00,
      "amount": 1000.00,
      "tax_rate": "21.00"
    }
  ],
  "subtotal": 1000.00,
  "total_tax": 210.00,
  "invoice_total": 1210.00,
  "amount_due": 1210.00,
  "payment_term": "Payment within 30 days",
  "payment_details": [
    {
      "iban": "BE68539007547034",
      "swift": "GEBABEBB",
      "payment_reference": "INV-2026-001"
    }
  ]
}

response = requests.post(
    "https://api.e-invoice.be/api/validate/json",
    headers={"Authorization": f"Bearer {os.environ['E_INVOICE_API_KEY']}"},
    json=invoice,
    timeout=30,
)
if not response.ok:
    raise SystemExit(f"HTTP {response.status_code}: {response.text}")
print(response.json())
```

```php PHP theme={null}
<?php
$invoice = [
  "document_type" => "INVOICE",
  "invoice_id" => "INV-2026-001",
  "invoice_date" => "2026-10-01",
  "due_date" => "2026-10-31",
  "currency" => "EUR",
  "purchase_order" => "PO-12345",
  "vendor_name" => "E-INVOICE BV",
  "vendor_tax_id" => "BE1018265814",
  "vendor_address" => "Brusselsesteenweg 119/A, 1980 Zemst, BE",
  "vendor_email" => "billing@e-invoice.be",
  "customer_name" => "OpenPeppol VZW",
  "customer_tax_id" => "BE0848934496",
  "customer_address" => "Robert Schumanplein 6 bus 5, 1040 Brussel, BE",
  "items" => [
    [
      "description" => "Professional services",
      "quantity" => 10,
      "unit" => "C62",
      "unit_price" => 100.00,
      "amount" => 1000.00,
      "tax_rate" => "21.00"
    ]
  ],
  "subtotal" => 1000.00,
  "total_tax" => 210.00,
  "invoice_total" => 1210.00,
  "amount_due" => 1210.00,
  "payment_term" => "Payment within 30 days",
  "payment_details" => [
    [
      "iban" => "BE68539007547034",
      "swift" => "GEBABEBB",
      "payment_reference" => "INV-2026-001"
    ]
  ]
];

$ch = curl_init("https://api.e-invoice.be/api/validate/json");
curl_setopt_array($ch, [
    CURLOPT_POST => true,
    CURLOPT_RETURNTRANSFER => true,
    CURLOPT_HTTPHEADER => [
        "Authorization: Bearer " . getenv("E_INVOICE_API_KEY"),
        "Content-Type: application/json",
    ],
    CURLOPT_POSTFIELDS => json_encode($invoice),
]);

$body = curl_exec($ch);
$status = curl_getinfo($ch, CURLINFO_HTTP_CODE);
curl_close($ch);

if ($status >= 400) {
    throw new RuntimeException("HTTP $status: $body");
}
print_r(json_decode($body, true));
```

```csharp C# theme={null}
using System.Net.Http.Headers;
using System.Text;

var invoice = """
{
  "document_type": "INVOICE",
  "invoice_id": "INV-2026-001",
  "invoice_date": "2026-10-01",
  "due_date": "2026-10-31",
  "currency": "EUR",
  "purchase_order": "PO-12345",
  "vendor_name": "E-INVOICE BV",
  "vendor_tax_id": "BE1018265814",
  "vendor_address": "Brusselsesteenweg 119/A, 1980 Zemst, BE",
  "vendor_email": "billing@e-invoice.be",
  "customer_name": "OpenPeppol VZW",
  "customer_tax_id": "BE0848934496",
  "customer_address": "Robert Schumanplein 6 bus 5, 1040 Brussel, BE",
  "items": [
    {
      "description": "Professional services",
      "quantity": 10,
      "unit": "C62",
      "unit_price": 100.00,
      "amount": 1000.00,
      "tax_rate": "21.00"
    }
  ],
  "subtotal": 1000.00,
  "total_tax": 210.00,
  "invoice_total": 1210.00,
  "amount_due": 1210.00,
  "payment_term": "Payment within 30 days",
  "payment_details": [
    {
      "iban": "BE68539007547034",
      "swift": "GEBABEBB",
      "payment_reference": "INV-2026-001"
    }
  ]
}
""";

using var client = new HttpClient { BaseAddress = new Uri("https://api.e-invoice.be") };
client.DefaultRequestHeaders.Authorization = new AuthenticationHeaderValue(
    "Bearer", Environment.GetEnvironmentVariable("E_INVOICE_API_KEY"));

var response = await client.PostAsync(
    "/api/validate/json",
    new StringContent(invoice, Encoding.UTF8, "application/json"));

var body = await response.Content.ReadAsStringAsync();
if (!response.IsSuccessStatusCode)
{
    throw new HttpRequestException($"HTTP {(int)response.StatusCode}: {body}");
}
Console.WriteLine(body);
```

A valid payload gives `is_valid: true`, an empty `issues` list and the generated UBL in `ubl_document`. The UBL is shortened here.

```json Valid theme={null}
{
  "id": "b55354b0-5c69-489b-a8f7-44be7d5bdd6b",
  "file_name": "b55354b0-5c69-489b-a8f7-44be7d5bdd6b.xml",
  "is_valid": true,
  "issues": [],
  "ubl_document": "<?xml version=\"1.0\" encoding=\"UTF-8\"?><Invoice xmlns=\"urn:oasis:names:specification:ubl:schema:xsd:Invoice-2\"> (shortened) </Invoice>"
}
```

A payload that breaks a rule gives `is_valid: false`. Each entry in `issues` has a `message`, a `type` (`error` or `warning`) and the name of the rule set in `schematron`. The fields `rule_id`, `flag`, `location` and `test` are optional. The response also contains the generated UBL in `ubl_document`. Do not send this UBL, because it is not valid.

```json Not valid theme={null}
{
  "id": "b55354b0-5c69-489b-a8f7-44be7d5bdd6b",
  "file_name": "b55354b0-5c69-489b-a8f7-44be7d5bdd6b.xml",
  "is_valid": false,
  "issues": [
    {
      "message": "Belgian enterprise number MUST be stated in the correct format.",
      "type": "error",
      "rule_id": "PEPPOL-COMMON-R043",
      "flag": "fatal",
      "schematron": "PEPPOL-EN16931-UBL"
    }
  ],
  "ubl_document": "<?xml version=\"1.0\" encoding=\"UTF-8\"?><Invoice xmlns=\"urn:oasis:names:specification:ubl:schema:xsd:Invoice-2\"> (shortened) </Invoice>"
}
```

See the [validation guide](https://docs.e-invoice.be/guides/validation.md) for the rules and the corrections. For all status codes and error formats, see [Errors and troubleshooting](https://docs.e-invoice.be/guides/errors.md).

## Create the invoice

Send the same JSON payload to `POST /api/documents/`. Replace the vendor fields with the data of your company before you run this example: the API returns `406` if the Peppol ID of the vendor is not one of the `peppol_ids` of your company.

```bash cURL theme={null}
curl -X POST "https://api.e-invoice.be/api/documents/" \
  -H "Authorization: Bearer $E_INVOICE_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{
  "document_type": "INVOICE",
  "invoice_id": "INV-2026-001",
  "invoice_date": "2026-10-01",
  "due_date": "2026-10-31",
  "currency": "EUR",
  "purchase_order": "PO-12345",
  "vendor_name": "E-INVOICE BV",
  "vendor_tax_id": "BE1018265814",
  "vendor_address": "Brusselsesteenweg 119/A, 1980 Zemst, BE",
  "vendor_email": "billing@e-invoice.be",
  "customer_name": "OpenPeppol VZW",
  "customer_tax_id": "BE0848934496",
  "customer_address": "Robert Schumanplein 6 bus 5, 1040 Brussel, BE",
  "items": [
    {
      "description": "Professional services",
      "quantity": 10,
      "unit": "C62",
      "unit_price": 100.00,
      "amount": 1000.00,
      "tax_rate": "21.00"
    }
  ],
  "subtotal": 1000.00,
  "total_tax": 210.00,
  "invoice_total": 1210.00,
  "amount_due": 1210.00,
  "payment_term": "Payment within 30 days",
  "payment_details": [
    {
      "iban": "BE68539007547034",
      "swift": "GEBABEBB",
      "payment_reference": "INV-2026-001"
    }
  ]
}'
```

```javascript Node.js theme={null}
const invoice = {
  document_type: "INVOICE",
  invoice_id: "INV-2026-001",
  invoice_date: "2026-10-01",
  due_date: "2026-10-31",
  currency: "EUR",
  purchase_order: "PO-12345",
  vendor_name: "E-INVOICE BV",
  vendor_tax_id: "BE1018265814",
  vendor_address: "Brusselsesteenweg 119/A, 1980 Zemst, BE",
  vendor_email: "billing@e-invoice.be",
  customer_name: "OpenPeppol VZW",
  customer_tax_id: "BE0848934496",
  customer_address: "Robert Schumanplein 6 bus 5, 1040 Brussel, BE",
  items: [
    {
      description: "Professional services",
      quantity: 10,
      unit: "C62",
      unit_price: 100.00,
      amount: 1000.00,
      tax_rate: "21.00"
    }
  ],
  subtotal: 1000.00,
  total_tax: 210.00,
  invoice_total: 1210.00,
  amount_due: 1210.00,
  payment_term: "Payment within 30 days",
  payment_details: [
    {
      iban: "BE68539007547034",
      swift: "GEBABEBB",
      payment_reference: "INV-2026-001"
    }
  ]
};

const response = await fetch("https://api.e-invoice.be/api/documents/", {
  method: "POST",
  headers: {
    Authorization: `Bearer ${process.env.E_INVOICE_API_KEY}`,
    "Content-Type": "application/json",
  },
  body: JSON.stringify(invoice),
});

const result = await response.json();
if (!response.ok) {
  throw new Error(`HTTP ${response.status}: ${JSON.stringify(result)}`);
}
console.log(result);
```

```python Python theme={null}
import os

import requests

invoice = {
  "document_type": "INVOICE",
  "invoice_id": "INV-2026-001",
  "invoice_date": "2026-10-01",
  "due_date": "2026-10-31",
  "currency": "EUR",
  "purchase_order": "PO-12345",
  "vendor_name": "E-INVOICE BV",
  "vendor_tax_id": "BE1018265814",
  "vendor_address": "Brusselsesteenweg 119/A, 1980 Zemst, BE",
  "vendor_email": "billing@e-invoice.be",
  "customer_name": "OpenPeppol VZW",
  "customer_tax_id": "BE0848934496",
  "customer_address": "Robert Schumanplein 6 bus 5, 1040 Brussel, BE",
  "items": [
    {
      "description": "Professional services",
      "quantity": 10,
      "unit": "C62",
      "unit_price": 100.00,
      "amount": 1000.00,
      "tax_rate": "21.00"
    }
  ],
  "subtotal": 1000.00,
  "total_tax": 210.00,
  "invoice_total": 1210.00,
  "amount_due": 1210.00,
  "payment_term": "Payment within 30 days",
  "payment_details": [
    {
      "iban": "BE68539007547034",
      "swift": "GEBABEBB",
      "payment_reference": "INV-2026-001"
    }
  ]
}

response = requests.post(
    "https://api.e-invoice.be/api/documents/",
    headers={"Authorization": f"Bearer {os.environ['E_INVOICE_API_KEY']}"},
    json=invoice,
    timeout=30,
)
if not response.ok:
    raise SystemExit(f"HTTP {response.status_code}: {response.text}")
print(response.json())
```

```php PHP theme={null}
<?php
$invoice = [
  "document_type" => "INVOICE",
  "invoice_id" => "INV-2026-001",
  "invoice_date" => "2026-10-01",
  "due_date" => "2026-10-31",
  "currency" => "EUR",
  "purchase_order" => "PO-12345",
  "vendor_name" => "E-INVOICE BV",
  "vendor_tax_id" => "BE1018265814",
  "vendor_address" => "Brusselsesteenweg 119/A, 1980 Zemst, BE",
  "vendor_email" => "billing@e-invoice.be",
  "customer_name" => "OpenPeppol VZW",
  "customer_tax_id" => "BE0848934496",
  "customer_address" => "Robert Schumanplein 6 bus 5, 1040 Brussel, BE",
  "items" => [
    [
      "description" => "Professional services",
      "quantity" => 10,
      "unit" => "C62",
      "unit_price" => 100.00,
      "amount" => 1000.00,
      "tax_rate" => "21.00"
    ]
  ],
  "subtotal" => 1000.00,
  "total_tax" => 210.00,
  "invoice_total" => 1210.00,
  "amount_due" => 1210.00,
  "payment_term" => "Payment within 30 days",
  "payment_details" => [
    [
      "iban" => "BE68539007547034",
      "swift" => "GEBABEBB",
      "payment_reference" => "INV-2026-001"
    ]
  ]
];

$ch = curl_init("https://api.e-invoice.be/api/documents/");
curl_setopt_array($ch, [
    CURLOPT_POST => true,
    CURLOPT_RETURNTRANSFER => true,
    CURLOPT_HTTPHEADER => [
        "Authorization: Bearer " . getenv("E_INVOICE_API_KEY"),
        "Content-Type: application/json",
    ],
    CURLOPT_POSTFIELDS => json_encode($invoice),
]);

$body = curl_exec($ch);
$status = curl_getinfo($ch, CURLINFO_HTTP_CODE);
curl_close($ch);

if ($status >= 400) {
    throw new RuntimeException("HTTP $status: $body");
}
print_r(json_decode($body, true));
```

```csharp C# theme={null}
using System.Net.Http.Headers;
using System.Text;

var invoice = """
{
  "document_type": "INVOICE",
  "invoice_id": "INV-2026-001",
  "invoice_date": "2026-10-01",
  "due_date": "2026-10-31",
  "currency": "EUR",
  "purchase_order": "PO-12345",
  "vendor_name": "E-INVOICE BV",
  "vendor_tax_id": "BE1018265814",
  "vendor_address": "Brusselsesteenweg 119/A, 1980 Zemst, BE",
  "vendor_email": "billing@e-invoice.be",
  "customer_name": "OpenPeppol VZW",
  "customer_tax_id": "BE0848934496",
  "customer_address": "Robert Schumanplein 6 bus 5, 1040 Brussel, BE",
  "items": [
    {
      "description": "Professional services",
      "quantity": 10,
      "unit": "C62",
      "unit_price": 100.00,
      "amount": 1000.00,
      "tax_rate": "21.00"
    }
  ],
  "subtotal": 1000.00,
  "total_tax": 210.00,
  "invoice_total": 1210.00,
  "amount_due": 1210.00,
  "payment_term": "Payment within 30 days",
  "payment_details": [
    {
      "iban": "BE68539007547034",
      "swift": "GEBABEBB",
      "payment_reference": "INV-2026-001"
    }
  ]
}
""";

using var client = new HttpClient { BaseAddress = new Uri("https://api.e-invoice.be") };
client.DefaultRequestHeaders.Authorization = new AuthenticationHeaderValue(
    "Bearer", Environment.GetEnvironmentVariable("E_INVOICE_API_KEY"));

var response = await client.PostAsync(
    "/api/documents/",
    new StringContent(invoice, Encoding.UTF8, "application/json"));

var body = await response.Content.ReadAsStringAsync();
if (!response.IsSuccessStatusCode)
{
    throw new HttpRequestException($"HTTP {(int)response.StatusCode}: {body}");
}
Console.WriteLine(body);
```

The API returns `201 Created` with the complete document in the `DRAFT` state. Amounts are strings in the response. The response is shortened here.

```json theme={null}
{
  "id": "doc-1a2b3c4d5e6f7a8b9c0d1e2f3a4b5c6d",
  "created_at": "2026-10-01T09:15:23.482913Z",
  "document_type": "INVOICE",
  "state": "DRAFT",
  "direction": "OUTBOUND",
  "invoice_id": "INV-2026-001",
  "invoice_date": "2026-10-01",
  "due_date": "2026-10-31",
  "currency": "EUR",
  "vendor_name": "E-INVOICE BV",
  "vendor_tax_id": "BE1018265814",
  "customer_name": "OpenPeppol VZW",
  "customer_tax_id": "BE0848934496",
  "subtotal": "1000.00",
  "total_tax": "210.00",
  "invoice_total": "1210.00",
  "amount_due": "1210.00"
}
```

Keep the `id`. You use it to send the document. If the API rejects the payload, see [Create document errors](https://docs.e-invoice.be/guides/errors.md#create-document-errors-406).

## Invoice structure

### Main fields

The schema marks no field as required, but `items` must contain one line or more (`minItems: 1`). The API also accepts a document only if the generated UBL passes the Peppol BIS Billing 3.0 rules. Thus a complete invoice also needs the fields that this table marks as mandatory, the vendor and customer identifiers, and `vendor_name`. For the full list, see the [document schema](https://docs.e-invoice.be/api-reference/schemas/document.md).

Always send `items` with one line or more:

* `"items": []` gives `422` with the message `List should have at least 1 item after validation, not 0`.
* A body with no `items` key passes the schema check, but the generated UBL has no invoice line. `POST /api/documents/` then returns `406` with an XSD error in the detail (`Provided document details lead to an invalid UBL document: ...`). `POST /api/validate/json` returns `201` with `is_valid` `false` and an issue with `rule_id` `xsd-validation`.

| Field | Description | Mandatory |
| - | - | - |
| `items` | Array of invoice lines | Yes (minimum 1) |
| `document_type` | `INVOICE`, `CREDIT_NOTE`, `DEBIT_NOTE`, `SELFBILLING_INVOICE` or `SELFBILLING_CREDIT_NOTE`. Default: `INVOICE`. See [Self-billing and debit notes](https://docs.e-invoice.be/guides/self-billing.md). | No |
| `invoice_id` | Your unique invoice number | Yes (rule `BR-02`) |
| `invoice_date` | Invoice date (`YYYY-MM-DD`), for example `"2026-10-01"`. If you omit it, the API writes the current date to the UBL (`cbc:IssueDate`). The stored document then has no `invoice_date`. | Recommended |
| `due_date` | Payment due date (`YYYY-MM-DD`) | For an invoice with a positive amount due, `due_date` or `payment_term` is mandatory (rule `BR-CO-25`) |
| `currency` | Currency code, for example `EUR`. Default: `EUR`. | No |

For all fields, see the [document schema](https://docs.e-invoice.be/api-reference/schemas/document.md). For the amounts (`subtotal`, `total_tax`, `invoice_total`, `amount_due`), see [Invoice totals and calculations](https://docs.e-invoice.be/guides/invoice-totals.md).

### Vendor fields

The vendor is the seller. This is your company.

| Field | Description | Example |
| - | - | - |
| `vendor_name` | Company name | `"E-INVOICE BV"` |
| `vendor_tax_id` | [VAT number](https://docs.e-invoice.be/glossary.md#vat-number) with the country prefix | `"BE1018265814"` |
| `vendor_company_id` | Company registration number, for example the Belgian [enterprise number](https://docs.e-invoice.be/glossary.md#enterprise-number) | `"1018265814"` |
| `vendor_address` | Full address | `"Brusselsesteenweg 119/A, 1980 Zemst, BE"` |
| `vendor_email` | Contact email address | `"billing@e-invoice.be"` |
| `vendor_address_recipient` | Recipient name at the vendor address. The UBL also uses it as the vendor contact name (BT-41). | `"Finance Department"` |
| `vendor_phone` | Telephone number of the vendor contact (BT-42) | `"+32 15 12 34 56"` |

> [!NOTE]
>
> The `vendor_tax_id` is the VAT number of the company. It is not the Peppol ID. For a Belgian company, give the full VAT number with the `BE` prefix, for example `BE1018265814`. The API derives the Peppol ID from it when you create the document, and stores that Peppol ID with the UBL. The send request uses the stored Peppol ID if you do not give the query parameters.
>
> The API changes `vendor_tax_id` and `customer_tax_id` to uppercase and removes all characters other than A-Z and 0-9. For example, `"be 1018.265.814"` becomes `"BE1018265814"`.

### Customer fields

The customer is the buyer.

| Field | Description | Example |
| - | - | - |
| `customer_name` | Company name | `"OpenPeppol VZW"` |
| `customer_tax_id` | VAT number with the country prefix | `"BE0848934496"` |
| `customer_company_id` | Company registration number | `"0848934496"` |
| `customer_peppol_id` | Peppol ID of the customer (`scheme:identifier`) | `"0208:0848934496"` |
| `customer_address` | Full address | `"Robert Schumanplein 6 bus 5, 1040 Brussel, BE"` |
| `customer_email` | Contact email address | `"info@openpeppol.org"` |
| `customer_address_recipient` | Recipient name at the customer address. The UBL also uses it as the customer contact name (BT-56). | `"Accounts Payable"` |
| `customer_phone` | Telephone number of the customer contact (BT-57) | `"+32 2 123 45 67"` |

The API writes a contact (`cac:Contact`) for a party when one of its three contact fields has a value: the recipient name, the telephone number or the email address.

> [!NOTE]
>
> When the vendor and the customer are both in Germany, the German rules need a vendor contact name (`DE-R-005`) and a vendor telephone number (`DE-R-006`). The telephone number must contain a minimum of 3 digits (`DE-R-027`, a warning). Example: `"vendor_address_recipient": "Buchhaltung"` and `"vendor_phone": "+49 30 1234567"`.

### Line items

Each object in the `items` array is one product or service:

```json theme={null}
{
  "description": "Professional services",
  "quantity": 10,
  "unit": "C62",
  "unit_price": 100.00,
  "amount": 1000.00,
  "tax_rate": "21.00"
}
```

| Field | Description |
| - | - |
| `name` | Optional. The item name (BT-153), for example the product name. If you omit it or send only spaces, the API uses `description` as the item name. |
| `description` | The product or service that you sell (BT-154). Each line must have a `name` or a `description` (rule `BR-25`). If a line has neither, the API returns `422`. See [Line items with no name](https://docs.e-invoice.be/guides/validation.md#line-items-with-no-name). |
| `quantity` | Quantity, with a maximum of 4 decimals |
| `unit` | [Unit code](https://docs.e-invoice.be/glossary.md#unit-code). Frequent codes: `C62` (unit or piece), `HUR` (hour), `DAY` (day), `MTR` (metre), `KGM` (kilogram). |
| `unit_price` | Price for one unit, without VAT, with a maximum of 4 decimals |
| `price_base_quantity` | Optional. The number of units to which `unit_price` applies (BT-149). Default: `1`. For example, send `100` when `unit_price` is the price for 100 units. |
| `amount` | Line total without VAT: `quantity` x `unit_price` / `price_base_quantity`, minus the line allowances, plus the line charges. When a line has allowances or charges, you must send `amount`. See [Line-level allowances](https://docs.e-invoice.be/guides/advanced-invoicing.md#line-level-allowances). |
| `tax_rate` | VAT percentage from 0 to 100, as a number or a string, for example `21.00`, `"6.00"` or `"0.00"` |

For all line fields, see the [LineItem schema](https://docs.e-invoice.be/api-reference/schemas/line-item.md).

### Optional fields

> [accordion] Payment details
>
> ```json theme={null}
> {
>   "payment_term": "Payment within 30 days",
>   "payment_details": [
>     {
>       "iban": "BE68539007547034",
>       "swift": "GEBABEBB",
>       "payment_reference": "INV-2026-001"
>     }
>   ]
> }
> ```
>
> The API writes `swift` only when `iban` or `bank_account_number` has a value.
>
> A Swedish vendor can give a bankgiro or plusgiro number. Put the number in `bank_account_number`, leave `iban` empty, and set `swift` to `SE:BANKGIRO` or `SE:PLUSGIRO`. The API removes the spaces and hyphens from the number. For example, `"5050-1055"` becomes `50501055` in the UBL:
>
> ```json theme={null}
> {
>   "payment_details": [
>     {
>       "bank_account_number": "5050-1055",
>       "swift": "SE:BANKGIRO",
>       "payment_reference": "INV-2026-001"
>     }
>   ]
> }
> ```

> [accordion] Additional addresses
>
> Of these fields, only `shipping_address` and `shipping_address_recipient` go into the UBL (as the delivery). The API stores the billing, service and remittance addresses with the document, but the receiver does not get them.
>
> ```json theme={null}
> {
>   "billing_address": "Billing Street 1, 1000 Brussels, BE",
>   "billing_address_recipient": "Accounts Payable Department",
>   "shipping_address": "Delivery Street 2, 2000 Antwerp, BE",
>   "shipping_address_recipient": "OpenPeppol VZW Antwerp Warehouse",
>   "service_address": "Service Location 3, 3000 Leuven, BE"
> }
> ```
>
> `shipping_address_recipient` is the name of the deliver-to party (BT-70): the party that receives the goods or services. It is not the name of a contact person. The API writes it to `cac:Delivery/cac:DeliveryParty/cac:PartyName/cbc:Name`. For example, the value above gives `<cbc:Name>OpenPeppol VZW Antwerp Warehouse</cbc:Name>`.

> [accordion] Allowances and charges
>
> ```json theme={null}
> {
>   "allowances": [
>     {
>       "amount": 50.00,
>       "reason": "Early payment discount",
>       "tax_code": "S",
>       "tax_rate": "21.00"
>     }
>   ],
>   "charges": [
>     {
>       "amount": 25.00,
>       "reason": "Shipping costs",
>       "tax_code": "S",
>       "tax_rate": "21.00"
>     }
>   ]
> }
> ```
>
> See [Advanced invoicing](https://docs.e-invoice.be/guides/advanced-invoicing.md).

> [accordion] References and notes
>
> ```json theme={null}
> {
>   "buyer_reference": "CC-4410",
>   "purchase_order": "PO-12345",
>   "sales_order": "SO-2026-0042",
>   "note": "Thank you for your business"
> }
> ```
>
> `buyer_reference` is the reference that the buyer asks for (BT-10). The UBL always contains a buyer reference. When `buyer_reference` is absent, the API uses `purchase_order`, then `customer_id`, then the text `Unknown`. For example, a document with only `"purchase_order": "PO-12345"` gets `<cbc:BuyerReference>PO-12345</cbc:BuyerReference>`.
>
> `sales_order` (BT-14) cannot stand alone in the UBL. If you send `sales_order` without `purchase_order`, the API writes `NA` as the order reference (BT-13).
>
> For the reference to a preceding invoice, see [Create credit notes](https://docs.e-invoice.be/guides/credit-notes.md).

> [accordion] Service period
>
> Use `service_start_date` and `service_end_date` (`YYYY-MM-DD`) to state the period that the invoice covers. The API writes them to `cac:InvoicePeriod` in the UBL (BT-73 and BT-74). You can send one date or the two dates.
>
> ```json theme={null}
> {
>   "service_start_date": "2026-09-01",
>   "service_end_date": "2026-09-30"
> }
> ```
>
> The UBL then contains `<cac:InvoicePeriod><cbc:StartDate>2026-09-01</cbc:StartDate><cbc:EndDate>2026-09-30</cbc:EndDate></cac:InvoicePeriod>`.

To send a PDF or a different file with the invoice, see [Attachments and PDF](https://docs.e-invoice.be/guides/attachments.md). If you have no PDF, the API can make one from the document. Add the query parameter `construct_pdf=true` to the create request: `POST /api/documents/?construct_pdf=true`. The default is `false`. The API embeds the PDF in the UBL and stores it as an attachment of the document, for example `INV-2026-001-generated.pdf`. See [Let the platform make the PDF](https://docs.e-invoice.be/guides/attachments.md#let-the-platform-make-the-pdf).

## Send the document

Send the document with `POST /api/documents/{document_id}/send`. Set the environment variable `DOCUMENT_ID` to the `id` from the create response. Replace the sender Peppol ID in the query with the Peppol ID of your company.

```bash cURL theme={null}
curl -X POST "https://api.e-invoice.be/api/documents/$DOCUMENT_ID/send?sender_peppol_scheme=0208&sender_peppol_id=1018265814&receiver_peppol_scheme=0208&receiver_peppol_id=0848934496" \
  -H "Authorization: Bearer $E_INVOICE_API_KEY"
```

```javascript Node.js theme={null}
const documentId = process.env.DOCUMENT_ID; // the "id" from the create response

const query = new URLSearchParams({
  sender_peppol_scheme: "0208",
  sender_peppol_id: "1018265814",
  receiver_peppol_scheme: "0208",
  receiver_peppol_id: "0848934496",
});

const response = await fetch(
  `https://api.e-invoice.be/api/documents/${documentId}/send?${query}`,
  {
    method: "POST",
    headers: { Authorization: `Bearer ${process.env.E_INVOICE_API_KEY}` },
  },
);

const result = await response.json();
if (!response.ok) {
  throw new Error(`HTTP ${response.status}: ${JSON.stringify(result)}`);
}
console.log(result.state);
```

```python Python theme={null}
import os

import requests

document_id = os.environ["DOCUMENT_ID"]  # the "id" from the create response

response = requests.post(
    f"https://api.e-invoice.be/api/documents/{document_id}/send",
    headers={"Authorization": f"Bearer {os.environ['E_INVOICE_API_KEY']}"},
    params={
        "sender_peppol_scheme": "0208",
        "sender_peppol_id": "1018265814",
        "receiver_peppol_scheme": "0208",
        "receiver_peppol_id": "0848934496",
    },
    timeout=30,
)
if not response.ok:
    raise SystemExit(f"HTTP {response.status_code}: {response.text}")
print(response.json()["state"])
```

```php PHP theme={null}
<?php
$documentId = getenv("DOCUMENT_ID"); // the "id" from the create response

$query = http_build_query([
    "sender_peppol_scheme" => "0208",
    "sender_peppol_id" => "1018265814",
    "receiver_peppol_scheme" => "0208",
    "receiver_peppol_id" => "0848934496",
]);

$ch = curl_init("https://api.e-invoice.be/api/documents/$documentId/send?$query");
curl_setopt_array($ch, [
    CURLOPT_POST => true,
    CURLOPT_RETURNTRANSFER => true,
    CURLOPT_HTTPHEADER => [
        "Authorization: Bearer " . getenv("E_INVOICE_API_KEY"),
    ],
]);

$body = curl_exec($ch);
$status = curl_getinfo($ch, CURLINFO_HTTP_CODE);
curl_close($ch);

if ($status >= 400) {
    throw new RuntimeException("HTTP $status: $body");
}
echo json_decode($body, true)["state"], PHP_EOL;
```

```csharp C# theme={null}
using System.Net.Http.Headers;

var documentId = Environment.GetEnvironmentVariable("DOCUMENT_ID"); // the "id" from the create response

using var client = new HttpClient { BaseAddress = new Uri("https://api.e-invoice.be") };
client.DefaultRequestHeaders.Authorization = new AuthenticationHeaderValue(
    "Bearer", Environment.GetEnvironmentVariable("E_INVOICE_API_KEY"));

var query = "sender_peppol_scheme=0208&sender_peppol_id=1018265814&receiver_peppol_scheme=0208&receiver_peppol_id=0848934496";

var response = await client.PostAsync($"/api/documents/{documentId}/send?{query}", null);

var body = await response.Content.ReadAsStringAsync();
if (!response.IsSuccessStatusCode)
{
    throw new HttpRequestException($"HTTP {(int)response.StatusCode}: {body}");
}
Console.WriteLine(body);
```

The API returns `200 OK` with the document. The state is now `TRANSIT`, because the delivery runs in the background. The response is shortened here.

```json theme={null}
{
  "id": "doc-1a2b3c4d5e6f7a8b9c0d1e2f3a4b5c6d",
  "created_at": "2026-10-01T09:15:23.482913Z",
  "document_type": "INVOICE",
  "state": "TRANSIT",
  "direction": "OUTBOUND",
  "invoice_id": "INV-2026-001",
  "invoice_date": "2026-10-01",
  "due_date": "2026-10-31",
  "currency": "EUR",
  "invoice_total": "1210.00"
}
```

For the errors of this call, see [Send errors](https://docs.e-invoice.be/guides/errors.md#send-errors).

### Peppol ID routing

When you send a document, the API finds each of the four Peppol values (sender scheme and identifier, receiver scheme and identifier) in this order:

1. The query parameter of the send request.
2. The Peppol ID that the API stored with the UBL of the document when you created it. For a document that you created from UBL, this is the `cbc:EndpointID` of the party.
3. The derivation from the identifiers in the document: `customer_peppol_id` first for the customer, then `vendor_company_id` / `customer_company_id` and `vendor_tax_id` / `customer_tax_id`. The API uses `customer_peppol_id` only in the form `scheme:identifier`, for example `0208:0848934496`. For `SELFBILLING_INVOICE` and `SELFBILLING_CREDIT_NOTE`, the direction is reversed: the API derives the sender from the `customer_*` fields and the receiver from the `vendor_*` fields.

For a Belgian party, the API derives scheme `0208` and the enterprise number: the tax ID `BE1018265814` gives the Peppol ID `0208:1018265814`. If a tax ID has no country prefix, the API uses the country code at the end of the address (for example `1980 Zemst, BE`). Always give the VAT number with its country prefix, because rule `BR-CO-09` rejects a VAT number without it. For the scheme that the API derives in other countries, see [Peppol ID schemes](https://docs.e-invoice.be/guides/lookup-participants.md#peppol-id-schemes).

When the API sends the document on the Peppol network, it writes the final sender and receiver values in the `cbc:EndpointID` elements of the UBL that it transmits. The other content of the UBL does not change.

The derived scheme can be different from the scheme that the receiver registered. Thus the best practice is to give all four query parameters:

```bash cURL theme={null}
curl -X POST "https://api.e-invoice.be/api/documents/$DOCUMENT_ID/send?sender_peppol_scheme=0208&sender_peppol_id=1018265814&receiver_peppol_scheme=0208&receiver_peppol_id=0848934496" \
  -H "Authorization: Bearer $E_INVOICE_API_KEY"
```

**sender\_peppol\_scheme** `string`

Scheme of the sender Peppol ID. Example: `0208`.

**sender\_peppol\_id** `string`

Identifier of the sender, without the scheme. Example: `1018265814`.

**receiver\_peppol\_scheme** `string`

Scheme of the receiver Peppol ID. Example: `0208`.

**receiver\_peppol\_id** `string`

Identifier of the receiver, without the scheme. Example: `0848934496`.

The send request also has the query parameter `email`. This parameter is deprecated. Do not use it.

The API returns `400` if it cannot find a complete sender and receiver Peppol ID. It returns `409` if the sender Peppol ID is not one of the `peppol_ids` of your company.

> [!TIP]
>
> Before you send, make sure that the receiver is registered on the Peppol network with the Peppol ID that you use. See [Look up Peppol participants](https://docs.e-invoice.be/guides/lookup-participants.md).

For the Peppol schemes and the check of a receiver, see [Look up Peppol participants](https://docs.e-invoice.be/guides/lookup-participants.md).

### After the send request

The result depends on the type of company:

* **Production company:** the API transmits the document on the Peppol network. The receiver gets it in the software that is connected to its Access Point.
* **Sandbox company:** the API sends the UBL XML to the contact email address of the company. Nothing goes to the Peppol network. See [What a send does in test mode](https://docs.e-invoice.be/environments.md#what-a-send-does-in-test-mode).

The code is the same for the two types of company. Only the API key is different.

### Document states

| State | Meaning |
| - | - |
| `DRAFT` | The document exists but is not sent. `POST /api/documents/` always creates a document in this state. |
| `TRANSIT` | Outbound: the send request is accepted and the transmission is in progress. Inbound: e-invoice.be is processing the received document. |
| `SENT` | The transmission is complete. |
| `FAILED` | Outbound: the transmission failed. You can send the document again. Inbound: the processing of the received document failed. |
| `RECEIVED` | The document came in from another Peppol participant. |

You can send a document only when it is in the `DRAFT` or `FAILED` state. For the transitions, the retry behaviour and the webhook events of each state, see [Document lifecycle and delivery tracking](https://docs.e-invoice.be/guides/document-lifecycle.md).

To follow the delivery, use [webhooks](https://docs.e-invoice.be/essentials/webhooks.md) or request `GET /api/documents/{document_id}` until the state is `SENT` or `FAILED`. If the state is `FAILED`, see [A document is in state FAILED](https://docs.e-invoice.be/guides/errors.md#a-document-is-in-state-failed).

## Complete example

These programs do the three steps in sequence. Save the example payload from [Validate the invoice data](#validate-the-invoice-data) as `invoice.json`, and replace the vendor fields and the Peppol IDs with your data.

> [accordion] Validate, create and send (Node.js and Python)
>
> ```javascript Node.js theme={null}
> import { readFile } from "node:fs/promises";
>
> const BASE_URL = "https://api.e-invoice.be";
>
> async function post(path, body) {
>   const response = await fetch(`${BASE_URL}${path}`, {
>     method: "POST",
>     headers: {
>       Authorization: `Bearer ${process.env.E_INVOICE_API_KEY}`,
>       "Content-Type": "application/json",
>     },
>     body,
>   });
>   const result = await response.json();
>   if (!response.ok) {
>     throw new Error(`HTTP ${response.status}: ${JSON.stringify(result)}`);
>   }
>   return result;
> }
>
> const invoice = await readFile("invoice.json", "utf8");
>
> // 1. Validate (while you develop)
> const validation = await post("/api/validate/json", invoice);
> if (!validation.is_valid) {
>   console.error("Validation failed:", validation.issues);
>   process.exit(1);
> }
> console.log("OK: the invoice JSON is valid");
>
> // 2. Create (same payload)
> const document = await post("/api/documents/", invoice);
> console.log("OK: document created:", document.id);
>
> // 3. Send. Replace the Peppol IDs with those of your company and of the receiver.
> const query = new URLSearchParams({
>   sender_peppol_scheme: "0208",
>   sender_peppol_id: "1018265814",
>   receiver_peppol_scheme: "0208",
>   receiver_peppol_id: "0848934496",
> });
> const sent = await post(`/api/documents/${document.id}/send?${query}`);
> console.log("OK: send request accepted, state:", sent.state);
> ```
>
> ```python Python theme={null}
> import json
> import os
> import sys
>
> import requests
>
> BASE_URL = "https://api.e-invoice.be"
> HEADERS = {"Authorization": f"Bearer {os.environ['E_INVOICE_API_KEY']}"}
>
>
> def post(path, **kwargs):
>     response = requests.post(f"{BASE_URL}{path}", headers=HEADERS, timeout=30, **kwargs)
>     if not response.ok:
>         raise SystemExit(f"HTTP {response.status_code}: {response.text}")
>     return response.json()
>
>
> with open("invoice.json") as f:
>     invoice = json.load(f)
>
> # 1. Validate (while you develop)
> validation = post("/api/validate/json", json=invoice)
> if not validation["is_valid"]:
>     print("Validation failed:", validation["issues"])
>     sys.exit(1)
> print("OK: the invoice JSON is valid")
>
> # 2. Create (same payload)
> document = post("/api/documents/", json=invoice)
> print("OK: document created:", document["id"])
>
> # 3. Send. Replace the Peppol IDs with those of your company and of the receiver.
> sent = post(
>     f"/api/documents/{document['id']}/send",
>     params={
>         "sender_peppol_scheme": "0208",
>         "sender_peppol_id": "1018265814",
>         "receiver_peppol_scheme": "0208",
>         "receiver_peppol_id": "0848934496",
>     },
> )
> print("OK: send request accepted, state:", sent["state"])
> ```

## Credit notes and other document types

A credit note has the same structure as an invoice. Set `document_type` to `CREDIT_NOTE`:

```json Credit note theme={null}
{
  "document_type": "CREDIT_NOTE",
  "invoice_id": "CN-2026-001",
  "invoice_date": "2026-10-15",
  "due_date": "2026-11-14",
  "currency": "EUR",
  "purchase_order": "PO-12345",
  "preceding_invoice_id": "INV-2026-001",
  "preceding_invoice_date": "2026-10-01",
  "note": "Credit note for invoice INV-2026-001: 2 units returned",
  "vendor_name": "E-INVOICE BV",
  "vendor_tax_id": "BE1018265814",
  "vendor_address": "Brusselsesteenweg 119/A, 1980 Zemst, BE",
  "vendor_email": "billing@e-invoice.be",
  "customer_name": "OpenPeppol VZW",
  "customer_tax_id": "BE0848934496",
  "customer_address": "Robert Schumanplein 6 bus 5, 1040 Brussel, BE",
  "items": [
    {
      "description": "Professional services (credit)",
      "quantity": 2,
      "unit": "C62",
      "unit_price": 100.00,
      "amount": 200.00,
      "tax_rate": 21.00
    }
  ],
  "subtotal": 200.00,
  "total_tax": 42.00,
  "invoice_total": 242.00,
  "amount_due": 242.00
}
```

This credit note has positive amounts. Replace the vendor fields with the data of your company. The API rejects a document if the Peppol ID of the vendor is not one of the `peppol_ids` of your company.

See [Create credit notes](https://docs.e-invoice.be/guides/credit-notes.md) for partial credits and corrections, and [Self-billing and debit notes](https://docs.e-invoice.be/guides/self-billing.md) for the other values of `document_type`.

## Next Steps

> [card] [Document lifecycle and delivery tracking](https://docs.e-invoice.be/guides/document-lifecycle.md)
>
> Follow the states and the delivery of a document

> [card] [Look up Peppol participants](https://docs.e-invoice.be/guides/lookup-participants.md)
>
> Find the Peppol ID of a customer

> [card] [List, filter and manage documents](https://docs.e-invoice.be/guides/managing-documents.md)
>
> List, find and delete documents

> [card] [Webhooks](https://docs.e-invoice.be/essentials/webhooks.md)
>
> Get a notification for each delivery result


This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.