Skip to main content
Pre-release

This release is a pre-release and may not be stable for production use.

Timbro Invoices for Python

timbro-invoices is the Python client for the canonical /v1/invoices API. Invoice request and response wire shapes are defined by the Timbro API; the installed package carries a generated projection of that contract.

Requires Python 3.10 or later. Install the current prerelease from PyPI:

python -m pip install "timbro-invoices==0.1.0a2"

This alpha targets the redesigned Invoice API, which is still awaiting coordinated hosted qualification. Its API contract may change before the stable release.

from timbro_invoices import TimbroInvoices

client = TimbroInvoices(api_key="your-invoice-api-key")
preview = client.preview_invoice(invoice_request)
invoice = client.create_invoice(invoice_request)
current = client.retrieve_invoice(invoice["id"])
page = client.list_invoices(invoice_reference="odoo:2026:1042")
xml = client.download_xml(invoice["id"])
pdf = client.download_pdf(invoice["id"])

# Replace a retained, replaceable Invoice with a new canonical request.
replacement = client.replace_invoice(
    rejected_invoice["id"],
    {**invoice_request, "invoiceReference": "odoo:2026:1042-r1"},
)

# Share an accepted receipt with a payment service.
receipt_access = client.share_receipt(invoice["id"])
receipt = client.retrieve_receipt(receipt_access)
receipt_pdf = client.download_receipt_pdf(receipt_access)

Keep the receipt access grant on your server and pass it to the receiving service over an authenticated channel. Restricted reads use its accessToken; the token is never sent in the URL and grants access only to receipt data and its PDF. Receipt PDF downloads verify the Invoice identity, media type, and SHA-256 headers. Other file downloads also verify Timbro's security metadata. HTTP problems preserve Timbro's status and machine-readable code. Webhook helpers verify Standard Webhooks signatures over the original bytes and parse only the canonical Invoice event envelope. The distribution uses jsonschema and regex to validate data against the generated OpenAPI contract.

A 422 admission refusal has no retained Invoice ID. Correct the request and call create_invoice; replace_invoice applies to a retained replaceable Invoice. Authority-rejected numbering gaps still require the existing administrator authorization. A replacement retains the predecessor's Source ID, uses a new Source version and invoiceReference, and exposes its predecessor in replacesInvoiceId.

Regenerate the contract projection with python python-sdk/scripts/generate_contract.py. Run the package tests with python -m unittest discover -s python-sdk/tests.

Metadata

Release files for timbro-invoices 0.1.0a4

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

Source distribution (sdist)

Source distribution for timbro-invoices 0.1.0a4
File Size Uploaded
timbro_invoices-0.1.0a4.tar.gz 33.5 kB Details

Built distribution (wheel)

Table of built distributions (wheels) for timbro-invoices 0.1.0a4
File Interpreter ABI Platform
timbro_invoices-0.1.0a4-py3-none-any.whl Python 3 none any Details

Total release size: 63.8 kB

Release files / timbro_invoices-0.1.0a4.tar.gz

Download URL timbro_invoices-0.1.0a4.tar.gz
Size 33.5 kB
Tags Source
SHA-256 checksum
How to use checksums
b3229e9fcfa4f05887f5def7658fc82ae9f6330f3d47de6117151b2db0b65cd2
BLAKE2b-256 checksum
How to use checksums
314b66441d2cd987f8e9a3d73a516863bb5b7ca5a59804b33918199948fcf55b
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/7.0.0 CPython/3.14.4

Release files / timbro_invoices-0.1.0a4-py3-none-any.whl

Download URL timbro_invoices-0.1.0a4-py3-none-any.whl
Size 30.4 kB
Tags Python 3
SHA-256 checksum
How to use checksums
f44fbf60505f3d30c8d7039841f886d782dc328a8e1a3abb8e4dfc6a768924a7
BLAKE2b-256 checksum
How to use checksums
04161bd566b9e296ca85a6c6d52901d7836bb7e45f81b61f98598f28c35f51f2
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/7.0.0 CPython/3.14.4
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