Python client for the Netvisor API.
You can install netvisor with pip::
$ pip install netvisor-api-client
from netvisor_api_client import Netvisor
from datetime import date, timedelta
# Create a client
client = Netvisor(
host="https://isvapi.netvisor.fi",
sender="Test client",
partner_id="x",
partner_key="x",
customer_id="x",
customer_key="x",
organization_id="1967543-8",
language="EN"
)
# Get a list of sales invoices for last 14 days
invoices = client.sales_invoices.list(start_date=date.today() - timedelta(days=14), end_date=date.today())
# Get detailed information for the first invoice
invoice_details = client.sales_invoices.get(invoices[0]['netvisor_key'])
Using language other than EN
can cause failures when parsing responses containing localised boolean like values.
Example: "Yes"
and "No"
parsed to bool True
and False
fails when language is FI
from netvisor_api_client.schemas.fields import Boolean
# Current schema
match_partial_payments_by_default = Boolean(true="Yes", false="No")
# i.e. for FI this should be
match_partial_payments_by_default = Boolean(true="Kyllä", false="Ei")