E-Invoice Conversion
Turn a PDF invoice that your company issues into a German e-invoice: an XRechnung (UBL or CII) or a ZUGFeRD PDF. Feld reads the PDF and returns the invoice data with a list of findings: what is missing, wrong or still to be confirmed. Once you have corrected and confirmed the data, you release the conversion: Feld creates the e-invoice file, validates it against the official rules and stores it as a version that never changes, for you to download.
A conversion is a resource under /v1/einvoice/conversions. It also appears in the E-Rechnung list of the Feld web app, where anyone with access to the project can review and correct it.
The examples below use api.feld.ai, the Feld cloud API host. On a dedicated or white-label deployment, replace it with the API host issued with your API key — the /v1 prefix and everything after it stay the same.
Before you start
The feature is enabled for your project
Feld enables e-invoice conversion per project. Ask your Feld contact to enable it for the project you use. Until then, every endpoint on this page answers 404 with code: einvoice_not_enabled.
A project for outgoing invoices, without automatic workflows
Upload the invoices you issue into a project of their own in which none of the automatic workflows of the project settings is switched on: no Auto-classification, Auto-extraction, Pipeline Workflow or Invoice Processing. Create the API key for the conversion in that project.
Every upload (POST /v1/documents) starts the automatic workflows of its project. In a project for incoming invoices, an outgoing invoice would be classified, extracted or processed as an incoming one: that costs processing and leaves wrong results in the project. In a project without workflows, the upload only reads the PDF's text. Feld does not check this when you create a conversion.
The seller config (recommended)
A project can hold one config of kind einvoice: your company's data as the seller of its invoices. In the Feld web app, the same data is under Settings > E-Rechnung of the project. It is optional, but with it:
- seller name, VAT id, tax number and address come from the config, not from the PDF. If the PDF shows a different VAT id or tax number, Feld reports an error, which catches an invoice of the wrong legal entity;
- an IBAN in the invoice that is not among the config's
credit_transfersis an error, whether Feld read it from the PDF or someone entered it later, which catches altered bank details; - the config's contact and electronic address fill in what the PDF does not show. XRechnung requires both.
Create it with the existing config endpoints. This is a minimal config for XRechnung:
curl -X POST https://api.feld.ai/v1/configs \
-H "Authorization: Bearer YOUR_API_KEY" \
-H "Content-Type: application/json" \
-d '{
"name": "E-Rechnung",
"kind": "einvoice",
"parameters": {
"default_format": "xrechnung_ubl",
"seller": {
"name": "Holzwerkstatt Brenner GmbH",
"vat_id": "DE987654328",
"address": {
"line1": "Lindenweg 8",
"post_code": "99997",
"city": "Musterhausen",
"country": "DE"
},
"electronic_address": { "scheme": "EM", "value": "rechnung@holz-brenner.example" },
"contact": {
"name": "Jonas Brenner",
"phone": "+49 30 23125 482",
"email": "rechnung@holz-brenner.example"
}
},
"credit_transfers": [
{ "iban": "DE89370400440532013000", "account_name": "Holzwerkstatt Brenner GmbH" }
]
}
}'
Further optional parameters are seller.tax_number, seller.legal_registration_id, default_payment_means_code and extraction_instructions (up to 10,000 characters of hints on where your invoices show their values; they help Feld find values on the page, but never add a value or change one the PDF shows).
- A project holds one
einvoiceconfig; creating a second returns409. Change it withPUT /v1/configs/{config_id}. - A change to the config does not reach conversions that are already open: they keep the config as it was when Feld read their invoice, until you send
"reapply_config": truein aPATCH. - Without a config, the seller data comes from the PDF, and anything XRechnung needs beyond it becomes a
missingfinding that you fill in per conversion.
How a conversion runs
- Upload the PDF with
POST /v1/documents. - Start a conversion for it with
POST /v1/einvoice/conversions. - Poll until the status is
needs_revieworready, and read the data and findings. - Correct and confirm with
PATCHuntil the status isready. - Release it with
POST /v1/einvoice/conversions/{conversion_id}/releaseand poll until it isreleased. - Download the file and the validation report.
01 — Upload the PDF
Use the existing upload, unchanged. folder_path is optional; the web app files its own uploads under E-Rechnungen.
curl -X POST https://api.feld.ai/v1/documents \
-H "Authorization: Bearer YOUR_API_KEY" \
-F "file=@Rechnung_2026-1202.pdf" \
-F "folder_path=E-Rechnungen"
Response — 201 Created (abridged)
{
"type": "document",
"id": "1b2e3f40-6a7b-4c8d-9e0f-1a2b3c4d5e6f",
"name": "Rechnung_2026-1202.pdf",
"status": "pending",
"created_at": "2026-11-23T09:14:00Z",
"updated_at": "2026-11-23T09:14:00Z"
}
Only a PDF can be converted. You do not need to wait until Feld has finished processing the upload (the document's status): create the conversion right away, and it waits for the document.
02 — Start the conversion
curl -X POST https://api.feld.ai/v1/einvoice/conversions \
-H "Authorization: Bearer YOUR_API_KEY" \
-H "Content-Type: application/json" \
-d '{
"document_id": "1b2e3f40-6a7b-4c8d-9e0f-1a2b3c4d5e6f",
"client_reference": "DMS-48213",
"format": "xrechnung_ubl",
"overrides": {
"buyer_reference": "08999000-GBM01-89",
"buyer": {
"electronic_address": { "scheme": "0204", "value": "08999000-GBM01-89" }
}
}
}'
| Field | Required | Description |
|---|---|---|
document_id | yes | The id the upload returned: a PDF in the API key's project. |
client_reference | no | Your own id for this invoice, for example its document or job id in your system: 1–255 characters after trimming, without control characters, unique per project, never written into the e-invoice. Makes retries safe, see Idempotency and retries. |
format | no | zugferd, xrechnung_ubl or xrechnung_cii, see Formats. Defaults to the seller config's default_format, then to zugferd. |
profile | no | en16931 is the only value, and only zugferd has a profile; Feld sets it from the format. With an XRechnung format it is refused (422 profile_not_supported). Leave it out. |
overrides | no | Values you already know, as a partial invoice, see Overrides. |
auto_release | no | true: once the invoice has been read without errors (status ready), Feld releases it without a separate release call, see Automatic release. Defaults to false. |
In the example, the buyer is a public authority: your system knows its Leitweg-ID and sends it as the buyer reference (BT-10) and as the buyer's electronic address (scheme 0204).
Response — 202 Accepted (abridged)
{
"type": "einvoice_conversion",
"id": "8f0c2d6e-0f8b-4b61-a3a5-0c1e8d7b9f10",
"document_id": "1b2e3f40-6a7b-4c8d-9e0f-1a2b3c4d5e6f",
"document_name": "Rechnung_2026-1202.pdf",
"client_reference": "DMS-48213",
"origin": "api",
"status": "processing",
"revision": 1,
"version": 1,
"format": "xrechnung_ubl",
"profile": null,
"rule_set": "xrechnung-3.0",
"review_url": "https://app.feld.ai/project/rechnungsausgang/einvoice/8f0c2d6e-0f8b-4b61-a3a5-0c1e8d7b9f10",
"data": null,
"findings": [],
"releases": [],
"error": null,
"created_at": "2026-11-23T09:14:02Z",
"updated_at": "2026-11-23T09:14:02Z"
}
Save the id. If Feld is still processing the uploaded document, the conversion waits for it for up to 10 minutes; after that it ends in failed with error.code: document_not_readable and error.retryable: true.
03 — Wait for the result
Poll the conversion until its status leaves processing.
- cURL
- Python
curl https://api.feld.ai/v1/einvoice/conversions/{conversion_id} \
-H "Authorization: Bearer YOUR_API_KEY"
import time
import requests
API = "https://api.feld.ai/v1"
HEADERS = {"Authorization": "Bearer YOUR_API_KEY"}
def wait(conversion_id):
"""Poll until the conversion is no longer processing or releasing."""
while True:
conversion = requests.get(
f"{API}/einvoice/conversions/{conversion_id}", headers=HEADERS
).json()
if conversion["status"] not in ("processing", "releasing"):
return conversion
time.sleep(5)
conversion = wait(conversion_id)
print(conversion["status"], conversion["summary"])
Poll every 2–5 seconds. The status becomes needs_review, ready or failed, see Statuses; with auto_release it can go on to releasing. Most invoices take less than a minute; long invoices with many lines take several minutes. While Feld works on the conversion, progress.stage names the current step: reading (waiting for and loading the uploaded PDF), extracting (reading the invoice values) and checking (checking them); during a release writing, validating, pdfa (building the ZUGFeRD PDF) and storing.
04 — Read the data and findings
Response — 200 OK (abridged: data holds the whole invoice, sources an entry for every value)
{
"type": "einvoice_conversion",
"id": "8f0c2d6e-0f8b-4b61-a3a5-0c1e8d7b9f10",
"document_id": "1b2e3f40-6a7b-4c8d-9e0f-1a2b3c4d5e6f",
"document_name": "Rechnung_2026-1202.pdf",
"client_reference": "DMS-48213",
"origin": "api",
"status": "needs_review",
"revision": 2,
"version": 1,
"format": "xrechnung_ubl",
"profile": null,
"rule_set": "xrechnung-3.0",
"review_url": "https://app.feld.ai/project/rechnungsausgang/einvoice/8f0c2d6e-0f8b-4b61-a3a5-0c1e8d7b9f10",
"data": {
"type_code": "380",
"number": "2026-1202",
"issue_date": "2026-11-05",
"due_date": "2026-12-05",
"currency": "EUR",
"buyer_reference": "08999000-GBM01-89",
"order_reference": "VG-2026-311",
"invoicing_period": { "start": "2026-10-20", "end": "2026-10-24" },
"seller": { "name": "Holzwerkstatt Brenner GmbH", "vat_id": "DE987654328" },
"buyer": {
"name": "Stadt Musterstadt",
"electronic_address": { "scheme": "0204", "value": "08999000-GBM01-89" }
},
"lines": [
{
"key": "l-3f2a",
"id": "1",
"name": "Holzfenster aufarbeiten",
"quantity": "14",
"unit_code": "H87",
"net_price": "185.00",
"net_amount": "2590.00",
"vat_category": "S",
"vat_rate": "19"
}
],
"totals": {
"net_total": "3785.00",
"vat_total": "719.15",
"gross_total": "4504.15",
"amount_due": "4504.15"
}
},
"sources": {
"/number": { "origin": "pdf", "page": 1, "bbox": [0.71, 0.21, 0.86, 0.23] },
"/buyer_reference": { "origin": "client" },
"/seller/vat_id": { "origin": "config" }
},
"findings": [
{
"id": "f-1",
"severity": "error",
"kind": "check_point",
"rule_id": "FELD-CHECK",
"business_term": "BT-73",
"path": "/invoicing_period/start",
"source": "rules",
"message": "Beginn des Abrechnungszeitraums wurde in der PDF nicht gefunden. Bitte prüfen und bestätigen.",
"message_key": "einvoice.rule.feld_check",
"params": {
"field": "Beginn des Abrechnungszeitraums",
"field_en": "Invoicing period start date"
},
"suggestion": null,
"code": null
}
],
"summary": {
"errors": 1,
"warnings": 0,
"check_points": 1,
"deviations": 0,
"number": "2026-1202",
"buyer_name": "Stadt Musterstadt",
"gross_total": "4504.15",
"currency": "EUR",
"issue_date": "2026-11-05"
},
"releases": [],
"last_release_error": null,
"error": null,
"created_at": "2026-11-23T09:14:02Z",
"updated_at": "2026-11-23T09:14:31Z"
}
data: the invoice
The invoice follows EN 16931 with snake_case names: number (BT-1), issue_date (BT-2), buyer_reference (BT-10), seller, buyer, delivery, payment, lines, vat_breakdown, totals and so on. data is null until the invoice has been read.
- Amounts and quantities are decimal strings (
"719.15"), dates areYYYY-MM-DD, codes come from the official code lists. - Every element of an array of objects carries a
key, such asl-3f2a. It stays the same when other elements are added or deleted, so paths keep pointing at the same line. GET /v1/einvoice/schema?format=xrechnung_ublreturns the JSON schema of the invoice with the business term of every field (x-bt), its German and English label (x-label), the code lists, and the fields the format requires.
sources: where each value comes from
sources maps a JSON pointer into data to the origin of its value:
origin | The value |
|---|---|
pdf | was read from the PDF; page (1-based) and bbox (left, top, right, bottom as fractions of the page) locate it |
config | comes from the seller config |
client | was set through this API, in overrides or a PATCH; it counts as confirmed |
user | was set by a person in the Feld web app; it counts as confirmed |
When a value differs from what the PDF shows, printed_value holds the value as the PDF shows it, and deviation says how the two differ:
deviation | Meaning |
|---|---|
rounding | An amount that differs by at most 2 cents and at most 1 % of the amount on the PDF. A warning. |
corrected_reading | Feld misread the PDF, and the new value is what the PDF actually shows. An info finding; it does not block ZUGFeRD. |
changed | Any other difference from the PDF. An error when it changes an invoice detail under zugferd (see Correct and confirm), an info finding otherwise. |
A value that Feld did not read from the PDF, such as a buyer reference or an electronic address you added, has neither field. If a line, allowance or charge, VAT breakdown row or bank account (lines, allowances_charges, vat_breakdown, payment.credit_transfers) has a new key — because it was deleted and entered again, or because your overrides replaced the whole array — Feld compares it with the element read from the PDF that it replaces: among the elements read from the PDF whose key no longer exists, the one that has the most invoice details in common with it.
findings: what is missing, wrong or unconfirmed
| Field | Description |
|---|---|
severity | error blocks the release; warning and info do not. |
kind | missing (a required value is absent), invalid (a value breaks a rule), arithmetic (amounts do not add up), check_point (see below), deviation (differs from the PDF), config_mismatch (contradicts the seller config) or validator (reported at release). |
rule_id | The id of the rule, for example BR-DE-15 (an XRechnung rule) or FELD-CHECK (a Feld rule). It does not change, so you can use it in code. |
business_term | The BT or BG id the finding is about. |
path | JSON pointer into data; array elements are addressed by key, as in /lines/l-3f2a/vat_rate. null when the finding concerns no single field. |
source | Which check reported it. While you review: rules (Feld's checks, which run on every change) and extraction (notes from reading the PDF). At release: kosit (the KoSIT validator), facturx (the Factur-X rules) and hybrid (Feld's checks of the ZUGFeRD PDF itself, such as PDF/A-3 and the embedded XML). |
message | German text for display. Use rule_id, kind and path for logic; message_key and params let you translate it. |
suggestion | {value, label}: a value Feld proposes, for example a calculated total or the value on the PDF. Feld never applies it on its own; send it with a PATCH. |
code | A machine-readable cause, on some validator findings. |
Check points. For critical values — amounts, dates, the invoice number, party names, ids, IBANs and VAT rates — Feld must find the value at a place on the PDF. If it cannot, the value gets an error with kind: "check_point" and rule_id: "FELD-CHECK" until someone confirms it or sets it. The official validators check the format, not whether the data matches the invoice, so these are the values to compare with the PDF.
Values read with a warning. A text on the PDF that is longer than its field allows is shortened. The name of a line (up to 1,000 characters) ends after a whole word and the line's description keeps the full text; any other shortened text gets a warning with rule_id: "FELD-TEXT-SHORTENED". The unit "MT" can mean Manntag, month or metric tonne: Feld sets it to C62 with a warning FELD-UNIT-AMBIGUOUS, so set the right unit_code.
summary holds the number of findings by severity and kind, and the main header values, as the list returns them.
05 — Correct and confirm
revision counts the changes to a conversion. It goes up by one with every change: each PATCH, release, revise and retry, each edit in the web app, and each time Feld finishes reading or releasing the invoice. Send the revision from your last read together with your corrections and confirmations; Feld refuses the request if the conversion has changed since.
curl -X PATCH https://api.feld.ai/v1/einvoice/conversions/{conversion_id} \
-H "Authorization: Bearer YOUR_API_KEY" \
-H "Content-Type: application/json" \
-d '{
"revision": 2,
"confirm": ["/invoicing_period/start"]
}'
Response — 200 OK: the whole conversion, checked again, with "status": "ready", "revision": 3 and no findings left.
| Field | Description |
|---|---|
revision | Required. The revision you read. If the conversion changed in the meantime, the request is refused with 409 revision_conflict: read it again and redo your change. |
data | A JSON merge patch (RFC 7396) of the invoice. Objects merge, and null removes a value. Arrays of objects merge by key: an element with a known key is changed, an element with an unknown key or none is appended, and "_delete": true removes one. An empty array changes nothing. |
confirm | JSON pointers whose current value you confirm. A confirmation holds for that value; if the value changes later, it has to be confirmed again. A pointer at which data holds no value is refused. |
format | Switches the format; the rules of the new format apply at once. |
reapply_config | true applies the project's current seller config again. |
To act on a finding, set a value at its path. A path through an array names the element's key, which becomes a key entry in the patch: /lines/l-3f2a/vat_rate becomes {"lines": [{"key": "l-3f2a", "vat_rate": "19"}]}. For a finding with a suggestion, send suggestion.value at the finding's path.
{
"revision": 2,
"data": {
"totals": { "vat_total": "719.15" },
"lines": [
{ "key": "l-3f2a", "vat_rate": "19" },
{ "key": "l-77c1", "_delete": true }
]
},
"confirm": ["/seller/name"]
}
-
Feld checks the invoice again before it answers, so the response already carries the new findings and status.
-
Values that do not fit the schema, such as
"issue_date": "05.11.2026"or text with a character XML cannot hold, are refused with400andcode: invalid_data, and nothing changes. Feld checksdatafirst:errorslists every value in it that does not fit, atbody.data.…(body.data.lines.l-3f2a.vat_rate), even whenconfirmnames the same pointer. Only whendatafits are theconfirmpointers checked, and the first one without a value is the only entry, named by its index:body.confirm.0. -
Values you set through
dataoroverridescount as confirmed; they need no entry inconfirm. -
With
zugferd, the visible PDF and the embedded data must show the same invoice. This applies to the invoice details: what § 14 UStG requires an invoice to state — amounts, quantities, VAT rates and exemption reasons, the names and addresses of seller and buyer, the seller's VAT id and tax number, the invoice number and type, the currency, the issue, delivery and tax point dates, the invoicing periods, and the names and descriptions of the lines — and the IBAN. These are errors, and no option turns them off:- changing an invoice detail away from the value on the PDF;
- deleting an invoice detail that the PDF shows, or a whole line, allowance, charge, VAT breakdown row or bank account that holds one (
rule_id: "FELD-DEV-REMOVED"); - adding an invoice detail that no page of the PDF shows (
FELD-DEV-ADDED), for example a delivery date, a line or an IBAN. Values that follow from others — codes, countries, VAT rates, the amounts of the VAT breakdown and the computed totals — may be added.
Switch to
xrechnung_ublorxrechnung_cii("format"in the patch), restore the value on the PDF, or correct the source PDF and start a new conversion for it. Correcting a value Feld misread so that it matches the PDF (corrected_reading) does not block ZUGFeRD. A line read by mistake, such as a subtotal row, cannot be deleted underzugferdeither, because the PDF shows it: use XRechnung for that invoice.
06 — Release
Once the conversion is ready, release the current revision:
curl -X POST https://api.feld.ai/v1/einvoice/conversions/{conversion_id}/release \
-H "Authorization: Bearer YOUR_API_KEY" \
-H "Content-Type: application/json" \
-d '{"revision": 3}'
Response — 202 Accepted: the conversion with "status": "releasing".
Feld writes the XML (for zugferd, the PDF/A-3 with the XML embedded) and validates it with the official rules: the KoSIT XRechnung configuration for XRechnung, the KoSIT EN 16931 rules and the Factur-X rules for ZUGFeRD. Feld's own checks cover what § 14 UStG requires beyond these rules; they run on every change, so an error from them blocks the release before it starts. A release usually takes a few seconds. Poll until the status changes:
| Outcome | Status | What to do |
|---|---|---|
| The validators accept the file | released | Download it. |
| The validators reject the file | needs_review | Their messages are findings with kind: "validator" and source kosit, facturx or hybrid. Correct and release again. |
| No result, for example a timeout | ready, with last_release_error (code, message, retryable) | If retryable is true, release again; if it is false, contact Feld support. |
While an error finding is left, the release is refused with 409 conversion_not_ready; an outdated revision gets 409 revision_conflict. If Feld cannot start the release (503 job_not_queued), the conversion is back in ready with a higher revision: read it again before you release again.
07 — Download the e-invoice
curl https://api.feld.ai/v1/einvoice/conversions/{conversion_id}/releases/1/file \
-H "Authorization: Bearer YOUR_API_KEY" \
-D - \
-o 2026-1202.xml
Response — 200 OK with the file. The headers identify it:
content-type: application/xml
content-disposition: attachment; filename="2026-1202.xml"; filename*=UTF-8''2026-1202.xml
x-content-sha256: 3a7bd3e2360a3d29eea436fcfb7e44c735d117c42d1c1835420b6b9942dd4f1b
x-validation-verdict: accepted
x-release-version: 1
x-content-type-options: nosniff
An XRechnung is an XML file (application/xml); a ZUGFeRD release is the PDF with the XML embedded (application/pdf). The file name is the invoice number. Compare X-Content-SHA256 with the SHA-256 of the bytes you stored. A version that was never released answers 404 ("Release not found"), a version below 1 400.
The conversion lists every released version in releases:
{
"version": 1,
"format": "xrechnung_ubl",
"profile": null,
"rule_set": "xrechnung-3.0",
"file_name": "2026-1202.xml",
"content_type": "application/xml",
"size": 14211,
"sha256": "3a7bd3e2360a3d29eea436fcfb7e44c735d117c42d1c1835420b6b9942dd4f1b",
"released_at": "2026-11-23T09:16:05Z",
"released_by": { "type": "api_key", "id": "5e1d2c3b-4a59-4b68-8c7d-9e0f1a2b3c4d" },
"validation": {
"verdict": "accepted",
"engines": ["e-rechnung 0.1.0 (2d05c67)", "xrechnung-config 2026-08-31"],
"report_id": "6b0d7f0e-4c8b-4d8e-9a53-0a4f6f6f2c10"
}
}
released_by is {"type": "api_key", "id": …} for a release through the API and {"type": "user", "id": …} for one from the web app. validation.engines names the validator software and the versions of the official rules that checked the file.
The validation report
The report lists the verdict, the validators and rule versions that ran, and every message. Store it with the file.
curl "https://api.feld.ai/v1/einvoice/conversions/{conversion_id}/releases/1/report?report_format=xml" \
-H "Authorization: Bearer YOUR_API_KEY" \
-o 2026-1202-report.xml
report_format is xml or html (the default). Both come as a download (report-v1.xml, report-v1.html), with the same headers as the file; here X-Content-SHA256 is the checksum of the report.
Statuses
| Status | Meaning | Next step |
|---|---|---|
processing | Feld waits for the document and reads the invoice. | Poll. |
needs_review | Error findings are left: missing values, check points, rule violations or a rejected release. | Correct and confirm with PATCH, or hand the review_url to a person. |
ready | No error finding is left. | Release, or keep correcting. |
releasing | Feld creates and validates the file. | Poll. |
released | The file of this version is created, validated and stored; it never changes. | Download. To change it, open a new version. |
failed | The PDF could not be converted; error says why. | If error.retryable is true, POST /v1/einvoice/conversions/{conversion_id}/retry. |
error.code on a failed conversion:
| Code | Cause |
|---|---|
document_not_readable | The PDF cannot be read, for example because it is password-protected, or it was not processed within 10 minutes. |
no_invoice_detected | The document is not an invoice. |
multiple_invoices_in_document | The PDF holds several invoices. Split it and convert each one. |
unsupported_document_type | Not an invoice (380), credit note (381) or corrected invoice (384), for example a partial or final invoice. |
document_too_long | The PDF has more than 30 pages. |
extraction_failed | Reading the invoice failed, was interrupted or could not be started. |
overrides_not_applicable | The overrides do not fit the invoice that was read. Not retryable. |
retry reads the invoice again and answers 202 with the conversion back in processing. It is refused with 409 conversion_not_retryable when error.retryable is false.
Formats
format | Output | For |
|---|---|---|
zugferd | The original PDF as PDF/A-3b with factur-x.xml embedded: ZUGFeRD 2.5 / Factur-X 1.09, profile EN 16931 | Businesses. The recipient sees the familiar PDF and can read the data. |
xrechnung_ubl | XML: XRechnung 3.0 in UBL 2.1 (Invoice, or CreditNote for a credit note) | Public authorities. Requires the buyer reference (BT-10), the electronic addresses of seller and buyer, and a seller contact. |
xrechnung_cii | XML: XRechnung 3.0 in UN/CEFACT CII | As xrechnung_ubl, in the other syntax. Use the one your recipient asks for. |
The format can be switched with PATCH until the release, and after it through a new version.
With zugferd:
- An invoice detail that differs from the PDF, that the PDF shows but the data no longer has, or that the data has but no page shows, blocks the release, because the visible PDF would show a different invoice than the data (see Correct and confirm).
- Signed or encrypted PDFs, and PDFs that already carry invoice data, cannot become ZUGFeRD. The release then returns to
needs_reviewwith a finding that says so; use XRechnung. - When Feld cannot verify that the PDF meets PDF/A-3b, the release still goes through, with a warning finding (
code: "pdfa_not_verified"). The invoice data is valid; some checking tools may show a warning about the PDF.
Overrides
overrides on create is a partial invoice in the shape of data. Use it for what you know before Feld reads the PDF and the PDF does not show, typically the buyer reference, the buyer's electronic address or a contact:
{
"document_id": "1b2e3f40-6a7b-4c8d-9e0f-1a2b3c4d5e6f",
"overrides": {
"buyer_reference": "08999000-GBM01-89",
"buyer": {
"electronic_address": { "scheme": "0204", "value": "08999000-GBM01-89" },
"contact": { "email": "gebaeudemanagement@musterstadt.example" }
}
}
}
- Feld applies the overrides after reading the PDF, and again after every
retry:- an object merges into what was read, so
buyer.contact.emailleaves the buyer's name alone; - a single value replaces the value read from the PDF;
- an array —
lines,payment.credit_transfers,notes, a line'sallowances_charges— replaces the array read from the PDF as a whole. An IBAN you send therefore replaces the one on the PDF instead of being added next to it.
- an object merges into what was read, so
- Every value under a path you set carries origin
clientinsourcesand counts as confirmed, even when it equals what the PDF shows. nulland blank values are ignored, so overrides cannot remove a value read from the PDF; remove it with aPATCHinstead. An array element left without any value is dropped, at every level, and an object or array left empty is ignored:{"lines": [{}]}changes nothing, while{"lines": [{}, {"name": "A"}]}replaces the lines read from the PDF with line A.- Feld assigns the
keyof every array element. Akeyanywhere inoverridesis refused with400andcode: invalid_data, with oneerrorsentry per occurrence (param:body.overrides.lines.0.key). - An override counts as confirmed, but Feld still compares it with the PDF, like a correction in a
PATCH. An override that contradicts an invoice detail on the PDF counts aschanged; an array override that leaves out a line, allowance, charge or bank account the PDF shows, or that brings one the PDF does not show, removes or adds an invoice detail. Underzugferdeach of these is an error, see Correct and confirm. An array that repeats the elements on the PDF needs no keys for that: Feld compares each element with the one on the PDF it has the most invoice details in common with. - Feld checks the overrides completely at create. Text with a character that XML cannot hold, and values that do not fit the schema, are refused there with
400andcode: invalid_data; one response lists every failure, thekeyentries first (param:body.overrides.issue_date,body.overrides.lines.0.net_amount). If they still cannot be applied to what was read, the conversion endsfailedwithoverrides_not_applicable, whichretrycannot fix: discard the conversion and create it again with corrected overrides. - With a seller config, the config decides the seller identity and the bank accounts. An override of a seller field the config sets (
seller.name,seller.vat_id,seller.tax_number,seller.address,seller.legal_registration_id), or ofpayment.credit_transferswhen the config lists bank accounts, is refused with422andcode: overrides_set_by_config;errorsnames each path. Change the config instead. The seller's contact and electronic address can still be overridden. - A seller config created after the conversion takes precedence too: when Feld reads the invoice, it ignores the overrides of the values that config sets.
Client reference and buyer reference
The two are easy to mix up:
client_reference | overrides.buyer_reference | |
|---|---|---|
| What it is | Your own id for the invoice, for example its document or job id in your system | BT-10: the reference the buyer gave you, so the invoice reaches the right place on the buyer's side |
| In the e-invoice | Never | Yes |
| What Feld uses it for | Recognising a repeated create (see Idempotency) and filtering the list | XRechnung requires it (BR-DE-15). For a public authority it is the Leitweg-ID. |
| Unique | Per project | No |
Idempotency and retries
-
Repeating a create with the same body returns
200with the existing conversion; nothing is started again. Feld comparesdocument_id,client_reference(trimmed),formatandprofileas sent,overrideswithout the blank values and empty elements it ignores (see Overrides), andauto_release: leaving outformatand sending the default explicitly count as different. Resend exactly the body of the first request. -
A different body for a document that already has a conversion, or under a
client_referencethat is already used, returns409 conversion_exists. Nothing changes. A document someone already converted in the web app gives the same409. -
A
503 job_not_queuedon create means Feld created the conversion but could not start reading the invoice: the conversion isfailedwitherror.retryable: true. Repeat the create to get it (200), then callretry. -
One conversion per document. Creating a conversion for the same document again gives you the existing one (or the
409above). -
The upload has no idempotency key. If an upload's response is lost and you upload again, the project holds a second copy of the PDF. Before uploading again, look the invoice up by your reference:
curl "https://api.feld.ai/v1/einvoice/conversions?client_reference=DMS-48213" \
-H "Authorization: Bearer YOUR_API_KEY"If it returns a conversion, continue with that one. A copy without a conversion is harmless; remove it with
DELETE /v1/documents/{document_id}if you like.
Deleting a document also deletes its conversions and their released files. Download what you need to keep first, and never delete the document of a conversion you still use.
Automatic release
With "auto_release": true, Feld releases the conversion as soon as the invoice has been read without errors (status ready), after the create and again after a retry; you then only poll until released. released_by names the API key that created the conversion. Automatic release never:
- confirms a check point,
- accepts a changed, removed or added invoice detail under
zugferd, - releases while an error finding is left.
So overrides that replace an array under zugferd with elements the PDF does not show leave the conversion in needs_review. If the conversion ends in needs_review, or the validators reject the file, it waits there like any other conversion. Correct it with PATCH (or through the review_url) and release it yourself with POST /v1/einvoice/conversions/{conversion_id}/release: a PATCH or revise never starts an automatic release.
In two cases the conversion stays ready with last_release_error (retryable: true) instead of being released; release it yourself:
api_key_inactive: the API key that created the conversion was no longer active (for example revoked or deleted) when Feld had read the invoice.release_failed: Feld could not start the release.
Review in the Feld web app
review_url opens the conversion in the Feld web app: the PDF next to the fields, with every finding at its field. Hand it to a person for what your integration cannot decide on its own, such as a check point that needs someone who knows the order.
- The person needs a Feld login with access to the project. The API key does not give access to the web app.
- In the E-Rechnung list of the web app, conversions created through the API carry an
apimarker and can be filtered by origin. Values you set show the origin "über die API" (via the API). review_urlisnullonly on a deployment that has no web app address configured.- Changes made in the web app raise the
revision. APATCH,releaseorrevisewith the revision you read before then returns409 revision_conflict: read the conversion again first.
Revising a released conversion
A released version never changes; a PATCH on it returns 409 conversion_released. To change the invoice, open the next version:
curl -X POST https://api.feld.ai/v1/einvoice/conversions/{conversion_id}/revise \
-H "Authorization: Bearer YOUR_API_KEY" \
-H "Content-Type: application/json" \
-d '{"revision": 5}'
Response — 200 OK: the conversion as version 2, with the data of version 1 and the status needs_review or ready. Correct it and release it as before. releases then lists both versions, and releases/1/file stays downloadable. A change of format after the release works the same way.
If the recipient already has the invoice, do not send a new version of it. Issue a corrected invoice instead.
Listing and discarding
GET /v1/einvoice/conversions returns the project's conversions, newest first, as {data, total}. Each item carries the status, summary, error, client_reference and review_url of a conversion, but not its data, sources, findings or releases. Conversions started in the web app are listed too (origin: ui). Filter with status, origin (api or ui), client_reference (trimmed like on create; a blank value or one with a control character is 400) and document_id; page with limit (1–100, default 20) and offset.
DELETE /v1/einvoice/conversions/{conversion_id} discards a conversion that was never released and answers 204. The PDF stays in the project. A conversion that is still processing is discarded too; one with a released version is kept (409 conversion_released), and one that is releasing cannot be discarded until the release has ended (409 conversion_busy).
Rate limits
POST /v1/einvoice/conversions and POST /v1/einvoice/conversions/{conversion_id}/release each allow 60 requests per API key within any 60 seconds, counted separately. The other endpoints, the list included, have no limit of their own. Feld counts a request once it has passed authentication, the check of the body, the check that the feature is enabled and, for a release, the lookup of the conversion; from then on it counts whatever the answer:
| Not counted | Counted | |
|---|---|---|
| Create | 401, 400 for the body, 404 einvoice_not_enabled | 400 invalid_data, 404 for the document, 200, 409, 422, 503 and 202 |
| Release | 401, 400 for the body, 404 for an unknown conversion or einvoice_not_enabled | 409, 503 and 202 |
A 429 does not count. Each of Feld's API servers counts on its own, so more than 60 requests may get through before the first 429.
Errors
Errors use the standard envelope. Where a client is expected to react, error.code names the case; every 409 carries one:
{
"type": "error",
"error": {
"type": "conflict_error",
"message": "The conversion was changed in the meantime; load it again",
"code": "revision_conflict"
}
}
| Status | code | When |
|---|---|---|
400 invalid_request_error | — | Malformed body, a missing or misspelled field, an unknown value such as "format": "xrechnung", a client_reference with a control character or an unpaired surrogate, or a version below 1. param names the field. |
400 invalid_request_error | invalid_data | Invoice values in overrides or data that do not fit the schema or hold a character XML cannot carry, a key in overrides, or a confirm pointer without a value. errors lists every failure in overrides, or every failure in data; a confirm pointer is checked only when data fits, and only the first one without a value is named (body.confirm.0). |
401 authentication_error | — | Missing or invalid API key. |
404 not_found_error | einvoice_not_enabled | E-invoice conversion is not enabled for the project. Every endpoint answers this way. |
404 not_found_error | — | "Conversion not found", "Document not found" (param: body.document_id) or "Release not found": it does not exist, or it belongs to another project. |
409 conflict_error | see below | The conversion's status or revision does not allow the request. |
422 unprocessable_entity_error | document_not_pdf | The document is not a PDF (param: body.document_id). |
422 unprocessable_entity_error | profile_not_supported | profile with an XRechnung format (param: body.profile). |
422 unprocessable_entity_error | overrides_set_by_config | overrides set what the seller config decides; errors names each path. |
429 rate_limit_error | rate_limited | Create or release above their limit, see Rate limits. There is no Retry-After header: wait and retry. |
503 api_error | job_not_queued | Feld could not start reading the invoice (create, retry) or creating the file (release). The conversion is then failed with error.retryable: true (create, retry) or back in ready with last_release_error (release). After a create, repeat it to get the conversion (200) and call retry; after a retry, call it again. Before you release again, GET the conversion: the failed start raised its revision, so the same body would get 409 revision_conflict. |
503 api_error | — | A released file or report cannot be read right now. Retry. |
code | Returned by | Meaning |
|---|---|---|
conversion_exists | create | The document or the client_reference already has a conversion, created with a different body. |
revision_conflict | PATCH, release, revise | The conversion changed since you read it. Read it again. |
conversion_busy | PATCH, release, DELETE | The conversion is processing or releasing. Wait. |
conversion_released | PATCH, release, DELETE | The version is released. Revise it to change it. |
conversion_failed | PATCH | The conversion is failed. Retry it. |
conversion_not_ready | release | Error findings are left. |
conversion_not_released | revise | Only a released conversion can be revised. |
conversion_not_failed | retry | Only a failed conversion can be retried. |
conversion_not_retryable | retry | error.retryable is false. |
Endpoints
| Method and path | Purpose |
|---|---|
GET /v1/einvoice/schema?format= | The invoice schema for a format |
POST /v1/einvoice/conversions | Start a conversion for an uploaded PDF |
GET /v1/einvoice/conversions | List conversions |
GET /v1/einvoice/conversions/{conversion_id} | Status, data, sources, findings and releases |
PATCH /v1/einvoice/conversions/{conversion_id} | Correct and confirm |
POST /v1/einvoice/conversions/{conversion_id}/release | Create, validate and store the e-invoice file |
POST /v1/einvoice/conversions/{conversion_id}/revise | Open the next version of a released conversion |
POST /v1/einvoice/conversions/{conversion_id}/retry | Read a failed conversion again |
GET /v1/einvoice/conversions/{conversion_id}/releases/{version}/file | Download a released file |
GET /v1/einvoice/conversions/{conversion_id}/releases/{version}/report | The validation report of a released version |
DELETE /v1/einvoice/conversions/{conversion_id} | Discard a conversion that was never released |
Request and response schemas for each endpoint are in the API Reference.
Next steps
- Authentication — API key management and security
- Error handling — Error types and status codes
- API Reference — Full endpoint documentation
- E-Rechnungen aus PDF-Rechnungen erstellen — The review in the web app (German)