Zak API to read payments
Get payments
Url: https://kapi.wubook.net/kapi/payments/get_payments
Field name |
Description |
---|---|
date |
date of payment |
off |
the payment have been cancelled (cancellation date) |
payed |
the payment has been payed (payment date) |
value |
payment amount |
type |
payment type (‘Cash’, ‘Credit Card’, ‘Bank Transfer’, ..) |
team_user |
who entered the payment |
remarks |
notes wrote on the payment |
currency |
payment amount currency |
invoice_num |
invoice number |
invoice_prefix |
prefix of invoice (it could be blank) |
invoice_date |
invoice date |
agency_name |
if the payment was made by an agency |
corporate_name |
if the payment was made by a corporate |
rsrvs |
reservations linked to the payment |
Example
curl:
$ curl https://kapi.wubook.net/kapi/payments/get_payments -u 123456: -X POST \
-d rcode=CG-0001
{"data": [
{"date": "18/01/2019", "off": "", "payed": "18/01/2019", "value": 200.0,
"type": "Cash", "team_user": "", "remarks": "volta la carta 200\u20ac",
"currency": "EUR", "invoice_text": "", "invoice_num": "", "invoice_prefix": "",
"invoice_date": "", "agency_name": "", "corporate_name": "", "rsrvs": "KG-0003"}
]
}
python code:
import requests
uspw=(123456, None)
data= {'rcode': 'CG-0001'}
response= requests.post('https://kapi.wubook.net/kapi/payments/get_payments', data, auth= uspw)
print(response.text)
Do payment
Url: https://kapi.wubook.net/kapi/payments/do_payment
The following fields are mandatory:
Field name |
Description |
---|---|
pay_type |
Name of one pay_type |
value |
Amount of the payment |
The following fields are optional:
Field name |
Description |
---|---|
date |
Payment date |
remarks |
Notes text |
rcode |
Reservation code |
payed |
payment date |
currency |
payment amoun currency |
year_inv |
year of payment invoice |
num_inv |
number of payment invoice |
prefix_inv |
prefix of payment invoice |
Example
curl:
curl https://kapi.wubook.net/kapi/payments/do_payment -u 123456: \
-X POST \
-d pay_type="Credit Card" -d value="150.00" -d date="20/02/2019" -d payed="20/02/2019" -d remarks="Reservation payment" -d rcode="KG-0003" -d currency="EUR"
{"data": "payment created"}
python code:
import json
import requests
data= {
"pay_type":"Credit Card",
"value":"150.00",
"date":"20/02/2019",
"payed":"20/02/2019",
"remarks":"Invoice 5/2019 payment",
"currency":"EUR",
"num_inv":"5",
"year_inv":"2019"
}
jdata=json.dumps(data)
uspw=('123456', None)
response= requests.post('https://kapi.wubook.net/kapi/payments/do_payment', jdata, auth= uspw)
print(response.text)