Skip to main content

Lexoffice

Prerequisites

  • A PolyDoc account and API key — sign up for free, no credit card required. The free plan includes 150 PDF conversions per month.
  • A Lexoffice account — start a free trial to explore the API.

Use Case 1: Custom-Branded Invoice PDFs

Generate custom-branded invoice PDFs from Lexoffice data, replacing the default Lexoffice PDF layout with your own template.
Lexoffice webhook (invoice created) → Automation tool → Fetch invoice details → PolyDoc API → Email branded PDF

Register a webhook in Lexoffice

Register a webhook subscription in the Lexoffice API documentation for the invoice.created event. The webhook payload includes the invoice ID, which you'll use to fetch full details.

Screenshot placeholder: /img/guides/lexoffice/lexoffice-uc1-register-webhook.png

Connect an automation tool to receive the webhook

In your automation tool (Make, Zapier, or n8n), create a workflow with a webhook trigger that receives the Lexoffice event. The incoming payload contains the resourceId (invoice ID).

Screenshot placeholder: /img/guides/lexoffice/lexoffice-uc1-automation-webhook.png

Fetch invoice details via the Lexoffice API

Add an HTTP request to fetch the full invoice from the Lexoffice API: GET https://api.lexoffice.io/v1/invoices/{resourceId}. Include your Lexoffice API key in the Authorization header.

Screenshot placeholder: /img/guides/lexoffice/lexoffice-uc1-fetch-invoice.png

Map data to your PolyDoc template

Add another HTTP request to call the PolyDoc API:

  • URL: https://api.polydoc.tech/pdf/convert
  • Method: POST
  • Headers: Authorization: Bearer YOUR_API_KEY and X-Sandbox: true (get your API key from the Dashboard)
  • Content-Type: application/json
  • Body: Map invoice fields (number, date, line items, contact, totals) to your PolyDoc template.
Screenshot placeholder: /img/guides/lexoffice/lexoffice-uc1-polydoc-request.png

Send the branded PDF by email

Add an email action to send the branded PDF to the customer. Map the recipient from the Lexoffice contact data, attach the PDF from the PolyDoc response, and activate the workflow.

Screenshot placeholder: /img/guides/lexoffice/lexoffice-uc1-send-email.png

Use Case 2: Bulk Custom Document Export

Export multiple Lexoffice vouchers as custom-branded PDFs in bulk.
Lexoffice API (list vouchers) → Loop → PolyDoc API → Cloud storage

Fetch vouchers from the Lexoffice API

Use the Lexoffice API to fetch a list of vouchers: GET https://api.lexoffice.io/v1/voucherlist. Filter by date range, status, or voucher type as needed.

Screenshot placeholder: /img/guides/lexoffice/lexoffice-uc2-fetch-vouchers.png

Loop and map each voucher to your template

Loop through each voucher. For each one, fetch the full details from the Lexoffice API and map the fields (number, date, line items, totals) to your PolyDoc template. Call the PolyDoc API to generate the PDF.

Screenshot placeholder: /img/guides/lexoffice/lexoffice-uc2-loop-generate.png

Generate PDFs and upload to storage

Upload each generated PDF to cloud storage (Google Drive, S3, or SharePoint). Name files consistently (e.g. voucher-{number}.pdf) for easy retrieval.

Screenshot placeholder: /img/guides/lexoffice/lexoffice-uc2-upload-storage.png