Every converted invoice is checked with the official KoSIT validator – so your e-invoice meets the XRechnung criteria.

Rechnung2XML API

Do you convert invoices regularly – or should your digital assistant (e.g. an AI tool in your practice or accounting software) take care of it? Via our API you send an invoice file through the interface and receive the checked XRechnung back – without going through the website. Every generated invoice is checked with the official KoSIT validator.

How it works

You send the invoice (PDF, scan/photo, Word or Excel) to the API and receive as a JSON response the recognized invoice data, the KoSIT validator's check result, and download links for the XRechnung XML and the ZUGFeRD PDF. Since there is no manual review step in the API, please check the returned fields yourself – if the check is not passed, that is stated expressly in the result (status: "invalid" with the KoSIT messages in plain German).

Endpoints

Method & pathDescription
POST /api/v1/convert Upload an invoice (multipart, field file) – conversion incl. KoSIT check
POST /api/v1/invoices Send invoice data as JSON (no file) – generation incl. KoSIT check
GET /api/v1/jobs/<job_id> Retrieve a job's status, invoice data and check result
GET /api/v1/jobs/<job_id>/xml Download the XRechnung XML
GET /api/v1/jobs/<job_id>/pdf Download the ZUGFeRD PDF (only for PDF inputs)
GET /api/v1/usage Query the key's plan and remaining conversions

Authentication

Every request carries your personal API key in the header:
Authorization: Bearer <your-key>

Machine-readable description for AI assistants: /llms.txt

Example

curl -X POST https://rechnung2xml.de/api/v1/convert \
  -H "Authorization: Bearer <your-key>" \
  -F "file=@rechnung.pdf"

A conversion usually takes 15–30 seconds because of the KoSIT check. Uploaded files and results are deleted automatically no later than 7 days after upload.

Send invoice data directly – no file

Has your system or your AI assistant already read the invoice? Then send the invoice data directly as JSON to POST /api/v1/invoices – entirely without a file upload. We generate the XRechnung and the ZUGFeRD PDF from it and check both with the official KoSIT validator. As the visible layer of the ZUGFeRD PDF you can optionally include the original PDF (field source_invoice_pdf, Base64-encoded); without an original, we generate a plain invoice PDF from your data.

The same plans and quotas apply as for POST /api/v1/convert: Only a conversion actually generated is billed. If required fields are missing, the API responds with status 422 and a list of the missing fields (missing, plus missing_labels in German and invalid for values that are present but unusable) – nothing is generated then, no job is created, and nothing is deducted from your quota. If the invoice is complete but is rejected by the KoSIT validator, you receive, as with conversion, a normal response with status: "invalid" and the individual check messages – the check result is the answer, not an API error.

FieldMeaningRequired
invoice_numberInvoice numberyes
issue_dateInvoice date, ISO format YYYY-MM-DDyes
delivery_dateDelivery/service date, ISO formatyes
due_dateDue date, ISO formatyes
buyer_referenceBuyer reference (Leitweg-ID)yes (for XRechnung)
profileResult profile: xrechnung (default) or en16931 (ZUGFeRD per EN 16931 – buyer reference then not required)no
currencyCurrency, 3 letters (default: EUR)no
vat_modestandard (default), kleinunternehmer (§ 19 UStG), exempt (tax-exempt) or reverse_charge (§ 13b UStG)no
seller.name / .street / .zip / .citySeller's name and addressyes
seller.countrySeller's country code (default: DE)no
seller.vat_idSeller's VAT IDyes
seller.ibanSeller's IBAN (for the bank transfer)yes
seller.contact_name / .phone / .emailSeller's contact person (mandatory XRechnung fields)yes
buyer.name / .street / .zip / .cityBuyer's name and addressyes
buyer.countryBuyer's country code (default: DE)no
buyer.emailBuyer's email address (mandatory XRechnung field)yes
buyer.vat_idBuyer's VAT IDno
itemsList of invoice line items (at least one)yes
items[].nameLine item descriptionyes
items[].quantityQuantityyes
items[].unitUnit as a UN/ECE code, e.g. H87 (piece), HUR (hour), C62 (flat rate, default)no
items[].unit_priceUnit price, netyes
items[].vat_rateVAT rate in percent, e.g. 19 or 7yes
source_invoice_pdfOriginal invoice as a PDF (Base64) – used as the visible layer of the ZUGFeRD PDFno

curl -X POST https://rechnung2xml.de/api/v1/invoices \
  -H "Authorization: Bearer <your-key>" \
  -H "Content-Type: application/json" \
  -d @rechnung.json

{
  "invoice_number": "RE-2026-0147",
  "issue_date": "2026-11-24",
  "delivery_date": "2026-11-20",
  "due_date": "2026-12-24",
  "buyer_reference": "EINKAUF-2026-118",
  "currency": "EUR",
  "seller": {
    "name": "Nordlicht Bau GmbH",
    "street": "Musterstraße 12",
    "zip": "20354",
    "city": "Hamburg",
    "country": "DE",
    "email": "rechnungen@nordlicht-bau.example",
    "contact_name": "Rechnungsabteilung",
    "phone": "+49 40 123456-0",
    "vat_id": "DE311456789",
    "iban": "DE89370400440532013000"
  },
  "buyer": {
    "name": "Küsten Handel GmbH",
    "street": "Am Sandtorkai 41",
    "zip": "20457",
    "city": "Hamburg",
    "country": "DE",
    "email": "einkauf@kuesten-handel.example",
    "vat_id": "DE298765432"
  },
  "items": [
    {"name": "Montageleistung Fenster, 2. OG", "quantity": 10,
     "unit": "HUR", "unit_price": 68.0, "vat_rate": 19},
    {"name": "Fensterrahmen Kunststoff, weiß", "quantity": 4,
     "unit": "H87", "unit_price": 145.5, "vat_rate": 19},
    {"name": "Anfahrtspauschale", "quantity": 1,
     "unit": "C62", "unit_price": 49.0, "vat_rate": 19}
  ]
}

The response matches that of POST /api/v1/convert: job number (job_id), status, the KoSIT check result (validation), the download URLs for XML and PDF, and the marker source: "data-in". The amounts (net, VAT, gross) are calculated from the line items – you do not need to send totals.

Result profile: XRechnung or ZUGFeRD (EN 16931)

Both conversion endpoints optionally accept the profile parameter – for POST /api/v1/convert as a form field, for POST /api/v1/invoices as a JSON field. The default is "xrechnung"; for that, the buyer reference (Leitweg-ID, BT-10) is mandatory. With "en16931" you instead generate the ZUGFeRD result per EN 16931: there the buyer reference is not a mandatory field, so an invoice missing only that detail is still generated validly – the same way out the website offers. All other mandatory fields remain required with en16931 too, and a placeholder reference is never invented. The response names the profile used in the profile field.

Plans

The website plans apply: 10 conversions per month free, Day Pass €2.99 (24 hours unlimited), Pro €5.99/month or €49/year (unlimited; all prices incl. VAT). The plan is assigned to your API key.

Getting an API key

You create your personal API key yourself in your user account — immediately and without waiting. The key applies to your account and uses its plan. For practices and accounting firms that convert for multiple clients, the Pro plan is intended.

Partner program for practices and accounting firms

For service providers there are partner keys: you convert your firm's own invoices within the free quota. For client work you book a monthly conversion pool onto your key. Three plans, each plus VAT: Starter — up to 100 conversions per month, €19/month; Standard — up to 400 conversions per month, €39/month; Large — up to 1,200 conversions per month, €79/month; over 1,200 — custom quote, talk to us: service@rechnung2xml.de. What you charge your clients for it is up to you. Details and sign-up: Partner program.