Sections and articles

API for booking widgets on the website for Shelter CLOUD

Description

The API is designed to work with the Shelter Cloud booking widget v2.

All methods require specifying a token, which can be obtained in your personal account on the " tabOnline v2".



General principle of operation

The client application asks the user for the check-in date and the required number of rooms, indicating how many guests will be in each room and the age of the children.

Next, it calls the getVariants method, gets the available variations, and displays them to the user.

The user selects the appropriate one and proceeds to fill in the guest information and select the payment method. The allowed payment methods are requested in the getPaymentOptions method.

After that, a request is made to create a reservation in the putOrder method. In response, you will receive information about the created booking, including a link to the payment (if necessary).

If you need to get the order details, you can request them using the getOrder method.

The Postman collection in the attachment:

Examples

POST Find placement options (getVariants)

https://pms.frontdesk24.ru/api/online/getVariants

The method performs a search and provides options for which there is a seat availability and prices for the requested dates and the number of guests.

The result is an array containing other arrays. The following order must be observed.

The system itself determines which rooms are suitable for the specified number of guests and how to seat the guests.

The number is considered suitable if the number of main and additionalthere are more or equal seats in it than requested. The main places are occupied first, then the additional ones.seats, while the guests are seated starting from adults. For example, if there are 2 main seats and 1 additional seat in a room and the search is for 1 adult, 1 child, and 1 infant, the adult and child will be counted for the main seats, and the infant will be assigned to the additional seat. 

An example in the archive:


POST Get the hotel parameters (getHotelParams)

https://pms.frontdesk24.ru/api/online/getHotelParams

Returns widget parameters and directories.

Archive example:



POST Receive payment methods (getPaymentOptions)

https://pms.frontdesk24.ru/api/online/getPaymentOptions

Archive example:


POST Create a booking (putOrder)

https://pms.frontdesk24.ru/api/online/putOrder

Creates a reservation.

Archive example:


POSTCancel booking (annulOrder)

https://pms.frontdesk24.ru/OnlineWidget3/online/v3/annulOrder

Cancels the booking. To cancel a reservation, you must specify an orderToken. It is displayed in the response to the booking creation request (putOrder).

Archive example:

Possible problems and their solutions

Problem 1: An empty array of data is displayed in the response to the request. The information is provided using the example of using the getVariants method.



Solution: Check on the website whether there are accommodation options in the booking module for the dates specified in the request. If there is no website, or the online booking module is not installed, then you can check through the car site.: 

- To do this, go to Shelter CLOUD.

- Go to settings by clicking on the username in the upper-right corner of the screen. 

- Select the section "Online for the v2.0 website". 

- Scroll down to the section "Car site". 

- Fill in the field "synonym of the hotel for the link", this is necessary to create a page with the online booking module. 

- Follow the link.



- We see that there are no available numbers during the specified period. That is why the request returns an empty array of data. The solution may be:

1) Check that the online booking module has been purchased and is included in the Shelter CLOUD tariff.

    2) Check that the categories and rates are configured for online upload.

3) Check that there are no restrictions for tariffs and categories.

4) Check that the tariffs set prices for the requested period.

5) Specify the dates on which there are available accommodation options.

 


Problem 2: Incorrect data in the request. The information is provided using the getVariants method as an example. The browser used is Google Chrome.



Solution: You need to get the correct request example when using the getVariants method. For this:

- Go to the booking module on the website or car site.

- Open the console (developer tools).

- In the booking module or car site, select the dates and start the search for available accommodations.



- Go to the " section in the consoleNetwork". Setting the "Fetch/XDR" parameter if it is not set.

- We find the getVariants query.

- On the "Headers" tab - "General" we see the URL and the method.



- On the " tabPayload" - "View the resource" we see the request body.



- On the " tabResponse" we see the response to the request for placement options.



- Go to the API testing tool (Postman, Bruno, etc.)

- Specify the URL and method from the example on the "Headers" tab - "General".



- Copy the request body from the " tabPayload" - "View the resource".

- We execute the request and receive a response.



- Now you can generate the code.



Problem 3: When using the putOrder method, an error occurs like this: "{"error":{"code":"0400","message":"The calculated 34f7a5e45be13567a2881ffc55f11111 and the incoming signature do not match","description":null}}"

Solution: When using the putOrder method, the request must specify the signature ID. This ID can be obtained by using the getVariants method. Each placement option will have its own signature ID.