Documentation

Invoice-api.xhub API Dokumentation

Alles was du brauchst, um E-Rechnungen zu erstellen, validieren und versenden. Von Quickstart-Guides bis zur vollständigen API-Referenz.

bash
1# 1. API Key setzen
2export XHUB_API_KEY=sk_live_...
3 
4# 2. E-Rechnung erstellen
5curl -X POST https://service.invoice-api.xhub.io/api/v1/invoice/de/xrechnung/generate \
6 -H "Authorization: Bearer $XHUB_API_KEY" \
7 -H "Content-Type: application/json" \
8 -d '{
9 "invoice": {
10 "invoiceNumber": "RE-2026-0042",
11 "type": "invoice",
12 "issueDate": "2026-03-01",
13 "currency": "EUR",
14 "seller": {
15 "name": "Deine Firma GmbH",
16 "street": "Musterstraße 1",
17 "city": "Berlin",
18 "postalCode": "10115",
19 "countryCode": "DE",
20 "vatId": "DE123456789",
21 "email": "rechnung@deinefirma.de",
22 "phone": "+49 30 12345678",
23 "bankAccount": { "iban": "DE89370400440532013000" }
24 },
25 "buyer": {
26 "name": "Kunde AG",
27 "street": "Kundenweg 42",
28 "city": "München",
29 "postalCode": "80331",
30 "countryCode": "DE",
31 "vatId": "DE987654321"
32 },
33 "items": [
34 {
35 "description": "Beratung",
36 "quantity": 1,
37 "unit": "C62",
38 "unitPrice": 1500.00,
39 "taxRate": 19,
40 "netAmount": 1500.00,
41 "taxAmount": 285.00
42 }
43 ],
44 "subtotal": 1500.00,
45 "total": 1785.00,
46 "taxSummary": [
47 { "taxRate": 19, "taxCategoryCode": "S", "netAmount": 1500.00, "taxAmount": 285.00 }
48 ],
49 "paymentMethods": [{ "type": "bank_transfer" }]
50 }
51 }'
52 
53# ✓ Response: {"success": true, "format": "xrechnung", ...}

Code-Beispiele

Keine SDK nötig – nutze einfach HTTP-Requests in deiner bevorzugten Sprache.

curl

Universell nutzbar in jedem Terminal

curl -X POST https://service.invoice-api.xhub.io/api/v1/invoice/de/xrechnung/generate \...

Node.js

Mit fetch() oder beliebigem HTTP-Client

const res = await fetch('https://service.invoice-api.xhub.io/api/v1/invoice/de/xrechnung/generate', {...

Python

Mit requests oder httpx

response = requests.post(...

PHP

Mit Guzzle oder cURL

$response = $client->post('https://service.invoice-api.xhub.io/api/v1/invoice/de/xrechnung/generate', [...

Schnellstart in 3 Schritten

01

API Key erstellen

Registriere dich und erstelle einen API Key im Dashboard.

sk_live_abc123...
02

Request senden

Sende einen HTTP-Request an unsere REST API.

POST /api/v1/invoice/de/xrechnung/generate
03

Rechnung erhalten

Erhalte eine valide XRechnung oder ZUGFeRD zurück.

{ "success": true, "format": "xrechnung", "data": "base64..." }