Movements (Entries)

Table of contents

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 Datetime
YYYY-MM-DDTHH:MM:SS
Yes Date of the movement
entrance Date
YYYY-MM-DD
Yes Check-in date
departure Date
YYYY-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 = Stay
2 = Visitor
3 = Other
4 = Restaurant table
5 = Gym or SPA access
6 = Entertainment activities
7 = SPA treatment
8 = Balinese bed
9 = Excursion
10 = Transfer
11 = Room service
12 = Minibar restocking
13 = Car rental
14 = Quote
15 = Bar
16 = Restaurant
17 = SPA access
18 = Gym
19 = Sports activity
20 = Golf
21 = Parking
22 = Upselling
23 = Cross-selling
24 = 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=1
Inactive=0
Default= 1
sub_status Integer No Movement sub-status:
Voided=1
Confirmed=2
Pending=3
Cancelled=4
No show=5
Modified=6
Quote=7
Stay=8
Departure=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 = Phone
1 = WEB
2 = APP
3 = WiFi
4 = PMS
5 = API
6 = IMPORT
7 = BE
8 = CHATBOT
9 = CONCIERGE
10 = CALL CENTER
12 = CHANNEL MANAGER
13 = PMS (other)
14 = PMS Restaurant
15 = PMS SPA
16 = BE (other)
17 = BE Restaurant
18 = BE SPA
19 = CONNECTOR HUB
20 = Digital key platform
21 = CRM
22 = Social media form
23 = POS Restaurant
24 = POS SPA
25 = TTOO
26 = B2C
27 = B2B
28 = Agency
29 = DMC
30 = 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 = Phone
1 = WEB
2 = APP
3 = WiFi
4 = PMS
5 = API
6 = IMPORT
7 = BE
8 = CHATBOT
9 = CONCIERGE
10 = CALL CENTER
12 = CHANNEL MANAGER
13 = PMS (other)
14 = PMS Restaurant
15 = PMS SPA
16 = BE (other)
17 = BE Restaurant
18 = BE SPA
19 = CONNECTOR HUB
20 = Digital key platform
21 = CRM
22 = Social media form
23 = POS Restaurant
24 = POS SPA
25 = TTOO
26 = B2C
27 = B2B
28 = Agency
29 = DMC
30 = 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
}