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

{ "status": "valid" }

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