API Reference
Complete documentation of the SyyPro Rechnungen API · v1 · EN 16931 konform · XRechnung 3.0 · Hybrid-PDF
https://rechnung.syypro.com/api/v1
All endpoints except /health and /profiles require an API key in the HTTP header:
Find your API keys in your
Dashboard
under the "API Keys" tab. Every key always starts with xr_.
XR_API_KEY).
| Endpoint | Limit | Scope |
|---|---|---|
/api/v1/* |
60 Requests / Minute | Pro API-Key (Token-Bucket) |
/extract/upload (Web) |
5 Requests / Minute | Pro IP (nginx) |
/auth/* (Login/Register) |
5 Requests / Minute | Pro IP (nginx) |
Bei Überschreitung: HTTP 429 mit Body {"error":{"code":"rate_limited","message":"..."}}.
Nach Ablauf der Minute wird das Bucket automatisch aufgefüllt.
Simple ping endpoint. Checks whether the server and database are reachable. Ideal for monitoring, health checks and uptime services. No API key required.
curl https://rechnung.syypro.com/api/v1/health
import requests
r = requests.get("https://rechnung.syypro.com/api/v1/health")
print(r.json())
# {"status": "ok", "db": true}
const r = await fetch('https://rechnung.syypro.com/api/v1/health');
const data = await r.json();
// { status: "ok", db: true }
{
"status": "ok",
"db": true
}
Returns all supported invoice profiles. Use the value from key in the profile fields of other endpoints.
curl https://rechnung.syypro.com/api/v1/profiles
r = requests.get("https://rechnung.syypro.com/api/v1/profiles")
for p in r.json()["profiles"]:
print(p["key"], "→", p["name"])
{
"profiles": [
{
"key": "XRECHNUNG",
"name": "XRechnung 3.0",
"standard": "UBL 2.1",
"description": "B2G-Pflichtformat für öffentliche Auftraggeber (Leitweg-ID erforderlich)"
},
{
"key": "B2B_UBL",
"name": "B2B (UBL 2.1)",
"standard": "UBL 2.1",
"description": "EN-16931-konformes B2B-Format ohne Leitweg-ID-Pflicht"
},
{
"key": "ZUGFERD",
"name": "Hybrid-PDF (XRechnung eingebettet)",
"standard": "UBL 2.1",
"description": "PDF-Rechnung mit eingebetteter XRechnung (UBL-XML, EN 16931)"
}
]
}
Creates a complete EN-16931-valid XRechnung XML from a JSON body. Optionally as hybrid PDF (embedded XRechnung). API key required.
| Field | Type | Required | Description |
|---|---|---|---|
| profile | string | Required | XRECHNUNG | B2B_UBL | ZUGFERD (Name historisch, liefert ein Hybrid-PDF mit eingebetteter XRechnung) |
| invoice_number | string | Required | Eindeutige Rechnungsnummer (BT-1), z. B. RE-2026-0042 |
| issue_date | string (ISO) | Required | Rechnungsdatum, Format YYYY-MM-DD (BT-2) |
| due_date | string (ISO) | Required | Fälligkeitsdatum, Format YYYY-MM-DD (BT-9) |
| currency | string | Required | ISO 4217 Währungscode, z. B. EUR (BT-5) |
| buyer_reference | string | Conditional | Leitweg-ID beim Profil XRECHNUNG Pflicht (BT-10). Format: 04011000-1234512345-06 |
| seller | Party | Required | Rechnungssteller (siehe Party-Objekt) |
| buyer | Party | Required | Rechnungsempfänger (siehe Party-Objekt) |
| lines | LineItem[] | Required | Mindestens eine Rechnungsposition (siehe LineItem-Objekt) |
| bank_account | object | Optional | {"iban": "DE89370400440532013000"} – Zahlungsinformationen |
| note | string | Optional | Freitext-Notiz auf der Rechnung (BT-22) |
| include_pdf | boolean | Optional | Wenn true: plain PDF als Base64 im Feld pdf_base64 |
| include_zugferd | boolean | Optional | Wenn true: Hybrid-PDF (PDF mit eingebetteter XRechnung, UBL) als Base64 im Feld zugferd_base64. Feldname historisch. Standard: false |
curl -X POST https://rechnung.syypro.com/api/v1/invoices \
-H "X-API-Key: $XR_API_KEY" \
-H "Content-Type: application/json" \
-d '{
"profile": "XRECHNUNG",
"invoice_number": "RE-2026-0042",
"issue_date": "2026-05-01",
"due_date": "2026-05-15",
"currency": "EUR",
"buyer_reference": "04011000-1234512345-06",
"seller": {
"name": "Mustermann IT GmbH",
"vat_id": "DE123456789",
"contact": {"name": "Max Mustermann", "email": "rechnung@mustermann-it.de", "phone": "0711 123456"},
"address": {
"street": "Musterstraße 12",
"postal_code": "70173",
"city": "Stuttgart",
"country_code": "DE"
}
},
"buyer": {
"name": "Landratsamt Musterhausen",
"contact": {"email": "rechnung@musterhausen.de"},
"address": {
"street": "Rathausplatz 1",
"postal_code": "70173",
"city": "Musterhausen",
"country_code": "DE"
}
},
"lines": [{
"name": "Webentwicklung",
"quantity": "12",
"unit_code": "HUR",
"unit_price": "120.00",
"tax_percent": "19"
}],
"bank_account": { "iban": "DE89370400440532013000" }
}'
import requests, os
XR_KEY = os.environ["XR_API_KEY"]
BASE = "https://rechnung.syypro.com/api/v1"
payload = {
"profile": "XRECHNUNG",
"invoice_number": "RE-2026-0042",
"issue_date": "2026-05-01",
"due_date": "2026-05-15",
"currency": "EUR",
"buyer_reference": "04011000-1234512345-06",
"seller": {
"name": "Mustermann IT GmbH",
"vat_id": "DE123456789",
"contact": {"name": "Max Mustermann", "email": "rechnung@mustermann-it.de", "phone": "0711 123456"},
"address": {
"street": "Musterstraße 12",
"postal_code": "70173",
"city": "Stuttgart",
"country_code": "DE"
}
},
"buyer": {
"name": "Landratsamt Musterhausen",
"contact": {"email": "rechnung@musterhausen.de"},
"address": {
"street": "Rathausplatz 1",
"postal_code": "70173",
"city": "Musterhausen",
"country_code": "DE"
}
},
"lines": [{"name": "Webentwicklung", "quantity": "12",
"unit_code": "HUR", "unit_price": "120.00", "tax_percent": "19"}],
"bank_account": {"iban": "DE89370400440532013000"}
}
r = requests.post(f"{BASE}/invoices",
headers={"X-API-Key": XR_KEY},
json=payload)
r.raise_for_status()
data = r.json()
import base64
xml = base64.b64decode(data["xml_base64"])
with open("rechnung.xml", "wb") as f:
f.write(xml)
print("Validierung:", data["validation"])
const payload = {
profile: "XRECHNUNG",
invoice_number: "RE-2026-0042",
issue_date: "2026-05-01",
due_date: "2026-05-15",
currency: "EUR",
buyer_reference: "04011000-1234512345-06",
seller: {
name: "Mustermann IT GmbH",
vat_id: "DE123456789",
contact: { name: "Max Mustermann", email: "rechnung@mustermann-it.de", phone: "0711 123456" },
address: { street: "Musterstraße 12", postal_code: "70173",
city: "Stuttgart", country_code: "DE" }
},
buyer: {
name: "Landratsamt Musterhausen",
contact: { email: "rechnung@musterhausen.de" },
address: { street: "Rathausplatz 1", postal_code: "70173",
city: "Musterhausen", country_code: "DE" }
},
lines: [{ name: "Webentwicklung", quantity: "12",
unit_code: "HUR", unit_price: "120.00", tax_percent: "19" }],
bank_account: { iban: "DE89370400440532013000" }
};
const resp = await fetch('https://rechnung.syypro.com/api/v1/invoices', {
method: 'POST',
headers: { 'X-API-Key': process.env.XR_API_KEY,
'Content-Type': 'application/json' },
body: JSON.stringify(payload)
});
const data = await resp.json();
// Decode XML
const xmlBytes = atob(data.xml_base64);
console.log('Validation OK:', data.validation.ok);
{
"invoice": {
"invoice_number": "RE-2026-0042",
"issue_date": "2026-05-01",
"total_net": 1440.0,
"total_tax": 273.6,
"total_gross": 1713.6
},
"validation": {
"ok": true,
"errors": []
},
"xml_base64": "PD94bWwgdmVyc2lvbj0iMS4wIiBlbmNvZGluZz0...",
"pdf_base64": null,
"zugferd_base64": null,
"document_id": 1234
}
{
"error": {
"code": "invalid_invoice",
"message": "Rechnungsdaten nicht EN-16931-konform.",
"errors": [
{ "level": "error", "code": "BR-04",
"message": "Seller VAT identifier is mandatory." }
]
}
}
Same request body as /invoices, but the response contains only the validation result. Useful for pre-checking before actual creation. API key required.
curl -X POST https://rechnung.syypro.com/api/v1/validate \
-H "X-API-Key: $XR_API_KEY" \
-H "Content-Type: application/json" \
-d '{ ... selber Body wie /invoices ... }'
r = requests.post(f"{BASE}/validate",
headers={"X-API-Key": XR_KEY},
json=payload) # gleicher Body wie /invoices
result = r.json()
if result["ok"]:
print("Rechnung ist EN-16931-konform ✓")
else:
for e in result["errors"]:
print(f"[{e['level'].upper()}] {e['code']}: {e['message']}")
{
"ok": true,
"errors": []
}
{
"ok": false,
"errors": [
{
"level": "error",
"code": "BR-04",
"message": "Seller VAT identifier is mandatory."
},
{
"level": "warning",
"code": "BT-10",
"message": "Buyer reference recommended for XRECHNUNG profile."
}
]
}
Sends an existing PDF invoice as multipart/form-data. The scanner reads embedded e-invoice XML or detects the fields rule-based from the PDF text and validates them. XML is only returned when all values were recognised reliably and are valid (downloads_advised). API key required.
| Field | Type | Required | Description |
|---|---|---|---|
| file | file (PDF) | Required | PDF-Datei, max. 16 MB. Nur application/pdf akzeptiert. |
| profile | string | Optional | Ausgabe-Profil: XRECHNUNG | B2B_UBL | ZUGFERD. Standard: XRECHNUNG |
| include_zugferd | string | Optional | "1" = Hybrid-PDF erzeugen (Standard: "0"). Achtung: erhöht Verarbeitungszeit. |
curl -X POST https://rechnung.syypro.com/api/v1/extract \ -H "X-API-Key: $XR_API_KEY" \ -F "file=@meine-rechnung.pdf" \ -F "profile=XRECHNUNG" \ -F "include_zugferd=0"
import requests, base64, os
XR_KEY = os.environ["XR_API_KEY"]
with open("meine-rechnung.pdf", "rb") as f:
r = requests.post(
"https://rechnung.syypro.com/api/v1/extract",
headers={"X-API-Key": XR_KEY},
files={"file": ("rechnung.pdf", f, "application/pdf")},
data={"profile": "XRECHNUNG", "include_zugferd": "0"}
)
data = r.json()
print(f"Konfidenz: {data['confidence']}%")
print(f"Warnungen: {data.get('warnings', [])}")
if r.status_code == 200 and data["downloads_advised"]:
xml = base64.b64decode(data["xml_base64"])
with open("output.xml", "wb") as f:
f.write(xml)
else:
# 422: Werte unsicher oder ungültig -> Felder in data["invoice"] prüfen
print("Bitte prüfen:", data.get("gate_reason"), data["validation"]["errors"])
const formData = new FormData();
formData.append('file', pdfFile); // File-Objekt aus input[type=file]
formData.append('profile', 'XRECHNUNG');
formData.append('include_zugferd', '0');
const resp = await fetch('https://rechnung.syypro.com/api/v1/extract', {
method: 'POST',
headers: { 'X-API-Key': process.env.XR_API_KEY },
// Content-Type NICHT setzen – FormData setzt boundary automatisch
body: formData
});
const data = await resp.json();
console.log(`Konfidenz: ${data.confidence}%`, data.warnings);
if (resp.ok && data.downloads_advised) {
const xmlBytes = atob(data.xml_base64);
} else {
console.warn('Bitte prüfen:', data.gate_reason, data.validation.errors);
}
{
"confidence": 87,
"warnings": ["due_date konnte nicht sicher erkannt werden"],
"checklist": {
"BT-1": { "name": "invoice_number", "ok": true },
"BT-2": { "name": "issue_date", "ok": true },
"BT-9": { "name": "due_date", "ok": false }
},
"invoice": { "invoice_number": "RE-2026-0042", ... },
"validation": { "ok": true, "errors": [] },
"reliable": true,
"downloads_advised": true,
"xml_base64": "PD94bWwgdmVyc2lvbj0i...",
"zugferd_base64": null,
"document_id": 1234
}
ⓘ If downloads_advised is false, the API responds with 422, xml_base64 is null and no quota is used. gate_reason states why (validation_failed or uncertain_values). Check the fields in invoice and create the invoice via POST /api/v1/invoices. Valid invoices appear in your invoice history (document_id).
Reused objects in request bodies:
Party (seller / buyer)| Field | Type | Required | Description |
|---|---|---|---|
| name | string | Required | Firmenname (BT-27 / BT-44) |
| vat_id | string | Conditional | USt-IdNr., z. B. DE123456789 – beim Verkäufer Pflicht (BT-31) |
| tax_number | string | Optional | Steuernummer, wenn keine VAT-ID vorhanden (BT-32) |
| address | Address | Required | Postanschrift (siehe Address-Objekt) |
| string | Optional | Kontakt-E-Mail | |
| contact_name | string | Optional | Ansprechpartner |
| Field | Type | Required | Description |
|---|---|---|---|
| street | string | Required | Straße + Hausnummer |
| postal_code | string | Required | Postleitzahl |
| city | string | Required | Stadt |
| country_code | string | Required | ISO 3166 Alpha-2, z. B. DE |
| Field | Type | Required | Description |
|---|---|---|---|
| name | string | Required | Bezeichnung der Position (BT-153) |
| quantity | string | Required | Menge als Dezimalzahl, z. B. "12" oder "1.5" (BT-129) |
| unit | string | Required | UN/CEFACT-Code: HUR Stunde · C62 Stück · KGM kg · DAY Tag (BT-130) |
| unit_price | string | Required | Netto-Einzelpreis, z. B. "120.00" (BT-146) |
| tax_percent | string | Required | Steuersatz: "19", "7" oder "0" (BT-152) |
| description | string | Optional | Erweiterte Beschreibung (BT-154) |
| article_number | string | Optional | Artikelnummer / SKU (BT-155) |
All error responses have the format:
| HTTP | Code | Meaning |
|---|---|---|
| 400 | invalid_body | JSON fehlerhaft oder Pflichtfelder fehlen (Feldname im message) |
| 401 | unauthorized | API-Key fehlt (X-API-Key Header) oder ungültig / abgelaufen |
| 413 | too_large | Upload > 16 MB – nginx-Limit |
| 415 | wrong_type | Nur PDF akzeptiert bei /extract (application/pdf) |
| 422 | invalid_invoice | Rechnungsdaten nicht EN-16931-konform – errors-Array enthält Details |
| 422 | extract_failed | PDF konnte nicht gelesen/geparst werden (beschädigt / verschlüsselt) |
| 422 | extract_xml_failed | Extraktion OK, aber XML-Generierung fehlgeschlagen (Hinweis im message) |
| 429 | rate_limited | Mehr als 60 Requests/Minute – warte und wiederhole |
| 500 | server_error | Unerwarteter Server-Fehler – bitte an support@syypro.com melden |
| 503 | api_disabled | API vorübergehend deaktiviert |
Copy-ready integration snippets for common stacks:
"""
SyyPro XRechnung API – Python-Schnellstart
pip install requests
"""
import requests, base64, os
API_BASE = "https://rechnung.syypro.com/api/v1"
API_KEY = os.environ["XR_API_KEY"]
HEADERS = {"X-API-Key": API_KEY, "Content-Type": "application/json"}
def create_invoice(data: dict) -> dict:
"""Erstellt XRechnung XML, gibt Antwort-Dict zurück."""
r = requests.post(f"{API_BASE}/invoices", headers=HEADERS, json=data)
r.raise_for_status()
return r.json()
def save_xml(response: dict, path: str) -> None:
xml_bytes = base64.b64decode(response["xml_base64"])
with open(path, "wb") as f:
f.write(xml_bytes)
def validate(data: dict) -> bool:
r = requests.post(f"{API_BASE}/validate", headers=HEADERS, json=data)
result = r.json()
for e in result.get("errors", []):
print(f" [{e['level']}] {e['code']}: {e['message']}")
return result.get("ok", False)
# Beispiel
payload = {
"profile": "XRECHNUNG",
"invoice_number": "RE-2026-0042",
"issue_date": "2026-05-01",
"due_date": "2026-05-15",
"currency": "EUR",
"buyer_reference": "04011000-1234512345-06",
"seller": {
"name": "Muster GmbH", "vat_id": "DE123456789",
"contact": {"name": "Max Mustermann", "email": "rechnung@muster.de", "phone": "0711 123456"},
"address": {"street": "Str. 1", "postal_code": "70173",
"city": "Stuttgart", "country_code": "DE"}
},
"buyer": {
"name": "Behörde XY",
"contact": {"email": "rechnung@musterhausen.de"},
"address": {"street": "Amt 1", "postal_code": "10115",
"city": "Berlin", "country_code": "DE"}
},
"lines": [
{"name": "Beratung", "quantity": "8", "unit_code": "HUR",
"unit_price": "150.00", "tax_percent": "19"}
],
"bank_account": {"iban": "DE89370400440532013000"}
}
if validate(payload):
result = create_invoice(payload)
save_xml(result, "rechnung.xml")
print(f"Erstellt: {result['invoice']['total_gross']} EUR")
// SyyPro XRechnung API – Node.js Schnellstart (ESM)
// Kein npm-Package nötig – natives fetch() seit Node 18
const API_BASE = 'https://rechnung.syypro.com/api/v1';
const API_KEY = process.env.XR_API_KEY;
async function createInvoice(payload) {
const resp = await fetch(`${API_BASE}/invoices`, {
method: 'POST',
headers: {
'X-API-Key': API_KEY,
'Content-Type': 'application/json'
},
body: JSON.stringify(payload)
});
if (!resp.ok) {
const err = await resp.json();
throw new Error(`API Error ${resp.status}: ${err.error?.message}`);
}
return resp.json();
}
async function extractPdf(filePath) {
const { readFileSync } = await import('fs');
const { Blob } = await import('buffer');
const fileBytes = readFileSync(filePath);
const formData = new FormData();
formData.append('file', new Blob([fileBytes], { type: 'application/pdf' }),
'rechnung.pdf');
formData.append('profile', 'XRECHNUNG');
const resp = await fetch(`${API_BASE}/extract`, {
method: 'POST',
headers: { 'X-API-Key': API_KEY },
body: formData
});
return resp.json();
}
// Beispiel
const payload = {
profile: 'XRECHNUNG',
invoice_number: 'RE-2026-0042',
issue_date: '2026-05-01', due_date: '2026-05-15',
currency: 'EUR', buyer_reference: '04011000-1234512345-06',
seller: { name: 'Muster GmbH', vat_id: 'DE123456789',
contact: { name: 'Max Mustermann', email: 'rechnung@muster.de', phone: '0711 123456' },
address: { street: 'Str. 1', postal_code: '70173',
city: 'Stuttgart', country_code: 'DE' } },
buyer: { name: 'Behörde XY', contact: { email: 'rechnung@behoerde.de' },
address: { street: 'Amt 1', postal_code: '10115',
city: 'Berlin', country_code: 'DE' } },
lines: [{ name: 'Beratung', quantity: '8', unit_code: 'HUR',
unit_price: '150.00', tax_percent: '19' }],
bank_account: { iban: 'DE89370400440532013000' }
};
const result = await createInvoice(payload);
const xmlBuf = Buffer.from(result.xml_base64, 'base64');
require('fs').writeFileSync('rechnung.xml', xmlBuf);
console.log('Total:', result.invoice.total_gross, 'EUR');
<?php
// SyyPro XRechnung API – PHP Schnellstart
$API_BASE = 'https://rechnung.syypro.com/api/v1';
$API_KEY = getenv('XR_API_KEY');
function xr_post(string $endpoint, array $data, string $apiKey, string $base): array {
$ch = curl_init("$base/$endpoint");
curl_setopt_array($ch, [
CURLOPT_RETURNTRANSFER => true,
CURLOPT_POST => true,
CURLOPT_POSTFIELDS => json_encode($data),
CURLOPT_HTTPHEADER => [
"X-API-Key: $apiKey",
'Content-Type: application/json'
]
]);
$body = curl_exec($ch);
$status = curl_getinfo($ch, CURLINFO_HTTP_CODE);
curl_close($ch);
if ($status >= 400) {
$err = json_decode($body, true);
throw new RuntimeException("API Error $status: " . ($err['error']['message'] ?? $body));
}
return json_decode($body, true);
}
$payload = [
'profile' => 'XRECHNUNG',
'invoice_number' => 'RE-2026-0042',
'issue_date' => '2026-05-01',
'due_date' => '2026-05-15',
'currency' => 'EUR',
'buyer_reference' => '04011000-1234512345-06',
'seller' => [
'name' => 'Muster GmbH',
'vat_id' => 'DE123456789',
'contact' => ['name' => 'Max Mustermann', 'email' => 'rechnung@muster.de', 'phone' => '0711 123456'],
'address' => ['street' => 'Str. 1', 'postal_code' => '70173',
'city' => 'Stuttgart', 'country_code' => 'DE']
],
'buyer' => [
'name' => 'Behörde XY',
'contact' => ['email' => 'rechnung@behoerde.de'],
'address' => ['street' => 'Amt 1', 'postal_code' => '10115',
'city' => 'Berlin', 'country_code' => 'DE']
],
'lines' => [[
'name' => 'Beratung', 'quantity' => '8', 'unit_code' => 'HUR',
'unit_price' => '150.00', 'tax_percent' => '19'
]],
'bank_account' => ['iban' => 'DE89370400440532013000']
];
$result = xr_post('invoices', $payload, $API_KEY, $API_BASE);
file_put_contents('rechnung.xml', base64_decode($result['xml_base64']));
echo "Rechnung erstellt: " . $result['invoice']['total_gross'] . " EUR\n";
#!/bin/bash
# SyyPro XRechnung API – Bash Schnellstart
# Benötigt: curl, jq
API_BASE="https://rechnung.syypro.com/api/v1"
# Key aus Umgebungsvariable laden (nie hartkodieren!)
XR_KEY="${XR_API_KEY}"
# ── Health check ──────────────────────────────────────────────
echo "=== Health ==="
curl -sf "$API_BASE/health" | jq .
# ── Verfügbare Profile auflisten ──────────────────────────────
echo "=== Profile ==="
curl -sf "$API_BASE/profiles" | jq '[.profiles[].key]'
# ── Rechnung erstellen ────────────────────────────────────────
echo "=== Rechnung erstellen ==="
RESPONSE=$(curl -sf -X POST "$API_BASE/invoices" \
-H "X-API-Key: $XR_KEY" \
-H "Content-Type: application/json" \
-d '{
"profile": "XRECHNUNG",
"invoice_number": "RE-SHELL-001",
"issue_date": "2026-05-12",
"due_date": "2026-05-26",
"currency": "EUR",
"buyer_reference": "04011000-1234512345-06",
"seller": {
"name": "Shell Script GmbH",
"vat_id": "DE999999999",
"contact": {"name": "Max Mustermann", "email": "rechnung@mustermann-it.de", "phone": "0711 123456"},
"address": {"street":"Bash-Allee 1","postal_code":"70173",
"city":"Stuttgart","country_code":"DE"}
},
"buyer": {
"name": "Testamt",
"contact": {"email": "rechnung@musterhausen.de"},
"address": {"street":"Amtstr. 1","postal_code":"10115",
"city":"Berlin","country_code":"DE"}
},
"lines": [{"name":"Dienst","quantity":"1","unit_code":"C62",
"unit_price":"100.00","tax_percent":"19"}],
"bank_account": {"iban":"DE89370400440532013000"}
}')
echo "$RESPONSE" | jq '{ok: .validation.ok, total: .invoice.total_gross}'
# XML speichern
echo "$RESPONSE" | jq -r '.xml_base64' | base64 -d > rechnung.xml
echo "XML gespeichert: rechnung.xml ($(wc -c < rechnung.xml) Bytes)"