Access: The API is included in the Pro plan. You create the API key in your account.
Endpoints
Convert
Conversion takes three calls: submit the PDF, fetch the fields that were read, send the confirmed fields. Between the second and the third call a person checks the fields. Without confirmation no e-invoice is created.
1. Submit the PDF
curl -sS https://api.erechnungsampel.de/v1/conversions \
-H "Authorization: Bearer $ERA_API_KEY" \
-H "Idempotency-Key: invoice-2026-0042" \
-H "Content-Type: application/pdf" \
--data-binary @invoice.pdf| Body | the PDF as raw data, 20 MB and 10 pages at most |
|---|---|
Idempotency-Key | required, 1 to 255 visible characters. The same key with the same content returns the same conversion instead of starting a second one |
The answer is 202 with the conversion in status processing and a Location header. The credits for the conversion are reserved now.
2. Fetch the fields
curl -sS https://api.erechnungsampel.de/v1/conversions/$ID \
-H "Authorization: Bearer $ERA_API_KEY"Poll about every two seconds until status is no longer processing. Reading usually takes 10 to 40 seconds.
{
"id": "50e54f6e87d6e9058ce45498ccb20974",
"status": "ready",
"createdAt": "2026-11-19T09:12:04Z",
"expiresAt": "2026-11-19T09:41:44Z",
"source": "text",
"needsReview": true,
"fields": {
"BT-1": {
"value": "RE-2026-0042",
"sources": [{ "page": 1, "line": 2, "quote": "RE-2026-0042" }]
}
},
"draft": { "BT-1": "RE-2026-0042" },
"hints": [{ "kind": "REVERSE_CHARGE", "sources": [{ "page": 1, "line": 31, "quote": "Reverse Charge" }] }],
"warnings": [{ "code": "FIELD_MISSING", "field": "BT-10" }]
}| Field | Content |
|---|---|
status | processing, ready or failed |
expiresAt | after this the data is deleted |
source | text (PDF with a text layer), ocr (scanned) or zugferd (the PDF already contains an e-invoice) |
needsReview | always true: the fields have to be checked |
fields | the fields that were read, by EN 16931 (keys BT and BG), each with value and sources |
fields.*.sources[] | page, line and the literal quote the value comes from |
draft | the same fields without sources, as a template for the confirmation |
hints[] | notes about a special case, with kind and sources |
warnings[] | what is missing or does not add up, with code and, depending on the code, the field concerned, the number of the line or VAT row (item, from 1) and the place in the PDF (page, line) |
error.code | for failed: the reason, for example protected_pdf or too_many_pages |
Warnings
code | Meaning |
|---|---|
FIELD_MISSING | a mandatory XRechnung field was not found in the PDF |
FIELD_AMBIGUOUS | two places in the PDF contradict each other |
CITATION_NOT_FOUND | a value could not be found in the line it cites and was discarded |
VALUE_NOT_IN_QUOTE | a date or an amount does not match the quote; the value was discarded |
ITEM_ARITHMETIC_MISMATCH | quantity times price does not give the amount of the line |
ARITHMETIC_MISMATCH | the totals of the invoice do not add up |
VAT_BREAKDOWN_MISMATCH | the VAT breakdown does not match the lines |
VAT_TOTAL_COMPUTED | the VAT total (BT-110) is not printed in the PDF; the value in fields is the sum of the quoted tax amounts |
IBAN_CHECKSUM_INVALID, VAT_ID_INVALID, LEITWEG_ID_INVALID | the check digit or the structure of the value is wrong; the quoted value is kept |
OCR_PAGE, OCR_LOW_CONFIDENCE | a page was read by text recognition; with OCR_LOW_CONFIDENCE the recognition was uncertain |
A discrepancy is reported, never corrected. The table is not complete: further codes describe how the PDF was read. Show an unknown code as a note when the fields are reviewed.
Hints
hints[].kind is REVERSE_CHARGE, KLEINUNTERNEHMER, INTRA_COMMUNITY_SUPPLY, EXPORT or SKONTO. A hint shows that the PDF mentions such a case. The API does not propose the tax category or the means of payment: that is for you and your tax adviser.
The PDF already is an e-invoice
If the PDF contains an embedded invoice XML (ZUGFeRD, Factur-X), source is zugferd. There is nothing to convert: the conversion is ready, report holds the check report of the embedded invoice (without the invoice field), the reserved credits are released, and confirm answers 409 with conversion_not_needed.
3. Confirm and receive the file
Send the checked fields (draft, with your corrections) and the target format:
curl -sS https://api.erechnungsampel.de/v1/conversions/$ID/confirm \
-H "Authorization: Bearer $ERA_API_KEY" \
-H "Content-Type: application/json" \
--data-binary @fields.json \
-D headers.txt \
-o xrechnung.xml{
"format": "xrechnung-cii",
"invoice": { "BT-1": "RE-2026-0042", "BT-10": "04011000-12345-06" }
}format | Result |
|---|---|
xrechnung-cii | XRechnung as CII XML |
xrechnung-ubl | XRechnung as UBL XML |
zugferd-en16931 | ZUGFeRD PDF in the EN16931 profile |
zugferd-xrechnung | ZUGFeRD PDF in the XRECHNUNG profile |
The created file is checked with the official validator before it is delivered. The answer 200 is the file itself, with these headers:
| Header | Content |
|---|---|
X-Erechnung-Traffic-Light | green or yellow |
X-Erechnung-Report | the check report as JSON, Base64url-encoded without padding |
Content-Disposition | the file name |
The credits are charged now, and the conversion is deleted. Fetching it again gives 410.
When the created invoice would be invalid
With 422 you receive the red check report instead of the file. The conversion stays ready and the credits stay reserved: correct the fields it names and confirm again. A file with errors is never delivered.
If an XRechnung lacks the business process (BT-23), the usual value urn:fdc:peppol.eu:2017:poacc:billing:01:1.0 is inserted; this does not happen for the format zugferd-en16931. Nothing else is calculated, rounded or filled in when you confirm.
Delete
curl -sS -X DELETE https://api.erechnungsampel.de/v1/conversions/$ID \
-H "Authorization: Bearer $ERA_API_KEY"204: the data is deleted and reserved credits are released.
Status codes
| Status | code | When |
|---|---|---|
400 | missing_idempotency_key, invalid_idempotency_key, empty_body | when submitting |
400 | invalid_json, invalid_format, missing_invoice, invalid_field | when confirming; for invalid_field, detail names the field |
400 | multiple_bg3_cii | when confirming in a CII format (xrechnung-cii, zugferd-en16931, zugferd-xrechnung): only one preceding invoice (BG-3) is possible |
402 | insufficient_credits, account_blocked | when submitting: the credits do not cover it, or the account is blocked |
403 | plan_without_conversion | the plan does not include conversion |
404 | conversion_not_found | unknown identifier |
409 | idempotency_in_progress | a request with this key is still running |
409 | conversion_not_ready, conversion_not_needed | when confirming |
410 | conversion_expired | expired, deleted or already delivered |
413 | body_too_large | larger than 20 MB |
415 | unsupported_media_type | not a PDF |
422 | idempotency_conflict | the same key with different content |
422 | (check report) | the created invoice would be invalid |
429 | rate_limited | limit reached, or the account already has 4 open conversions; Retry-After gives the waiting time |
502 | validator_failed, invalid_report | when confirming: the check of the created file failed |
503 | conversion_unavailable, service_busy, service_unavailable, validator_unavailable, timeout | temporarily unavailable |