Skip to main content

fakturownia-client

PyPI CI Python License: MIT

Unofficial Python client for the Fakturownia (InvoiceOcean) REST API. Covers invoices (list/search, create/update, status changes, PDF download), clients (CRUD) and products.

This is a community-maintained project. It is not affiliated with, endorsed by, or sponsored by Fakturownia sp. z o.o. or InvoiceOcean. "Fakturownia" and "InvoiceOcean" are trademarks of their respective owner, used here only to indicate compatibility.

Security note: token in header, never in URL

The official Fakturownia docs mostly show ?api_token=... in URLs, which leaks tokens into server and proxy logs. This client sends the token only in the Authorization: Bearer header. Header auth was verified against the live API for every endpoint used here (see scripts/verify_auth.py — a no-side-effects check you can run against your own account).

Install

uv add fakturownia-client   # or: pip install fakturownia-client

Usage

from fakturownia_client import FakturowniaClient, InvoiceCreate, InvoicePositionCreate

with FakturowniaClient("mycompany", api_token="...") as fk:
    # list & search
    invoices = fk.list_invoices(period="this_month", include_positions=True)
    for inv in fk.iter_invoices(period="this_year"):  # auto-pagination
        print(inv.number, inv.price_gross)

    # create
    created = fk.create_invoice(
        InvoiceCreate(
            buyer_name="ACME Sp. z o.o.",
            buyer_tax_no="1234567890",
            positions=[InvoicePositionCreate(name="Usługa", total_price_gross=123.00, tax=23)],
        )
    )

    # status & PDF
    fk.change_invoice_status(created.id, "paid")
    pdf = fk.download_invoice_pdf(created.id)

    # e-mail the invoice to the buyer (or explicit recipients, max 5)
    fk.send_invoice_by_email(created.id, email_to="client@acme.pl", email_pdf=True)

    # payments (banking): record money against invoices
    fk.create_payment({"name": "Transfer 001", "price": 123.00, "invoice_id": created.id})
    payments = fk.list_payments(include_invoices=True)

    # clients / products
    clients = fk.list_clients(tax_no="1234567890")
    products = fk.list_products()

Async

AsyncFakturowniaClient mirrors the sync API 1:1 on httpx.AsyncClient:

from fakturownia_client import AsyncFakturowniaClient

async with AsyncFakturowniaClient("mycompany", api_token="...") as fk:
    invoices = await fk.list_invoices(period="this_month")
    async for inv in fk.iter_invoices(period="this_year"):
        print(inv.number)

domain accepts "mycompany", "mycompany.fakturownia.pl" or a full URL.

Compatible platforms (InvoiceOcean, VosFactures, BitFactura)

Fakturownia runs the same API under several regional brands — this client works with all of them; pass your full account domain:

Platform Region Example domain
fakturownia.pl Poland mycompany or mycompany.fakturownia.pl
invoiceocean.com Global / USA mycompany.invoiceocean.com
invoiceocean.de Germany mycompany.invoiceocean.de
vosfactures.fr France mycompany.vosfactures.fr
bitfactura.es Spain mycompany.bitfactura.es

This repository also publishes a companion alias package, invoiceocean-client, which re-exports this API as InvoiceOceanClient / AsyncInvoiceOceanClient (equally unofficial). Errors raise typed exceptions: AuthenticationError, NotFoundError, ValidationError, RateLimitError, ServerError (all subclass FakturowniaError).

Caveat: delete_product() calls an endpoint absent from the official API docs — it may not work on all accounts.

Development

uv sync --extra dev
uv run ruff check . && uv run mypy && uv run pytest -m "not live"

# optional read-only smoke test against the real API:
FAKTUROWNIA_DOMAIN=mycompany FAKTUROWNIA_API_TOKEN=... uv run pytest -m live

License

MIT

Metadata

Release files for fakturownia-client 0.2.1

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for fakturownia-client 0.2.1
File Size Uploaded Provenance Actions
fakturownia_client-0.2.1.tar.gz 22.1 kB Without provenance Details for fakturownia_client-0.2.1.tar.gz

Built distribution (wheel)

Table of built distributions (wheels) for fakturownia-client 0.2.1
File Interpreter ABI Platform Actions
fakturownia_client-0.2.1-py3-none-any.whl Python 3 none any Details for fakturownia_client-0.2.1-py3-none-any.whl

Total release size: 41.2 kB

Release files / fakturownia_client-0.2.1.tar.gz

Download URL fakturownia_client-0.2.1.tar.gz
Size 22.1 kB
Tags Source
SHA-256 checksum
How to use checksums
da7b7a66e51903bfc2ad3e5857f631899922f9c7380bdb42daa8d7f69d72fd67
BLAKE2b-256 checksum
How to use checksums
904e9682b015bb475a70fc707ba9cc0888c8177a42ae0c62946562cc54cb52e5
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/7.0.0 CPython/3.13.14

Release files / fakturownia_client-0.2.1-py3-none-any.whl

Download URL fakturownia_client-0.2.1-py3-none-any.whl
Size 19.1 kB
Tags Python 3
SHA-256 checksum
How to use checksums
a017f5aa09ab523d9e8b78efd7210f0d62c76261615cf12fe3b82406c78fe59f
BLAKE2b-256 checksum
How to use checksums
50b24ab58ccd523e8241703638606560cb4423e77f20f4d0b534d6723d7652a5
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/7.0.0 CPython/3.13.14

Security for fakturownia-client 0.2.1

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

No provenance found

None of the files in this release were uploaded with provenance metadata.

A note on package security

PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.

To learn more about protecting yourself from malicious actors, visit our package security documentation.

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page