OpenAPI Specification
Unsere vollständige API ist als OpenAPI 3.1 Spezifikation verfügbar. Nutze sie für Code-Generierung, API-Clients oder interaktive Dokumentation.
Download
API Endpoints
Die wichtigsten Endpoints der invoice.xhub API (Version 1.0.0):
/api/v1/invoice/{countryCode}/{format}/generate/api/v1/invoice/parse/api/v1/invoice/{countryCode}/validate/api/v1/invoice/{countryCode}/formats/api/v1/invoice/formatsAuthentifizierung
Bearer Token
Authentifiziere dich mit deinem API Key im Authorization Header:
1Authorization: Bearer sk_live_xxxxxxxxxxxxx2 3# Testmodus4Authorization: Bearer sk_test_xxxxxxxxxxxxxLive Keys (sk_live_*) sind für Produktionsdaten. Test Keys (sk_test_*) sind für Entwicklung und Tests.
Unterstützte Länder
Die API unterstützt E-Rechnungsformate für folgende Länder:
Deutschland
Österreich
Schweiz
Frankreich
Italien
Spanien
Niederlande
Belgien
Portugal
Polen
Tschechien
Ungarn
Rumänien
Bulgarien
Vorschau
Auszug aus der OpenAPI Spezifikation:
1openapi: 3.1.02info:3 title: invoice.xhub API4 version: 1.0.05 description: E-Rechnung API für XRechnung, ZUGFeRD und Peppol6 7servers:8 - url: https://api.invoice.xhub.io/v19 description: Production10 - url: https://sandbox.api.invoice.xhub.io/v111 description: Sandbox12 13paths:14 /api/v1/invoice/{countryCode}/{format}/generate:15 post:16 summary: Generate E-Invoice17 description: Erstellt eine E-Rechnung im gewählten Format18 parameters:19 - name: countryCode20 in: path21 required: true22 schema:23 type: string24 enum: [DE, AT, CH, FR, IT, ES, NL, BE, PT, PL, CZ, HU, RO, BG]25 - name: format26 in: path27 required: true28 schema:29 type: string30 security:31 - bearerAuth: []32 # ...33 34 /api/v1/invoice/{countryCode}/validate:35 post:36 summary: Validate E-Invoice37 description: Validiert eine E-Rechnung (kostenlos)38 # ...39 40components:41 securitySchemes:42 bearerAuth:43 type: http44 scheme: bearer45 description: "API Key (sk_live_* oder sk_test_*)"46 # ...Import in API-Clients
Postman
1# Via URL importieren21. Öffne Postman32. Klicke auf "Import" (oben links)43. Wähle "Link" Tab54. Füge ein: https://api.invoice.xhub.io/openapi.yaml65. Klicke "Continue" → "Import"7 8# Alternativ: Collection herunterladen9curl -O https://api.invoice.xhub.io/postman-collection.jsonInsomnia
1# Via URL importieren21. Öffne Insomnia32. Application → Preferences → Data43. "Import Data" → "From URL"54. URL: https://api.invoice.xhub.io/openapi.yaml65. "Fetch and Import"Code-Generierung
Generiere typsichere API-Clients aus der OpenAPI Spezifikation:
1# TypeScript/JavaScript mit openapi-typescript2npx openapi-typescript https://api.invoice.xhub.io/openapi.yaml -o ./types/api.d.ts3 4# Python mit openapi-python-client5pip install openapi-python-client6openapi-python-client generate --url https://api.invoice.xhub.io/openapi.yaml7 8# Go mit oapi-codegen9go install github.com/deepmap/oapi-codegen/cmd/oapi-codegen@latest10oapi-codegen -package api https://api.invoice.xhub.io/openapi.yaml > api/api.gen.goVersionierung
Die OpenAPI Spezifikation wird bei API-Änderungen aktualisiert. Nutze die Versionsnummer in der Spec, um Kompatibilität sicherzustellen. Breaking Changes werden im Changelog angekündigt.