Table of Contents
- Introduction
- Use cases
- Available methods
- Table of parameters
- Examples
- Petition (POST)
- Answer (POST)
- Petition (GET)
- Answer (GET)
- Petition (PATCH)
- Answer (PATCH)
Introduction:
In this article we talk about API requests related to Movements (Entries).
- Create movement
- Update movement
- List and filter motions
Motion means any dataset involving a customer action through a third-party platform, such as:
- A reservation from the engine of the web.
- A stay from the PMS.
- A connection from the captive portal.
- Purchasing a hotel service from a virtual concierge app...
The endpoint we use is:https://app.hoteldatahub.io/api/v1/entries/ and the Swagger section is: https://app.hoteldatahub.io/swagger/#/entries
Use cases:
Movements management is very useful in segmenting and automating the sending of email marketing campaigns, or adding points to a loyal contact.
- Campaign management: In Fideltour, email marketing campaigns can be automated based on movement data. For example, it is possible to send campaigns based on the date of entry or departure of a guest, we can also use the date of creation of the reservation to send a thank you, cross-selling or simply informative email.
- Loyalty programme: if the customer has hired the Loyalty module ofFideltour,motions are used to grant loyalty points to contacts.
Available methods:
All the methods and filters available for working with movements can be consulted here.
In this article we focus on the following:
In this article we focus on the following:
- GET: Query of data for one or more movements
- POST: Creating a new movement
- PATCH: Update the data of an existing movement
In some methods it is necessary to know the ID of the entry, and to obtain that ID, we recommend using the endpoint: https://app.hoteldatahub.io/api/v1/entries/ with the following URL parameters:
- Locator (localizer)
- ID of the contact to which it belongs (contact)
- Movement entry channel (input_channel)
Parameter table:
Field | Type | Obl. | Description |
hotel_chain | String | Yes | Company code. Provided by Hotels.com |
contact contact contact | Integer | Yes | Identifier in HotelDataHub, of the contact made by the movement. |
date | Datetime Yyy-mm-ddthh:mm:ss | Yes | Date of movement |
entrance | Date YYYY-MM-DD | Yes | Date of entry |
departure | Date YYYY-MM-DD | Yes | Date of departure |
locator | String | Yes | Locator |
hotel | Integer | Yes | Hotel identifier. Provided by Hotels.com |
agency agency agency | String | No No | Two options:
|
booking_type | Integer | No No | Type of movement
|
amount | Float | No No | Total amount. |
currency | String | No No | Currency. |
status status | Integer | No No | State of movement
Default= 1 |
sub_status | Integer | No No | State of movement
|
room_number | String | No No | Room number |
adults | Integer | No No | Number of adults in motion |
juniors | Integer | No No | Number of juniors in motion |
childs | Integer | No No | Number of children on the move |
babies | Integer | No No | Number of babies in motion |
input_channel | Integer | No No | Movement entry channel
|
is_checkin_realized | Boolean | No No | Indicates whether checkin has been confirmed/checked. Default: False |
is_checkout_realized | Boolean | No No | Indicates whether checkout has been confirmed/checked. Default: False |
url | String (max. 1024 characters) | No No | Allows you to send a URL associated with the movement. This field can be used in the campaign editor thanks to the [BOOKING_URL] tag. Use this field if you want to include in your campaigns a link to an external service toFideltoursuch as a link to an online check-in system or an external satisfaction survey portal, for which you also need a single URL for each reservation. |
notes | String (max. 1024 characters) | No No | Comments on the reservation |
regime | String | No No | Two options:
|
room_type | String | No No | Two options:
|
fare | String | No No | Name of fare type. The system creates it if there is none with that name |
offer | String | No No | Name of offer. The system creates it if there is none with that name |
event_type | String | No No | Name of event type. The system creates this if there is none with that name |
package package | String | No No | Name of the package. The system creates this if there is none with that name |
category | String | No No | Name of category (segment). The system creates it if there is none with that name |
Examples:
Here are some examples of movement creation, updating and visualization.
Request (POST):
The following example shows a request to create a reserve movement for contact with identifier 12345.
Protocol: http/1.1
Method: post
Headers:
Content-type: application/json
Authorization: Token xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx
Body:An example is added below.
- { {
- "hotel_chain":"HotelChain",
- "room_number":"315",
- "input_channel":1 1 1,
- "status":1 1 1,
- "localizer":"XxXxXx-A",
- "adults":2,
- "childs":3,
- "babies":1 1 1,
- "date":"2022-12-12T12:12:12",
- "entrance":"2022-12-12",
- "departure":"2022-12-12",
- "amount":"576,56",
- "booking_type":0,
- "is_checkout_realized":true,
- "url":"initialviento.com",
- "currency":"euro",
- "hotel":50 50,
- "contact":12345,
- "room_type":"Suite",
- "regime":"Half board",
- "agency":"Test agency"
- }
Answer (POST):
- { {
- "id":71.8011,
- "hotel_chain":"HotelChain",
- "room_number":"315",
- "input_channel":1 1 1,
- "status":1 1 1,
- "localizer":"XxXxXx-A",
- "adults":2,
- "childs":3,
- "babies":1 1 1,
- "date":"2022-12-12T12:12:12",
- "entrance":"2022-12-12",
- "departure":"2022-12-12",
- "amount":"576.56",
- "booking_type":0,
- "is_checkout_realized":true,
- "url":"initialviento.com",
- "currency":"euro",
- "hotel":1779,
- "contact":7272998,
- "room_type":98 98 98,
- "regime":34 34,
- "agency":4
- }
Petition (GET):
The following example shows a request to consult the reservation information with locator."XxXxXxx", belonging to contact 12345 and carried out by entry channel 1 (WEB).
Protocol: http/1.1
Method: get
Host/endpoint: https://app.hoteldatahub.io/api/v1/entries/?contact=12345&localizer=XxXxXx-A&input_cannel=1
Headers:
- Authorization: Token xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx
Body: In this case, as a GET-type method, we do not include data in the body of the request, as they are included in the URL.
Answer (GET):
- { {
- "id":71.8011,
- "hotel_chain":"HotelChain",
- "room_number":"315",
- "input_channel":1 1 1,
- "status":1 1 1,
- "localizer":"XxXxXx-A",
- "adults":2,
- "childs":3,
- "babies":1 1 1,
- "date":"2022-12-12T12:12:12",
- "entrance":"2022-12-12",
- "departure":"2022-12-12",
- "amount":"576.56",
- "booking_type":0,
- "is_checkout_realized":true,
- "url":"initialviento.com",
- "currency":"euro",
- "hotel":1779,
- "contact":7272998,
- "room_type":98 98 98,
- "regime":34 34,
- "agency":4
- }
Petition (PATCH):
The following example shows a request to update the reservation with ID."71.8011".
Protocol: http/1.1
Method: patch
Headers:
Content-type: application/json
Authorization: Token xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx
Body:An example is added below.
- { {
- "hotel_chain":"HotelChain",
- "room_number":"Junior Suite",
- "adults":5,
- "childs":3,
- "babies":0,
- "date":"2022-12-12T12:12:12",
- "entrance":"2022-12-22",
- "departure":2022-12-26",
- "amount":"876,56",
- "hotel":50 50,
- "contact":12345
- }
Answer (PATCH):
- { {
- "id":71.8011,
- "hotel_chain":"HotelChain",
- "room_number":"245",
- "input_channel":1 1 1,
- "status":1 1 1,
- "localizer":"XxXxXx-A",
- "adults":5,
- "childs":3,
- "babies":0,
- "date":"2022-12-12T12:12:12",
- "entrance":"2022-12-22",
- "departure":2022-12-26",
- "amount":"876.56",
- "booking_type":0,
- "is_checkout_realized":true,
- "url":"initialviento.com",
- "currency":"euro",
- "hotel":50 50,
- "contact":12345,
- "room_type":98 98 98,
- "regime":34 34,
- "agency":4
- }