Skip to content

Rechnung erstellen

Generiere eine ZUGFeRD/Factur-X konforme PDF-Rechnung.

Endpoint

POST https://api.thelawin.dev/v1/generate

Headers

HeaderErforderlichBeschreibung
X-API-KeyJaDein API-Schlüssel
Content-TypeJaapplication/json

Request Body

json
{
  "template": "minimal",
  "locale": "de",
  "invoice": {
    "number": "2026-001",
    "date": "2026-01-15",
    "seller": {
      "name": "Acme GmbH",
      "vatId": "DE123456789",
      "city": "Berlin",
      "country": "DE"
    },
    "buyer": {
      "name": "Kunde AG",
      "city": "München",
      "country": "DE"
    },
    "items": [{
      "description": "Beratungsleistungen",
      "quantity": 8,
      "unit": "HUR",
      "unitPrice": 150.00,
      "vatRate": 19.0
    }]
  }
}

Antwort

Erfolg (200)

json
{
  "pdf_base64": "JVBERi0xLjcK...",
  "filename": "invoice-2026-001.pdf",
  "validation": {
    "status": "valid",
    "profile": "EN16931",
    "version": "2.3.2"
  }
}

Fehler (400)

json
{
  "error": "validation_failed",
  "message": "Invoice validation failed",
  "details": [
    {
      "path": "$.invoice.seller.vatId",
      "code": "REQUIRED",
      "message": "Seller VAT ID is required"
    }
  ]
}

Siehe API-Referenz für vollständige Details.

ZUGFeRD 2.3 & Factur-X 1.0 compliant