Re:Drink
Settings

Lexware Office

Connection to the Lexware (lexoffice) Public API.

Last sync: never

Connection

API key stored securely as LEXWARE_API_KEY. Endpoint: api.lexoffice.io/v1.

Fetch data

Read-only calls to preview what Lexware returns.

Import invoices

Fetches all outgoing invoices (Ausgangsrechnungen) from Lexware and adds them to the Invoices section with their original invoice number. Customers are matched or created by name. Duplicates (matching invoice number) are skipped.

Import invoice PDFs

Downloads the PDF for every invoice from Lexware and attaches it to the matching invoice (by original invoice number). Invoices that already have a PDF are skipped.

Sync line items & auto-classify revenue

Pulls line items from Lexware for every imported invoice, then classifies each invoice into a revenue bucket (Lease 12/24/36, Purchase, Flavour Boxes, Installation, Other). Matched bank transactions inherit that bucket. Runs in batches of 150 (Lexware rate limit ~2 req/s).

Backfill net amounts (VAT split)

Recomputes the net subtotal and VAT for invoices that were imported without them, using their stored Lexware line items. The normalized (accrual) P&L counts net revenue only — invoices without a net amount are excluded.

Enrich customers & fill invoice links

Pulls full Kontakt details from Lexware — company name, Kunden-Nr., legal name, VAT ID, billing address, email, phone, IBAN & BIC — and fills any missing fields on your customers. Also recalculates total revenue and average days-to-pay per customer from paid invoices, and backfills IBAN from matched incoming bank transactions.

Pull Gesamtumsatz from Lexware

For every customer, sums totalAmount across all Lexware invoices (all statuses except voided) grouped by contactId — same as Gesamtumsatz shown in Lexware Office. Matched by Kunden-Nr., Lexware contact ID, or name. Writes into revenue_total on each customer.

Rebuild products & discounts

Scans every invoice line, links it to a matching product from the catalog, detects discounts (Lexware's discountPercentage or the delta between list price × quantity and the line total), and refreshes total / average discount on every customer.

Recurring templates (Serienvorlagen)

Pulls all recurring invoice templates from Lexware and projects the next 18 months of billings into Scheduled Invoices and the Cash Forecast. Templates are matched to customers by Lexware contact ID / name and to closed-won deals when available.