Skip to content

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

Shell
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
Bodythe PDF as raw data, 20 MB and 10 pages at most
Idempotency-Keyrequired, 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

Shell
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.

JSON
{
  "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" }]
}
FieldContent
statusprocessing, ready or failed
expiresAtafter this the data is deleted
sourcetext (PDF with a text layer), ocr (scanned) or zugferd (the PDF already contains an e-invoice)
needsReviewalways true: the fields have to be checked
fieldsthe 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
draftthe 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.codefor failed: the reason, for example protected_pdf or too_many_pages

Warnings

codeMeaning
FIELD_MISSINGa mandatory XRechnung field was not found in the PDF
FIELD_AMBIGUOUStwo places in the PDF contradict each other
CITATION_NOT_FOUNDa value could not be found in the line it cites and was discarded
VALUE_NOT_IN_QUOTEa date or an amount does not match the quote; the value was discarded
ITEM_ARITHMETIC_MISMATCHquantity times price does not give the amount of the line
ARITHMETIC_MISMATCHthe totals of the invoice do not add up
VAT_BREAKDOWN_MISMATCHthe VAT breakdown does not match the lines
VAT_TOTAL_COMPUTEDthe 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_INVALIDthe check digit or the structure of the value is wrong; the quoted value is kept
OCR_PAGE, OCR_LOW_CONFIDENCEa 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:

Shell
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
JSON
{
  "format": "xrechnung-cii",
  "invoice": { "BT-1": "RE-2026-0042", "BT-10": "04011000-12345-06" }
}
formatResult
xrechnung-ciiXRechnung as CII XML
xrechnung-ublXRechnung as UBL XML
zugferd-en16931ZUGFeRD PDF in the EN16931 profile
zugferd-xrechnungZUGFeRD 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:

HeaderContent
X-Erechnung-Traffic-Lightgreen or yellow
X-Erechnung-Reportthe check report as JSON, Base64url-encoded without padding
Content-Dispositionthe 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

Shell
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

StatuscodeWhen
400missing_idempotency_key, invalid_idempotency_key, empty_bodywhen submitting
400invalid_json, invalid_format, missing_invoice, invalid_fieldwhen confirming; for invalid_field, detail names the field
400multiple_bg3_ciiwhen confirming in a CII format (xrechnung-cii, zugferd-en16931, zugferd-xrechnung): only one preceding invoice (BG-3) is possible
402insufficient_credits, account_blockedwhen submitting: the credits do not cover it, or the account is blocked
403plan_without_conversionthe plan does not include conversion
404conversion_not_foundunknown identifier
409idempotency_in_progressa request with this key is still running
409conversion_not_ready, conversion_not_neededwhen confirming
410conversion_expiredexpired, deleted or already delivered
413body_too_largelarger than 20 MB
415unsupported_media_typenot a PDF
422idempotency_conflictthe same key with different content
422(check report)the created invoice would be invalid
429rate_limitedlimit reached, or the account already has 4 open conversions; Retry-After gives the waiting time
502validator_failed, invalid_reportwhen confirming: the check of the created file failed
503conversion_unavailable, service_busy, service_unavailable, validator_unavailable, timeouttemporarily unavailable

The limits are listed under Limits, all codes under Errors.