Valifakt REST API v1
REST API v1 lets Pro and Office subscribers wire e-invoice conversion and validation straight into an ERP, accounting system or script. Base URL: https://valifakt.com/api/v1. Machine-readable description: OpenAPI 3 (openapi.json).
Choose Office (1,000 conversions/month) Choose Pro
Authentication
Every request needs the API key from your subscription e-mail (it starts with vf_) in the header Authorization: Bearer vf_…. Keys on the pro, office and api plans have access. When a subscription ends, the key stops working (HTTP 401). Treat the key like a password and call the API from your server, never from a browser.
Quota and rate limits
The API shares the same monthly quota as the web tool: Pro 100, Office 1,000 successful conversions per calendar month. Only a conversion that ends status: valid counts; needs_input, invalid, errors and /validate do not. Check usage with GET /api/v1/quota or the quota field of each conversion.
Rate limit per key, /convert and /validate combined: Pro 10, Office 30 requests per minute. Responses from these two endpoints carry X-RateLimit-Limit, X-RateLimit-Remaining and X-RateLimit-Reset (Unix time); HTTP 429 adds Retry-After in seconds.
POST /api/v1/convert
Multipart form: file (required; PDF, XLSX, XLSM or DOCX, at most 10 MB), country (required; de, pl, be, ae), format (optional; xrechnung-ubl, xrechnung-cii, zugferd for DE, ksef-fa3 for PL, peppol-bis3 for BE, pint-ae for AE), patch (optional; JSON object with values for missing fields).
HTTP 200 means the conversion ran. Read status:
valid: the official validators accepted the file.files.xml(plusfiles.pdffor ZUGFeRD) hold download links.needs_input: required data is missing.missinglists the fields; send the same file again withpatch.invalid: the validator found errors, listed invalidation.errors.
Other fields: job, format, totals, precheck, validation, invoice, quota.
GET /api/v1/jobs/{job}/xml and /pdf
Downloads the generated file. Only the key that ran the conversion can fetch it. Jobs and files are deleted after 60 minutes.
POST /api/v1/validate
Checks existing e-invoice XML (XRechnung UBL/CII, ZUGFeRD XML and Peppol BIS 3.0 via KoSIT; KSeF FA(3) via the Ministry of Finance schema; PINT-AE). Field file, at most 10 MB. Uses no quota. Response: ok, engine, engines, errors, warnings, info.
GET /api/v1/quota
Response: plan, used, limit, month.
Errors
Errors are always JSON {"error": {"code": "…", "message": "…"}} with a matching HTTP status. Branch on code, not on the message.
| HTTP | code | Meaning |
|---|---|---|
| 400 | invalid_request | A required field is missing or invalid (list in fields) |
| 400 | invalid_country | country is not de, pl, be or ae |
| 400 | invalid_format | format does not belong to the country |
| 400 | unsupported_file_type | Convert: not PDF/XLSX/XLSM/DOCX; validate: not XML |
| 400 | unsafe_file | File would expand too much when unpacked (zip / PDF bomb protection) |
| 400 | invalid_patch | patch is not a JSON object |
| 401 | missing_api_key | No Authorization: Bearer header |
| 401 | invalid_api_key | Unknown key or subscription ended |
| 402 | quota_exceeded | Monthly quota used up (plan, limit, upgrade) |
| 403 | plan_not_allowed | The key's plan has no API access |
| 404 | not_found | Job unknown, expired or owned by another key |
| 413 | file_too_large | File larger than 10 MB |
| 422 | conversion_failed | The file could not be read or converted |
| 429 | rate_limited | Too many requests; honour Retry-After |
| 500 | internal_error | Unexpected error; retry |
Examples
curl
curl -sS -X POST https://valifakt.com/api/v1/convert \
-H "Authorization: Bearer $VALIFAKT_API_KEY" \
-F "country=de" \
-F "format=xrechnung-ubl" \
-F "file=@invoice.pdf;type=application/pdf"
# download the XML from files.xml in the response
curl -sS -o invoice.xml -H "Authorization: Bearer $VALIFAKT_API_KEY" \
https://valifakt.com/api/v1/jobs/JOB_ID/xml
curl -sS -X POST https://valifakt.com/api/v1/validate \
-H "Authorization: Bearer $VALIFAKT_API_KEY" \
-F "file=@xrechnung.xml;type=application/xml"Python (requests)
import json, os, requests
API = "https://valifakt.com/api/v1"
H = {"Authorization": f"Bearer {os.environ['VALIFAKT_API_KEY']}"}
with open("invoice.pdf", "rb") as f:
r = requests.post(f"{API}/convert", headers=H, timeout=120,
data={"country": "de", "format": "xrechnung-ubl"},
files={"file": ("invoice.pdf", f, "application/pdf")})
if r.status_code != 200:
err = r.json()["error"]
raise SystemExit(f"{r.status_code} {err['code']}: {err['message']}")
job = r.json()
if job["status"] == "valid":
xml = requests.get(job["files"]["xml"], headers=H, timeout=60)
open("invoice.xml", "wb").write(xml.content)
elif job["status"] == "needs_input":
print("fill in and send again as patch:", [m["field"] for m in job["missing"]])
# e.g. data["patch"] = json.dumps({"buyer_reference": "04011000-1234512345-06"})
print(job["quota"])Node.js
// Node.js 18+ (built-in fetch, FormData, Blob)
import { readFile, writeFile } from "node:fs/promises";
const API = "https://valifakt.com/api/v1";
const headers = { Authorization: `Bearer ${process.env.VALIFAKT_API_KEY}` };
const form = new FormData();
form.append("country", "de");
form.append("format", "xrechnung-ubl");
form.append("file", new Blob([await readFile("invoice.pdf")], { type: "application/pdf" }), "invoice.pdf");
const res = await fetch(`${API}/convert`, { method: "POST", headers, body: form });
const body = await res.json();
if (!res.ok) throw new Error(`${res.status} ${body.error.code}: ${body.error.message}`);
if (body.status === "valid") {
const xml = await fetch(body.files.xml, { headers });
await writeFile("invoice.xml", Buffer.from(await xml.arrayBuffer()));
} else {
console.log(body.status, body.missing.map((m) => m.field));
}
console.log(body.quota, res.headers.get("x-ratelimit-remaining"));Open source: command line and GitHub Action
MIT-licensed and public on GitHub. valifakt-cli checks XRechnung, ZUGFeRD, Peppol BIS and KSeF FA(3) locally (offline) and through the API, converts with your key and emits CI annotations.
pip install "valifakt-cli[offline] @ git+https://github.com/saoudaltamimi/valifakt-cli@v0.1.2"
valifakt validate invoices/*.xmlThe GitHub Action validate-einvoice validates e-invoices in every pull request.
- uses: saoudaltamimi/validate-einvoice@v1
with:
files: invoices/**/*.xmlvalifakt-cli (GitHub) validate-einvoice (GitHub Action)
Related: overview of the older X-API-Key endpoints (still supported), pricing.
FAQ
Do the API and the website share one quota?
Yes. A key has one monthly counter. Successful conversions through the API and through older endpoints with the same key both count towards it.
What happens when a subscription is cancelled?
The key becomes inactive at the end of the subscription and every call returns HTTP 401 with code invalid_api_key.
Is there an OpenAPI file for code generation?
Yes: https://valifakt.com/api/v1/openapi.json (OpenAPI 3). Load it into Postman, Insomnia or an OpenAPI code generator.
Facts as of 30.11.2026. This is not tax or legal advice.