[ overview ]
This article explains the implementation steps for developing your own booking engine (reservation site) by using AirHost API to obtain inventory and price information.
[Details]
Implementation image
Please make sure to design your system so that a copy of the inventory and price data obtained from the AirHost API is stored in your in-house database. You cannot implement a system that retrieves real-time data via API each time.
Processing Steps
Initial data acquisition
Call GET /properties to get information for all properties and keep a copy in the local DB.
Call GET /availabilities to get inventory and price information for each room type and rate plan, and store a copy in the local DB.
Keeping data up to date
In order to keep the facility and reservation information stored in the local DB up to date, a Push Webhook (POST /webhooks) call is received and the inventory and price updates of the availabilities.update Event are reflected in the local DB. A URL must be registered, so please let the AirHost development team know when you implement and test it.
Full Scan
You can ensure data consistency by retrieving the latest inventory and pricing information using GET /availabilities about once a day.
Displaying information to booking engines
Please use the data in the local DB to display facility information on your own reservation site and inventory and price information on the reservation calendar. If you design it to call the AirHost API every time, it will not work due to access restrictions.
Creating reservation data
By calling POST /stays, you can register the reservation confirmed on the booking site to AirHost via API.
Reservations created via POST /stays can also be updated via PUT /room_reservations/{id}. *Other reservations, such as OTA reservations, cannot be updated.
API Documentation and Available Endpoints
API documentation: https://airhost.stoplight.io/docs/airhost-public-api-doc/branches/japanese/b8pf0iy7p7mrw-
*The only APIs available in the "Booking Engine API" package are listed below.
GET /properties
GET /availabilities
POST /webhooks (availabilities.update Event only)
POST /stays
PUT /room_reservations/{id} (only for reservations created with POST /stays)
GET /stays (only applies to reservations created with POST /stays)