Update Room (DateRange)

This endpoint is used to update the room's price, availability and restrictions.

Request

PUT https://app.hotelrunner.com/api/v2/apps/rooms/~

// Example Request Snippet for JavaScript XHR

var data = null;

var xhr = new XMLHttpRequest();
xhr.withCredentials = true;

xhr.addEventListener("readystatechange", function () {
  if (this.readyState === 4) {
    console.log(this.responseText);
  }
});

xhr.open("PUT", "https://app.hotelrunner.com/api/v2/apps/rooms/~?hr_id={HR_ID}&token={TOKEN}&room_code={ROOM_CODE}&channel_codes[]={CHANNEL_CODE_1}&channel_codes[]={CHANNEL_CODE_2}&start_date={START_DATE}&end_date={END_DATE}&availability={AVAILABILITY}&price={PRICE}&min_stay={MIN_STAY}&stop_sale={STOP_SALE}");
xhr.setRequestHeader("cache-control", "no-cache");

xhr.send(data);

The above command returns json structured like this:

    {
        "status": "ok", 
        "transaction_id": "123456789" 
    }

    or

    {
        "status": "try_again", 
        "transaction_id": "123456789" 
    }


Query Parameters

Parameter Default Required Description
@rooms.inv_code - Yes Inv code that will be updated. ( Only updates the Room Type and its Master Rate )
@rooms.rate_code - Yes Rate code is used to update price of rates if it's 'price_update' is 'true'.If inv_code is also sent in the request, rate_code will be ignored and the request will only update the Room Type and its Master Rate.
availability - No Don't send this parameter if you don't want to update availability.
price - No Don't send this parameter if you don't want to update price.
stop_sale - No Don't send this parameter if you don't want to update stop sale. Accepted values: 1 or 0
cta - No Don't send this parameter if you don't want to update CTA. Accepted values: 1 or 0
ctd - No Don't send this parameter if you don't want to update CTD. Accepted values: 1 or 0
min_stay - No Don't send this parameter if you don't want to update min_stay.
start_date - Yes Format: YYYY-MM-DD Start date
end_date - Yes Format: YYYY-MM-DD End date
days [0,1,2,3,4,5,6] No Type: Array Used to update specific week days within given date range. (Sunday: 0)
channel_codes All connected channels of room No Type: Array Used to update specific channels. (eg. ['bookingcom', 'online'])

Get Transaction Details

This endpoint is used to fetch status logs of given transaction id.

GET https://app.hotelrunner.com/api/v2/apps/infos/transaction_details

// Example Request Snippet for JavaScript XHR

var data = null;

var xhr = new XMLHttpRequest();
xhr.withCredentials = true;

xhr.addEventListener("readystatechange", function () {
  if (this.readyState === 4) {
    console.log(this.responseText);
  }
});

xhr.open("GET", "https://app.hotelrunner.com/api/v2/apps/infos/transaction_details?transaction_id={TRANSACTION_ID}&token={TOKEN}&hr_id={HR_ID}");
xhr.setRequestHeader("cache-control", "no-cache");

xhr.send(data);

The above command returns json structured like this:

{
  "transaction": {
    "id": "883770514",
    "counts": {
      "failed": 1,
      "succeeded": 1,
      "in_progress": 0
    },
    "details": [
      {
        "id": 12529,
        "channel_code": "bookingcom",
        "state": "failed",
        "name": "Люкс (68366) - Стандартный тариф - 1 Person",
        "code": "156754:8833301",
        "allocation_group": "8833301",
        "created_at": "2015-10-16T08:01:29Z",
        "pid": 9651,
        "error_message": null
      },
      {
        "id": null,
        "channel_code": "online",
        "state": "succeeded",
        "name": "Online",
        "code": "Online",
        "allocation_group": "Online",
        "created_at": "2015-10-16T07:54:25Z",
        "pid": null,
        "error_message": null
      }
    ]
  }
}

Query Parameters

Parameter Default Required Description
transaction_id - Yes Each room update request returns transaction_id.