Reference
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
Vorschau
Auszug aus der OpenAPI Spezifikation:
yaml
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.xhub.io/v19 description: Production10 - url: https://sandbox.api.xhub.io/v111 description: Sandbox12 13paths:14 /invoices:15 post:16 summary: Create Invoice17 operationId: createInvoice18 tags: [Creator]19 security:20 - bearerAuth: []21 requestBody:22 required: true23 content:24 application/json:25 schema:26 $ref: '#/components/schemas/CreateInvoiceRequest'27 responses:28 '200':29 description: Invoice created successfully30 content:31 application/json:32 schema:33 $ref: '#/components/schemas/Invoice'34 35 /validate:36 post:37 summary: Validate Invoice38 operationId: validateInvoice39 tags: [Validator]40 # ...41 42components:43 securitySchemes:44 bearerAuth:45 type: http46 scheme: bearer47 48 schemas:49 CreateInvoiceRequest:50 type: object51 required: [format, seller, buyer, items]52 properties:53 format:54 type: string55 enum: [xrechnung-3.0, zugferd-2.1, factur-x-1.0]56 invoiceNumber:57 type: string58 # ...Import in API-Clients
Postman
bash
1# Via URL importieren21. Öffne Postman32. Klicke auf "Import" (oben links)43. Wähle "Link" Tab54. Füge ein: https://api.xhub.io/openapi.yaml65. Klicke "Continue" → "Import"7 8# Alternativ: Collection herunterladen9curl -O https://api.xhub.io/postman-collection.jsonInsomnia
bash
1# Via URL importieren21. Öffne Insomnia32. Application → Preferences → Data43. "Import Data" → "From URL"54. URL: https://api.xhub.io/openapi.yaml65. "Fetch and Import"Code-Generierung
Generiere typsichere API-Clients aus der OpenAPI Spezifikation:
bash
1# TypeScript/JavaScript mit openapi-typescript2npx openapi-typescript https://api.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.xhub.io/openapi.yaml7 8# Go mit oapi-codegen9go install github.com/deepmap/oapi-codegen/cmd/oapi-codegen@latest10oapi-codegen -package api https://api.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.