Introduction

suppliersHotel API is used by DerbySoft to get the list of hotels and products from suppliers automatically by a regular schedule (normally a daily schedule).  The supplier can manage the status of the hotel and product to one distributor through this API. 


This API Set, which includes 2 API, are both mandatory to implement.

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


TABLE OF CONTENTS


Hotel List

This is an API for DerbySoft to call 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


Name

Description

Required

Type

Example

distributorId

The ID of distributor in DerbySoft's system

Yes

string

BOOKINGCOM


Response Example

  • Success Response (HTTP Status 200)
[
  {
    "hotelId": "100001",
    "hotelName": "This is a test hotel",
    "distributorId": "GTA",
    "status": "Actived"
  }
]
  • Error Response (HTTP Status 500)
{
  "errorCode": "InvalidField",
  "errorMessage": "Invalid Message"
}


Response Specification


Attribute

Type

Required

Description

Example

hotelId

string

Yes

Hotel id in distributor's system

100001

hotelName

string

No

Hotel name

This is a test hotel

distributorId

string

Yes

Distributor id in DerbySoft's system

GTA

status

enum

Yes

Enum: [ Actived, Deactived ]

Status in distributor’s system

Actived



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


Name

Description

Required

Type

Example

hotelId

The ID of the hotel in the distributor's system

Yes

string

100001

distributorId

The ID of distributor in DerbySoft's system

Yes

string

BOOKINGCOM


Response Example

  • Success Response (HTTP Status 200)
{
  "hotelId": "100001",
  "hotelName": "This is a test hotel",
  "distributorId": "BOOKINGCOM",
  "status": "Actived",
  "chainCode": "Hilton",
  "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": "ByAge",
  "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",
      "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"
}


Response Specification

Note:
Elements and attributes marked with Number=1 or more will always be sent. 
0 means that the element or attribute is optional, while a second numeric value or "n" indicates the element or attribute can repeat (where n = no limit).

Element

Type

Required

Description

Example

hotelId

string

Yes

Hotel ID in distributor's system

100001

hotelName

string

No

Hotel name

This is a test hotel

distributorId

string

Yes

Distributor id in DerbySoft's system

BOOKINGCOM

status

enum

Yes

Enum: [ Actived, Deactived ]

Status in supplier's system

Actived

chainCode

string

No

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

No

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.

Courtyard

longitude

string

No

The information for hotel location.

41.40338

latitude

string

No

The information for hotel location.

2.17403

city

string

No

The information for hotel location.

 /

country

string

No

The information for hotel location.

 /

state

string

No

The information for hotel location.

 /

address

array[string]

No

Support up to five enumeration values.

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

phone

object

No

 /

 /

@countryAccessCode

string

Yes

 /

 /

@areaCityCode

string

No

 /

 /

@phoneNumber

string

Yes

 /

 /

settings

object

Yes

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

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

ariType

enum

Yes

Emun:[ Daily, LOS ]

Indicates which ARI model be used for ARI API.

Daily

timezone

string

Yes

Timezone of property

America/Los_Angeles

rateType

enum

Yes

Enum: [ AmountBeforeTax, AmountAfterTax, Both ]

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

Both

maxChildAge

integer

No

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

17

childRateType

enum

No

Enum: [ Normal, ByAge, Free, AsAdult ]

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

  • Normal: by default, the occupancy rate is combined by adult rate and child rate without age settings.
  • ByAge: the child will be charged by age, maxChildAge must be provided, and extraChildRates should be provided in ARI.
  • Free: the child is free, maxChildAge may be provided.
  • AsAdult: the child will be charged as an adult.

ByAge

products

array[object]

Yes

 /

 /

@roomId

string

Yes

Room id in distributor's system

10000101

@roomDescription

string

No

 /

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

@rateId

string

Yes

Rate id in distributor's system

123456

@rateDescription

string

No

 /

Begin your day with a hearty meal.

@stayType

enum

No

Enum: [ OverNightRoom, DayUseRoom ]

This tag indicates if the product is specifically for day-use or regular overnight use. Default is OverNightRoom.

OverNightRoom

@status

enum

Yes

Enum: [ Actived, Deactived ]

Actived

@roomName

string

No

Room type name

Double Room

@rateName

string

No

Rate plan name

Best Available Rate

products/occupancy

object

Yes

 /

 /

@maxAdult

integer

Yes

Max adult count

3

@maxChild

integer

Yes

Max child count

2

@maxOccupancy

integer

Yes

Max occupancy

3

@paymentType

enum

No

Enum: [ PayLater, PayNow ]

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

PayNow

products / cancelPolicies

array[object]

No

 /

 /

cancelPolicies / dateRange

object

No

 /

 /

@startDate

string

Yes

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

2018-01-01

@endDate

string

Yes

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

2018-01-04

cancelPolicies / cancelPolicy

object

No

 /

 /

@code

string

Yes

Code of cancel policy

maxLength: 128

AD100P_100P

@description

string

No

The description of the cancel policy

maxLength: 1024

Non Refundable

products/fees

 /

No

 /

 /

fees / dateRange

 /

No

 /

 /

@startDate

string

Yes

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

2018-01-01

@endDate

string

Yes

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

2018-01-04

fees / fee

object

No

 /

 /

name

string

Yes

The name of fee or tax

Service Charge

type

enum

Yes

Enum: [ Inclusive, Exclusive ]

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

Exclusive

amount

number

Yes

Amount value of fee or tax

10

amountType

enum

Yes

Enum: [ Fix, Percent ]

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

Percent

chargeType

enum

Yes

Enum: [ PerRoomPerNight, PerPersonPerNight, PerRoomPerStay, PerPersonPerStay ]

PerRoomPerNight

paymentType

enum

No

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

PayNow