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 "seller": {
11 "name": "Deine Firma GmbH",
12 "vatId": "DE123456789"
13 },
14 "buyer": {
15 "name": "Kunde AG",
16 "vatId": "DE987654321"
17 },
18 "items": [
19 { "description": "Beratung", "quantity": 1, "unitPrice": 1500, "taxRate": 19 }
20 ]
21 }
22 }'
23 
24# 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

1

Create API Key

Sign up and create an API key in the dashboard.

sk_live_abc123...
2

Send Request

Send an HTTP request to our REST API.

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

Receive Invoice

Receive a valid XRechnung or ZUGFeRD back.

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

More Resources

OpenAPI Specification

Import our API into Postman, Insomnia, or your tools.

Download OpenAPI Spec

Postman Collection

Ready-made collection with all endpoints and examples.

Import Collection

Changelog

All updates, new features, and breaking changes.

View Changelog