Once you have the access to Booking Manager web service, the easiest procedure to start the integration is to create a local database, where you will store most of the data for all the boats to reduce the number of requests to web service and to increase the response time when availability request is required.
Starting the integration
The first action would be to get the data for all the charter companies from the Booking Manager System you will be working with. The proper function for this is GET/companies.
Once you get the data for all companies from Booking Manager System with
https://app.swaggerhub.com/apis-docs/mmksystems/bm-api/#/Booking/getCompanies
you can parse the boat data company by company and store it to your local database.
You will use ID of an company provided from GET/companies and use it in GET/yachts function. All relevant boat information can be found in GET/yachts.
Data that can be stored locally are all the data non-related to real-time boat availability - shipyards (GET/shipyards), bases (GET /bases), sailing areas (GET/sailingAreas) , boat equipment (part of GET/yachts response under equipmentIds), pictures (part of GET/yachts response under "images"), and applicable extras (part of GET/yachts response under "extras"). This data can be rechecked periodically to receive new data and store it locally along with all other existing data.
Boat prices retrieval
Companies sometimes want to have boat pricelists for a particular year, to show the boat prices troughout different booking seasons.
The proper function for retrieving the pricelist would be GET/prices. Calling this function for every Saturday - Saturday dates will provide you a boat prices throughout the year.
https://app.swaggerhub.com/apis-docs/mmksystems/bm-api/#/Booking/getPrices/
To get the prices for all boats in the system, you need to send the only date from/to parameter and the response will return all boats (with prices) for selected period/s.
Request and response structure is :
Performing this for all Saturdays in the year will give you pricelist of all boats for entire year, that can be stored locally and presented on the website.
Boat location
Another part of the integration is to properly connect boats with dedicated bases and countries.
Function GET/bases will provide a response for particular base with the following data -
"id": 87964150000100000,
"name": "Cala Bitta",
"city": "Genova",
"country": "Italy",
"address": "",
"latitude": "41.126387",
"longitude": "9.469442",
"countryId": 380,
"sailingAreas": [
19
This base has flag : sailingAreas="19"
In sailingAreas call , area with id 19 is:
{ "id": 19, "name": "Liguria / Toscana"
and also form the GET/bases you have country id parameter ( countryId="380") .
In GET/countries call this country is:
{
Combining these functions you will know that base Cala Bitta is in country Italy and that belongs to the sailing area Liguria / Toscana.
Boat availability
Retrieving boat availability is an important part of the booking process, therefore it requires proper usage of availability function.
The function to use is GET/offers with dateFrom/dateTo as required elements. Every other parameter is optional.
Example of request and response (part of the response) for particular period :
/offers?dateTo=2020-08-22T00:00:00&dateFrom=2020-08-15T00:00:00
This function and the response will return all available boats for the selected period. The response will return the base price, discount, and the final price for the client, along with all other details. Calling this function for every Saturday - Saturday dates will provide you a realtime boat availability throughout the year.
Additional availability functions such as GET/availability or GET/shortAvailability are described in documentation with all details and response structure. These functions will provide information on boat status (booked/available) throughout the year, so you can know what is the actual boat status on any particular day in the year (with GET/shortAvailability).
Comments
0 comments
Please sign in to leave a comment.