Zak API to read invoices

These APIs allow you to read the invoices data of a zak property.
These functions are not yet active, they will be in a few days.

Get invoices by number

This method provides invoices with document-number between a range of numbers.
Could accept a filter by billing year and by document type.
To prevent overflow, the maximum limit of records is 100.
Url: https://kapi.wubook.net/kapi/invoices/get_by_numbers
Input fields: nfrom, nto are mandatory. Input field year and dtype are optional.
If year filter is passed, it return invoices dated on year.
If year filter is not passed, it return the invoices of the current year.
If dtype filter is passed, it return only the fiscal documents of the indicated type.
Response-data: list of invoices data.
For every invoice are provided the following data:
Field name Description
doc_type fiscal document type code. (‘INV’, ‘REC’, ‘CRN’, …)
num document number
prefix document number prefix (generally it is null)
date date of document
name customer name
address customer address
zipcode customer zipcode
city customer city
country customer country ISO code
nationalid customer fiscal code
vatnumber customer vat number
currency amount currency
amount amount
tax_amount amount of taxes
tax_rate list of percentage rate of tax
total total (amount + taxes)
biller biller data
notes notes
services List of services sold (detail of invoice)
services is an array of object with the following fields:
Field name Description
quantity how many units
description service description
unitprice price of one unit
amount amount of service
currency amount currency
tax_amount amount of taxes
tax_rate percentage rate of tax
total total (amount + taxes)

Examples

curl:

The following example return invoices with number between (1, 20), of the current year.
$ curl https://kapi.wubook.net/kapi/invoices/get_by_numbers -u 123456: -X POST \
  -d nfrom=1 -d nto=20 -d dtype=INV
{"data": [{
  "doc_type": "INV",
  "num": 1,
  "date": "06/11/2018",
  "name": "Georg Hegel",
  "address": "Weg der Aufhebung",
  "zipcode": null,
  "city": "Berlin",
  "country": "DE",
  "currency": "EUR",
  "nationalid": "GE3304HH22KK",
  "vatnumber": "054321-1234",
  "amount": 200.0,
  "tax_amount": 44.0,
  "tax_rate": [22.0],
  "total": 244.0,
  "biller": "Schoenhouse Apartments",
  "notes": "Phanomenologie des Geistes",
  "services": [{
     "quantity": 5,
     "description": "Ungluck und Schmerz",
     "unitprice": 40.0,
     "amount": 200.0,
     "tax_amount": 44.0,
     "tax_rate": 22.0,
     "total": 244.0,
     "currency": "EUR"}]
  }]
}

python code:

The following example return credit notes with number between (10, 20), of the current year.
import requests
data= {'nfrom': 10, 'nto': 20, 'dtype': 'CRN'}
uspw= (123456, None)
response= requests.post('https://kapi.wubook.net/kapi/invoices/get_by_numbers', data, auth= uspw)
print(response.text)

Get invoices by dates

Read all invoices with bill-date between a dates range.
To prevent overflow, the maximum limit of records is 100.
Url: https://kapi.wubook.net/kapi/invoices/get_by_dates
Input fields dfrom, dto are mandatory. Filter field dtype is optional.
If dtype filter is passed, it return the fiscal documents of the indicated type.
Response-data: is an array of invoices.
Each invoice has the same format of Get invoices by number response.

Examples

curl:

The following example return the receipts with date on june 2018.
$ curl https://kapi.wubook.net/kapi/invoices/get_by_dates -u 123456: -X POST \
  -d dfrom=01/06/2018 -d dto=30/06/2018 -d dtype=REC

python code:

The following example return all documents with date on first quarter of 2018.
import requests
data= {'dfrom': '01/01/2018', 'dto': '31/03/2018'}
uspw= (123456, None)
response= requests.post('https://kapi.wubook.net/kapi/invoices/get_by_dates', data, auth= uspw)
print(response.text)