Zak API to read reservations¶
These methods allow to read the reservations of a zak property.
Get one reservation¶
This method reads one reservation data using his zak reservation code (rcode)
which is the alphanumeric code of the reservation (like “ZK-0012”).
Url: https://kapi.wubook.net/kapi/rsrvs/reservation
Input fields: rcode
Response-data:
Field name | Description |
---|---|
code | Reservation Zak code |
date_from | Arrival date |
date_to | Checkout date |
rsrv_date | Booking date |
booker | Booker name |
amount | Total amount for reservation |
amount_currency | Amount currency code |
payment | Payments amount |
payment_currency | ISO currency code of payment (EUR, USD, GBP, ..) |
status | Reservation status (you can read all status by api symbols: get reservation status) |
wubook_id | WuBook reservation code (if reservation has been fetched from WuBook) |
channel | Channel name (if reservation has been fetched by channel manager) |
channel_rsrv_id | Reservation OTA id (if reservation has been fetched by channel manager) |
country | Country ISO code (US, RU, IT, ES, ..) |
board | Kind of meals board (fb, hb, bb, nb, ai) |
arrived | The guests are arrived (ture or false) |
left | The guests have left (true or false) |
agency | Name of reservation agency |
corporate | Name of reservation corporate |
rooms | List of rooms on reservation |
cutomers | List of guests of reservation |
rooms is an array of objects with the following fields:
Field name | Description |
---|---|
rrid | Reservation-room |
room_name | Room name |
date_from | Room arrival date |
date_to | Room check out date Left date from the room |
adults | Number of adults |
children | Number of children |
customers is an array of object with the following fields:
Field name | Description |
---|---|
cid | Guest Id |
name | Guest name |
surname | Guest surname |
country | Guest country ISO code (ES, IT, …) |
Guest Email address | |
phone | Guest phone number |
doc | Guest has provided his document (1 or 0) |
Example¶
On each examples 123456 is used as api-key which is sent as user.
curl:¶
$ curl https://kapi.wubook.net/kapi/rsrvs/reservation -u 123456: -X POST \
-d rcode=CG-0001
{"data": {
"code": "CG-0001",
"date_from": "14/08/2018",
"date_to": "20/08/2018",
"rsrv_date": "01/08/2018",
"booker": "Carl Gauss",
"rooms": [
{"rrid": 104,
"room_name": "dbl",
"date_from": "15/08/2018",
"date_to": "20/08/2018",
"adults": 2,
"children": 0},
{"rrid": 105,
"room_name": "SUP",
"date_from": "14/08/2018",
"date_to": "18/08/2018",
"adults": null,
"children": null}],
"customers": [
{"cid": 52,
"name": "Carl",
"surname": "Gauss",
"country": "DE",
"email": "--",
"phone": "--",
"doc": 0}],
"amount": 3200.0,
"amount_currency": "EUR",
"payment": 0,
"payment_currency": "EUR",
"status": "Confirmed",
"country": "DE",
"board": "nb",
"arrived": true,
"left": true,
"corporate": "",
"agency": ""}
}
python code:¶
import requests
uspw=(123456, None)
data= {'rcode': 'CG-0001'}
response= requests.post('https://kapi.wubook.net/kapi/rsrvs/reservation', data, auth= uspw)
print(response.text)
Arrivals¶
Read all the reservations arriving today or between a dates range.
To prevent overflow, the maximum limit of records is 200.
Url: https://kapi.wubook.net/kapi/rsrvs/arrivals
Input fields are not necessary. dfrom, dto are optional.
If not use input arguments, it returns the reservation arriving today.
If use only dfrom, it returns reservations with arrival in dfrom or after it.
If use only dto, it returns reservations with arrival in dto or before it.
If use both dfrom and dto, it returns reservations with arrival date between dfrom and dto.
Response-data: is an array of reservations.
Each reservation has the same format of Get one reservation response.
Departures¶
Read all the reservations leaving today or with departure date in a dates range.
To prevent overflow, the maximum limit of records is 200.
Url: https://kapi.wubook.net/kapi/rsrvs/departures
Input fields are not necessary. dfrom, dto are optional.
If not use input arguments, it returns the reservation leaving today.
If use only dfrom, it returns reservations with departure in dfrom or after it.
If use only dto, it returns reservations with departure in dto or before it.
If use both dfrom and dto, it returns reservations with departure date between dfrom and dto.
Response-data: is an array of reservations.
Each reservation has the same format of Get one reservation response.
Example¶
curl:¶
$ curl https://kapi.wubook.net/kapi/rsrvs/departures -u 123456: -X POST \
-d dfrom=12/11/2018 -d dto=18/11/2018
{"data": [{reservation details}]}
python code:¶
import requests
uspw=(123456, None)
data={'dfrom':'12/11/2018', 'dto=18/11/2018'}
response= requests.post('https://kapi.wubook.net/kapi/rsrvs/departures', data, auth= uspw)
print(response.text)
At home¶
Read all the reservations that stay in lodging on a date.
To prevent overflow, the maximum limit of records is 200.
Url: https://kapi.wubook.net/kapi/rsrvs/at_home
Input fields are not necessary. date and arrived are optional.
If not use date argument, it returns the reservations that stay today.
If use date, it returns reservations that have date in their stay.
If use arrived= 1, it returns only reservations set up as arrived.
Response-data: is an array of reservations.
Each reservation has the same format of Get one reservation response.
Example¶
curl:¶
$ curl https://kapi.wubook.net/kapi/rsrvs/at_home -u 123456: -X POST \
-d date=11/10/2018 -d arrived=1
{"data": [{reservation details}]}
python code:¶
import requests
uspw=(123456, None)
response= requests.post('https://kapi.wubook.net/kapi/rsrvs/at_home', {}, auth= uspw)
print(response.text)