Booking Request

Request

Method URL
POST api/v3/hotels/bookings

Booking Payload

Attribute Type Required Description
search_id string REQUIRED Search ID returned in the search response
hotel_code string REQUIRED GRN hotel code returned in search response
city_code string REQUIRED City code returned in search response
booking_name string OPTIONAL Name of the booking; for agent’s reference
group_code string REQUIRED Group code returned in search
checkin date REQUIRED Check-in date; ISO8601 format (YYYY-MM-DD).
checkout date REQUIRED Check-out date; ISO8601 format (YYYY-MM-DD).
payment_type string REQUIRED “AT_WEB” or “AT_HOTEL”. Must get matched with the booking item selected
holder object REQUIRED Information of the lead passenger. See Holder for details.
booking_items array REQUIRED Information of the rooms and the pax in the rooms. See Booking Item for details.
booking_comments string OPTIONAL Optional booking comments to be passed along to the hotel
agent_reference string OPTIONAL Optional. Alpha Numeric and -_ allowed.
credit_card object REQUIRED if payment_type = “AT_HOTEL” Contains Fields of Credit Card
Booking Item:
Attribute Type Required Description
rate_key string REQUIRED rate_key value from the search response
room_code string REQUIRED,
if returned in the search response
room_code value from the search response
rooms array REQUIRED List of Room elements
Room
Attribute Type Required Description
room_reference string REQUIRED,
if returned in the search response
Unique room reference for the room
paxes array REQUIRED Contains the information of Pax in the room
no_of_infants integer OPTIONAL,
required if Infants are present
Number of infants
no_of_extra_beds integer OPTIONAL,
required if children are present
Number of extra beds needed for children
bedtype_id integer OPTIONAL Preferred bed type which can be selected from the list of bed types returned in the search response.
Pax
Attribute Type Required Description
title string REQUIRED Title of the passenger (accepted values are: “Mr.”, “Ms.”, “Mrs.”, “Mstr.”)
name string REQUIRED Name of the person staying in the room. Must not contain any special characters and numbers.
surname string REQUIRED Surname/patronymic of the person staying in the room. Must not contain any special characters and numbers.
type string REQUIRED Must be either “AD” or “CH”
age integer REQUIRED if type = “CH” Age of the children
Holder
Attribute Type Required Description
title string REQUIRED Title of the passenger (accepted values are: “Mr.”, “Ms.”, “Mrs.”, “Mstr.”)
name string REQUIRED Name of the lead passenger. Must not contain any special characters and numbers.
surname string REQUIRED Surname/patronymic of the lead passenger. Must not contain any special characters and numbers.
email string REQUIRED Valid email address of the lead passenger
phone_number string REQUIRED Phone number of the lead passenger
client_nationality string REQUIRED Two-letter ISO country code of the lead passenger
CreditCard
Attribute Type Required Description
address_line1 string REQUIRED First line for street address, 28 char max.
address_line2 string OPTIONAL Optional second line for street address, 28 char max.
address_line3 string OPTIONAL Optional third line for street address, 28 char max.
amount float REQUIRED Amount to be paid for the booking
card_cv2 integer REQUIRED Credit card identification number or the card security value (CSV or CVV) that is found on the back of the card. Never store this value after the customer’s initial entry and booking attempt.
card_holder_name string REQUIRED Full first name of the credit card holder. Only accepts non-accented Latin ASCII (26 letter alphabet). 25 char max - no salutations or company names.
card_issue_number integer OPTIONAL Card issue number.
card_number integer REQUIRED Must be a valid card number in-order to book a hotel
card_type string REQUIRED Must be in the list of card_types provided
city_name string REQUIRED Customer’s city.
country string REQUIRED Two character ISO-3166 code for the country containing the specified city. Use only country codes designated as “officially assigned” in the ISO-3166 decoding table.
expiry_month integer REQUIRED Credit card expiration month, in MM format.

Ex: 6, 11 etc
expiry_year integer REQUIRED Credit card expiration year, in YYYY format.
issuing_bank string OPTIONAL Bank name Which issued the credit card
state string OPTIONAL Must be in the list of state codes provided(destination master).
zip string REQUIRED This must match the credit card provider’s records or the booking will not be valid.

N.B. GRNconnect does not store any credit card information of the users. The details are passed to the supplier with whom the booking is made.

Sample Booking Payload

For Bundled Rates:

{
    "search_id": "d3kmmkyqvuhyi7pnrkcm5szkvu",
    "hotel_code": "H!0049396",
    "city_code": "C!000555",
    "group_code": "wsdbjylcxn4uf",
    "checkin": "2016-12-29",
    "checkout": "2016-12-30",
    "booking_comments": "Testing",
    "payment_type": "AT_HOTEL",
    "booking_items": [
        {
            "room_code": "4ddfznbt7quczuc3",
            "rate_key": "wknvbnjq4n6sjr2qusmwaags4hn2zxhz6czoztzjr",
            "rooms": [
                {
                    "bedtype_id": 25,
                    "no_of_infants": 2,
                    "paxes": [
                        {
                            "title": "Mr.",
                            "name": "Sam",
                            "surname": "Patrick",
                            "type": "AD"
                        }
                    ]
                },
                {
                    "paxes": [
                        {
                            "title": "Mr.",
                            "name": "Henry",
                            "surname": "Patrick",
                            "type": "AD"
                        },
                        {
                            "title": "Mr.",
                            "name": "Harry",
                            "surname": "Patrick",
                            "type": "AD"
                        },
                        {
                            "title": "Mr.",
                            "name": "Luke",
                            "surname": "Patrick",
                            "type": "CH",
                            "age": "3"
                        }
                    ]
                }
            ]
        }
    ],
    "holder": {
        "title": "Mr.",
        "name": "James",
        "surname": "Patrick",
        "email": "james@pat.com",
        "phone_number": "6614565589",
        "client_nationality": "fr"
    },
    "credit_card": {
        "city_name": "delhi",
        "amount": 23128.09,
        "card_type": "VISA",
        "card_number": "4242424242424242",
        "expiry_month": 3,
        "expiry_year": "2018",
        "card_cv2": "832",
        "card_holder_name": "TEST CUSTOMER",
        "country": "NL",
        "address_line1": "delhi, india",
        "state": "D!001175"
    }
}

For Non Bundled Rates:

{
    "search_id": "d3kmmkyqvuhyi7pnrkcm5szkvu",
    "hotel_code": "H!0049396",
    "city_code": "C!000555",
    "group_code": "wcobnyltrv3xhbq",
    "checkin": "2016-12-29",
    "checkout": "2016-12-30",
    "booking_comments": "Testing",
    "payment_type": "AT_WEB",
    "booking_items": [
        {
            "room_code": "43fevnb45bouroa",
            "rate_key": "nhzihyw3fvlaj5xq5ua2dcgfb6oxye4wktlutu3vs",
            "rooms": [
                {
                    "paxes": [
                        {
                            "title": "Mr.",
                            "name": "Henry",
                            "surname": "Patrick",
                            "type": "AD"
                        },
                        {
                            "title": "Mr.",
                            "name": "Harry",
                            "surname": "Patrick",
                            "type": "AD"
                        },
                        {
                            "title": "Mr.",
                            "name": "Luke",
                            "surname": "Patrick",
                            "type": "CH",
                            "age": "3"
                        }
                    ]
                }
            ]
        },
        {
            "room_code": "47eevnb45bouroa",
            "rate_key": "cmg5hph74uaq6qghgwbthpxr5cmtuxec5liojekowzhzspwdpa2v4",
            "rooms": [
                {
                    "no_of_infants": 1,
                    "paxes": [
                        {
                            "title": "Mr.",
                            "name": "Sam",
                            "surname": "Patrick",
                            "type": "AD"
                        }
                    ]
                }
            ]
        }
    ],
    "holder": {
        "title": "Mr.",
        "name": "James",
        "surname": "Patrick",
        "email": "james@pat.com",
        "phone_number": "6614565589",
        "client_nationality": "fr"
    }
}