Motion management

Motion management

Movements

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...



Use cases:

Movements management is very useful in segmenting and automating the sending of email marketing campaigns, or adding points to a loyal contact.

  1. 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.

  1. 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:

  1. GET: Query of data for one or more movements
  2. POST: Creating a new movement
  3. 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:
  • Identifier of the agency already created.
  • Name of the agency. The system creates it if there is none with that name
booking_type
Integer
No No
Type of movement
  • 0 = Booking (Default)
  • 1 = Stay
  • 2 = Visitor
  • 3 = Other
  • 4 = Table in restaurant
  • 5 = Access to gym or SPA
  • 6 = Animation activities
  • 7 = SPA treatment
  • 8 = Balinese bed
  • 9 = Excursion
  • 10 = Transfer
  • 11 = Room service
  • 12 = Replacement of minibar
  • 13 = Rental of vehicles
  • 14 = Quote
  • 15 = Bar
  • 16 = Restaurant
  • 17 = Access to the Spa
  • 18 = Gym
  • 19 = Sports activity
  • 20 = Golf
  • 21 = Parking
amount
Float
No No
Total amount.
currency
String
No No
Currency.
status status
Integer
No No
State of movement
  • Active=1
  • Inactive=0
Default= 1
sub_status
Integer
No No
State of movement
  • Cancelled=1
  • Confirmed=2
  • Pending=3
  • Cancelled=4
  • No show=5
  • Modified=6
  • Quote=7
  • Stay=8
  • Output=9
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
  • 0 = Phone
  • 1 = Web
  • 2 = App
  • 3 = WiFi
  • 4 = Pms
  • 5 = Api
  • 6 = Import
  • 7 = Be
  • 8 = Chatbot
  • 9 = Concierge
  • 10 = Call center
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:
  • Identifier of the regime already created.
  • Name of the regime. The system creates it if there is none with that name
room_type
String
No No
Two options:
  • Identifier of the room type already created.
  • Name of room type. The system creates it if there is none with that name
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
Host/endpoint: https://app.hoteldatahub.io/api/v1/entries/
Headers:
Content-type: application/json
Authorization: Token xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx
Body:An example is added below. 

  1. { {
  2. "hotel_chain":"HotelChain",
  3. "room_number":"315",
  4. "input_channel":1 1 1,
  5. "status":1 1 1,
  6. "localizer":"XxXxXx-A",
  7. "adults":2,
  8. "childs":3,
  9. "babies":1 1 1,
  10. "date":"2022-12-12T12:12:12",
  11. "entrance":"2022-12-12",
  12. "departure":"2022-12-12",
  13. "amount":"576,56",
  14. "booking_type":0,
  15. "is_checkout_realized":true,
  16. "url":"initialviento.com",
  17. "currency":"euro",
  18. "hotel":50 50,
  19. "contact":12345,
  20. "room_type":"Suite",
  21. "regime":"Half board",
  22. "agency":"Test agency"
  23. }


Answer (POST):

  1. { {
  2. "id":71.8011,
  3. "hotel_chain":"HotelChain",
  4. "room_number":"315",
  5. "input_channel":1 1 1,
  6. "status":1 1 1,
  7. "localizer":"XxXxXx-A",
  8. "adults":2,
  9. "childs":3,
  10. "babies":1 1 1,
  11. "date":"2022-12-12T12:12:12",
  12. "entrance":"2022-12-12",
  13. "departure":"2022-12-12",
  14. "amount":"576.56",
  15. "booking_type":0,
  16. "is_checkout_realized":true,
  17. "url":"initialviento.com",
  18. "currency":"euro",
  19. "hotel":1779,
  20. "contact":7272998,
  21. "room_type":98 98 98,
  22. "regime":34 34,
  23. "agency":4
  24. }


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):

  1. { {
  2. "id":71.8011,
  3. "hotel_chain":"HotelChain",
  4. "room_number":"315",
  5. "input_channel":1 1 1,
  6. "status":1 1 1,
  7. "localizer":"XxXxXx-A",
  8. "adults":2,
  9. "childs":3,
  10. "babies":1 1 1,
  11. "date":"2022-12-12T12:12:12",
  12. "entrance":"2022-12-12",
  13. "departure":"2022-12-12",
  14. "amount":"576.56",
  15. "booking_type":0,
  16. "is_checkout_realized":true,
  17. "url":"initialviento.com",
  18. "currency":"euro",
  19. "hotel":1779,
  20. "contact":7272998,
  21. "room_type":98 98 98,
  22. "regime":34 34,
  23. "agency":4
  24. }

Petition (PATCH):

The following example shows a request to update the reservation with ID."71.8011".
Protocol: http/1.1
Method: patch
Host/endpoint: https://app.hoteldatahub.io/api/v1/entries/
Headers:
Content-type: application/json
Authorization: Token xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx

Body:An example is added below.
  1. { {
  2. "hotel_chain":"HotelChain",
  3. "room_number":"Junior Suite",
  4. "adults":5,
  5. "childs":3,
  6. "babies":0,
  7. "date":"2022-12-12T12:12:12",
  8. "entrance":"2022-12-22",
  9. "departure":2022-12-26",
  10. "amount":"876,56",
  11. "hotel":50 50,
  12. "contact":12345
  13. }


Answer (PATCH):

  1. { {
  2. "id":71.8011,
  3. "hotel_chain":"HotelChain",
  4. "room_number":"245",
  5. "input_channel":1 1 1,
  6. "status":1 1 1,
  7. "localizer":"XxXxXx-A",
  8. "adults":5,
  9. "childs":3,
  10. "babies":0,
  11. "date":"2022-12-12T12:12:12",
  12. "entrance":"2022-12-22",
  13. "departure":2022-12-26",
  14. "amount":"876.56",
  15. "booking_type":0,
  16. "is_checkout_realized":true,
  17. "url":"initialviento.com",
  18. "currency":"euro",
  19. "hotel":50 50,
  20. "contact":12345,
  21. "room_type":98 98 98,
  22. "regime":34 34,
  23. "agency":4
  24. }



    • Related Articles

    • Other connections

      Other Introduction In the Hotel Data Hub API, several numeric values are required, which serve to identify an item or element in Fideltour's database. We can deduce that if an item does not exist in the database, it must first be created in order to ...
    • Loyalty

      Loyalty Introduction: In this article we talk about API requests related to the Fideltour Loyalty module. The sections of the Swagger which include this information are: https://app.hoteldatahub.io/swagger/#/contacts ...
    • GDPR Consent

      GDPR Consent Introduction: In this article, we talk about API requests related to the mandatory consents of the General Data Protection Regulation (GDPR in English), and how to manage it in our contacts. - Create consents for a contact - List and ...
    • Introduction

      Getting started Introduction: In this article, we show how to consult and use the HotelDataHub/Fideltour API through the Swagger platform. There, we find the different endpoints (URLs) and the information that must be provided for each one to use the ...
    • Contact management

      Contacts Introduction: In this article we talk about API requests related to Contacts. Create contact Update contact List and filter contacts The endpoint we use is:https://app.hoteldatahub.io/api/v1/contacts/and the Swagger section ...