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 "bankAccount": { "iban": "DE89370400440532013000", "bic": "COBADEFFXXX" }
19 },
20 "buyer": {
21 "name": "Kunde AG",
22 "vatId": "DE987654321",
23 "street": "Kundenweg 42",
24 "city": "München",
25 "postalCode": "80331",
26 "countryCode": "DE"
27 },
28 "countrySpecific": { "countryCode": "DE", "buyerReference": "BUYER-REF-001" },
29 "items": [
30 {
31 "position": 1,
32 "description": "Beratungsleistung",
33 "quantity": 10,
34 "unit": "HUR",
35 "unitPrice": 150.00,
36 "taxRate": 19,
37 "netAmount": 1500.00,
38 "taxAmount": 285.00,
39 "grossAmount": 1785.00
40 }
41 ],
42 "subtotal": 1500.00,
43 "total": 1785.00,
44 "taxSummary": [{ "taxRate": 19, "netAmount": 1500.00, "taxAmount": 285.00 }],
45 "paymentTerms": { "dueDays": 30 },
46 "paymentMethods": [{ "type": "bank_transfer" }]
47 }
48 }'
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 bankAccount: { iban: 'DE89370400440532013000', bic: 'COBADEFFXXX' }
18 },
19 buyer: {
20 name: 'Kunde AG', vatId: 'DE987654321',
21 street: 'Kundenweg 42', city: 'München', postalCode: '80331', countryCode: 'DE'
22 },
23 countrySpecific: { countryCode: 'DE', buyerReference: 'BUYER-REF-001' },
24 items: [
25 { position: 1, description: 'Beratungsleistung', quantity: 10, unit: 'HUR',
26 unitPrice: 150, taxRate: 19, netAmount: 1500, taxAmount: 285, grossAmount: 1785 }
27 ],
28 subtotal: 1500, total: 1785,
29 taxSummary: [{ taxRate: 19, netAmount: 1500, taxAmount: 285 }],
30 paymentTerms: { dueDays: 30 },
31 paymentMethods: [{ type: 'bank_transfer' }]
32 }
33 })
34});
35 
36const result = await response.json();
37const 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 'bankAccount': {'iban': 'DE89370400440532013000', 'bic': 'COBADEFFXXX'}
21 },
22 'buyer': {
23 'name': 'Kunde AG', 'vatId': 'DE987654321',
24 'street': 'Kundenweg 42', 'city': 'München', 'postalCode': '80331', 'countryCode': 'DE'
25 },
26 'countrySpecific': {'countryCode': 'DE', 'buyerReference': 'BUYER-REF-001'},
27 'items': [
28 {'position': 1, 'description': 'Beratungsleistung', 'quantity': 10, 'unit': 'HUR',
29 'unitPrice': 150, 'taxRate': 19, 'netAmount': 1500, 'taxAmount': 285, 'grossAmount': 1785}
30 ],
31 'subtotal': 1500, 'total': 1785,
32 'taxSummary': [{'taxRate': 19, 'netAmount': 1500, 'taxAmount': 285}],
33 'paymentTerms': {'dueDays': 30},
34 'paymentMethods': [{'type': 'bank_transfer'}]
35 }
36 }
37)
38 
39result = response.json()
40xml_data = base64.b64decode(result['data']) # Base64 decode to get XML

Ready to get started?

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