Skip to content

sevDesk Integration

Combine sevDesk for accounting with thelawin.dev for EU-compliant e-invoice generation.

Use Case

sevDesk handles invoicing, but for certain requirements you need thelawin.dev:

  • XRechnung with Leitweg-ID for government agencies (B2G)
  • Peppol format for European business partners
  • FatturaPA for Italian customers
  • Automated bulk generation via API

Workflow: sevDesk → thelawin.dev

sevDesk API → Export invoice data
    → Build JSON for thelawin.dev
    → POST api.thelawin.dev/v1/generate
    → E-invoice (ZUGFeRD / XRechnung / Peppol)
    → Send to customer or government portal

Example: sevDesk Invoice → XRechnung

python
import httpx
from thelawin import ThelawinClient

SEVDESK_TOKEN = "your-sevdesk-token"

# 1. Load invoice from sevDesk
invoice = httpx.get(
    f"https://my.sevdesk.de/api/v1/Invoice/{invoice_id}",
    headers={"Authorization": SEVDESK_TOKEN}
).json()["objects"][0]

# 2. Generate XRechnung with thelawin.dev
client = ThelawinClient("env_sandbox_demo")

result = (
    client.invoice()
    .number(invoice["invoiceNumber"])
    .date(invoice["invoiceDate"].split("T")[0])
    .format("xrechnung")
    .leitweg_id("04011000-12345-67")
    .buyer_reference("PO-2026-001")
    .seller("Deine Firma GmbH", vat_id="DE123456789", city="Berlin", country="DE")
    .buyer(invoice["contact"]["name"], country="DE")
    .add_item("Dienstleistung", quantity=1, unit_price=float(invoice["sumNet"]))
    .generate()
)

if result.success:
    result.save_pdf(f"xrechnungen/{result.filename}")

Alternative: n8n as Middleware

  1. HTTP Request | sevDesk API: fetch new invoices
  2. HTTP Request | thelawin.dev: generate e-invoice
  3. Email/Upload | Send PDF

See the n8n Guide.

Next Steps

ZUGFeRD 2.4 & Factur-X 1.0.8 compliant