Skip to content

thelawin.dev Documentation

A REST API for EU e-invoices. Send JSON, get back a PDF/A-3 with the embedded XML that auditors and government portals expect. Nothing is stored on our side.

Supported standards: EN 16931 (EU Core Invoice), ZUGFeRD 2.4 (Germany), and Factur-X 1.0.8 (France/EU).

New here? Start with the Getting Started Guide.

What you get

FeatureDescription
StatelessInvoice data is processed in memory and returned as Base64. Nothing written to disk.
3 templatesMinimal, Classic, and Compact
Pre-validationCheck a JSON payload before burning a credit. /v1/validate is free.
8 SDKsTypeScript, Python, Ruby, Kotlin, Java, Swift, Dart, C#
MCP serverUsable directly from Claude, GPT, and other agents

API Overview

Generate Invoice

bash
curl -X POST https://api.thelawin.dev/v1/generate \
  -H "X-API-Key: env_live_..." \
  -H "Content-Type: application/json" \
  -d '{
    "template": "minimal",
    "invoice": {
      "number": "2026-001",
      "date": "2026-01-15",
      "seller": {"name": "Acme GmbH", "vat_id": "DE123456789", "city": "Berlin", "country": "DE"},
      "buyer": {"name": "Customer AG", "city": "München", "country": "DE"},
      "items": [{"description": "Consulting", "quantity": 8, "unit": "HUR", "unit_price": 150, "vat_rate": 19}]
    }
  }'

Validate Invoice Data

Free pre-validation for invoice JSON. No API key, no quota consumed:

bash
curl -X POST https://api.thelawin.dev/v1/validate \
  -H "Content-Type: application/json" \
  -d '{
    "format": "auto",
    "invoice": {
      "number": "2026-001",
      "date": "2026-01-15",
      "seller": {"name": "Acme GmbH", "vat_id": "DE123456789", "city": "Berlin", "country": "DE"},
      "buyer": {"name": "Customer AG", "city": "München", "country": "DE"},
      "items": [{"description": "Consulting", "quantity": 8, "unit": "HUR", "unit_price": 150, "vat_rate": 19}]
    }
  }'

Retrieve Invoice from PDF

Extract structured invoice data from an existing PDF/XML e-invoice (1 credit):

bash
curl -X POST https://api.thelawin.dev/v1/retrieve \
  -H "X-API-Key: env_live_..." \
  -F "file=@invoice.pdf"

Next Steps

ZUGFeRD 2.4 & Factur-X 1.0.8 compliant