Skip to content

Tourmind Hotel Distribution API - TMS API (2.0) ​

Download OpenAPI specification: Download

TMS API.

Overall Overview ​

Welcome to the TourMind Developer Documentation. This guide provides all the information you need to integrate TourMind into your applications. Whether you are looking for hotel booking processes or AI-powered solutions, we've got you covered.

Key Features ​
  • Hotel APIs: Provides a comprehensive suite of APIs designed for streamlined hotel reservation processes.
  • TourMind AI APIs: Leverages advanced algorithms for room matching, room mapping, and rate prediction, enhancing pricing strategies and optimize inventory utilization rate.
Technical Specifications ​
  • All communications from agents to the TourMind API are conducted via HTTP POST.
  • The format of request payloads is based on JSON.
  • All requests should accept GZIP encoding, and all responses are returned in GZIP format.
  • All requests include a common request header, which contains authentication information.

API Development Process ​

workflow_EN

Changelog ​

VersionDateDescription
v1.0.12023.05.01Initial API documentation.
v2.0.12023.05.25Adjustments to hotel API fields.
v2.0.22026.03.19Add Query Bookings endpoint; add new fields to Retrieve Booking response (HotelCode, RoomCount, CheckIn, CheckOut, PaxRooms, Contact, ContactPhone, BookingTime).
v2.0.32026.08.14Align the Prebook MealType table with Search; document that the first guest of each PaxRoom is the primary guest.

Authorization ​

1. Common Request Field ​

All requests require a common field named RequestHeader, in which account information must be provided. example:

json
{
    "AgentCode": "your agent code",
    "UserName": "your username",
    "Password": "your password",
    "RequestTime": "2018-07-26T09:51:32.999Z",
    "TransactionID": "6ba7b810-9dad-11d1-80b4-00c04fd430c8"
}

2. Http Header ​

Please add the following two items to the Http header:

  • X-Agent-Code: your agent code
  • X-Username: your username

3. Test Environment Credential ​

API Test Credential
AgentCodetms_test
UserNametms_test
Passwordtms_test

Availability & Booking ​

Search hotel room rates and available inventory for a specific property, enabling users to view detailed room availability and pricing information.

API Call Schema

NameValue
Request URLhttp://developers.tourmind.cn/v2/HotelDetail
Request methodPOST
Request Fields
CheckIn: string
Check-in date, format: “2006-01-02”.
CheckOut: string
Check-out date, format: “2006-01-02”.
HotelCodes[]: integer
TourMind hotel IDs; up to 20 IDs are supported in this request.
IsDailyPrice: boolean
If true, daily price information will be included in the response. Default: false.
Nationality: string
Nationality.
Timeout: integer
request timeout, millisecond
Response Fields
json
{
  "CheckIn": "2018-08-25",
  "CheckOut": "2018-08-26",
  "HotelCodes": [
    8268393
  ],
  "Nationality": "CN",
  "PaxRooms": [
    {
      "Adults": 4,
      "Children": 0,
      "ChildrenAges": [],
      "RoomCount": 2
    }
  ],
  "Timeout": 6000,
  "RequestHeader": {
    "AgentCode": "tms_test",
    "Password": "tms_test",
    "RequestTime": "2018-07-26T09:51:32.123Z",
    "TransactionID": "6ba7b810-9dad-11d1-80b4-00c04fd430c8",
    "UserName": "tms_test"
  }
}
json
{
  "Error": {
    "ErrorCode": "101",
    "ErrorMessage": "invaild param"
  },
  "Hotels": [
    {
      "CheckIn": "2018-08-25",
      "CheckOut": "2018-08-26",
      "HotelCode": "740650",
      "RoomTypes": [
        {
          "Name": "Suite 3 bedrooms",
          "NameCN": "Triple Room",
          "RateInfos": [
            {
              "Allotment": 2,
              "CancelPolicyInfos": [
                {}
              ],
              "CurrencyCode": "CNY",
              "DailyPriceInfo": [
                {}
              ],
              "MealInfo": {
                "MealCount": 2,
                "MealType": "breakfast"
              },
              "Name": "SUITE THREE BEDROOMS",
              "RateCode": "13800206",
              "TotalPrice": 688.88
            }
          ],
          "RoomTypeCode": "4613"
        }
      ]
    }
  ],
  "ResponseHeader": {
    "ResponseTime": "2018-07-26 09:51:32",
    "TransactionID": "6ba7b810-9dad-11d1-80b4-00c04fd430c8"
  }
}

Prebook ​

Check the availability and price of a specific room rate selected, usually requested when the user selects a room to book and submits a booking.

API Call Schema

NameValue
Request URLhttp://developers.tourmind.cn/v2/CheckRoomRate
Request methodPOST
Request Fields
CheckIn: string
Check-in date, format: “2006-01-02”.
CheckOut: string
Check-out date, format: “2006-01-02”.
HotelCodes[]: integer
TourMind Hotel ID; only one ID is required in this request.
Nationality: string
Nationality.
RateCode: string
TourMind Rate ID.
TotalPrice: number
Total price returned from the SearchResponse.
Response Fields
json
{
  "CheckIn": "2018-08-25",
  "CheckOut": "2018-08-26",
  "HotelCodes": [
    8268393
  ],
  "Nationality": "CN",
  "PaxRooms": [
    {
      "Adults": 4,
      "Children": 0,
      "ChildrenAges": [],
      "RoomCount": 2
    }
  ],
  "RateCode": "13800206",
  "RequestHeader": {
    "AgentCode": "tms_test",
    "Password": "tms_test",
    "RequestTime": "2018-07-26T09:51:32.123Z",
    "TransactionID": "6ba7b810-9dad-11d1-80b4-00c04fd430c8",
    "UserName": "tms_test"
  },
  "TotalPrice": 688.88
}
json
{
  "Error": {
    "ErrorCode": "101",
    "ErrorMessage": "invaild param"
  },
  "Hotels": [
    {
      "CheckIn": "2018-08-25",
      "CheckOut": "2018-08-26",
      "HotelCode": "740650",
      "RoomTypes": [
        {
          "Name": "Suite 3 bedrooms",
          "NameCN": "Triple Room",
          "RateInfos": [
            {
              "Allotment": 2,
              "CancelPolicyInfos": [
                {}
              ],
              "CurrencyCode": "CNY",
              "DailyPriceInfo": [
                {}
              ],
              "MealInfo": {
                "MealCount": 2,
                "MealType": "breakfast"
              },
              "Name": "SUITE THREE BEDROOMS",
              "RateCode": "13800206",
              "TotalPrice": 688.88
            }
          ],
          "RoomTypeCode": "4613"
        }
      ]
    }
  ],
  "ResponseHeader": {
    "ResponseTime": "2018-07-26 09:51:32",
    "TransactionID": "6ba7b810-9dad-11d1-80b4-00c04fd430c8"
  }
}

Booking ​

Note: If the request times out, returns a PENDING status, or returns an error, please poll the Retrieve Booking API to obtain the final status of the booking.

API Call Schema

NameValue
Request URLhttp://developers.tourmind.cn/v2/CreateOrder
Request methodPOST
Request Fields
AgentRefID: string
Unique agent reference ID to identify a booking; maximum length is 128 characters. Note! Reserving with the same AgentRefID will not create a new reservation; instead, the original reservation information will be returned.
CheckIn: string
Check-in date, format: “2006-01-02”.
CheckOut: string
Check-out date, format: “2006-01-02”.
CurrencyCode: string
Currency code.
HotelCode: integer
TourMind Hotel ID; only one ID is required in this request.
RateCode: string
TourMind Rate ID.
SpecialRequest: string
Special customer requests.
TotalPrice: number
Total price for the booking returned from the CheckRoomRateResponse.
Response Fields
ReservationID: string
Tourmind order ID
json
{
  "AgentRefID": "213415",
  "CheckIn": "2018-08-15",
  "CheckOut": "2018-08-18",
  "ContactInfo": {
    "Email": "xxx@google.com",
    "FirstName": "Tom",
    "LastName": "Lee",
    "PhoneNo": "1521777777"
  },
  "CurrencyCode": "CNY",
  "HotelCode": 235113,
  "PaxRooms": [
    {
      "Adults": 2,
      "Children": 0,
      "ChildrenAges": [],
      "PaxNames": [
        {
          "FirstName": "Tom",
          "LastName": "Lee",
          "Type": "ADU"
        }
      ],
      "RoomCount": 1
    }
  ],
  "RateCode": "2132151",
  "RequestHeader": {
    "AgentCode": "tms_test",
    "Password": "tms_test",
    "RequestTime": "2018-07-26T09:51:32.123Z",
    "TransactionID": "6ba7b810-9dad-11d1-80b4-00c04fd430c8",
    "UserName": "tms_test"
  },
  "SpecialRequest": "Non-smoking room",
  "TotalPrice": 88.88
}
json
{
  "Error": {
    "ErrorCode": "101",
    "ErrorMessage": "invaild param"
  },
  "OrderInfo": {
    "OrderStatus": "CONFIRMED",
    "ReservationID": "10470379"
  },
  "ReservationID": "10470379",
  "ResponseHeader": {
    "ResponseTime": "2018-07-26 09:51:32",
    "TransactionID": "6ba7b810-9dad-11d1-80b4-00c04fd430c8"
  }
}

Cancel ​

Send a cancel request to cancel refundable and pending bookings.

Note: If the request times out or returns an error, please poll the Retrieve Booking API to obtain the final status of the booking.

API Call Schema

NameValue
Request URLhttp://developers.tourmind.cn/v2/CancelOrder
Request methodPOST
Request Fields
AgentRefID: string
Agent reference ID provided in the CreateOrder request by the agent; maximum length is 128.
Response Fields
json
{
  "AgentRefID": "213415",
  "RequestHeader": {
    "AgentCode": "tms_test",
    "Password": "tms_test",
    "RequestTime": "2018-07-26T09:51:32.123Z",
    "TransactionID": "6ba7b810-9dad-11d1-80b4-00c04fd430c8",
    "UserName": "tms_test"
  }
}
json
{
  "CancelResult": {
    "CancelFee": 42,
    "CurrencyCode": "CNY",
    "OrderStatus": "CANCELLED"
  },
  "Error": {
    "ErrorCode": "101",
    "ErrorMessage": "invaild param"
  },
  "ResponseHeader": {
    "ResponseTime": "2018-07-26 09:51:32",
    "TransactionID": "6ba7b810-9dad-11d1-80b4-00c04fd430c8"
  }
}

Retrieve Booking ​

Retrieve booking to check its status in the booking process.

API Call Schema

NameValue
Request URLhttp://developers.tourmind.cn/v2/SearchOrder
Request methodPOST
Request Fields
AgentRefID: string
Agent reference ID provided in the CreateOrder request; maximum length is 128.
Response Fields
json
{
  "AgentRefID": "21345555",
  "RequestHeader": {
    "AgentCode": "tms_test",
    "Password": "tms_test",
    "RequestTime": "2018-07-26T09:51:32.123Z",
    "TransactionID": "6ba7b810-9dad-11d1-80b4-00c04fd430c8",
    "UserName": "tms_test"
  }
}
json
{
  "Error": {
    "ErrorCode": "101",
    "ErrorMessage": "invaild param"
  },
  "OrderInfo": {
    "AgentRefID": "213415",
    "CurrencyCode": "CNY",
    "HotelConfirmationNo": "10470374",
    "OrderStatus": "CANCELLED",
    "ReservationID": "10470374",
    "TotalPrice": 888.89,
    "HotelCode": 0,
    "RoomCount": 0,
    "CheckIn": "2020-01-01",
    "CheckOut": "2020-01-02",
    "PaxRooms": [
      {
        "Adults": 2,
        "Children": 0,
        "ChildrenAges": [],
        "PaxNames": [
          {
            "FirstName": "Tom",
            "LastName": "Lee",
            "Type": "ADU"
          }
        ],
        "RoomCount": 1
      }
    ],
    "BookingTime": "2020-01-03 12:00:00"
  },
  "ResponseHeader": {
    "ResponseTime": "2018-07-26 09:51:32",
    "TransactionID": "6ba7b810-9dad-11d1-80b4-00c04fd430c8"
  }
}

Query Bookings ​

Query bookings by date range with pagination. Use this endpoint to retrieve a list of orders filtered by check-in date, check-out date, or booking date. The actual API endpoint is POST /v2/SearchOrder (same URL as Retrieve Booking, but with different request parameters).

API Call Schema

NameValue
Request URLhttp://developers.tourmind.cn/v2/SearchOrder
Request methodPOST
Request Fields
DateType: string
Date type for date range query. Possible values: CheckIn (check-in date), CheckOut (check-out date), Booking (booking date).
From: string
Start date for the query range. Format YYYY-MM-DD. The date span (To minus From) must be <= 31 days.
To: string
End date for the query range. Format YYYY-MM-DD. The date span (To minus From) must be <= 31 days.
Page: integer
Page number for pagination. Must be >= 1.
PageSize: integer
Number of results per page. Must be between 1 and 500.
Response Fields
json
{
  "DateType": "CheckIn",
  "From": "2024-01-01",
  "To": "2024-01-31",
  "Page": 1,
  "PageSize": 50,
  "RequestHeader": {
    "AgentCode": "tms_test",
    "Password": "tms_test",
    "RequestTime": "2018-07-26T09:51:32.123Z",
    "TransactionID": "6ba7b810-9dad-11d1-80b4-00c04fd430c8",
    "UserName": "tms_test"
  }
}
json
{
  "Error": {
    "ErrorCode": "101",
    "ErrorMessage": "invaild param"
  },
  "OrderList": {
    "OrderList": [
      {
        "AgentRefID": "213415",
        "CurrencyCode": "CNY",
        "HotelConfirmationNo": "10470374",
        "OrderStatus": "CANCELLED",
        "ReservationID": "10470374",
        "TotalPrice": 888.89,
        "HotelCode": 0,
        "RoomCount": 0,
        "CheckIn": "2020-01-01",
        "CheckOut": "2020-01-02",
        "PaxRooms": [
          {
            "Adults": 2,
            "Children": 0,
            "ChildrenAges": [],
            "PaxNames": [
              {
                "FirstName": "Tom",
                "LastName": "Lee",
                "Type": "ADU"
              }
            ],
            "RoomCount": 1
          }
        ],
        "BookingTime": "2020-01-03 12:00:00"
      }
    ],
    "Page": 1,
    "PageSize": 50,
    "Total": 100
  },
  "ResponseHeader": {
    "ResponseTime": "2018-07-26 09:51:32",
    "TransactionID": "6ba7b810-9dad-11d1-80b4-00c04fd430c8"
  }
}

Static Data ​

MealCode ​

Meal code

MealCodeDescription
1No Breakfast
2Breakfast
3Lunch
4Dinner
5Lunch and Dinner
6HalfBoard
7FullBoard
8AllInclusive
9SelfCatering

Hotel List ​

Retrieve static data for hotels.

API Call Schema

NameValue
Request URLhttp://developers.tourmind.cn/v2/HotelStaticList
Request methodPOST
Request Fields
CountryCode: string
Country code.
HotelIds[]: integer
Identifiers for specific hotels..
Lang: string
Language, e.g. zh-CN, en-US.
Response Fields
json
{
  "CountryCode": "CN",
  "HotelIds": [],
  "Lang": "zh-CN",
  "Pagination": {
    "PageIndex": 1,
    "PageSize": 10
  },
  "RequestHeader": {
    "AgentCode": "tms_test",
    "Password": "tms_test",
    "RequestTime": "2018-07-26T09:51:32.123Z",
    "TransactionID": "6ba7b810-9dad-11d1-80b4-00c04fd430c8",
    "UserName": "tms_test"
  }
}
json
{
  "Error": {
    "ErrorCode": "101",
    "ErrorMessage": "invaild param"
  },
  "HotelStaticListResult": {
    "Hotels": [
      {
        "Address": "3007 Santa Monica Blvd, 90404",
        "AmenitiesHotel": [
          {
            "name": "Golfing nearby"
          }
        ],
        "AmenitiesRoom": [
          {
            "name": "Golfing nearby"
          }
        ],
        "CityCode": "14209",
        "CityName": "ShangHai",
        "CityNameCN": "Shanghai",
        "CountryCode": "CN",
        "Description": {
          "Attractions": "Qijang Park - 1 km / 0.6 mi. Xingzhong Plaza - 1 km / 0.6 mi.",
          "BusinessAmenities": "Featured amenities include a business center, limo/town car service, and express check-in.",
          "Headline": "In Zhongshan (West District)",
          "Location": "You'll be centrally located in Zhongshan, within a 15-minute walk of Qijang Park and Xingzhong Plaza.",
          "Rooms": "Make yourself at home in one of the 362 air-conditioned rooms featuring refrigerators and LCD televisions."
        },
        "HotelId": "739315",
        "Images": [
          {
            "links": {}
          }
        ],
        "Latitude": "34.03644",
        "Longitude": "-118.47048",
        "Name": "Days Inn Santa Monica/Los Angeles",
        "Phone": "1523333333",
        "StarRating": "5"
      }
    ],
    "Pagination": {
      "PageCount": 1,
      "TotalCount": 10
    }
  },
  "ResponseHeader": {
    "ResponseTime": "2018-07-26 09:51:32",
    "TransactionID": "6ba7b810-9dad-11d1-80b4-00c04fd430c8"
  }
}

Region List ​

Retrieve the list of regions.

API Call Schema

NameValue
Request URLhttp://developers.tourmind.cn/v2/RegionList
Request methodPOST
Request Fields
CountryCode: string
Country code.
Response Fields
json
{
  "CountryCode": "CN",
  "Pagination": {
    "PageIndex": 1,
    "PageSize": 10
  },
  "RequestHeader": {
    "AgentCode": "tms_test",
    "Password": "tms_test",
    "RequestTime": "2018-07-26T09:51:32.123Z",
    "TransactionID": "6ba7b810-9dad-11d1-80b4-00c04fd430c8",
    "UserName": "tms_test"
  }
}
json
{
  "Error": {
    "ErrorCode": "101",
    "ErrorMessage": "invaild param"
  },
  "RegionListResult": {
    "Regions": [
      {
        "CountryCode": "231",
        "Name": "ShangHai",
        "NameCN": "Shanghai",
        "RegionID": "21312541",
        "RegionNameLong": "Shanghai, China",
        "RegionNameLongCN": "Shanghai, China"
      }
    ]
  },
  "ResponseHeader": {
    "ResponseTime": "2018-07-26 09:51:32",
    "TransactionID": "6ba7b810-9dad-11d1-80b4-00c04fd430c8"
  }
}

Hotel Room Type List ​

Retrieve the list of room information of sepecific hotels.

API Call Schema

NameValue
Request URLhttp://developers.tourmind.cn/v2/RoomStaticList
Request methodPOST
Request Fields
HotelCode: integer
Hotel ID.
Response Fields
json
{
  "HotelCode": 235113,
  "RequestHeader": {
    "AgentCode": "tms_test",
    "Password": "tms_test",
    "RequestTime": "2018-07-26T09:51:32.123Z",
    "TransactionID": "6ba7b810-9dad-11d1-80b4-00c04fd430c8",
    "UserName": "tms_test"
  }
}
json
{
  "Error": {
    "ErrorCode": "101",
    "ErrorMessage": "invaild param"
  },
  "ResponseHeader": {
    "ResponseTime": "2018-07-26 09:51:32",
    "TransactionID": "6ba7b810-9dad-11d1-80b4-00c04fd430c8"
  },
  "RoomTypes": [
    {}
  ]
}

Certification ​

Please complete all test cases in the Test Cases document.

Attachments ​

Information Questionnaire.(Click to Download.)

Test Cases.(Click to Download.)