Documentation

Invoice-api.xhub API Documentation

Everything you need to create, validate, and send e-invoices. From quickstart guides to the full API reference.

bash
1# 1. Set API key
2export XHUB_API_KEY=sk_live_...
3 
4# 2. Create e-invoice
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 Examples

No SDK required – just use HTTP requests in your preferred language.

curl

Universally usable in any terminal

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

Node.js

With fetch() or any HTTP client

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

Python

With requests or httpx

response = requests.post(...

PHP

With Guzzle or cURL

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

Quick Start in 3 Steps

01

Create API Key

Sign up and create an API key in the dashboard.

sk_live_abc123...
02

Send Request

Send an HTTP request to our REST API.

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

Receive Invoice

Receive a valid XRechnung or ZUGFeRD back.

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