TABLE OF CONTENTS



Introduction

Hotel API is used by DerbySoft to get the list of hotels and products from the hotel provider system periodically. The hotel provider system can manage the status of hotels and products through this API. This API Set includes 2 APIs, both are mandatory to implement.


  • Hotel List (/hotels) - Get all hotels for a specific distributor.
  • Hotel Products (/hotel/{hotelId}) - Get all available products of one hotel to a specific distributor.


Hotel List

This is an API for DerbySoft to call the Supplier's system to get all hotel summary information for a specific distributor.

GET /hotels HTTP/1.1
URL: {{endpoint}}/hotels?distributorId={{distributorId}}
Authorization: 53ac07777cdffac2d53000002d698728ce964432d7167596bc005c5fc
Accept-Encoding: gzip
Content-Encoding: gzip
Content-Type: application/json;charset=utf-8

Request Parameters

NameDescriptionRequiredTypeExample
distributorIdThe ID of distributor in DerbySoft‘s systemYStringHOTELBEDS


Response Specification

ElementTypeRequiredDescriptionExample
distributorIdStringYDistributor ID in DerbySoft’s systemHOTELBEDS
hotelIdStringYHotel ID in supplier’s system100001
hotelNameStringNHotel NameTest hotel
StatusEnumY

Enum: [ Actived, Deactived ]


Status in supplier's system


Actived



Response Example


Success Response (HTTP Status 200)

[
  {
    "hotelId": "100001",
    "hotelName": "This is a test hotel",
    "distributorId": "HOTELBEDS",
    "status": "Actived"
  }
]

Error Response (HTTP Status 500)

{
  "errorCode": "InvalidField",
  "errorMessage": "Invalid Message"
}


Hotel Products

This is an API for DerbySoft to call the Supplier's system to get all products of one hotel to a specific distributor. Fee & Cancel Policy are optional fields because some distributors get this information offline instead of through the API.

GET /hotel/{hotelId} HTTP/1.1
URL: {{endpoint}}/hotel/{{hotelId}}?distributorId={{distributorId}}
Authorization: 53ac07777cdffac2d53000002d698728ce964432d7167596bc005c5fc
Accept-Encoding: gzip
Content-Encoding: gzip
Content-Type: application/json;charset=utf-8


Request Parameters

NameDescriptionRequiredTypeExample
hotelIdThe ID of the hotel in the Supplier's systemYString100001
distributorIdThe ID of distributor in DerbySoft's systemYStringHOTELBEDS



Response Specification

Element

Type

Required

Description

Example

hotelId

String

Y

Hotel id in supplier's system

100001

hotelName

String

N

Hotel name

This is a test hotel

distributorId

String

Y

Distributor id in DerbySoft's system

GTA

status

Enum

Y

Enum: [ Actived, Deactived ]

Status in supplier's system

Actived

chainCode

String

N

The chain code may identify a hotel chain or management group, e.g. Hyatt, Hilton. The hotel chain code is decided between suppliers and is optional if the hotel is an independent property that can be identified by the hotelId field alone.

Marriott

brandCode

String

N

The brand code may identify the brand within a chain, e.g. Courtyard, Hampton Inn. This field is optional if the hotel is an independent property that can be identified by the hotelId field alone.

Courtyard

longitude

String

N

The information for hotel location.

41.40338

latitude

String

N

The information for hotel location.

2.17403

city

String

N

The information for hotel location.

 

country

String

N

The information for hotel location.

 

state

String

N

The information for hotel location.

 

address

Array[String]

N

Support up to five enumeration values

[ "AddressLine1", "AddressLine2", "AddressLine3", "AddressLine4", "AddressLine5" ]

phone

Object

N

 /

 / 

@countryAccessCode

String

Y

 / 

 / 

@areaCityCode

String

N

 / 

 / 

@phoneNumber

String

Y

 / 

 / 

settings

Object

Y

A common extension object for extra attributes like account, extra setting required by a distributor, etc.

"settings": {
"key1": "value1",
"key2": "value2"
}

ariType

Enum

Y

Emun:[ Daily, LOS ]

Indicates which ARI model to be used for ARI API.

Daily

timezone

String

Y

Timezone of property

America/Los_Angeles

rateType

Enum

Y

Enum: [ AmountBeforeTax, AmountAfterTax, Both ]

  • AmountBeforeTax: only AmountBeforeTax be pushed out to distributor, and only AmountBeforeTax be sent back to the supplier.

  • AmountAfterTax: only AmountAfterTax be pushed out to distributor, and only AmountAfterTax be sent back to the supplier.

  • Both: both of AmountBeforeTax & AmountAfterTax to be pushed out to distributor, and both AmountBeforeTax & AmountAfterTax be sent back to supplier.

Both

maxChildAge

Integer

N

If childRateType is set as ByAge, max child age must be provided and greater than zero.

17

childRateType

Enum

N

Indicates which child rate type will be used in ARI OccupancyRate.

  • Normal: by default, occupancy rate is combined by adult rate and child rate without age settings.

  • Free: the child is free, maxChildAge may be provided.

  • AsAdult: the child will be charged as an adult.


products

Array[Object]

Y

 /

 /

@roomId

String

Y

Room id in supplier's system

10000101

@roomDescription

String

N

 /

Soak in city views in our Deluxe room, which features a well-appointed ensuite bathroom and up-to-date entertainment offerings.

@rateId

String

Y

Rate id in supplier system

123456

@rateDescription

String

N

 /

Begin your day with a hearty meal.

@stayType

Enum

N

Enum: [ OverNightRoom, DayUseRoom ]

 Indicates if the product is specifically for day-use or regular over-night use. Default is OverNightRoom.

OverNightRoom

@status

Enum

Y

Enum: [ Actived, Deactived ]

Actived

@roomName

String

N

Room type name

Double Room

@rateName

String

N

Rate plan name

Best Available Rate

products / occupancy

Object

Y

 /

 /

@maxAdult

Integer

Y

Max adult count

3

@maxChild

Integer

Y

Max child count

2

@maxOccupancy

Integer

Y

Max occupancy

3

@paymentType

Enum

N

Enum: [ PayLater, PayNow ]

Indicates the product is prepaid to hotel(PayNow) or pay at hotel(PayLater)

PayNow

products / guarantee

Object

N

 /

 /

@guaranteeType

String

Y

Guarantee information for this room rate.
The type of guarantee method, ref to the standard guarantee type list.

CCG

products / cancelPolicies

Array[Object]

N

 /

 /

cancelPolicies / dateRange

Object

N

 /

 /

@startDate

String

Y

Start date of date range, format with yyyy-MM-dd

2018-01-01

@endDate

String

Y

End date of date range, format with yyyy-MM-dd

2018-01-04

cancelPolicies / cancelPolicy

Object

N

 /

 /

@code

String

Y

Cancel policy

maxLength: 128

AD100P_100P

@description

String

N

The description of the cancel policy

maxLength: 1024

Non Refundable

products / fees

 

N

 /

 /

fees / dateRange

 

N

 /

 /

@startDate

String

Y

Start date of date range, format with yyyy-MM-dd

2018-01-01

@endDate

String

Y

End date of date range, format with yyyy-MM-dd

2018-01-04

fees / fee

Object

N

 /

 /

name

String

Y

The name of fee or tax

Service Charge

type

Enum

Y

Enum: [ Inclusive, Exclusive ]

The fee or tax is included in the amount before tax or not.

Exclusive

amount

Number

Y

Amount value of fee or tax

10

amountType

Enum

Y

Enum: [ Fix, Percent ]

Indicates how to charge the tax, 10% per room per night in this example.

Percent

chargeType

Enum

Y

Enum: [ PerRoomPerNight, PerPersonPerNight, PerRoomPerStay, PerPersonPerStay ]

PerRoomPerNight

paymentType

Enum

N

Enum: [ PayLater, PayNow ]
Indicates the fee is prepaid to hotel(PayNow) or pay at hotel(PayLater)

PayNow



Response Example


Success Response (HTTP Status 200)

{
  "hotelId": "100001",
  "hotelName": "This is a test hotel",
  "distributorId": "HOTELBEDS",
  "status": "Actived",
  "chainCode": "Marriott",
  "brandCode": "Courtyard",
  "longitude": 41.40338,
  "latitude": 2.17403,
  "city": "string",
  "country": "string",
  "state": "string",
  "address": [
    "AddressLine1",
    "AddressLine2",
    "AddressLine3",
    "AddressLine4",
    "AddressLine5"
  ],
  "phone": {
    "countryAccessCode": "string",
    "areaCityCode": "string",
    "phoneNumber": "string"
  },
  "settings": {
    "key1": "value1",
    "key2": "value2"
  },
  "ariType": "Daily",
  "timezone": "America/Los_Angeles",
  "rateType": "AmountBeforeTax",
  "maxChildAge": 17,
  "childRateType": "Free",
  "products": [
    {
      "roomId": "10000101",
      "roomDescription": "Soak in city views in our Deluxe room, which features a well-appointed ensuite bathroom and up-to-date entertainment offerings.",
      "rateId": "123456",
      "rateDescription": "Begin your day with a hearty meal.",
      "stayType": "OverNightRoom",
      "status": "Actived",
      "roomName": "Double Room",
      "rateName": "Bar Rate",
      "occupancy": {
        "maxAdult": 3,
        "maxChild": 2,
        "maxOccupancy": 3
      },
      "paymentType": "PayNow",
      "guarantee": {
        "guaranteeType": "CCG"
      },
      "cancelPolicies": [
        {
          "dateRange": {
            "startDate": "2018-01-01",
            "endDate": "2018-01-04"
          },
          "cancelPolicy": {
            "code": "AD100P_100P",
            "description": "Non Refundable"
          }
        }
      ],
      "fees": [
        {
          "dateRange": {
            "startDate": "2018-01-01",
            "endDate": "2018-01-04"
          },
          "fee": {
            "name": "Service Charge",
            "type": "Exclusive",
            "amount": 10,
            "amountType": "Percent",
            "chargeType": "PerRoomPerNight",
            "paymentType": "PayNow"
          }
        }
      ]
    }
  ]
}

Error Response (HTTP Status 500)

{
  "errorCode": "InvalidField",
  "errorMessage": "Invalid Message"
}