Movements (Entries)
Table of contents¶
- Introduction
- Use cases
- Available methods
- Parameter table
- Examples
- Request (POST)
- Response (POST)
- Request (GET)
- Response (GET)
- Request (PATCH)
- Response (PATCH)
Introduction¶
This article covers the API requests related to Movements (Entries).
Available operations: - Create a movement - Update a movement - List and filter movements
A movement is any set of data that represents an action taken by a customer through a third-party platform, for example:
- A booking made through the website engine.
- A stay recorded from the PMS.
- A connection through the captive portal.
- The purchase of a hotel service through a virtual concierge app...
Endpoint: https://app.hoteldatahub.io/api/v1/entries/
Swagger: https://app.hoteldatahub.io/swagger/#/entries
Use cases¶
Movement management is very useful for segmenting and automating email marketing campaigns, or for adding points to a loyalty contact's profile.
Campaign management¶
In Fideltour, email marketing campaigns can be automated based on movement data. For example, you can send campaigns based on a guest's check-in or check-out date, or use the booking's creation date to send a thank-you email, a cross-sell email, or a purely informational one.
Loyalty program¶
If the customer has the Fideltour Loyalty module, movements are used to award loyalty points to contacts.
Available methods¶
All the methods and filters available for working with movements can be found here.
This article focuses on the following:
- GET: Retrieve data for one or more movements
- POST: Create a new movement
- PATCH: Update the data of an existing movement
For some methods you need to know the entry's ID. To get that ID, we recommend using the https://app.hoteldatahub.io/api/v1/entries/ endpoint with the following URL parameters:
- Localizer (
localizer) - ID of the contact it belongs to (
contact) - Input channel of the movement (
input_channel)
Parameter table¶
| Field | Type | Req. | Description |
|---|---|---|---|
hotel_chain |
String | Yes | Company code. Provided by HotelDataHub. |
contact |
Integer | Yes | HotelDataHub identifier of the contact making the movement. |
date |
DatetimeYYYY-MM-DDTHH:MM:SS |
Yes | Date of the movement |
entrance |
DateYYYY-MM-DD |
Yes | Check-in date |
departure |
DateYYYY-MM-DD |
Yes | Check-out date |
localizer |
String | Yes | Localizer |
hotel |
Integer | Yes | Hotel identifier. Provided by HotelDataHub. |
agency |
String | No | Two options: - Identifier of an already-created agency. - Name of the agency. The system creates it if none exists with that name |
booking_type |
Integer | No | Movement type:0 = Booking (Default)1 = Stay2 = Visitor3 = Other4 = Restaurant table5 = Gym or SPA access6 = Entertainment activities7 = SPA treatment8 = Balinese bed9 = Excursion10 = Transfer11 = Room service12 = Minibar restocking13 = Car rental14 = Quote15 = Bar16 = Restaurant17 = SPA access18 = Gym19 = Sports activity20 = Golf21 = Parking22 = Upselling23 = Cross-selling24 = Survey |
amount |
Float | No | Total amount. |
amount_paid |
Float | No | Amount paid. |
paid |
Boolean | No | Whether the full payment is confirmed |
currency |
String | No | Currency in ISO 4217 |
status |
Integer | No | Movement status:Active=1Inactive=0Default= 1 |
sub_status |
Integer | No | Movement sub-status:Voided=1Confirmed=2Pending=3Cancelled=4No show=5Modified=6Quote=7Stay=8Departure=9 |
room_number |
String | No | Room number |
adults |
Integer | No | Number of adults in the movement |
juniors |
Integer | No | Number of juniors in the movement |
children |
Integer | No | Number of children in the movement |
babies |
Integer | No | Number of babies in the movement |
input_channel |
Integer | No | Input channel of the movement. For booking engines, PMS and WiFi the server sets it automatically (7, 4 and 3) and overrides the value sent. For any other integration (chatbot, call center, CRM, etc.) you must send it; otherwise the movement will not have the right channel.0 = Phone1 = WEB2 = APP3 = WiFi4 = PMS5 = API6 = IMPORT7 = BE8 = CHATBOT9 = CONCIERGE10 = CALL CENTER12 = CHANNEL MANAGER13 = PMS (other)14 = PMS Restaurant15 = PMS SPA16 = BE (other)17 = BE Restaurant18 = BE SPA19 = CONNECTOR HUB20 = Digital key platform21 = CRM22 = Social media form23 = POS Restaurant24 = POS SPA25 = TTOO26 = B2C27 = B2B28 = Agency29 = DMC30 = SURVEY PLATFORM |
original_input_channel |
Integer | No | Origin channel as recorded by the external system (PMS/BE). Unlike input_channel (which the server can override based on the company type), this field preserves the original channel reported by the external system.0 = Phone1 = WEB2 = APP3 = WiFi4 = PMS5 = API6 = IMPORT7 = BE8 = CHATBOT9 = CONCIERGE10 = CALL CENTER12 = CHANNEL MANAGER13 = PMS (other)14 = PMS Restaurant15 = PMS SPA16 = BE (other)17 = BE Restaurant18 = BE SPA19 = CONNECTOR HUB20 = Digital key platform21 = CRM22 = Social media form23 = POS Restaurant24 = POS SPA25 = TTOO26 = B2C27 = B2B28 = Agency29 = DMC30 = SURVEY PLATFORM |
is_checkin_realized |
Boolean | No | Indicates whether check-in has been confirmed/completed. Default: False |
is_checkout_realized |
Boolean | No | Indicates whether check-out has been confirmed/completed. Default: False |
regime |
String | No | Name of the meal plan. The system creates it if none exists with that name |
contracted_regime |
String | No | Originally contracted meal plan. Accepts a numeric ID or a name; the system creates it if none exists with that name |
upgraded_regime |
String | No | Meal plan assigned after an upgrade. Accepts a numeric ID or a name; the system creates it if none exists with that name |
room_type |
String | No | Name of the room type. The system creates it if none exists with that name |
contracted_room_type |
String | No | Contracted room type. Accepts a numeric ID or a name; the system creates it if none exists with that name |
upgraded_room_type |
String | No | Room type assigned after an upgrade. Accepts a numeric ID or a name; the system creates it if none exists with that name |
fare_type |
String | No | Name of the rate type. The system creates it if none exists with that name |
offer |
String | No | Name of the offer. The system creates it if none exists with that name |
event_type |
String | No | Name of the event type. The system creates it if none exists with that name |
package |
String | No | Name of the package. The system creates it if none exists with that name |
category |
String | No | Name of the category (segment). The system creates it if none exists with that name |
fare_type |
String | No | Name of the rate type. The system creates it if none exists with that name |
offer |
String | No | Name of the offer. The system creates it if none exists with that name |
event_type |
String | No | Name of the event type. The system creates it if none exists with that name |
package |
String | No | Name of the package. The system creates it if none exists with that name |
category |
String | No | Name of the category (segment). The system creates it if none exists with that name |
amount_paid |
Float | No | Amount paid |
paid |
Boolean | No | Whether the full payment is confirmed |
url |
String (max. 2048 characters) | No | Lets you send a URL associated with the movement. This field can be used in the campaign editor via the [BOOKING_URL] tag. Use this field if you want to include in your campaigns a link to a service external to Fideltour, such as a link to an online check-in system or an external satisfaction survey portal, for which you also need a unique URL for each booking. |
external_object_id |
String | No | Movement identifier in the external system (PMS, BE, etc.). Used together with hotel, booking_type and contact as a uniqueness key to identify and deduplicate movements in Fideltour. |
notes |
String (max. 1024 characters) | No | Comments about the booking |
custom_fields |
Object | No | Key-value dictionary with the movement's custom fields. The keys are the identifiers of the fields defined in Fideltour. Example: {"cf_promo_code": "SUMMER24"} |
Examples¶
Below are some examples of creating, updating and viewing movements.
Request (POST)¶
The following example shows a request to create a booking movement for the contact with ID 12345.
PROTOCOL: HTTP/1.1
METHOD: POST
HOST/ENDPOINT: https://app.hoteldatahub.io/api/v1/entries/
HEADERS:
Content-type: application/json
Authorization: Token xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx
BODY:
{
"hotel_chain": "HotelChain",
"hotel": 50,
"contact": 12345,
"date": "2022-12-12T12:12:12",
"entrance": "2022-12-12",
"departure": "2022-12-20",
"localizer": "XxXxXx-A",
"status": 1,
"room_number": "315",
"adults": 2,
"children": 3,
"babies": 1,
"amount": "576.56",
"currency": "EUR",
"booking_type": 0,
"is_checkout_realized": false,
"url": "https://checkin.hotel.com/XxXxXx-A",
"room_type": "Suite",
"regime": "Half board",
"agency": "Test agency"
}
Response (POST)¶
{
"id": 718011,
"hotel_chain": "HotelChain",
"hotel": 50,
"contact": 12345,
"date": "2022-12-12T12:12:12",
"entrance": "2022-12-12",
"departure": "2022-12-20",
"localizer": "XxXxXx-A",
"status": 1,
"room_number": "315",
"input_channel": 7,
"adults": 2,
"childs": 3,
"babies": 1,
"amount": "576.56",
"currency": "EUR",
"booking_type": 0,
"is_checkout_realized": false,
"url": "https://checkin.hotel.com/XxXxXx-A",
"room_type": 98,
"regime": 34,
"agency": 4
}
Request (GET)¶
The following example shows a request to look up the booking with localizer "XxXxXx-A", belonging to contact 12345.
PROTOCOL: HTTP/1.1
METHOD: GET
HOST/ENDPOINT: https://app.hoteldatahub.io/api/v1/entries/?contact=12345&localizer=XxXxXx-A
HEADERS:
Authorization: Token xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx
BODY: Since this is a GET request, no data is included in the request body, as it's included in the URL instead.
Response (GET)¶
{
"count": 1,
"next": null,
"previous": null,
"results": [{
"id": 718011,
"hotel_chain": "HotelChain",
"hotel": 50,
"contact": 12345,
"date": "2022-12-12T12:12:12",
"entrance": "2022-12-12",
"departure": "2022-12-20",
"localizer": "XxXxXx-A",
"status": 1,
"room_number": "315",
"input_channel": 7,
"adults": 2,
"childs": 3,
"babies": 1,
"amount": "576.56",
"currency": "EUR",
"booking_type": 0,
"is_checkout_realized": false,
"url": "https://checkin.hotel.com/XxXxXx-A",
"room_type": 98,
"regime": 34,
"agency": 4
}]
}
Request (PATCH)¶
The following example shows a request to update the booking with ID 718011.
PROTOCOL: HTTP/1.1
METHOD: PATCH
HOST/ENDPOINT: https://app.hoteldatahub.io/api/v1/entries/718011/
HEADERS:
Content-type: application/json
Authorization: Token xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx
BODY:
{
"hotel_chain": "HotelChain",
"room_number": "Suite Junior",
"adults": 5,
"children": 3,
"babies": 0,
"entrance": "2022-12-22",
"departure": "2022-12-26",
"amount": "876.56"
}
Response (PATCH)¶
{
"id": 718011,
"hotel_chain": "HotelChain",
"hotel": 50,
"contact": 12345,
"date": "2022-12-12T12:12:12",
"entrance": "2022-12-22",
"departure": "2022-12-26",
"localizer": "XxXxXx-A",
"status": 1,
"room_number": "Suite Junior",
"input_channel": 7,
"adults": 5,
"childs": 3,
"babies": 0,
"amount": "876.56",
"currency": "EUR",
"booking_type": 0,
"is_checkout_realized": false,
"url": "https://checkin.hotel.com/XxXxXx-A",
"room_type": 98,
"regime": 34,
"agency": 4
}