Examples

This document includes the sample requests and responses for below Coral API endpoints,

Search

Single Hotel Search

Method : POST

Multiple Hotel Search

Method : POST

Destination Search

Method : POST or GET

Geo Location Search

Method : POST or GET

Sample Response

{
  "count": 237,
  "code": "20170120_5_1_1_76_34500f62d64c42dc942f266c44803d17_",
  "next_page_code": null,
  "max_wait": "1.0",
  "response_time": "0.96",
  "results": [
    {
      "hotel_code": "135f3a",
      "checkout": "2017-01-25",
      "checkin": "2017-01-20",
      "destination_code": "11260",
      "products": [
        {
          "code": "135f3a_233937112242_2_2_2_2_0_1_1133722502_0_0-1-0.20170120_5_1_1_76_34500f62d64c42dc942f266c44803d17_",
          "offer": false,
          "pay_at_hotel": false,
          "price": "64.74",
          "currency": "USD",
          "rooms": [
            {
              "pax": {
                "children_ages": [],
                "adult_quantity": 1
              },
              "room_category": "Shared Facility",
              "room_description": "BED IN SHARED ROOM WITH SHARED BATHROOM",
              "nightly_prices": {
                "2017-01-20": "12.94",
                "2017-01-21": "12.94",
                "2017-01-22": "12.94",
                "2017-01-23": "12.94",
                "2017-01-24": "12.94"
              },
              "room_type": "SB"
            }
          ],
          "nonrefundable": false,
          "supports_cancellation": true,
          "hotel_currency": null,
          "hotel_price": null,
          "meal_type": "RO",
          "minimum_selling_price": null,
          "taxes": [
            {
              "currency": "EUR",
              "amount": "6.00",
              "type": "VAT",
              "detail": "",
              "inclusive": true
            },
            {
              "currency": "EUR",
              "amount": "5.00",
              "type": "City Tax",
              "detail": "Example data",
              "inclusive": true
            }
          ],
          "fees": [
            {
              "currency": "EUR",
              "amount": "6.00",
              "type": "Resort Fee",
              "detail": "",
              "inclusive": true
            },
          ],
          "view": false
        },
        ...
      ]
    },
    ...
  ]
}

Hotel Availability

Method : GET

Sample Request

URL

https://api-test.hprotravel.com/api/v2/hotel-availability?hotel_code=1362c9&search_code=20170726_3_2_0_232_a10900758fcd458ea131eb8ba14bcbbd_

Sample Response

{
    "code": "20170726_3_2_0_232_a10900758fcd458ea131eb8ba14bcbbd_", 
    "count": 37, 
    "results": [
        {
            "code": "1362c9_54086212650717_2_22_2_2_0_0_3713021929_12_1-0-0.20170726_3_2_0_232_a10900758fcd458ea131eb8ba14bcbbd_", 
            "destination_code": "20b12", 
            "hotel_code": "1362c9", 
            "additional_info": "", 
            "checkin": "2017-07-26", 
            "checkout": "2017-07-29", 
            "price": "100.14", 
            "currency": "USD", 
            "pay_at_hotel": false, 
            "hotel_price": null, 
            "hotel_currency": null, 
            "meal_type": "RO", 
            "nonrefundable": false, 
            "view": false, 
            "rooms": [
                {
                    "pax": {
                        "children_ages": [], 
                        "adult_quantity": 2
                    }, 
                    "room_category": "Standard", 
                    "room_description": "Studio Double Room", 
                    "nightly_prices": {
                        "2017-07-26": "33.38", 
                        "2017-07-27": "33.38", 
                        "2017-07-28": "33.38"
                    }, 
                    "room_type": "DB"
                }
            ], 
            "supports_cancellation": true, 
            "minimum_selling_price": null, 
            "offer": false, 
            "policies": [
                {
                    "ratio": "1.00", 
                    "days_remaining": 1
                }, 
                {
                    "ratio": "0.33", 
                    "days_remaining": 2
                }
            ]
        }, 
        ...
    ]
}

Provision

Method : POST

Sample Request

URL

https://api-test.hprotravel.com/api/v2/provision/1362c9_54086212650717_2_22_2_2_0_0_3713021929_12_1-0-0.20170726_3_2_0_232_a10900758fcd458ea131eb8ba14bcbbd_

Sample Response

{
  "code": "1362c9_54086212650717_2_22_2_2_0_0_3713021929_12_1-0-0.20170726_3_2_0_232_a10900758fcd458ea131eb8ba14bcbbd_",
  "destination_code": "20b12",
  "offer": false,
  "price": "116.31",
  "currency": "USD",
  "rooms": [
    {
      "pax": {
        "children_ages": [],
        "adult_quantity": 2
      },
      "room_category": "Standard",
      "room_description": "Studio Double Room",
      "nightly_prices": {
        "2017-07-26": "38.77",
        "2017-07-27": "38.77",
        "2017-07-28": "38.78"
      },
      "room_type": "TW"
    }
  ],
  "nonrefundable": true,
  "additional_info": " 24-hour airport shuttle service is available.",
  "supports_cancellation": true,
  "hotel_code": "1362c9",
  "hotel_currency": null,
  "hotel_price": null,
  "checkin": "2017-07-26",
  "meal_type": "RO",
  "policies": [
    {
      "ratio": "1.00",
      "days_remaining": 79
    }
  ],
  "taxes": [
    {
      "currency": "EUR",
      "amount": "6.00",
      "type": "VAT",
      "detail": "",
      "inclusive": true
    },
    {
      "currency": "EUR",
      "amount": "5.00",
      "type": "City Tax",
      "detail": "Example data",
      "inclusive": true
    }
  ],
  "fees": [
    {
      "currency": "EUR",
      "amount": "6.00",
      "type": "Resort Fee",
      "detail": "",
      "inclusive": true
    },
  ],
  "view": false,
  "checkout": "2017-07-29",
  "minimum_selling_price": "123.45",
  "pay_at_hotel": false
}

Book

Method : POST

Sample Request

URL

https://api-test.hprotravel.com/api/v2/book/1362c9_54086212650717_2_22_2_2_0_0_3713021929_12_1-0-0.20170726_3_2_0_232_a10900758fcd458ea131eb8ba14bcbbd_

Post Body Parameters:

Sample Response

{
  "code": "BDNE4UL2Z8DN",
  "created_at": "2017-05-09 07:23:09.577833+00:00",
  "checkin": "2017-07-26",
  "checkout": "2017-07-29",
  "hotel_code": "1362c9",
  "destination_code": "20b12",
  "client_nationality": "us",
  "pay_at_hotel": false,
  "currency": "USD",
  "mealtype_code": "RO",
  "nonrefundable": true,
  "view": false,
  "taxes": [
    {
      "currency": "EUR",
      "amount": "6.00",
      "type": "VAT",
      "detail": "",
      "inclusive": true
    },
    {
      "currency": "EUR",
      "amount": "5.00",
      "type": "City Tax",
      "detail": "Example data",
      "inclusive": true
    }
  ],
  "fees": [
    {
      "currency": "EUR",
      "amount": "6.00",
      "type": "Resort Fee",
      "detail": "",
      "inclusive": true
    },
  ],
  "policies": [
    {
      "days_remaining": 79,
      "ratio": "1.00"
    }
  ],
  "price": "116.31",
  "rooms": [
    {
      "pax": {
        "children_ages": [],
        "adult_quantity": 2
      },
      "room_category": "Standard",
      "room_description": "Standard Double Room",
      "nightly_prices": {
        "2017-07-26": "38.77",
        "2017-07-27": "38.77",
        "2017-07-28": "38.78"
      },
      "room_type": "TW"
    }
  ],
  "status": "succeeded",
  "confirmation_numbers": [
    {
      "confirmation_number": "284395319|1234",
      "names": [
        "test test",
        "testa testa"
      ],
      "rooms": [
        {
          "room_description": "Standard Double Room",
          "room_type": "2"
        }
      ]
    }
  ],
  "hotel_payment_info": [
    {
      "hotel_currency": null,
      "hotel_price": null
    }
  ],
  "minimum_selling_price": "123.45",
  "special_request": null,
  "hotel_confirmation_number": "112234344",
  "hotel_confirmation_number_date": "2018-01-31 20:58:16.429164+00:00" 
}

Cancel

Method : POST

Sample Request

URL

https://api-test.hprotravel.com/api/v2/cancel/BDNE4UL2Z8DN

Sample Response

{
     "currency":"USD",
     "charge_amount":"0.00",
     "code":"BDNE4UL2Z8DN"
}

Alternative Recommendation

Sample Response

{
  "error_code": "4410",
  "detail": "This product is no longer available, you can continue with recommended product",
  "recommended": {
    "code": "1362c9_2096612503_1_11_2_2_0_0_2096612519_0_2-0-0.20170726_3_2_0_232_1b2cdbab4774420eb068ee55c74174c0_",
    "destination_code": "20b12",
    "offer": false,
    "price": "105.59",
    "currency": "USD",
    "rooms": [
      {
        "pax": {
          "children_ages": [],
          "adult_quantity": 2
        },
        "room_category": "Standard",
        "room_description": "Standard Studio",
        "nightly_prices": {
          "2017-07-26": "35.20",
          "2017-07-27": "35.20",
          "2017-07-28": "35.20"
        },
        "room_type": "TW"
      }
    ],
    "nonrefundable": true,
    "additional_info": " 24-hour airport shuttle service is available.",
    "supports_cancellation": true,
    "hotel_code": "1362c9",
    "hotel_currency": null,
    "hotel_price": null,
    "checkin": "2017-07-26",
    "meal_type": "RO",
    "policies": [
      {
        "ratio": "1.00",
        "days_remaining": 79
      }
    ],
    "view": false,
    "checkout": "2017-07-29",
    "minimum_selling_price": "123.45",
    "pay_at_hotel": false
  }
}