Skip to content

Latest commit

 

History

History
81 lines (63 loc) · 3.18 KB

File metadata and controls

81 lines (63 loc) · 3.18 KB

invovate

Official Python client for the Invovate invoice API. Generate PDF, JSON, or UBL 2.1 invoices in 11 languages (incl. Arabic RTL, Japanese, Hindi, Cyrillic) from one call. Zero dependencies (standard library only).

pip install invovate

Quick start

import os
from invovate import Invovate

# JSON totals work WITHOUT a key. PDF, UBL, QR, and hosted/shareable links require a
# free API key (inv_…) — get one instantly, no card, at https://invovate.com/auth
client = Invovate(api_key=os.environ.get("INVOVATE_API_KEY"))

# 1) Compute totals (no key needed)
totals = client.calculate_totals(
    from_={"name": "Acme LLC"},
    to={"name": "Globex Corp"},
    currency="USD",
    items=[{"description": "Consulting", "quantity": 2, "unit_price": 150, "tax_rate": 10}],
)
print(totals["grand_total"])  # 330

# 2) Get a downloadable PDF link (requires a free API key)
link = client.create_pdf_link(
    from_={"name": "Acme BV", "tax_id": "NL0012"},
    to={"name": "Client KK"},
    language="nl", currency="EUR", template="modern",
    items=[{"description": "Onderhoud", "quantity": 1, "unit_price": 450, "tax_rate": 21}],
)
print(link["hosted_url"])  # https://invovate.com/api/i/...  (renders the PDF, 7 days)

Note: from is a Python keyword, so the SDK uses from_ for the sender party.

With an API key (direct file bytes)

pdf = client.create_pdf(from_={"name": "Acme"}, to={"name": "Client"},
                        items=[{"description": "Work", "quantity": 1, "unit_price": 100}])
open("invoice.pdf", "wb").write(pdf)

xml = client.create_ubl(from_={"name": "Acme"}, to={"name": "Client"},
                        items=[{"description": "Work", "quantity": 1, "unit_price": 100}])

API

Method Returns Key
calculate_totals(...) dict of totals no
create_pdf_link(...) {"hosted_url", "invoice"} no
create_pdf(...) bytes (PDF) yes
create_ubl(...) str (UBL 2.1 XML) yes
batch([...]) batch result (≤ 50) yes
generate(..., output=, hosted_link=, idempotency_key=) low-level

Each method accepts either a full invoice dict or the keyword shortcuts from_=, to=, items= plus any other fields (currency, language, template, payment, notes, …). Errors raise InvovateError (.status, .code, .request_id).

Notes

  • Languages: en, nl, de, fr, es, it, pt, ar, ja, ru, hi. Templates: classic, modern, bold, minimal, navy.
  • Not regulated e-invoicing. UBL is for interoperability/archival — no Peppol/Factur-X/XRechnung/NF-e compliance.

Links

License

MIT © Invovate