Skip to main content

billos (Python)

BillOS from Python: legally valid Israeli tax documents (חשבונית מס, קבלה, זיכוי), the expense ledger, webhooks and the regulatory outputs, over one small client with no dependencies beyond the standard library (Python 3.9+).

pip install billos
from billos import BillOS, BillOSError

billos = BillOS(api_key=os.environ["BILLOS_API_KEY"])
bid = billos.businesses.list()["businesses"][0]["id"]

created = billos.documents.create(bid, {
    "docType": 320,
    "priceMode": "gross",
    "party": {"name": "דנה לוי", "phone": "0521111111"},
    "lines": [{"description": "איפור כלה", "quantity": 1, "unitPriceExVat": 120000}],
    "payments": [{"method": "card", "amount": 120000}],
}, idempotency_key="order-8812")

issued = billos.documents.issue(bid, created["document"]["id"])
print(issued["document"]["docNumber"])

pdf = billos.documents.print(bid, created["document"]["id"])   # Binary: .bytes, .content_type, .variant
link = billos.documents.share(bid, created["document"]["id"])   # a public URL for the customer

Money is integer agorot everywhere, exactly like the API (₪354.00 is 35400); a foreign-currency document ("currency": "USD") is in that currency's cents. Nothing in the client converts.

What you get

  • Every operation in the spec as namespace.method (snake_case): businesses, parties, documents, recurring, legacy, expenses, exports, files, webhooks, events, keys, usage, requests, sandbox. OPERATIONS (method and path per operation) is generated from the OpenAPI spec, and a test checks every operation has a method, so the client cannot lag behind the API.
  • The conventions handled: X-Api-Key, the {ok, ...} envelope returned as a dict (plus request_id), Idempotency-Key from idempotency_key=, Retry-After honoured.
  • api_version="2026-09-08" pins a dated API version (sent as BillOS-Version); the default is the current one.
  • Retries on 429 / 502 / 503 / 504 and network errors, up to max_retries (default 2), for GET/DELETE and for POSTs carrying an idempotency key; never for a POST without one.
  • BillOSError with status, reason, request_id, body, retryable. Branch on reason.
  • Binary answers (documents.preview, documents.print, files.get, a PDF report) come back as Binary(bytes, content_type, variant, request_id).
  • verify_webhook_signature(secret, header, raw_body) for the X-BillOS-Signature header.
  • A bk_test_ key answers from the sandbox with no change on your side (billos.sandbox.seed() fills it with demo data).

Documentation and the OpenAPI spec: https://docs.billos.co.il. MIT.

What is new in 0.2.0

Twelve operations the API grew since 0.1.0, and one argument:

  • Open items: documents.receivables, documents.add_settlement, documents.remove_settlement, and settles / dueDate on a draft.
  • Partial credit: documents.credit_note(bid, id, {"amount": ..., "reason": ...}).
  • The VAT return: exports.pcn874 writes the PCN874.TXT, exports.vat answers the figures and warnings without a file.
  • Your own traffic: requests.list (the 7-day request log) and latency on usage.get.
  • Webhook replay: webhooks.replay(id, {"from": ..., "to": ...}).
  • The archive: the legacy namespace, for documents from the software a business used before BillOS.
  • api_version= pins a dated API version on every call.

Metadata

Release files for billos 0.2.0

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

Source distribution (sdist)

Source distribution for billos 0.2.0
File Size Uploaded Provenance Actions
billos-0.2.0.tar.gz 13.8 kB Without provenance Details for billos-0.2.0.tar.gz

Built distribution (wheel)

Table of built distributions (wheels) for billos 0.2.0
File Interpreter ABI Platform Actions
billos-0.2.0-py3-none-any.whl Python 3 none any Details for billos-0.2.0-py3-none-any.whl

Total release size: 24.9 kB

Release files / billos-0.2.0.tar.gz

Download URL billos-0.2.0.tar.gz
Size 13.8 kB
Tags Source
SHA-256 checksum
How to use checksums
59b40370c3505197b11f25bc600fe56da3b75795c950ed70e3a531eb28f4e9ba
BLAKE2b-256 checksum
How to use checksums
3ae979acfa50696c33887a1da984bc5c5ed5e07172158d97c6bd94ba6fff0c50
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/7.0.0 CPython/3.10.5

Release files / billos-0.2.0-py3-none-any.whl

Download URL billos-0.2.0-py3-none-any.whl
Size 11.1 kB
Tags Python 3
SHA-256 checksum
How to use checksums
30b1974f432bc39c81e7be1188fdedb807730b13eb971c97816d5af3999b84a4
BLAKE2b-256 checksum
How to use checksums
d79de25047cfb4bf4a2285c47ab497fcbc5efabb9a085cd35d3d50099bbea8e9
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/7.0.0 CPython/3.10.5

Security for billos 0.2.0

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