An unofficial, batteries-included Python client for the WeFact API. Pragmatic, typed where it counts, and intentionally minimal on magic.
WeFact is a Dutch invoicing and accounting platform. Create invoices and quotes, process supplier invoices, and maintain real-time insight into your administration.
Built and maintained by zzinnovate. Not affiliated with WeFact.
Complete guides and API reference:
- Getting Started - Installation • Usage • Configuration
- API Reference - Resources • Parameters • Variables (Enums) • Errors
- Guides - Invoice Lifecycle • CLI Testing Tool
- Project - Contributing • Changelog • Security
For the upstream API, see the official WeFact API documentation.
- Python 3.11+
# Basic installation (library only)
pip install wefact-python
# With CLI testing tool
pip install "wefact-python[cli]"
# For development (includes CLI, testing, and docs)
pip install -e ".[all]"import os
from wefact import WeFact
client = WeFact(api_key=os.getenv('WEFACT_API_KEY'))
# List your latest invoices
result = client.invoices.list(limit=25)
print(result)- Minimal dependencies - Only
requestsfor HTTP calls - Type hints - Better IDE support and fewer runtime errors
- Direct API mapping - Mirrors WeFact's controller/action structure
- Error handling - Clear exceptions for common failure modes
- Attachment support - Base64 encoding/decoding utilities built-in
- Production-tested - Used by zzinnovate in client projects
Complete coverage of all 13 WeFact API resources:
Invoices • Credit Invoices • Debtors • Products • Creditors • Groups • Subscriptions • Quotes • Interactions • Tasks • Transactions • Cost Categories • Settings
# Show a debtor
debtor = client.debtors.show(Identifier=5)
# Create an invoice
invoice = client.invoices.create(
DebtorCode="DB10000",
InvoiceLines=[
{
"Number": 1,
"ProductCode": "P0001",
"Description": "Service",
"PriceExcl": 100
}
],
)
# Mark invoice as paid
client.invoices.mark_as_paid(Identifier=invoice["invoice"]["Identifier"])Contributions are welcome. See CONTRIBUTING.md for development setup, testing, and workflow guidelines.
See SECURITY.md for reporting vulnerabilities and best practices.
- Sjoerd Zaalberg van Zelst (zzinnovate)
- All contributors
- Inspired by vormkracht10/wefact-php
MIT. See LICENSE.