5 Minuten

Quickstart Guide

Erstelle deine erste E-Rechnung in unter 5 Minuten. Kein SDK nötig – nur ein HTTP-Request.

1

API Key erstellen

Registriere dich kostenlos und hole dir deinen API Key aus dem Dashboard.

2

Request senden

Sende deine Rechnungsdaten als JSON an unsere API.

3

Rechnung erhalten

Erhalte eine validierte XRechnung oder ZUGFeRD zurück.

1

API Key erstellen

Erstelle einen kostenlosen Account und generiere deinen API Key im Dashboard. Du erhältst zwei Keys:

  • Test
    xhub_test_...

    Für Entwicklung und Testing (keine Kosten)

  • Live
    xhub_live_...

    Für Production (Pay-per-Use)

Dein API Key

xhub_test_abc123xyz...

Halte deinen API Key geheim. Teile ihn nie öffentlich.

2

Erste Rechnung erstellen

Sende einen POST-Request an /v1/invoices mit deinen Rechnungsdaten. Hier ein vollständiges Beispiel:

POSThttps://api.xhub.io/v1/invoices
bash
1curl -X POST https://api.xhub.io/v1/invoices \
2 -H "Authorization: Bearer xhub_test_abc123..." \
3 -H "Content-Type: application/json" \
4 -d '{
5 "format": "xrechnung-3.0",
6 "seller": {
7 "name": "Meine Firma GmbH",
8 "vatId": "DE123456789",
9 "address": {
10 "street": "Musterstraße 1",
11 "city": "Berlin",
12 "zip": "10115",
13 "country": "DE"
14 }
15 },
16 "buyer": {
17 "name": "Kunde AG",
18 "vatId": "DE987654321",
19 "leitweg": "991-12345-67",
20 "address": {
21 "street": "Kundenweg 42",
22 "city": "München",
23 "zip": "80331",
24 "country": "DE"
25 }
26 },
27 "items": [
28 {
29 "description": "Beratungsleistung",
30 "quantity": 10,
31 "unitPrice": 150.00,
32 "vat": 19
33 }
34 ]
35 }'
3

Response verstehen

Bei Erfolg erhältst du einen 200 OK mit der erstellten Rechnung. Die Response enthält die Validierungs-Ergebnisse und Download-URLs:

json
1{
2 "id": "inv_abc123xyz",
3 "status": "valid",
4 "format": "XRechnung 3.0.2",
5 "created": "2025-01-15T10:30:00Z",
6 "validation": {
7 "valid": true,
8 "errors": 0,
9 "warnings": 0
10 },
11 "totals": {
12 "net": 1500.00,
13 "vat": 285.00,
14 "gross": 1785.00
15 },
16 "download": {
17 "xml": "https://api.xhub.io/v1/invoices/inv_abc123xyz/xml",
18 "pdf": "https://api.xhub.io/v1/invoices/inv_abc123xyz/pdf"
19 }
20}

status

valid bedeutet die Rechnung ist KoSIT-konform.

validation

Zeigt Fehler und Warnungen aus der Schema-Validierung.

download

URLs zum Herunterladen der XML- und PDF-Dateien.

Code-Beispiele

Node.js / TypeScript

typescript
1const response = await fetch('https://api.xhub.io/v1/invoices', {
2 method: 'POST',
3 headers: {
4 'Authorization': 'Bearer xhub_test_abc123...',
5 'Content-Type': 'application/json'
6 },
7 body: JSON.stringify({
8 format: 'xrechnung-3.0',
9 seller: {
10 name: 'Meine Firma GmbH',
11 vatId: 'DE123456789',
12 address: { street: 'Musterstraße 1', city: 'Berlin', zip: '10115', country: 'DE' }
13 },
14 buyer: {
15 name: 'Kunde AG',
16 vatId: 'DE987654321',
17 leitweg: '991-12345-67',
18 address: { street: 'Kundenweg 42', city: 'München', zip: '80331', country: 'DE' }
19 },
20 items: [
21 { description: 'Beratungsleistung', quantity: 10, unitPrice: 150.00, vat: 19 }
22 ]
23 })
24});
25 
26const invoice = await response.json();
27console.log(invoice.download.xml); // Download URL für XML

Python

python
1import requests
2 
3response = requests.post(
4 'https://api.xhub.io/v1/invoices',
5 headers={
6 'Authorization': 'Bearer xhub_test_abc123...',
7 'Content-Type': 'application/json'
8 },
9 json={
10 'format': 'xrechnung-3.0',
11 'seller': {
12 'name': 'Meine Firma GmbH',
13 'vatId': 'DE123456789',
14 'address': {'street': 'Musterstraße 1', 'city': 'Berlin', 'zip': '10115', 'country': 'DE'}
15 },
16 'buyer': {
17 'name': 'Kunde AG',
18 'vatId': 'DE987654321',
19 'leitweg': '991-12345-67',
20 'address': {'street': 'Kundenweg 42', 'city': 'München', 'zip': '80331', 'country': 'DE'}
21 },
22 'items': [
23 {'description': 'Beratungsleistung', 'quantity': 10, 'unitPrice': 150.00, 'vat': 19}
24 ]
25 }
26)
27 
28invoice = response.json()
29print(invoice['download']['xml']) # Download URL für XML

Bereit loszulegen?

Teste die API direkt im Playground – ohne Account.