Start here
Invoice Ninja Python preview
Unofficial Octri preview. Built from Invoice Ninja's public API reference, labeled 5.12.55. Selected scope: list clients, retrieve one invoice, and serialize invoice creation against a local mock. No production request, invoice delivery, payment, or auto_bill test.
Install and inspect
Download generated Python SDK v5.12.55. Unzip and pip install . in the extracted directory. This ZIP is publicly downloadable; it is not a PyPI release.
import os
from invoice_ninja_octri_preview_sdk import ClientAuthConfig, ClientConfig, InvoiceNinjaOctriPreview
token = os.environ["INVOICE_NINJA_API_TOKEN"]
client = InvoiceNinjaOctriPreview(ClientConfig(
base_url="https://your-authorized-instance.example",
auth=ClientAuthConfig(api_key_auth=token),
))
clients = client.clients.get(x_api_token=token, x_requested_with="XMLHttpRequest", page=2, per_page=15)
print(clients.meta.pagination.current_page, clients.data)
invoice = client.invoices.show(id="your-hashed-invoice-id", x_api_token=token, x_requested_with="XMLHttpRequest")
print(invoice.id, invoice.amount, invoice.line_items)The source contract requires X-API-TOKEN and X-Requested-With operation parameters. Generated client also accepts project-level API-key auth, so pass same token in both places. Use an instance you control. Invoice IDs are strings; amounts are numeric values from API response.
Creation scope
Generated client.invoices.store(...) accepted a synthetic client_id and typed InvoiceItemRequest(quantity=2, cost=12.25) against a local HTTP mock only. This preview does not recommend running its create sample against any shared or production instance. No auto_bill field was supplied. Creation, delivery, and billing behavior on live Invoice Ninja remain untested.
Validation and updates
Downloaded package installed and passed four local mock calls: paginated clients and nested meta.pagination, invoice retrieval with line items and money fields, mock-only invoice POST body, and typed 401. Custom base URL and required headers were asserted. No automatic synchronization configured or tested.