Reference

OpenAPI Specification

Our complete API is available as an OpenAPI 3.1 specification. Use it for code generation, API clients, or interactive documentation.

Download

OpenAPI YAML

Human-readable, great for Git

openapi.json

Postman Collection

Import directly into Postman

postman-collection.json

API Endpoints

The most important endpoints of the Invoice-api.xhub API (Version 1.0.0):

POST/api/v1/invoice/{countryCode}/{format}/generate
E-Invoice GenerationAuth
POST/api/v1/invoice/parse
E-Invoice ParsingAuth
POST/api/v1/invoice/{countryCode}/validate
Validation (Planned Q2 2026)Public
GET/api/v1/invoice/{countryCode}/formats
Formats per countryPublic
GET/api/v1/invoice/formats
All available formatsPublic

Authentication

Bearer Token

Authenticate with your API key in the Authorization header:

bash
1Authorization: Bearer sk_live_xxxxxxxxxxxxx
2 
3# Testmodus
4Authorization: Bearer sk_test_xxxxxxxxxxxxx

Live Keys (sk_live_*) are for production data. Test Keys (sk_test_*) are for development and testing.

Supported Countries

The API supports e-invoice formats for the following countries:

DE

Germany

AT

Austria

CH

Switzerland

FR

France

IT

Italy

ES

Spain

NL

Netherlands

BE

Belgium

PT

Portugal

PL

Poland

CZ

Czech Republic

HU

Hungary

RO

Romania

BG

Bulgaria

Preview

Excerpt from the OpenAPI specification:

yaml
1openapi: 3.1.0
2info:
3 title: Invoice-api.xhub API
4 version: 1.0.0
5 description: E-Rechnung API für XRechnung, ZUGFeRD und Peppol
6 
7servers:
8 - url: https://service.invoice-api.xhub.io/v1
9 description: Production
10 - url: https://sandbox.service.invoice-api.xhub.io/v1
11 description: Sandbox
12 
13paths:
14 /api/v1/invoice/{countryCode}/{format}/generate:
15 post:
16 summary: Generate E-Invoice
17 description: Erstellt eine E-Rechnung im gewählten Format
18 parameters:
19 - name: countryCode
20 in: path
21 required: true
22 schema:
23 type: string
24 enum: [DE, AT, CH, FR, IT, ES, NL, BE, PT, PL, CZ, HU, RO, BG]
25 - name: format
26 in: path
27 required: true
28 schema:
29 type: string
30 security:
31 - bearerAuth: []
32 # ...
33 
34 /api/v1/invoice/{countryCode}/validate:
35 post:
36 summary: Validate E-Invoice
37 description: Validiert eine E-Rechnung (kostenlos)
38 # ...
39 
40components:
41 securitySchemes:
42 bearerAuth:
43 type: http
44 scheme: bearer
45 description: "API Key (sk_live_* oder sk_test_*)"
46 # ...

Import into API Clients

Postman

bash
1# Via URL importieren
21. Öffne Postman
32. Klicke auf "Import" (oben links)
43. Wähle "Link" Tab
54. Füge ein: https://service.invoice-api.xhub.io/docs
65. Klicke "Continue" "Import"
7 
8# Alternativ: Collection herunterladen
9curl -O https://service.invoice-api.xhub.io/postman-collection.json

Insomnia

bash
1# Via URL importieren
21. Öffne Insomnia
32. Application Preferences Data
43. "Import Data" "From URL"
54. URL: https://service.invoice-api.xhub.io/openapi.json
65. "Fetch and Import"

Code Generation

Generate type-safe API clients from the OpenAPI specification:

bash
1# TypeScript/JavaScript mit openapi-typescript
2npx openapi-typescript https://service.invoice-api.xhub.io/openapi.json -o ./types/api.d.ts
3 
4# Python mit openapi-python-client
5pip install openapi-python-client
6openapi-python-client generate --url https://service.invoice-api.xhub.io/openapi.json
7 
8# Go mit oapi-codegen
9go install github.com/deepmap/oapi-codegen/cmd/oapi-codegen@latest
10oapi-codegen -package api https://service.invoice-api.xhub.io/openapi.json > api/api.gen.go

Versioning

The OpenAPI specification is updated with API changes. Use the version number in the spec to ensure compatibility. Breaking changes are announced in the Changelog.