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 "seller": {
6 "name": "Meine Firma GmbH",
7 "vatId": "DE123456789",
8 "street": "Musterstraße 1",
9 "city": "Berlin",
10 "postalCode": "10115",
11 "country": "DE"
12 },
13 "buyer": {
14 "name": "Kunde AG",
15 "vatId": "DE987654321",
16 "street": "Kundenweg 42",
17 "city": "München",
18 "postalCode": "80331",
19 "country": "DE"
20 },
21 "items": [
22 {
23 "description": "Beratungsleistung",
24 "quantity": 10,
25 "unitPrice": 150.00,
26 "taxRate": 19
27 }
28 ]
29 }'
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 seller: {
9 name: 'Meine Firma GmbH',
10 vatId: 'DE123456789',
11 street: 'Musterstraße 1', city: 'Berlin', postalCode: '10115', country: 'DE'
12 },
13 buyer: {
14 name: 'Kunde AG',
15 vatId: 'DE987654321',
16 street: 'Kundenweg 42', city: 'München', postalCode: '80331', country: 'DE'
17 },
18 items: [
19 { description: 'Beratungsleistung', quantity: 10, unitPrice: 150.00, taxRate: 19 }
20 ]
21 })
22});
23 
24const result = await response.json();
25const 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 'seller': {
12 'name': 'Meine Firma GmbH',
13 'vatId': 'DE123456789',
14 'street': 'Musterstraße 1', 'city': 'Berlin', 'postalCode': '10115', 'country': 'DE'
15 },
16 'buyer': {
17 'name': 'Kunde AG',
18 'vatId': 'DE987654321',
19 'street': 'Kundenweg 42', 'city': 'München', 'postalCode': '80331', 'country': 'DE'
20 },
21 'items': [
22 {'description': 'Beratungsleistung', 'quantity': 10, 'unitPrice': 150.00, 'taxRate': 19}
23 ]
24 }
25)
26 
27result = response.json()
28xml_data = base64.b64decode(result['data']) # Base64 decode to get XML

Ready to get started?

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