Zak API to read/write reservations details

These APIs allow you to read/write the reservations data of a zak property.
On each examples wb_yyyyyyyyyyy is used as api-key which is sent as user.

A Reservation

A reservation is a data structure composed of the following fields:

Field name

Description

id

Id of the reservation

rcode

Reservation code of the form XY-0001

rooms

A list of rooms

status

Status of the reservation

expiration_date

In case status is option/offer, such field contains the optional expiring date

price

A data structure containing information regarding the price

payment

A data structure containing information regarding the payment

board

type of board of the reservation

agency

id of the agency through which the reservation has been made

booker

id of the booker

corporate

id of the corporate through which the reservation has been made

created

creation date of the reservation

A room is structured as following:

Field name

Description

dfrom

Starting date

dto

Ending date

id_zak_room

id of the room

id_zak_room_type

id of the room type

customers

A data structure containing the ids of the customers related to the reservation

occupancy

A data structure containing information regarding occupancy

Fetch one reservation

This method will return information regarding a specific reservation of a given property.
Url: https://kapi.wubook.net/kp/reservations/fetch_one_reservation

Usage example

At least one of the following parameters is required:

Field name

Description

id

reservation id

hcode

reservation code of the form (XY-0001)

$ curl --location --request POST 'https://kapi.wubook.net/kp/reservations/fetch_one_reservation' \
 --header 'x-api-key: wb_yyyyyyyyyyy' \
 --header 'Content-Type: application/x-www-form-urlencoded' \
 --data-urlencode 'rcode=XY-0001'

Response Example

${

    "data":{
        "id":549,
        "id_human":"PD-0003",
        "booker":7,
        "status":"Confirmed",
        "expiration_date":"",
        "origin":{
            "channel":"--"
        },
        "last_status_date":"",
        "board":"fb",
        "created":"18/10/2023",
        "cpolicy":"Default Policy",
        "agency":null,
        "corporate":null,
        "price":{
            "rooms":{
                "amount":11700.0,
                "vat":1521.0,
                "total":13221.0,
                "discount":0.0,
                "currency":"EUR"
            },
            "extras":{
                "amount":0,
                "vat":0,
                "total":0,
                "discount":0
            },
            "meals":{
                "amount":0,
                "vat":0,
                "total":0,
                "discount":0
            },
            "total":17750.850000000002
        },
        "payment":{
            "amount":0.0,
            "currency":"EUR"
        },
        "taxes":{
            "rsrv_tax":{
                "currency":"EUR",
                "amount":0.0,
                "vat":0.0,
                "vat_rate":0,
                "total":0.0,
                "discount":0.0
            },
            "currency":"EUR",
            "room_tax":{
                "amount":4529.850000000001,
                "total":4529.850000000001,
                "vat":0.0,
                "vat_rate":0
            },
            "total":4529.850000000001
        },
        "rooms":[
            {
                "id_zak_room":2,
                "id_zak_reservation_room":1356,
                "door_code":{
                    "door_code":"yellow"
                },
                "id_zak_room_type":1,
                "dfrom":"18/10/2023",
                "dto":"31/10/2023",
                "occupancy":{
                    "adults":1,
                    "teens":0,
                    "children":0,
                    "babies":0
                },
                "product_id":"1",
                "rate_id":"1",
                "customers":[
                    {
                        "checkin":null,
                        "checkout":null,
                        "id":7
                    }
                ]
            },
            {
                "id_zak_room":3,
                "id_zak_reservation_room":1357,
                "door_code":{
                    "door_code":"green"
                },
                "id_zak_room_type":1,
                "dfrom":"18/10/2023",
                "dto":"31/10/2023",
                "occupancy":{
                    "adults":1,
                    "teens":0,
                    "children":0,
                    "babies":0
                },
                "product_id":"1",
                "rate_id":"1",
                "customers":[
                ]
            },
            {
                "id_zak_room":9,
                "id_zak_reservation_room":1358,
                "door_code":{
                    "door_code":"13131"
                },
                "id_zak_room_type":3,
                "dfrom":"18/10/2023",
                "dto":"31/10/2023",
                "occupancy":{
                    "adults":3,
                    "teens":0,
                    "children":0,
                    "babies":0
                },
                "product_id":"3",
                "rate_id":"1",
                "customers":[
                ]
            },
            {
                "id_zak_room":15,
                "id_zak_reservation_room":1359,
                "door_code":{
                    "door_code":""
                },
                "id_zak_room_type":1,
                "dfrom":"18/10/2023",
                "dto":"31/10/2023",
                "occupancy":{
                    "adults":1,
                    "teens":0,
                    "children":0,
                    "babies":0
                },
                "customers":[
                ]
            },
            {
                "id_zak_room":7,
                "id_zak_reservation_room":1360,
                "door_code":{
                    "door_code":"123"
                },
                "id_zak_room_type":3,
                "dfrom":"18/10/2023",
                "dto":"31/10/2023",
                "occupancy":{
                    "adults":3,
                    "teens":0,
                    "children":0,
                    "babies":0
                },
                "customers":[
                ]
            }
        ]
    }

}

Create a reservation

Used to insert a reservation
Url: https://kapi.wubook.net/kp/reservations/new

Usage example

The information is sent with an unique parameter, containing a json structure:

Field name

Description

params

Json Structure

The Json Structure has the following mandatory fields:

Field name

Description

arrival

Arrival (european format 21/12/2121)

depature

Departure (european format 21/12/2121)

customer

As an object: {‘name’: Name, ‘surname’: surname} (and optionally email and phone)

It is also mandatory to specify rooms and/or products. At least specify rooms or products (specifying both still possible):

Field name

Description

rooms

A list of rooms (each room being a dict-like object)

products

A list of products (each product being a dict-like object)

About rooms: you can specify the room type, the phisical room or both information.

$ curl --location --request POST 'https://kapi.wubook.net/kp/reservations/new' \
  --header 'x-api-key: wb_yyyyyyyyyyy' \
  --header 'Content-Type: application/x-www-form-urlencoded' \
  --data-urlencode 'params={"arrival": "20/01/2023", "departure": "31/02/2023", "customer": {"name": "Name", "surname": "Surname"}, "rooms": [{"room": 159, "room_type": 107, "price": 100, "currency": "EUR"}], "products": [{"product": 329, "price": 101, "currency": "EUR"}]}'

Response Example

$

{
    "data":  {
                "id": XY-0001,
        }

Fetch reservations

This method will return a list of reservations
Url: https://kapi.wubook.net/kp/reservations/fetch_reservations

Usage example

Input fields are not necessary, nevertheless a data structure containing filtering options can be provided

Type of filters

Description

created

Reservations created in a range of dates

arrival

Reservation with arrival date in a range of dates

departure

Reservation with departure date in a range of dates

pager

Paging options - Limit can be a value in [8, 16, 32, 64], offset can be any integer

${'filters':{
          'created': {'from': '10/10/2023', 'to':'01/02/2024'},
          'arrival': {'from': '17/12/2023', 'to': '11/01/2024'},
          'departure': {'from': '10/02/2024', 'to': '12/03/2024'},
          'pager': {'limit': 8, 'offset': 0}

        }

  }

filters must be passed as JSON.

$ curl --location --request POST 'https://kapi.wubook.net/kp/reservations/fetch_reservations' \
   --header 'x-api-key: wb_yyyyyyyyyyy' \
   --header 'Content-Type: application/x-www-form-urlencoded' \
   --data-urlencode 'filters= {"created": {"from": "08/12/2023", "to": "10/12/2023"},"arrival": {"from": "08/12/2023", "to": "10/12/2023"},"pager": {"limit": 32, "offset": 0}}'

Response example

This API returns a list of reservations.


Fetch today reservations

This method will return a list of reservations
Url: https://kapi.wubook.net/kp/reservations/fetch_today_reservations

Usage example

Input fields are not necessary.

$ curl --location --request POST 'https://kapi.wubook.net/kp/reservations/fetch_today_reservations' \
   --header 'x-api-key: wb_yyyyyyyyyyy'

Checkin/out

This section describes methods to execute check-in / check-out actions on a given reservation.
Url: https://kapi.wubook.net/kp/reservations/do_checkin
Url: https://kapi.wubook.net/kp/reservations/do_checkout

Usage example

Following parameters can / must be used in order to use this call

Field name

Description

Mandatory

reservation_id

reservation id

yes, if not human_code

human_code

reservation code of the form (XY-0001)

yes, if not id

room_customer_ids

list of reservation room customers id’s

No

all

str to check-in(out) all the customers in a reservation (any string is ok, ‘x’ e.g )

No


$ curl --location --request POST 'https://kapi.wubook.net/kp/reservations/do_checkin' \
   --header 'x-api-key: wb_yyyyyyyyyyy' \
   --data-urlencode 'reservation_ireservation_id=277' \
   --data-urlencode 'all='\''true'\

Response example

${"data": {
            "success": "true"
          }

${ "error": "the error" }

Undo Checkin/out

This section describes methods to revert check-in / check-out actions on a given reservation.
Url: https://kapi.wubook.net/kp/reservations/undo_checkin
Url: https://kapi.wubook.net/kp/reservations/undo_checkout

Usage example

Following parameters can / must be used in order to use this call

Field name

Description

Mandatory

reservation_id

reservation id

yes, if not human_code

human_code

reservation code of the form (XY-0001)

yes, if not id


$ curl --location --request POST 'https://kapi.wubook.net/kp/reservations/undo_checkin' \
   --header 'x-api-key: wb_yyyyyyyyyyy' \
   --data-urlencode 'reservation_id=277'

Response example

${"data": {
            "success": "true"
          }

${ "error": "the error" }

Add Customer

This section describes how to add customer to a given reservation.
Url: https://kapi.wubook.net/kp/reservations/add_customer

Usage example

Following parameters can / must be used in order to use this call

Field name

Description

Mandatory

reservation_id

reservation id

yes, if not human_code

human_code

reservation code of the form (XY-0001)

yes, if not reservation_id

reservation_room_id

reservation room id

yes

custdata

json object containing customer to add

yes

docdata

json object containing document to add

yes

A customer data is

Field name

Description

Mandatory

name

str

yes

surname

str

yes

country

str (‘IT’, ‘GB’, ‘ES’..)

no

birth_contry

str (‘IT’, ‘GB’, ‘ES’..)

no

residence_country

str (‘IT’, ‘GB’, ‘ES’..)

no

birthday

str ( ‘10/01/1993’ )

no

phone

str

no

zipcode

str

no

address

str

no

city

str

no

birth_city

str

no

email

str

no

gender

str (‘m’, ‘f’, ‘x’)

no

A docdata is

Field name

Description

Mandatory

doc_type

str (see doc types in syms)

yes

doc_country

str (‘italy’, ‘spain’ …)

yes

doc_number

str

yes

doc_issue

str

yes

doc_expiry

str

yes

doc_issuer

str

no

doc_medium

str

no


$ curl --location --request POST 'https://kapi.wubook.net/kp/reservations/add_customer' \
   --header 'x-api-key: wb_yyyyyyyyyyy' \
   --data-urlencode 'reservation_id=277' \
   --data-urlencode 'reservation_room_id=962' \
   --data-urlencode 'custdata={"name": "Mario", "surname": "Rossi"}'\
   --data-urlencode 'docdata={"doc_type": "i", "doc_country": "italy", "doc_number": "CA00000AA", "doc_issue": "30/05/2022", "doc_expiry": "30/12/2031" }'\
   --data-urlencode 'all='\''true'\'

Response example

${"data": {
            "customer_id": "10",
            "reservation_room_customer_id": "15",
          }

${ "error": "the error" }

Bind Customer

This section describes how to bind customer to a given reservation.
Url: https://kapi.wubook.net/kp/reservations/bind_customer

Usage example

Following parameters can / must be used in order to use this call

Field name

Description

Mandatory

reservation_id

reservation id

yes, if not human_code

human_code

reservation code of the form (XY-0001)

yes, if not reservation_id

reservation_room_id

reservation room id

yes

customer_id

customer id

yes


$ curl --location --request POST 'https://kapi.wubook.net/kp/reservations/bind_customer' \
   --header 'x-api-key: wb_yyyyyyyyyyy' \
   --data-urlencode 'reservation_id=277' \
   --data-urlencode 'reservation_room_id=962' \
   --data-urlencode 'customer_id=20' -k

Response example

${"data": null}

${ "error": "the error" }

Meal

A meal is a data structure having the following fields

Field name

Description

subf-ields

id

id of the meal

dates

structure containing dates information

day, created

meal_info

structure containing meal information

mnumber, mtype, times

price

structure containing costs information

amount, currency, discount, total, vat, vat_rate

Sub-fields description

field

Type

Description

day

date (dd/mm/yyyy)

day on which the meal was eaten

created

date (dd/mm/yyyy)

creation date on Zak

mnumber

integer

number of meals

mtype

string (“b”, “l” or “d” )

Breakfast, lunch or dinner

times

integer

number of repetitions for this meal

amount

float

amount

currency

string

currency of the amount

discount

float

discount

total

float

total

vat

float

vat

vat_rate

int

vat percentage

Meal example

${"data":
        {
            "id": 34,
            "dates": {
                "created": "27/01/2021",
                "day": "25/01/2021"
            },
            "meal_info": {
                "mnumber": 1,
                "mtype": "l",
                "times": 1
            },
            "price": {
                "amount": 19.0,
                "currency": "EUR",
                "discount": 0.0,
                "total": 19.0,
                "vat": 0.0,
                "vat_rate": 0
            }
        },
     }

Get Meals

This function will return a list of meals related to a given reservation
Url: https://kapi.wubook.net/kp/reservations/get_meals

Usage example

Only reservation id is required to use this API.

$ curl --location --request POST 'https://kapi.wubook.net/kp/reservations/get_meals' \
   --header 'x-api-key: wb_yyyyyyyyyyy' \
   --data-urlencode 'rsrvid=277'

Response example

${"data": [
            {"id": 34 . .  },{"id": 35  . . }, {}, {}
          ]

Add Meal

This API can be used to add a meal to a given reservation
Url: https://kapi.wubook.net/kp/reservations/add_meal

Usage example

To use this API one must provide several different parameters

Field

Description

Type

Mandatory

rsrvid

reservation id

int

yes

meal

json object containing meal to add

JSON

yes


A meal data is

Field name

Description

Mandatory

price

float

yes

mtype

char(b,l,d)

yes

mnumber

int

yes

day

str

yes

times

int

yes


$ curl --location --request POST 'https://kapi.wubook.net/kp/reservations/add_meal' \
   --header 'x-api-key: wb_yyyyyyyyyyy' \
   --data-urlencode 'rsrvid=277' \
   --data-urlencode 'meal={"price": 200, "mtype": "l", "mnumber" : 1, "times" : 1, "day": "21/10/2022"}'

Response example

${
  "data": 1
  }

Delete Meal

This API will allow you to delete a meal from zak.
Url: https://kapi.wubook.net/kp/reservations/del_meal

Usage example

To use this API only two parameters are mandatory: reservation id and the meal id:

Field

Description

Type

Mandatory

rsrvid

reservation id

int

yes

fmid

meal id

int

yes


$ curl --location --request POST 'https://kapi.wubook.net/kp/reservations/del_meal' \
   --header 'x-api-key: wb_yyyyyyyyyyy' \
   --data-urlencode 'rsrvid=277' \
   --data-urlencode 'fmid=1'

Response example

${"data": null}

Extra

A extra is a data structure having the following fields

Field name

Description

subf-ields

rexid

id of the extra related to reservation

dates

structure containing dates information

created, daily, day

extra_info

structure containing extra information

number, name

price

structure containing costs information

amount, currency, discount, total, vat, vat_rate

Sub-fields description

field

Type

Description

created

date (dd/mm/yyyy)

creation date on Zak

daily

bool (true,false)

if the extra has been assigned for each day of the reservation

day

date (dd/mm/yyyy)

assigned day (if daily, the field returns null)

number

integer

number of extras (if daily per day)

exid

int

id of the extra related to property

name

string

Extra’s name

amount

float

amount

currency

string

currency of the amount

discount

float

discount

total

float

total

vat

float

vat

vat_rate

int

vat percentage


Extra example

${

  "data":[
      {
          "rexid":164,
          "dates":{
              "created":"16/08/2023",
              "daily":true,
              "day":null
          },
          "extra_info":{
              "number":1,
              "name":"Acqua"
          },
          "price":{
              "amount":89.28571428571429,
              "currency":"EUR",
              "discount":0.0,
              "total":100.0,
              "vat":10.714285714285708,
              "vat_rate":12.0
          }
      }
  ]
}

Get Extras

This function will return a list of extras related to a given reservation
Url: https://kapi.wubook.net/kp/reservations/get_extras

Usage example

Only reservation id is required to use this API.

$ curl --location --request POST 'https://kapi.wubook.net/kp/reservations/get_extras' \
  --header 'x-api-key: wb_yyyyyyyyyyy' \
  --data-urlencode 'rsrvid=277'

Response example

${"data": [
            {"rexid": 164 . .  },{"rexid": 165  . . }, {}, {}
          ]

Add Extra

This section describes how to add an extra to a given reservation.
Url: https://kapi.wubook.net/kp/reservations/add_extra

Usage example

Following parameters can / must be used in order to use this call

Field name

Description

Mandatory

rsrvid

reservation id

yes

extra

json object containing extra to add

yes


A extra data is

Field name

Description

Mandatory

price

float

yes

exid

str

yes (if not name)

name

str

yes (if not exid)

number

int

yes

daily

str (“true” or “false”)

no (default is “false”)

day

str

yes (if daily is “false”)

vat_rate

float

no (default from property settings)

currency

str

no (default from property settings)


$ curl --location --request POST 'https://kapi.wubook.net/kp/reservations/add_extra' \
  --header 'x-api-key: wb_yyyyyyyyyyy' \
  --data-urlencode 'rsrvid=528' \
  --data-urlencode 'extra={"price": 200, "name": "Big", "number" : 1, "daily" : "false", "day": "10/09/2023", "vat_rate": 12, "currency": 'EUR'}'

Del Extra

This section describes how to delete an extra to a given reservation.
Url: https://kapi.wubook.net/kp/reservations/del_extra

Usage example

Only Reservation id and extra id are necessary

Field name

Description

Mandatory

rsrvid

reservation id

yes

rexid

extra id related to reservation

yes


$ curl --location --request POST 'https://kapi.wubook.net/kp/reservations/del_extra' \
  --header 'x-api-key: wb_yyyyyyyyyyy' \
  --data-urlencode 'rsrvid=528' \
  --data-urlencode 'rexid=164'

Response example

${"data": null}

Get Doors Codes

This function will return a list of room’s codes related to a given reservation
Url: https://kapi.wubook.net/kp/reservations/get_doors_codes

Usage example

Only reservation id or reservation code are necessary

Field name

Description

Mandatory

rsrvid

reservation id

yes


$ curl --location --request POST 'https://kapi.wubook.net/kp/reservations/get_doors_codes' \
  --header 'x-api-key: wb_yyyyyyyyyyy' \
  --data-urlencode 'rsrvid=549'

Response example

${
  "data":[
      {
          "zak_reservation_room_id":1356,
          "door_code":{
              "code":"yellow"
          }
      },
      {
          "zak_reservation_room_id":1357,
          "door_code":{
              "code":"green"
          }
      },
      {
          "zak_reservation_room_id":1358,
          "door_code":{
              "code":"13131"
          }
      },
      {
          "zak_reservation_room_id":1359,
          "door_code":{
              "code":""
          }
      },
      {
          "zak_reservation_room_id":1360,
          "door_code":{
              "code":"123"
          }
      }
  ]
}

Set Doors Codes

This section describes how to set door codes for a reservation
Url: https://kapi.wubook.net/kp/reservations/set_doors_codes

Usage example

Following parameters can / must be used in order to use this call

Field name

Description

Mandatory

rsrvid

reservation id

yes

codes

json object containing codes to set

yes


A codes data is

Field name

Description

Mandatory

id

zak reservation room id

yes

door_code

str

yes

$ curl --location --request POST 'https://kapi.wubook.net/kp/reservations/set_doors_codes' \
  --header 'x-api-key: wb_yyyyyyyyyyy' \
  --data-urlencode 'rsrvid=549' \
  --data-urlencode 'codes=[{"id": 1356, "door_code": "1111"},{"id": 1357, "door_code": "2222"}]'

Response example

${"data": null}