POST /visualize/pdf – Render the invoice as a PDF

REST-API · POST /visualize/pdf · paid route

The invoice as a PDF: readable for people, straight from the API.

This route turns an e-invoice into a readable PDF. An XML invoice is hard to read for people; the rendering shows sender, recipient, lines, taxes and payment details the way you know it from an invoice on paper.

The rendering is made with the visualization part of the KoSIT validator. It is suited for filing, printing and forwarding.


Request

How to call the route

Address: POST https://invoicepress.de/wp-json/einvoice-api/v1/visualize/pdf

Key: Send your API key in the header Authorization: Bearer <key> or in X-Api-Key. Both work the same way. Without a key, the free quota of two calls per route and day applies; a key that is sent but not valid gets status 401.

Body: The body of the request is the invoice itself: as XML (XRechnung, Peppol BIS, CII or UBL) with Content-Type: application/xml, or as a ZUGFeRD or Factur-X PDF with Content-Type: application/pdf. From a PDF the service first takes the embedded invoice.

Parameters

lang (optional) – de or en: the language of the labels.

This route passes the invoice on to the Validator Bridge on our server. The bridge is a small program that runs the validator there. The invoice goes to this bridge and to no other service.

The invoice is processed in memory only and is not stored. The usage log keeps a fingerprint of the request, never its content.


Answer

What comes back

Status 200 – with the rendering as a PDF (application/pdf).

When something goes wrong

Status 401 – A key was sent, but it is not valid.

Status 403 – The route is switched off on this service.

Status 429 – The quota is used up.

Status 501 – No Validator Bridge is set up on this service.

Status 502 – The Validator Bridge does not answer.


Example

A call with curl

curl -X POST "https://invoicepress.de/wp-json/einvoice-api/v1/visualize/pdf?lang=en" \
     -H "X-Api-Key: <key>" \
     -H "Content-Type: application/xml" \
     --data-binary @invoice.xml -o invoice.pdf

Cost

Quota and plan

This route is a paid route. With a key, every successful call counts as one validation against the monthly quota of your plan; answers with an error status are not counted. To try it, you can call the route twice a day without a key. This limit applies per network address and per route: two calls to this route leave the other routes untouched. Every answer without a key tells you in the headers X-RateLimit-Remaining and X-RateLimit-Reset how many calls are left today and when the counter resets.