Booking

Booking API allows you to book rooms & rates confirmed by the price check response. The primary itinerary method of the Booking API creates a reservation for the selected hotel, room, rate and occupancy.

Parameters

Name

Description

Accept

string

( header )

Must be application/json

Accept - Encoding

string

( header )

Must be gzip

Authorization

string

( header )

Must be Your PID

Must be Your API Key

Customer-Ip

string

( header )

Must be IP address of the customer, as captured by your integration. Send IPV4 addresses only.

Ensure your integration passes the customer’s IP, not your own. This value helps determine their location and other settings.

Also used for fraud recovery and other important analytics.

action

string

( query )

Must be "bookHotel" as parameter

Action methods in Web API controller can have one or more parameters of different types. It can be either primitive type or complex type. Web API binds action method parameters either with URL's query string or with request body depending on the parameter type.

apiKey

string

( query )

Must be a valid API Key

The API Key provided to you is critical to the security of your request data – treat it like a password. Never include the raw value in any publicly accessible site or app code. You will be provided with an API key when you are approved to integrate TPS API.

ModeType

string

( query )

Must be either "Test" or "LIVE"

Your application must be approved from Adivaha Personnel. All the transactions will be treated as LIVE once the parameter is set to LIVE.

requestBody

array

( query )

Must be an array with the following parameters

ResultIndex

string

( query )

*required Result Index.

hotelId

string

( query )

*required Unique hotel code.

HotelName

string

( query )

Unique hotel Name.

hotelAddress

string

( query )

Hotel Address.

nationality

string

( query )

ISO Country Code (Ex. India = IN, Great Britain = GB)

rooms

string

( query )

Number of rooms to be set for the search, can be between 1-7

chargablePrice

decimal

( query )

Total Price

currency

string

( query )

Currency code

checkIn

string

( query )

The date by which a guest must check in. Must follow YYYY-MM-DD format. ie. "checkIn:2019-05-30"

checkOut

string

( query )

The date by which a guest must check out. Must follow YYYY-MM-DD format. ie. "checkIn:2019-05-31"

TraceId

string

( query )

*required The TraceId of the property you want to gather information for.

HotelRoomsDetails

Array

( query )

*required Array of hotel room details.

RoomIndex

Integer

Index of the room

RatePlanCode

string

Rate plan code associated with room

RatePlanName

string

Name of the Rate plan associated with room

RoomTypeCode

string

Room Type Code

RoomTypeName

string

Room Type Name

BedTypes

Array

( query )

Array of bed types

(1.1)BedTypeCode

string

Bed type code

(1.2)BedTypeDescription

string

Bed type description(Optional)

SmokingPreference

Enumeration

Smoking Preference associated with room

Mandatory SmokingPreference NoPreference = 0, Smoking = 1, NonSmoking = 2, Either = 3

Supplements

StringList

List of supplements

Price

Array

Price detail of the room

(1.1)CurrencyCode

string

Currency in which minimum hotel price is returned

(1.2)RoomPrice

decimal

Price of the room

(1.3)Tax

decimal

Tax applicable for the room

(1.4)ExtraGuestCharge

decimal

Extra Guest Charges applicable for the room

(1.5)ChildCharge

decimal

Child Charges applicable for the room

(1.6)OtherCharges

decimal

Other Charges applicable for the room

(1.7)Discount

decimal

Discount applicable for the room

(1.8)PublishedPrice

decimal

Published Price of the room

(1.9)PublishedPriceRoundedOff

Integer

Published Price (rounded off) of the room

(1.10)OfferedPrice

decimal

Offered Price of the room

(1.11)OfferedPriceRoundedOff

Integer

Offered Price (rounded off) of the room

(1.12)AgentCommission

decimal

Commission applicable on the Room Price

(1.13)AgentMarkUp

decimal

Agent Mark Up applicable on the Room Price

(1.14)ServiceTax

decimal

Service tax applicable for the room

(1.15)TDS

decimal

TDS applicable on Commission Earned

HotelPassenger

Array

Array of guest details for in the particular room as requested in hotel search

(1.1)Title

string

Title of the guest

(1.2)FirstName

string

First name of the guest

(1.3)MiddleName

string

Middle name of the guest

(1.4)LastName

string

Last name of the guest

(1.5)Phoneno

string

Phone number

(1.6)Email

string

Email id

(1.7)PaxType

Enumeration

Guest Type

Mandatory - HotelPassenger - PaxType Adult = 1, Child = 2

(1.8)LeadPassenger

Boolean

Represent the lead guest of the booking

(1.9)Age

Integer

Age of the guest

Mandatory * (only for child and age should be <= 12 years)

(1.10)PassportNo

PassportNo

Age of the guest

Passport No

(1.11)PassportIssueDate

Date

Passport Expiry Date

(provide in minimum date time format “0001-01- 01T00:00:00:00” )

(1.12)PassportExpDate

Date

Passport Expiry Date

(provide in minimum date time format “0001-01- 01T00:00:00:00” )

(1.13)PAN

string

PAN should be in correct format)

IsPackageFare

boolean

In case you receive "IsPackageFare": true in Block response then you need to pass same in Book Request

IsPackageDetailsMandatory

if you get IsPackageDetailsMandatory": true in Block Response then following details need to be passed in Book request.

ArrivalTransport

ArrivalTransportType,TransportInfoId,Time

(1.1)ArrivalTransportType

int

Flight = 0, surface = 1

(1.2)TransportInfoId

string

Transfer Details

(1.3)Time

string

0001-01-01T00: 00: 00

REQUEST

API Endpoint: https://abengines.com/api/v1/travel-api/hotels/

header: array(
'Content-Type:application/json',
'Accept-encoding: gzip',
'PID:'ADD-YOUR-KEY',
'x-api-key:'ADD-YOUR-KEY'
);

POST:
{
  "action": "bookHotel",
  "mode": "Test",
  "ResultIndex": "4",
  "hotelId": "31620301",
  "HotelName": "Moustache Delhi",
  "hotelAddress": "231,delhi",
  "nationality": "IN",
  "rooms": "1",
  "chargablePrice": "5000",
  "currency": "INR",
  "checkIn": "2021-09-16",
  "checkOut": "2021-09-17",
  "IsPackageFare": false,
  "ArrivalTransport": null,
  "TraceId": "3b62998f-46dc-4482-bf79-23619a6f221f",
  "HotelRoomsDetails": [
    {
      "RoomIndex": 4,
      "RoomTypeCode": "990001490971:6804#$#15:146202:990001490971:6804#3925285|si-16848ff2-76cd-4856-ba00-bef4adc2d3f8#$#1#$#0",
      "RoomTypeName": "16 Bed Mixed Dorm Ac,1 Twin Bunk Bed,Nonsmoking",
      "RatePlanCode": "990001490971:6804#$#15:146202:990001490971:6804#3925285|si-16848ff2-76cd-4856-ba00-bef4adc2d3f8#$#1#$#0",
      "BedTypeCode": null,
      "SmokingPreference": "0",
      "Supplements": null,
      "Price": {
        "CurrencyCode": "INR",
        "RoomPrice": 5655.74,
        "Tax": 678,
        "ExtraGuestCharge": 0,
        "ChildCharge": 0,
        "OtherCharges": 0,
        "Discount": 210,
        "PublishedPrice": 6631.41,
        "PublishedPriceRoundedOff": 6631,
        "OfferedPrice": 6333.74,
        "OfferedPriceRoundedOff": 6334,
        "AgentCommission": 297.67,
        "AgentMarkUp": 0,
        "ServiceTax": 0,
        "TDS": 14.88,
        "ServiceCharge": 0,
        "TotalGSTAmount": 0
      },
      "HotelPassenger": [
        {
          "Title": "Mr",
          "FirstName": "Test",
          "Middlename": "",
          "LastName": "Booking",
          "Phoneno": "9988776655",
          "Email": "test@thewebconz.com",
          "PaxType": 1,
          "LeadPassenger": true,
          "Age": 25,
          "PassportNo": null,
          "PassportIssueDate": null,
          "PassportExpDate": null,
          "PAN": null
        }
      ]
    }
  ]
}
					 

Response

The API returns an HTTP response, which generally includes the result of the request invocation

{
  "status": 200,
  "status_message": "Booking has been confirmed",
  "responseData": {
    "BookResult": {
      "VoucherStatus": true,
      "ResponseStatus": 1,
      "Error": {
        "ErrorCode": 0,
        "ErrorMessage": ""
      },
      "TraceId": "3b62998f-46dc-4482-bf79-23619a6f221f",
      "Status": 1,
      "HotelBookingStatus": "Confirmed",
      "InvoiceNumber": "MW\/2021\/3122",
      "ConfirmationNo": "FLLBBV(7253958265303)",
      "BookingRefNo": "432493301682594",
      "BookingId": 1614235,
      "IsPriceChanged": false,
      "IsCancellationPolicyChanged": false
    }
  }
}