.. meta:: :description: Wired Zak API read prices :keywords: api, pms, zak, kapi, prices, price, room prices, pricing plan Zak API to read prices ********************** | These methods allow to read the prices of a zak room type. Get pricing plans ================= | This method return the list of pricing plans of a zak property. .. code-block:: html Url: https://kapi.wubook.net/kapi/prices/get_plans | Input fields are not necessary. | Response-data: return the list of '*pricing plans of a property*'. | For each plan you receive the following fields: .. table:: :widths: auto +--------------------------+-------------------------------------------------------------------------------------------+ | **Field name** | **Description** | +==========================+===========================================================================================+ | *id* | Identification number of the zak pricing plan | +--------------------------+-------------------------------------------------------------------------------------------+ | *name* | Name of the zak pricing plan | +--------------------------+-------------------------------------------------------------------------------------------+ | *info* | Information about the plan (if linked to another plan) | +--------------------------+-------------------------------------------------------------------------------------------+ .. _123456: ../kapintro.html#authentication Examples -------- | On each examples `123456`_ is used as **api-key** which is sent as *user*. curl: ..... .. code-block:: shell $ curl https://kapi.wubook.net/kapi/prices/get_plans -u 123456: -X POST {"data": [ {"id": 1, "name": "Standard", "info": ""}, {"id": 2, "name": "not refundable", "info": "virtual (Standard +-10.0%)"}, ... ] } python code: ............ .. code-block:: python import requests uspw=(123456, None) response= requests.post('https://kapi.wubook.net/kapi/prices/get_plans', {}, auth= uspw) print(response.text) Get prices per room per occupancy ================================= | This method returns the list of prices of a room type for each days | between two dates (dfrom, dto) read on a certain pricing plan. | You can specify the occupancy (adults, children) and the meal. .. code-block:: html Url: https://kapi.wubook.net/kapi/prices/get_by_roomocc | Input fields: The following fields are mandatory: .. table:: :widths: auto +--------------------------+-----------------------------------------------------------------------------------------+ | **Field name** | **Description** | +==========================+=========================================================================================+ | *dfrom* | Date start of the price reading period | +--------------------------+-----------------------------------------------------------------------------------------+ | *dto* | Date end of the price reading period | +--------------------------+-----------------------------------------------------------------------------------------+ | *rtid* | Zak room type id roomtypeid | +--------------------------+-----------------------------------------------------------------------------------------+ | *plid* | ZaK pricing plan id planid | +--------------------------+-----------------------------------------------------------------------------------------+ The following fields are optional: .. table:: :widths: auto +--------------------------+-----------------------------------------------------------------------------------------+ | **Field name** | **Description** | +==========================+=========================================================================================+ | *adults* | Numebr of adults | +--------------------------+-----------------------------------------------------------------------------------------+ | *children* | Numenr of children | +--------------------------+-----------------------------------------------------------------------------------------+ | *meal* | `meal symbol`_ (bb, hb, ..) | +--------------------------+-----------------------------------------------------------------------------------------+ .. _meal symbol: symbols.html#get-meals | Response-data: list of prices. **roomtypeid** It is the identification number of a zak-room-type and it can be obtained by `room api. `_ **planid** It is the identification number of a zak-pricing-plan and it can be obtained by `plans api. `_ Example ------- curl: ..... .. code-block:: shell $ curl https://kapi.wubook.net/kapi/prices/get_by_roomocc -u 123456: -X POST \ -d dfrom=12/11/2018 -d dto=18/11/2018 -d rtid=4870 -d plid=1025 -d adults=2 -d meal=bb {"data": [[90.0, 90.0, 90.0, 90.0, 90.0, 100.0, 100.0]]} python code: ............ .. code-block:: python import requests uspw=(123456, None) data= {'dfrom':'12/11/2018', 'dto':'18/11/2018', 'rtid':4870, 'plid':1025, 'adults':2, 'meal':'bb'} response= requests.post('https://kapi.wubook.net/kapi/prices/get_by_roomocc', data, auth= uspw) print(response.text)