5 Minutes

Quickstart Guide

Create your first e-invoice in under 5 minutes. No SDK required – just an HTTP request.

1

Create API Key

Sign up for free and get your API key from the dashboard.

2

Send Request

Send your invoice data as JSON to our API.

3

Receive E-Invoice

Receive a validated XRechnung or ZUGFeRD back.

1

Create API Key

Create a free account and generate your API key in the dashboard. You will receive two keys:

  • Test
    sk_test_...

    For development and testing (no cost)

  • Live
    sk_live_...

    For production (pay-per-use)

Your API Key

sk_test_abc123xyz...

Keep your API key secret. Never share it publicly.

2

Create First E-Invoice

Send a POST request to /api/v1/invoice/de/xrechnung/generate with your invoice data. Here is a complete example:

POSThttps://service.invoice-api.xhub.io/api/v1/invoice/de/xrechnung/generate
bash
1curl -X POST https://service.invoice-api.xhub.io/api/v1/invoice/de/xrechnung/generate \
2 -H "Authorization: Bearer sk_test_abc123..." \
3 -H "Content-Type: application/json" \
4 -d '{
5 "invoice": {
6 "invoiceNumber": "RE-2026-001",
7 "type": "invoice",
8 "issueDate": "2026-04-10",
9 "dueDate": "2026-05-10",
10 "currency": "EUR",
11 "seller": {
12 "name": "Meine Firma GmbH",
13 "vatId": "DE123456789",
14 "street": "Musterstraße 1",
15 "city": "Berlin",
16 "postalCode": "10115",
17 "countryCode": "DE"
18 },
19 "buyer": {
20 "name": "Kunde AG",
21 "vatId": "DE987654321",
22 "street": "Kundenweg 42",
23 "city": "München",
24 "postalCode": "80331",
25 "countryCode": "DE"
26 },
27 "countrySpecific": { "buyerReference": "BUYER-REF-001" },
28 "items": [
29 {
30 "position": 1,
31 "description": "Beratungsleistung",
32 "quantity": 10,
33 "unit": "HUR",
34 "unitPrice": 150.00,
35 "taxRate": 19,
36 "netAmount": 1500.00,
37 "taxAmount": 285.00,
38 "grossAmount": 1785.00
39 }
40 ],
41 "subtotal": 1500.00,
42 "total": 1785.00,
43 "taxSummary": [{ "taxRate": 19, "netAmount": 1500.00, "taxAmount": 285.00 }],
44 "paymentTerms": { "dueDays": 30 }
45 }
46 }'
3

Understand the Response

On success you receive a 200 OK with the created invoice. The response contains validation results and download URLs:

json
1{
2 "success": true,
3 "format": "xrechnung",
4 "filename": "invoice-2025-001.xml",
5 "mimeType": "application/xml",
6 "hash": "sha256:abc123...",
7 "data": "PD94bWwgdmVyc2lvbj0iMS4wIj8+...",
8 "errors": [],
9 "warnings": []
10}

success

true means the invoice was successfully generated.

data

Base64-encoded document (XML or PDF depending on format).

errors / warnings

Validation errors and warnings as array.

Code Examples

Node.js / TypeScript

typescript
1const response = await fetch('https://service.invoice-api.xhub.io/api/v1/invoice/de/xrechnung/generate', {
2 method: 'POST',
3 headers: {
4 'Authorization': 'Bearer sk_test_abc123...',
5 'Content-Type': 'application/json'
6 },
7 body: JSON.stringify({
8 invoice: {
9 invoiceNumber: 'RE-2026-001',
10 type: 'invoice',
11 issueDate: '2026-04-10',
12 dueDate: '2026-05-10',
13 currency: 'EUR',
14 seller: {
15 name: 'Meine Firma GmbH', vatId: 'DE123456789',
16 street: 'Musterstraße 1', city: 'Berlin', postalCode: '10115', countryCode: 'DE'
17 },
18 buyer: {
19 name: 'Kunde AG', vatId: 'DE987654321',
20 street: 'Kundenweg 42', city: 'München', postalCode: '80331', countryCode: 'DE'
21 },
22 countrySpecific: { buyerReference: 'BUYER-REF-001' },
23 items: [
24 { position: 1, description: 'Beratungsleistung', quantity: 10, unit: 'HUR',
25 unitPrice: 150, taxRate: 19, netAmount: 1500, taxAmount: 285, grossAmount: 1785 }
26 ],
27 subtotal: 1500, total: 1785,
28 taxSummary: [{ taxRate: 19, netAmount: 1500, taxAmount: 285 }],
29 paymentTerms: { dueDays: 30 }
30 }
31 })
32});
33 
34const result = await response.json();
35const xmlData = atob(result.data); // Base64 decode to get XML

Python

python
1import requests
2import base64
3 
4response = requests.post(
5 'https://service.invoice-api.xhub.io/api/v1/invoice/de/xrechnung/generate',
6 headers={
7 'Authorization': 'Bearer sk_test_abc123...',
8 'Content-Type': 'application/json'
9 },
10 json={
11 'invoice': {
12 'invoiceNumber': 'RE-2026-001',
13 'type': 'invoice',
14 'issueDate': '2026-04-10',
15 'dueDate': '2026-05-10',
16 'currency': 'EUR',
17 'seller': {
18 'name': 'Meine Firma GmbH', 'vatId': 'DE123456789',
19 'street': 'Musterstraße 1', 'city': 'Berlin', 'postalCode': '10115', 'countryCode': 'DE'
20 },
21 'buyer': {
22 'name': 'Kunde AG', 'vatId': 'DE987654321',
23 'street': 'Kundenweg 42', 'city': 'München', 'postalCode': '80331', 'countryCode': 'DE'
24 },
25 'countrySpecific': {'buyerReference': 'BUYER-REF-001'},
26 'items': [
27 {'position': 1, 'description': 'Beratungsleistung', 'quantity': 10, 'unit': 'HUR',
28 'unitPrice': 150, 'taxRate': 19, 'netAmount': 1500, 'taxAmount': 285, 'grossAmount': 1785}
29 ],
30 'subtotal': 1500, 'total': 1785,
31 'taxSummary': [{'taxRate': 19, 'netAmount': 1500, 'taxAmount': 285}],
32 'paymentTerms': {'dueDays': 30}
33 }
34 }
35)
36 
37result = response.json()
38xml_data = base64.b64decode(result['data']) # Base64 decode to get XML

Ready to get started?

Test the API directly in the Playground – no account needed.