KSeF Hub
Open source · AGPL-3.0 Self-host or managed

One ledger for every
invoice your company touches.

Pulls from Poland's KSeF on a schedule, accepts PDFs by inbound email, categorizes with ML, flags duplicates, and hands clean data to your accountant — or to your next dashboard via API. Ship it yourself or let us run it.

docker compose up or mix release
Invoice sources flow into one ledger, then out to consumers. KSeF inbound email PDF + OCR foreign / manual ledger accountant export REST API payment transfers BI / dashboards
Your data, your server
Self-host the whole thing. No telemetry, no lock-in.
Multi-company by default
One install, every NIP. Switch context from the nav.
Full audit log
Every sync, approve, reject, export — timestamped, immutable.
Hands-free sync
Cron-driven pulls from KSeF. No manual logins.
Why it exists

The KSeF portal wasn't built for the people using it.

As of 2026, every Polish company has to pull invoices from Krajowy System e-Faktur (KSeF), reconcile them with the PDFs that still arrive by email, and hand the whole mess to their accountant. Doing that by hand through the government portal is a daily tax on your time.

KSeF Hub is the missing operating layer: a proper UI, a REST API, ML that learns your categories, and permissioned access for the people who help you run the business. It's open source so you can audit it, fork it, or run it yourself — and managed if you'd rather not.

Features

Everything you were doing by hand, automated.

From ingest to export. Each piece works independently; together they replace the spreadsheet-plus-email workflow most companies run today.

Periodic KSeF sync

Scheduled pulls from the government e-invoice system. Certificate stays on your server; no browser logins, no stale sessions.

Every company in one place

Add as many NIPs as you like. The admin switches context in one click — no separate logins per entity.

PDFs, OCR, inbound email

Forward an expense to your company inbox. We extract NIP, amounts, dates with OCR and drop it into the same ledger as KSeF rows.

ML categories, per company

Models train on your company's corrections, not a global dataset. Predictions at ≥80% confidence auto-apply; anything lower arrives flagged for review. Never predicts a category you haven't configured.

Correction invoices, linked

KSeF issues corrections (faktura korygująca) as separate documents. Each is modeled with a link to the original, a reason, and the affected period — one timeline, not two unrelated rows.

Approval with trust tiers

KSeF invoices stay pending until a human signs off. Team uploads with complete extraction can auto-approve on arrival — opt-in per company. Every row is pending, approved, rejected, or excluded (kept for audit, off the books).

Bank-ready payment transfers

Export Polish bank-transfer CSVs (rachunek_zleceniodawcy) from approved expenses. Multi-currency, per-company bank accounts, bulk select across vendors. Mark paid in bulk; the ledger updates atomically.

KSeF certificate management

Upload once, expiry tracked, renewal reminders. Stored encrypted on your server, never in a third-party cloud.

Accountant access

Scoped read + export. Your accountant pulls monthly packages directly; no more zipped email attachments.

Per-invoice permissions

Share a single row with a stakeholder without exposing the rest. Approver, editor, viewer — revoke in one click.

Activity log, end-to-end

Who synced, who approved, who exported, who changed the category. Every action is timestamped and attributable.

REST API, webhooks

Every row has an endpoint. Pipe into your BI stack, trigger your own workflows on new approvals, or build a custom UI on top.

The ledger

Unified row, whatever the source.

KSeF rows, emailed PDFs, and manual foreign invoices all land in the same table with the same fields. Sources are marked with a single-character dot so you can spot outliers without a legend lookup.

  • Status + payment state, always visible
  • Amount gross-on-top, net-below — the real reading order for accountants
  • Multi-select: bulk approve, reject, export, mark paid
  • Date range + Status + Category + Tag filters, combinable
/invoices 126 rows
Number Seller Date Amount Status
FV/2026/04/118 Orange Polska 18 Apr 1,427.00 / 1,160.16 approved
inv-ff3d1b Cloudflare Inc. 17 Apr 820.00 / 820.00 pending
2026-04-17-002 Grupa Maspex 17 Apr 314.00 / 255.28 duplicate
FV/2026/04/071 Linear, Inc. 14 Apr 960.00 / 780.49 approved
API-2026-0042 Stripe Payments 12 Apr 42.00 / 42.00 excluded
KSeF email PDF API
Developers

A REST API for KSeF — every invoice as an endpoint.

Read invoices, trigger syncs, mark payments, subscribe to events. Everything the admin UI does is available over HTTP.

  • GET /v1/invoices — paginated, filterable
  • POST /v1/invoices/:id/approve
  • POST /v1/syncs — trigger on demand
  • HOOK invoice.created, invoice.approved, sync.failed
Read the docs
# Fetch this month's approved expenses for one NIP
curl https://ksef-hub.local/v1/invoices \
  -H "Authorization: Bearer $KSH_TOKEN" \
  -G -d "company=5252344078" \
     -d "status=approved" \
     -d "type=expense" \
     -d "date_from=2026-04-01"

# -> 
{
  "data": [
    { "number": "FV/2026/04/118",
      "seller": "Orange Polska",
      "brutto": 1427.00,
      "category": "telecom",
      "confidence": 0.94 }
  ],
  "page": { "next": "cursor=inv_5f1b" }
}
Open source

Audit it. Fork it. Run it.

KSeF Hub is licensed AGPL-3.0. Read every line, check every migration, run it in your own datacenter. If you improve it, upstream the patch — or fork it and ship your own flavour.

License
AGPL-3.0

Copyleft. Use it, host it for yourself — if you offer it as a service, your modifications go back to the community.

Stack
Elixir · Phoenix · LiveView

A BEAM server. Handles thousands of syncs concurrently on a single small VM. Boring tech, long runway.

Self-host
docker compose

One .env, one container per service. Postgres, Oban, the Phoenix app, an OCR worker. Bring your own reverse proxy.

Community
github.com / discord

Issues, RFCs, and a weekly open call. Built by founders who'd rather not touch the government portal ever again.

Get started

Run it yourself, or hand it to us.

Same code, same features. Pick how much you want to operate.

Self-host
Free
AGPL-3.0. Bring your own hardware.
Clone on GitHub
  • * Full feature set, no gating
  • * Unlimited companies, users, invoices
  • * Your Postgres, your backups
  • * Community support
Enterprise
Custom
Managed, dedicated, onboarded.
Contact us
  • * We host, monitor, back up, upgrade
  • * Private VPC, EU data residency
  • * SSO, audit export, custom retention
  • * Named support & SLA
FAQ

Questions people ask before they install.

What is KSeF?

KSeF (Krajowy System e-Faktur) is Poland's national e-invoice system. From 2026 every registered company must issue and receive invoices through KSeF. KSeF Hub sits on top of it and handles the integration, so your team doesn't have to touch the government portal.

Can I self-host KSeF Hub?

Yes. KSeF Hub is AGPL-3.0 licensed and ships as a docker-compose stack: Postgres, the Phoenix app, and a couple of sidecars. Bring your own reverse proxy and you're live in under an hour. There's also a managed version if you'd rather not operate it yourself.

Which KSeF certificates does KSeF Hub support?

Person certificates (tied to PESEL) and company (NIP) certificates. Certificates are user-scoped, so one uploaded cert authenticates KSeF sessions for every company the user has access to. Certificates stay encrypted at rest on your server — never in a third-party cloud.

Does it handle correction invoices (faktura korygująca)?

Yes. KSeF Hub models the full KSeF invoice taxonomy: standard, corrections, advances, simplified, and settlements. Correction invoices are linked to their originals with a reason and the affected period — one timeline, not two unrelated rows.

How does ML categorization work?

Models train on your company's corrections, not a global dataset. Predictions at ≥80% confidence auto-apply; anything lower arrives flagged for review. The model never predicts a category that isn't already on your list.

Is there a REST API?

Yes. Every row in the ledger is exposed over HTTP. Endpoints for reading invoices, triggering syncs, approving payments, and webhooks for invoice.created, invoice.approved, and sync.failed. Bearer-token auth.

Stop forwarding PDFs. Run one ledger.

Clone the repo, spin up a container, point it at your KSeF certificate. Your ledger is live in under an hour.