Fetch a Booking with GRN booking reference

  • You can use this method to fetch a single booking using booking reference.
Method URL
GET api/v3/hotels/bookings/<bref>?type=value

<bref> refers to the ‘GRN booking_reference returned in the booking response.

For GRN booking reference type="GRN". Default value type="GRN"

Mandatary Step - You have to fetch the booking in case of noresponse, server error (503, 502, 500) from booking endpoint or incase booking status="pending" in booking response.

Fetch a Booking with Agent booking reference

  • You can use this method to fetch a single booking using booking reference.
Method URL
GET api/v3/hotels/bookings/by_reference/<agentref>?type=value

<agentref> refers to the Agent reference’ returned in the booking response.

For Agent reference type="Agent". Default value type="GRN"

Mandatary Step - You have to fetch the booking in case of noresponse, server error (503, 502, 500) from booking endpoint or incase booking status="pending" in booking response.

Error Codes

HTTP Status Code Error Code Description
200 2002 Invalid Booking Reference
404 5121 Booking not found

Fetch Bookings List

  • You can use this method to fetch all bookings and cancellations.
Method URL
GET api/v3/hotels/bookings

Parameters

Attribute Type Required Description
filter_type string OPTIONAL ‘booking_date’ to fetch bookings based on booking date
‘checkin_date’ to fetch bookings based on check-in date
Defaults to ‘booking_date’
start date OPTIONAL The starting date for the given filter type
end date OPTIONAL,
REQUIRED if ‘start’ is given.
The end date for the given filter type
from string OPTIONAL Booking reference of the starting item
count integer OPTIONAL
REQUIRED if ‘from’ is given
Number of bookings to fetch. Maximum value is 100. Defaults to 30
direction string OPTIONAL
REQUIRED if ‘from’ is given
‘next’ to fetch the next ‘count’ bookings
‘prev’ to fetch the previous
‘count’ bookings
type string OPTIONAL Type of the booking
‘B’ to fetch bookings
‘C’ to fetch cancellations
When type is not specified, both types are fetched
  • Note: ‘start’ and ‘end’ date duration cannot exceed 30 days When no options are given, recent 30 bookings will be fetched (both types)

Sample Response

{
    "total": 474,
    "count": 1,
    "bookings": [
        {
            "supports_cancellation": true,
            "supports_amendment": true,
            "supplier_reference": "5007557",
            "search_id": "d3kmmkyqvuhyi7pnrkcm5szkvu",
            "price": {
                "total": "16966.59",
                "breakdown": {
                    "name": "Net",
                    "amount": "16966.59"
                }
            },
            "payment_type": "AT_WEB",
            "payment_status": "pending",
            "nationality": "fr",
            "hotel": {
                "paxes": [
                    {
                        "type": "AD",
                        "surname": "Patrick",
                        "pax_id": 4,
                        "name": "Sam"
                    },
                    {
                        "type": "AD",
                        "surname": "Patrick",
                        "pax_id": 3,
                        "name": "Henry"
                    },
                    {
                        "type": "AD",
                        "surname": "Patrick",
                        "pax_id": 2,
                        "name": "Harry"
                    },
                    {
                        "type": "CH",
                        "surname": "Patrick",
                        "pax_id": 1,
                        "name": "Luke"
                    }
                ],
                "hotel_code": "1848138",
                "hotel_confirmation_number": "71370192 - Krissana Reservation Department",
                "city_code": "121449",
                "booking_items": [
                    {
                        "rooms": [
                            {
                                "room_type": "28076",
                                "room_reference": "BB",
                                "pax_ids": [
                                    4
                                ],
                                "no_of_children": 0,
                                "no_of_adults": 1
                            }
                        ],
                        "price": "11602.47",
                        "non_refundable": false,
                        "includes_boarding": true,
                        "currency": "INR",
                        "cancellation_policy": {
                            "under_cancellation": false,
                            "details": [
                                {
                                    "from": "2022-12-28T00:00:00",
                                    "flat_fee": "11602.47",
                                    "currency": "INR"
                                }
                            ],
                            "cancel_by_date": "2022-12-27T00:00:00",
                            "amount_type": "value"
                        },
                        "boarding_details": [
                            "Bed & Breakfast"
                        ]
                    },
                    {
                        "rooms": [
                            {
                                "room_type": "28076",
                                "room_reference": "BB",
                                "pax_ids": [
                                    3,
                                    2,
                                    1
                                ],
                                "no_of_children": 1,
                                "no_of_adults": 2
                            }
                        ],
                        "price": "12182.37",
                        "non_refundable": false,
                        "includes_boarding": true,
                        "currency": "INR",
                        "cancellation_policy": {
                            "under_cancellation": false,
                            "details": [
                                {
                                    "from": "2022-12-28T00:00:00",
                                    "flat_fee": "12182.37",
                                    "currency": "INR"
                                }
                            ],
                            "cancel_by_date": "2022-12-27T00:00:00",
                            "amount_type": "value"
                        },
                        "boarding_details": [
                            "Bed & Breakfast"
                        ]
                    }
                ]
            },
            "holder": {
                "surname": "Patrick",
                "phone_number": "6614565589",
                "name": "James",
                "email": "james@pat.com"
            },
            "currency": "INR",
            "checkout": "2022-12-30",
            "checkin": "2022-12-29",
            "booking_type": "C",
            "booking_status": "confirmed",
            "booking_reference": "rpftjtcfl67mmlgiigtbezxboy",
            "booking_id": "GRN-201611-000566",
            "booking_date": "2022-11-11T08:11:51"
        }
    ]
}

Error Codes

HTTP Status Code Error Code Description
200 2005 Internal server error
200 5128 Field(type_1) is required when Field(type_2) is given
200 5129 Field(name) dates must be valid, and in ISO8601 format (YYYY-MM-DD)
200 5130 start and end date duration cannot exceed 30 days
200 5131 a maximum of 100 bookings can be viewed at a time
200 5132 type must be either B or C (Booking, Cancelled)
200 5133 filter_type type must be either booking_date or checkin_date