From the national e-invoicing system to the accounting portal — invoices are collected, registered, turned into PDFs and delivered to accounting without manual copying.
Built for a healthcare & retail company in Poland
Cost invoices used to be downloaded, retyped into a spreadsheet, saved as PDFs and uploaded to the accounting portal by hand — a repetitive chain with plenty of room for typos and missed documents.
The automation now handles the whole path. Twice a week it fetches new invoices from the national e-invoicing system, filters out non-cost suppliers, writes each invoice into the monthly Google Sheet and stores a readable PDF in the matching Drive folder.
After month-end, a second flow takes the verified sheet and folder and delivers the complete document set to the accounting portal — including cost documents added by the team from outside the e-invoicing system.
Two rhythms, one pipeline: a twice-weekly collection flow and a monthly handoff to accounting. PostgreSQL underneath remembers the status of every document.
Collection · Wed & Fri
E-invoicing system
government API · XML invoices
Ignore list
excluded supplier tax IDs
Google Sheets
monthly register, one tab per month
PDF generator
XML → readable invoice
Google Drive
monthly folder, files named by LP
Month-end close
Google Sheets
monthly register, one tab per month
Google Drive
monthly folder, files named by LP
Accounting portal
document intake for bookkeeping
Accounting
books & settlement
PostgreSQL
statuses · history · resume points · dashed = status tracking
Runs Wednesday & Friday mornings
Runs on the 1st night of the next month
The unglamorous part is what makes it production-grade: the automation assumes things will occasionally fail — and is designed to make that boring.
Each run uses a single browser session and a single portal login, minimizing time and failure surface.
A PostgreSQL lock prevents two invoice processes from ever running at the same time.
Every target system tracks its own status. A Drive error never causes a correct sheet row to be written twice.
Before any file or document is created, the automation checks whether it already exists.
Completed operations are never undone or repeated. Errors stay queued for retry and are visible in the database and logs.
Credentials, the company certificate and API tokens are never stored in code or shown in reports.
Technology: Python · government e-invoicing API · Google Sheets & Drive API · browser automation · PostgreSQL
Invoices, orders, onboarding, reporting — if it follows rules, it can run itself. Let's talk about your workflow.
Discuss your process