Overview

This documentation covers basic principles of Ostrovok e-channel API.

Authentication

All users of this api are provided with public authentication token and private token.

Authentication token is used to determine the exact user of api and is sent through request as GET parameter.

Private token is used to determine sign request and should not be exposed in public. To sign request you need to generate md5 hash from all parameters and their values which you are up to send through api. All parameters should be sorted by their names and concatenated with their values through ";".

Example:

Initial conditions

You are going to put some data to update, for example, restrictions of the specific allotment. Your credentials are:

Autentication token
token=2523e7d3be4393983732d02652216a81
Private token
private=f5347f1fa2dd2c5fb778a4cea8483c25

Endpoint URL: /echannel/rate_plan_allotment_plans/

{
    "id": 111111,
    "rate_plan": 66666,
    "disable_flexible": true,
}
Signature generation

So the data you are going to send consists of parameters: "id", "rate_plan", "disable_flexible" these are in request body and authentication token parameter that is sent via GET with name "token" encoded in url.

To generate signature for this request you should form the string by pattern:

<name1>=<value1>...<nameN>=<valueN>

All parameters in that string are going in alphabetical order. The parameters list should contain all parameters that you are going to send including private token in the form:

private=f5347f1fa2dd2c5fb778a4cea8483c25

So we will add private token to that list of parameters, then sort the keys, concatenate them with their values and then concatenate again with each other as mentioned before. In the end we will come up with string like:

disable_flexible=true;id=111111;private=f5347f1fa2dd2c5fb778a4cea8483c25;rate_plan=66666;token=2523e7d3be4393983732d02652216a81

To generate signature use md5 hashing against the string. In this example signature is:

None
    47bd4263f87f6d177b07705867e72967
Make the request

So the final request url will be:

/echannel/rate_plan_allotment_plans/?token=2523e7d3be4393983732d02652216a81&sign=47bd4263f87f6d177b07705867e72967

And request body is:

{
    "id": 111111,
    "rate_plan": 66666,
    "disable_flexible": true,
}

Using curl the request will look like:

curl -d '{"id":111111, "rate_plan": 66666, "disable_flexible": true}' -X PUT /echannel/rate_plan_allotment_plans/?token=2523e7d3be4393983732d02652216a81&sign=47bd4263f87f6d177b07705867e72967

Pagination

Every api response support pagination. Let's study the support using simple get request to the API:

/echannel/hotels/?sign=3f821e082f7b155bc6ab7520d3cd05e7&pk=609198278&token=5329d9e05a9621a09575a3e8607264cf
So, as you can see the response contains fields:
  • num_pages shows how many pages resultset has
  • page is index of selected page. First page index is 1
  • limits is quantity of results shown per page
This response tells us that there is only one page, and currently selected page is page number 1(the only one) and maximum results shown per page is 10.
{
    "num_pages": 1,
    "page": 1,
    "limits": 10,
    "hotels": [
        {
            "id": 609198278,
            "name": "Тест отель"
        }
    ]
}

If you want to change pagination bahaviour you may add pagination parameters to request. To change limits add it to url with desired value. For example this will make API to show 100 results per page, as you can see limits=100 was appended to url

/echannel/hotels/?sign=3f821e082f7b155bc6ab7520d3cd05e7&pk=609198278&token=5329d9e05a9621a09575a3e8607264cf&limits=100

Lets assume you've made request like:

/echannel/hotels/?sign=3f821e082f7b155bc6ab7520d3cd05e7&pk=609198278&token=5329d9e05a9621a09575a3e8607264cf&limits=2

And the response was:
Paginator indicates that two pages are available (num_pages = 2) and page number 1 is selected and we display 2 results per page.

{
    "num_pages": 2,
    "page": 1,
    "limits": 2,
    "hotels": [
        {
            "id": 609198278,
            "name": "Test hotel 1"
        },
        {
            "id": 609198279,
            "name": "Test hotel 2"
        }
    ]
}

To request second page append page parameter to url with value 2, like that, and the response will contain the second page:

/echannel/hotels/?sign=3f821e082f7b155bc6ab7520d3cd05e7&pk=609198278&token=5329d9e05a9621a09575a3e8607264cf&limits=2&page=2
Well, that's all, that's how pagination works.

Response formatting

Each request supports different data formats. To specify data format you're going to use simply add format parameter to your url like:

This url specifies format - json
Note: json format is default, if you want to use json formatting you don't need t specify format at all.

/echannel/hotels/?sign=b7c916d6d03acad9dbbca53c323169f1&format=json&token=5329d9e05a9621a09575a3e8607264cf

Supported formats are:

  • json
  • xml

Json

The json formatting is pretty simple.

{
   "object_field": [
        "list_item1",
        "list_item2",
        "list_item3"
   ],
   "str_field": "string",
   "int_field": 123,
   "decimal": 123.23
}

Xml

Valid xml requires version header and root node.
To form xml assume that your object is root node of xml and is called "root". So you should just create separate nodes for your object fields, name them after corresponding fields and put value as content, with the only exception: list values are wrapped with separate "item". As for now all structures are plain and so we don't need to handle nested objects.
So to send xml data you should wrap all nodes into one: "root" node.

<root>
   <object_field>
       <item>list_item1</item>
       <item>list_item2</item>
       <item>list_item3</item>
   </object_field>
   <str_field>string</str_field>
   <int_field>123</int_field>
   <decimal>123.23</decimal>
</root>

Api reference

/echannel/api/v0.1/hotels/ - Lists your hotels

Description:

This resource provides information about all the hotels associated with your user's account. This is readonly resource.

HTTP response:

Response description of /echannel/api/v0.1/hotels/

id Hotel ID
Unique hotel identifier
Integer
name Name
Name of the hotel
CharArray
status Moderation status.
This field shows current instance moderation status. The available values are:
  • M - object is currently on moderation. You may perform any operations with it, but it won't be exported to the ostrovok.ru search.
  • P - object passed all moderation steps. It's shown in search results on ostrovok.ru search page.
ChoiceFields
currency Currency
Currency for hotel
CharArray
limits Results per page count
Limit of number of elements per page, If 0 return all elements in 1 page. For more information see Pagination section.
Integer
page Page index
This parameter is used to page set up selected page index for paginator. For more detailed information see Pagination section
Integer
page_num Page count
This parameter shows how many pages result set has. Use it to determine how many page you need to query to get all the results. For more information check Pagination section
Integer

HTTP methods:


This method is used to retrieve hotels associated with you account. To get specific hotel - specify hotel id. If no filter specified then whole set of hotels will be returned.
NOTE: All requests should be signed, for more information about request signing see Authentication section.

Test request:

id Object ID filter
Specify this field if you want to retrieve the specific object
Integer Optional Maximum value: Not specified
Minimum value: 0
GET
limits Results per page count
Limit of number of elements per page, If 0 return all elements in 1 page. For more information see Pagination section.
Integer Optional Maximum value: Not specified
Minimum value: 0
GET
page Page index
This parameter is used to set up page index for paginator. For more detailed information see Pagination section
Integer Optional Maximum value: Not specified
Minimum value: 1
GET
format Format
request format
json ChoiceFields Optional GET
lang Language
Language selected in response
ChoiceFields Optional GET
Test this request

/echannel/api/v0.1/room_categories/ - Lists rooms of your hotels

Description:

This resource is available for viewing. When addressing the resource, a user gets the response, which contains all rooms that a user is authorized to work with. Filtering by hotel_id is allowed in the resource. If you indicate the needed identifier as hotel_id GET attribute, the system will show only the room categories, connected to this hotel. To change values in RoomCategory object, send a PUT request, in which all the fields you want to change are listed.

HTTP response:

Response description of /echannel/api/v0.1/room_categories/

id Room ID
This is unique room identifier.
Integer
name Room name
Name of a room as it shown at ostrovok.ru search.
CharArray
hotel Hotel ID
This is unique identifier of a hotel which object refers to.
Integer
status Moderation status.
This field shows current instance moderation status. The available values are:
  • M - object is currently on moderation. You may perform any operations with it, but it won't be exported to the ostrovok.ru search.
  • P - object passed all moderation steps. It's shown in search results on ostrovok.ru search page.
ChoiceFields
limits Results per page count
Limit of number of elements per page, If 0 return all elements in 1 page. For more information see Pagination section.
Integer
page Page index
This parameter is used to page set up selected page index for paginator. For more detailed information see Pagination section
Integer
page_num Page count
This parameter shows how many pages result set has. Use it to determine how many page you need to query to get all the results. For more information check Pagination section
Integer

HTTP methods:


This method is used to retrieve hotels associated with you account. To get specific hotel - specify hotel_id. If no filter specified then whole set of hotels will be returned.
NOTE: All requests should be signed, for more information about request signing see Authentication section.

Test request:

id Object ID filter
Specify this field if you want to retrieve the specific object
Integer Optional Maximum value: Not specified
Minimum value: 0
GET
hotel Hotel id
Specify this field if you need to retrieve all objects related to specific hotel. To get list of available hotel ids see hotel resource.
Integer Optional Maximum value: Not specified
Minimum value: Not specified
GET
limits Results per page count
Limit of number of elements per page, If 0 return all elements in 1 page. For more information see Pagination section.
Integer Optional Maximum value: Not specified
Minimum value: 0
GET
page Page index
This parameter is used to set up page index for paginator. For more detailed information see Pagination section
Integer Optional Maximum value: Not specified
Minimum value: 1
GET
format Format
request format
ChoiceFields Optional GET
lang Language
Language selected in response
ChoiceFields Optional GET
Test this request

/echannel/api/v0.1/rates_plans/ - Lists rate plans of your hotel's rooms

Description:

This resource provides information about all the rate plans associaled with your user's account. This is readonly resource.

HTTP response:

Response description of /echannel/api/v0.1/rates_plans/

id Rate Plan ID
This is unique room identifier.
Integer
name Rate plan name
Name of a rate_plan as it shown at ostrovok.ru search.
CharArray
room_category Room ID
This is unique identifier of a room which object refers to.
Integer
status Moderation status.
This field shows current instance moderation status. The available values are:
  • M - object is currently on moderation. You may perform any operations with it, but it won't be exported to the ostrovok.ru search.
  • P - object passed all moderation steps. It's shown in search results on ostrovok.ru search page.
ChoiceFields
limits Results per page count
Limit of number of elements per page, If 0 return all elements in 1 page. For more information see Pagination section.
Integer
min_stay_arrival Minimum stay on arrival
Sets minimum amount of days required to book rate plan if check in date is at plan date
Integer
min_stay_through Minimum stay through
Sets minimum amount of days required to book rate plan if if plan date is inside booking period
Integer
page Page index
This parameter is used to page set up selected page index for paginator. For more detailed information see Pagination section
Integer
page_num Page count
This parameter shows how many pages result set has. Use it to determine how many page you need to query to get all the results. For more information check Pagination section
Integer

HTTP methods:


This method is used to retrieve rate plans associated with you account. If no filter specified it will return whole set of rate plans. If you fill room_category filed, then result will consist of rate_plans for room_category specified.
NOTE: All requests should be signed, for more information about request signing see Authentication section.

Test request:

id Object ID filter
Specify this field if you want to retrieve the specific object
Integer Optional Maximum value: Not specified
Minimum value: 0
GET
room_category Room ID
This parameter is used to filter objects by specific room. If specified resource returns all instances related to room you specified. To get list of available room category ids see room category resource.
Integer Optional Maximum value: Not specified
Minimum value: Not specified
GET
limits Results per page count
Limit of number of elements per page, If 0 return all elements in 1 page. For more information see Pagination section.
Integer Optional Maximum value: Not specified
Minimum value: 0
GET
page Page index
This parameter is used to set up page index for paginator. For more detailed information see Pagination section
Integer Optional Maximum value: Not specified
Minimum value: 1
GET
format Format
request format
ChoiceFields Optional GET
lang Language
Language selected in response
ChoiceFields Optional GET
hotel Hotel id
Specify this field if you need to retrieve all objects related to specific hotel. To get list of available hotel ids see hotel resource.
Integer Optional Maximum value: Not specified
Minimum value: Not specified
GET
Test this request

/echannel/api/v0.1/occupancies/ - Lists available occupancies for your hotel's rooms

Description:

The resource provides information about occupancies available for rooms. Occupancies are used to specify prices for different counts of guests. If room is suitable to settle 1 or 2 or 3 guests (children are not taken into account here), then is will has three occupancies with capacities 1, 2, 3 respectively, knowing the specific occupancy you will be able to set up prices for it through, occupancy allotment plan resource.

HTTP response:

Response description of /echannel/api/v0.1/occupancies/

room_category Room ID
This is unique identifier of a room which object refers to.
Integer
capacity capacity
Capacity of settlement configuration for a specific room. For example: if room has occupancy with capacity 2, it means that you may specify prices for this room for this specific configuration and maximum two people(children are not taken into account) can stay in this room paying that price.
Integer
limits Results per page count
Limit of number of elements per page, If 0 return all elements in 1 page. For more information see Pagination section.
Integer
page Page index
This parameter is used to page set up selected page index for paginator. For more detailed information see Pagination section
Integer

HTTP methods:


Test request:

id Object ID filter
Specify this field if you want to retrieve the specific object
Integer Optional Maximum value: Not specified
Minimum value: 0
GET
room_category Room ID
This parameter is used to filter objects by specific room. If specified resource returns all instances related to room you specified. To get list of available room category ids see room category resource.
Integer Optional Maximum value: Not specified
Minimum value: Not specified
GET
limits Results per page count
Limit of number of elements per page, If 0 return all elements in 1 page. For more information see Pagination section.
Integer Optional Maximum value: Not specified
Minimum value: 0
GET
page Page index
This parameter is used to set up page index for paginator. For more detailed information see Pagination section
Integer Optional Maximum value: Not specified
Minimum value: 1
GET
format Format
request format
ChoiceFields Optional GET
lang Language
Language selected in response
ChoiceFields Optional GET
hotel Hotel
All rates should be owned by current hotel id
Integer Optional Maximum value: Not specified
Minimum value: Not specified
GET
Test this request

/echannel/api/v0.1/room_settings_plan/ - Setups availability

Description:

This resource allows you to retrieve, create and update data about room allotment plans associated with your account.

HTTP response:

Response description of /echannel/api/v0.1/room_settings_plan/

hotel Hotel ID
This is unique identifier of a hotel which object refers to.
Integer
room_category Room ID
This is unique identifier of a room which object refers to.
Integer
plan_date Allotment plan Date
Date
count Count
Flexible quote of rooms for sale at plan date. This parameter may be changed by hotelier or e-channel manager.
Integer
fixed_count Fixed Count
Fixed quote of rooms for sale at plan date. This parametermay be changed only by members of only by members of ostrovok.ru Operations team.
Integer
is_closed Is Closed
This flag means that the whole room is not selling at plan date. This flag is set up only by members of ostrovok.ru Operations team.
Boolean
limits Results per page count
Limit of number of elements per page, If 0 return all elements in 1 page. For more information see Pagination section.
Integer
page Page index
This parameter is used to page set up selected page index for paginator. For more detailed information see Pagination section
Integer

HTTP methods:


Test request:

id Object ID filter
Specify this field if you want to retrieve the specific object
Integer Optional Maximum value: Not specified
Minimum value: 0
GET
hotel Hotel id
Specify this field if you need to retrieve all objects related to specific hotel. To get list of available hotel ids see hotel resource.
Integer Required Maximum value: Not specified
Minimum value: Not specified
GET
room_category Room ID
This parameter is used to filter objects by specific room. If specified resource returns all instances related to room you specified. To get list of available room category ids see room category resource.
Integer Required Maximum value: Not specified
Minimum value: Not specified
GET
plan_date_start_at Plan date start at
Use this filter to specify beginning of period of allotment plans you wish to change. By default it' current_date
Date Optional Date format is YYYY-MM-DD GET
plan_date_end_at Plan date end at
Use this filter to specify end of period of allotment plans you wish to change. The whole period of change
Date Optional Date format is YYYY-MM-DD GET
limits Results per page count
Limit of number of elements per page, If 0 return all elements in 1 page. For more information see Pagination section.
Integer Optional Maximum value: Not specified
Minimum value: 0
GET
page Page index
This parameter is used to set up page index for paginator. For more detailed information see Pagination section
Integer Optional Maximum value: Not specified
Minimum value: 1
GET
format Format
request format
ChoiceFields Optional GET
lang Language
Language selected in response
ChoiceFields Optional GET
Test this request

This method allows you to update batch of records for date period specified using plan_date_start_at and plan_date_end_at. Currently only modifications available is to set room allotment via count parameter.
NOTE: This method only updates existing records, it doesn't create new records. To create new records use POST method.

Test request:

hotel Hotel ID
This is unique identifier of a hotel which object refers to.
Integer Required Maximum value: Not specified
Minimum value: Not specified
GET
room_category Room ID
This is unique identifier of a room which object refers to.
Integer Required Maximum value: Not specified
Minimum value: Not specified
GET
count Count
Count of rooms for sale at plan_date
Integer Required Maximum value: 32767
Minimum value: 0
GET
plan_date_start_at Plan date start at
Use this filter to specify beginning of period of allotment plans you wish to change. By default it' current_date
Date Required Date format is YYYY-MM-DD GET
plan_date_end_at Plan date end at
Use this filter to specify end of period of allotment plans you wish to change. The whole period of change
Date Required Date format is YYYY-MM-DD GET
format Format
request format
ChoiceFields Optional GET
Test this request

This method allows you to create batch of records for date period specified using plan_date_start_at and plan_date_end_at. Currently only modifications available is to set room allotment via count parameter.
NOTE: This method only creates existing records, it doesn't update existing records. To update existing records use PUT method.

Test request:

hotel Hotel ID
This is unique identifier of a hotel which object refers to.
Integer Required Maximum value: Not specified
Minimum value: Not specified
GET
room_category Room ID
This is unique identifier of a room which object refers to.
Integer Required Maximum value: Not specified
Minimum value: Not specified
GET
count Count
Count of rooms for sale at plan_date
Integer Required Maximum value: 32767
Minimum value: 0
GET
plan_date_start_at Plan date start at
Use this filter to specify beginning of period of allotment plans you wish to change. By default it' current_date
Date Required Date format is YYYY-MM-DD GET
plan_date_end_at Plan date end at
Use this filter to specify end of period of allotment plans you wish to change. The whole period of change
Date Required Date format is YYYY-MM-DD GET
format Format
request format
ChoiceFields Optional GET
Test this request

/echannel/api/v0.1/rate_settings_plan/ - Setups restrictions for rates

Description:

This resource allows you to retrieve, create and update data about rate plan allotment plans associated with your account.

HTTP response:

Response description of /echannel/api/v0.1/rate_settings_plan/

hotel Hotel ID
This is unique identifier of a hotel which object refers to.
Integer
room_category Room ID
This is unique identifier of a room which object refers to.
Integer
rate_plan Rate Plan id
This is unique identifier of a rate plan which object refers to.
Integer
plan_date Allotment plan Date
Date
disable_flexible Disable flexible
Disable flexible quote for plan date
Boolean
min_stay_arrival Minimum stay on arrival
Sets minimum amount of days required to book rate plan if check in date is at plan date
Integer
min_stay_through Minimum stay through
Sets minimum amount of days required to book rate plan if if plan date is inside booking period
Integer
closed_on_arrival Closed on arrival
Forbid to check in at plan date
Boolean
limits Results per page count
Limit of number of elements per page, If 0 return all elements in 1 page. For more information see Pagination section.
Integer
page Page index
This parameter is used to page set up selected page index for paginator. For more detailed information see Pagination section
Integer

HTTP methods:


Test request:

id Object ID filter
Specify this field if you want to retrieve the specific object
Integer Optional Maximum value: Not specified
Minimum value: 0
GET
hotel Hotel id
Specify this field if you need to retrieve all objects related to specific hotel. To get list of available hotel ids see hotel resource.
Integer Required Maximum value: Not specified
Minimum value: Not specified
GET
room_category Room ID
This parameter is used to filter objects by specific room. If specified resource returns all instances related to room you specified. To get list of available room category ids see room category resource.
Integer Required Maximum value: Not specified
Minimum value: Not specified
GET
rate_plan Rate Plan id
Specify this field if you need to retrieve all objects related to specific rate_plan. To get list of available rate plan ids see rate plans resource.
Integer Optional Maximum value: Not specified
Minimum value: Not specified
GET
plan_date_start_at Plan date start at
Use this filter to specify beginning of period of allotment plans you wish to change. By default it' current_date
Date Optional Date format is YYYY-MM-DD GET
plan_date_end_at Plan date end at
Use this filter to specify end of period of allotment plans you wish to change. The whole period of change
Date Optional Date format is YYYY-MM-DD GET
limits Results per page count
Limit of number of elements per page, If 0 return all elements in 1 page. For more information see Pagination section.
Integer Optional Maximum value: Not specified
Minimum value: 0
GET
page Page index
This parameter is used to set up page index for paginator. For more detailed information see Pagination section
Integer Optional Maximum value: Not specified
Minimum value: 1
GET
format Format
request format
ChoiceFields Optional GET
lang Language
Language selected in response
ChoiceFields Optional GET
Test this request

This method allows you to update batch of records for date period specified using plan_date_start_at and plan_date_end_at. Currently only modifications available is to close rate plan on arrival.
NOTE: This method only updates existing records, it doesn't create new ones. To create new records use POST method.

Test request:

hotel Hotel ID
This is unique identifier of a hotel which object refers to.
Integer Required Maximum value: Not specified
Minimum value: Not specified
GET
room_category Room ID
This is unique identifier of a room which object refers to.
Integer Required Maximum value: Not specified
Minimum value: Not specified
GET
rate_plan Rate Plan id
This is unique identifier of a rate plan which object refers to.
Integer Required Maximum value: Not specified
Minimum value: Not specified
GET
plan_date_start_at Plan date start at
Use this filter to specify beginning of period of allotment plans you wish to change. By default it' current_date
Date Required Date format is YYYY-MM-DD GET
plan_date_end_at Plan date end at
Use this filter to specify end of period of allotment plans you wish to change. The whole period of change
Date Required Date format is YYYY-MM-DD GET
disable_flexible Disable flexible
Disable flexible quote for plan date
Boolean Optional GET
min_stay_arrival Minimum stay on arrival
Sets minimum amount of days required to book rate plan if check in date is at plan date
Integer Optional Maximum value: 32767
Minimum value: 0
GET
min_stay_through Minimum stay through
Sets minimum amount of days required to book rate plan if if plan date is inside booking period
Integer Optional Maximum value: 32767
Minimum value: 0
GET
closed_on_arrival Closed on arrival
Forbid to check in at plan date
Boolean Optional GET
format Format
request format
ChoiceFields Optional GET
Test this request

This method allows you to create batch of records for date period specified using plan_date_start_at and plan_date_end_at. Currently only modifications available is to close rate plan on arrival.
NOTE: This method only creates new records, it doesn't update existing. To update existing records use PUT method.

Test request:

hotel Hotel ID
This is unique identifier of a hotel which object refers to.
Integer Required Maximum value: Not specified
Minimum value: Not specified
GET
room_category Room ID
This is unique identifier of a room which object refers to.
Integer Required Maximum value: Not specified
Minimum value: Not specified
GET
rate_plan Rate Plan id
This is unique identifier of a rate plan which object refers to.
Integer Required Maximum value: Not specified
Minimum value: Not specified
GET
plan_date_start_at Plan date start at
Use this filter to specify beginning of period of allotment plans you wish to change. By default it' current_date
Date Required Date format is YYYY-MM-DD GET
plan_date_end_at Plan date end at
Use this filter to specify end of period of allotment plans you wish to change. The whole period of change
Date Required Date format is YYYY-MM-DD GET
disable_flexible Disable flexible
Disable flexible quote for plan date
Boolean Optional GET
min_stay_arrival Minimum stay on arrival
Sets minimum amount of days required to book rate plan if check in date is at plan date
Integer Optional Maximum value: 32767
Minimum value: 0
GET
min_stay_through Minimum stay through
Sets minimum amount of days required to book rate plan if if plan date is inside booking period
Integer Optional Maximum value: 32767
Minimum value: 0
GET
closed_on_arrival Closed on arrival
Forbid to check in at plan date
Boolean Optional GET
format Format
request format
ChoiceFields Optional GET
Test this request

/echannel/api/v0.1/occupancy_settings_plan/ - Setups prices

Description:

This resource allows you to retrieve, create and update data about occupancy allotment plans associated with your account.

HTTP response:

Response description of /echannel/api/v0.1/occupancy_settings_plan/

hotel Hotel ID
This is unique identifier of a hotel which object refers to.
Integer
room_category Room ID
This is unique identifier of a room which object refers to.
Integer
rate_plan Rate Plan id
This is unique identifier of a rate plan which object refers to.
Integer
occupancy Occupancy id
This is unique identifier of an occupancy which object refers to.
Integer
plan_date Allotment plan Date
Date when settings are active
Date
limits Results per page count
Limit of number of elements per page, If 0 return all elements in 1 page. For more information see Pagination section.
Integer
page Page index
This parameter is used to page set up selected page index for paginator. For more detailed information see Pagination section
Integer

HTTP methods:


Test request:

id Object ID filter
Specify this field if you want to retrieve the specific object
Integer Optional Maximum value: Not specified
Minimum value: 0
GET
hotel Hotel id
Specify this field if you need to retrieve all objects related to specific hotel. To get list of available hotel ids see hotel resource.
Integer Required Maximum value: Not specified
Minimum value: Not specified
GET
room_category Room ID
This parameter is used to filter objects by specific room. If specified resource returns all instances related to room you specified. To get list of available room category ids see room category resource.
Integer Required Maximum value: Not specified
Minimum value: Not specified
GET
rate_plan Rate Plan id
Specify this field if you need to retrieve all objects related to specific rate_plan. To get list of available rate plan ids see rate plans resource.
Integer Optional Maximum value: Not specified
Minimum value: Not specified
GET
occupancy Occupancy id
Specify this field if you need to retrieve all objects related to specific occupancy. To get list of available occuancies plan ids see occupancy resource.
Integer Optional Maximum value: Not specified
Minimum value: Not specified
GET
plan_date_start_at Plan date start at
Use this filter to specify beginning of period of allotment plans you wish to change. By default it' current_date
Date Optional Date format is YYYY-MM-DD GET
plan_date_end_at Plan date end at
Use this filter to specify end of period of allotment plans you wish to change. The whole period of change
Date Optional Date format is YYYY-MM-DD GET
limits Results per page count
Limit of number of elements per page, If 0 return all elements in 1 page. For more information see Pagination section.
Integer Optional Maximum value: Not specified
Minimum value: 0
GET
page Page index
This parameter is used to set up page index for paginator. For more detailed information see Pagination section
Integer Optional Maximum value: Not specified
Minimum value: 1
GET
format Format
request format
ChoiceFields Optional GET
lang Language
Language selected in response
ChoiceFields Optional GET
Test this request

This method allows you to update batch of records for date period specified using plan_date_start_at and plan_date_end_at. Currently only modifications available is to set prices for specific room's rate plan with specific occupancy via price parameter.
NOTE: This method only updates existing records, it doesn't create new records. To create new records use POST method.

Test request:

hotel Hotel ID
This is unique identifier of a hotel which object refers to.
Integer Required Maximum value: Not specified
Minimum value: Not specified
GET
room_category Room ID
This is unique identifier of a room which object refers to.
Integer Required Maximum value: Not specified
Minimum value: Not specified
GET
rate_plan Rate Plan id
This is unique identifier of a rate plan which object refers to.
Integer Required Maximum value: Not specified
Minimum value: Not specified
GET
occupancy Occupancy id
This is unique identifier of an occupancy which object refers to.
Integer Required Maximum value: Not specified
Minimum value: Not specified
GET
plan_date_start_at Plan date start at
Use this filter to specify beginning of period of allotment plans you wish to change. By default it' current_date
Date Required Date format is YYYY-MM-DD GET
plan_date_end_at Plan date end at
Use this filter to specify end of period of allotment plans you wish to change. The whole period of change
Date Required Date format is YYYY-MM-DD GET
price Price
Price for current room and occupancy at plan date.
Decimal Required Maximum value: Not specified
Minimum value: 0
Maximum length: Not specified
Decimal places: Not specified
GET
format Format
request format
ChoiceFields Optional GET
Test this request

This method allows you to create batch of records for date period specified using plan_date_start_at and plan_date_end_at. Currently only modifications available is to set prices for specific room's rate plan with specific occupancy via price parameter.
NOTE: This method only creates existing records, it doesn't update existing records. To update existing records use PUT method.

Test request:

hotel Hotel ID
This is unique identifier of a hotel which object refers to.
Integer Required Maximum value: Not specified
Minimum value: Not specified
GET
room_category Room ID
This is unique identifier of a room which object refers to.
Integer Required Maximum value: Not specified
Minimum value: Not specified
GET
rate_plan Rate Plan id
This is unique identifier of a rate plan which object refers to.
Integer Required Maximum value: Not specified
Minimum value: Not specified
GET
occupancy Occupancy id
This is unique identifier of an occupancy which object refers to.
Integer Required Maximum value: Not specified
Minimum value: Not specified
GET
plan_date_start_at Plan date start at
Use this filter to specify beginning of period of allotment plans you wish to change. By default it' current_date
Date Required Date format is YYYY-MM-DD GET
plan_date_end_at Plan date end at
Use this filter to specify end of period of allotment plans you wish to change. The whole period of change
Date Required Date format is YYYY-MM-DD GET
price Price
Price for current room and occupancy at plan date.
Decimal Required Maximum value: Not specified
Minimum value: 0
Maximum length: Not specified
Decimal places: Not specified
GET
format Format
request format
ChoiceFields Optional GET
Test this request

/echannel/api/v0.1/rna/ - setups RNA

Description:

Send in 1 request information for update or create any kind of RNA information. Put and Post work the same.

Signature generation sting
function signaturelizer(data){ // data should contain fields // private <- contain your private token // token <- contain your authorization token if (_.isArray(data)) { var str_data = _.map(data, signaturelizer).join(';'); return (data.length <= 1) ? str_data :'[' + str_data + ']' } if (_.isBoolean(data)) { return data.toString().toLowerCase(); } if (_.isObject(data)){ var pairs = _.sortBy(_.pairs(data), function (tmp){ return tmp[0];}); return _.map(pairs, function (a) { return _.map(a, signaturelizer).join('='); } ).join(';') } return data.toString(); } function generateSignature (data) { var data_copy = _.clone(data) data_copy.private = $('#currentPrivateToken').text() data_copy.token = $('#currentAuthorizationToken').text() var str_data = signaturelizer(data_copy) return hex_md5(str_data).toLowerCase() }
Send push notification like this
{ "occupancies": [ { "plan_date_end_at": "2012-08-04", "room_category": 8, "price": 100, "plan_date_start_at": "2012-08-03", "occupancy": 3954, "rate_plan": 10 }, ... { "plan_date_end_at": "2012-09-14", "room_category": 8, "price": 100, "plan_date_start_at": "2012-09-10", "occupancy": 3954, "rate_plan": 10 } ], "rate_plans": [ { "rate_plan": 10, "plan_date_start_at": "2012-08-03", "plan_date_end_at": "2012-08-04", "room_category": 8, "closed_on_arrival": true, "min_stay_through": 3 }, ... { "rate_plan": 10, "plan_date_start_at": "2012-08-09", "plan_date_end_at": "2012-08-24", "room_category": 8, "min_stay_arrival": 5 } ], "room_categories": [ { "count": 10, "room_category": 8, "plan_date_start_at": "2012-08-01", "plan_date_end_at": "2012-08-01" }, ... { "count": 3, "room_category": 8, "plan_date_start_at": "2012-11-13", "plan_date_end_at": "2012-12-24" } ] }
You will receive such response
{ "occupancies": { 'updated': 1, 'created': 4 }, "rate_plans": { 'updated': 1, 'created': 0 }, "room_categories": 'updated': 0, 'created': 1 } }

/echannel/api/v0.1/bookings/ - Booking objects resource

Description:

This resource allows you to retrieve about booking set associated with your account.

HTTP response:

Response description of /echannel/api/v0.1/bookings/

id Id
Booking id
CharArray
uuid Uuid
Booking uuid
CharArray
phone Phone
Customer's phone (if enabled in hotel settings)
CharArray
email Email
Customer's email (if enabled in hotel settings)
CharArray
first_name First name
Customer's first name
CharArray
last_name Last name
Customer's last name
CharArray
comment Comment
User comment for booking
CharArray
adults Adults
Number of adults
CharArray
children Children
Array of child ages. For example: 2 children 2 and 5 years old will be represented as [2, 5]
Array
arrive_at Arrive at
Date of arrive
Date
depart_at Depart at
Date of departure
Date
created_at Created at
Date Time of creation
CharArray
modified_at Modified at
Date Time of modification
CharArray
cancelled_at Cancelled at
Date Time of cancellation
CharArray
hotel Hotel ID
This is unique identifier of a hotel which object refers to.
Integer
room_category Room ID
This is unique identifier of a room which object refers to.
Integer
rate_plan Rate Plan id
This is unique identifier of a rate plan which object refers to.
Integer
room_capacity Room capacity
Capacity for current room
Integer
bedding Bedding
Information about bedding configuration for current booking
Array
extra_bed_prices Extra bed prices
Information about extra bed price for current booking
Array
child_cot_prices Child cot prices
Information about child cot price for current booking
Array
existing_bed Existing bed
Information about location on existing bed for current booking
Integer
rate_plan_name Rate plan name
Name of booked rate plan
CharArray
min_stay_arrival Min stay arrival
Information about minimum stay on arrival in nights for current booking
Integer
min_stay_through Min stay through
Information about minimum stay through in nights for current booking
Integer
advance Advance
Integer
status Status
Status for current booking (Normal, Missed, Cancelled)
CharArray
allotment_type_per_day Allotment type per day
Information about allotment type per day. List contain info type of booking (fix or flex location) per day
Array
free_nights Free nights
Integer value indicates that each N-th night is free
Integer
price_per_day Price per day
Array of decimal values with two decimal places. Prices for each day of stay are in this array.
Array
rate_per_day Rate per day
Array of integer values.Rate plan for each day of stay are in this array.
Array
is_nightly Is nightly
Boolean
is_credit_card_required Is credit card required
Boolean flag. Said if that booking required credit card
Boolean
is_pre_pay Is pre pay
Boolean flag. Said if current booking booked on pre pay mode
Boolean
payment_error Payment error
Indicates if hotel had problems processing credit card
Boolean
payment_error_reason Payment error reason
Detailed payment error reason.
ChoiceFields
payment_is_cancelable Payment is cancelable
Indicates if booking can be cancelled by hotel manager
Boolean
payment_is_modifiable Payment is modifiable
Indicates if hotel manager is able to report payment error
Boolean
order_id Order id
Order id for booking. Every booking is a part of the order
CharArray
is_multibooking Is multibooking
Indicates if the booking is multybooking. If booking is multybooking there is at least one more booking with same order id
Boolean
guests Guests
List of guest names
CharArray
currency Currency
Currency code. Indicate the currency in which the booking was exposed
CharArray
action_description Action description
Action that initiated push notification
ChoiceFields

HTTP methods:


Test request:

uuid Uuid
Specify this field if you need to retrieve object related to current uuid.
CharArray Optional Maximum length: Not specified GET
order_id Order id
Specify this field if you need to retrieve all objects related to specific order id.
CharArray Optional Maximum length: Not specified GET
hotel Hotel id
Specify this field if you need to retrieve all objects related to specific hotel. To get list of available hotel ids see hotel resource.
Integer Optional Maximum value: Not specified
Minimum value: Not specified
GET
created_at_start_at Created at start at
Created at greater or equal than current date
Date Optional Date format is YYYY-MM-DD GET
created_at_end_at Created at end at
Created at less or equal than current date
Date Optional Date format is YYYY-MM-DD GET
arrive_at_start_at Arrive at start at
Arrive at greater or equal than current date
Date Optional Date format is YYYY-MM-DD GET
arrive_at_end_at Arrive at end at
Arrive at less or equal than current date
Date Optional Date format is YYYY-MM-DD GET
depart_at_start_at Depart at start at
Depart at greater or equal than current date
Date Optional Date format is YYYY-MM-DD GET
depart_at_end_at Depart at end at
Depart at less or equal than current date
Date Optional Date format is YYYY-MM-DD GET
modified_at_start_at Modified at start at
Modified at greater or equal than current date
CharArray Optional Maximum length: GET
modified_at_end_at Modified at end at
Modified at greater or equal than current date
CharArray Optional Maximum length: GET
cancelled_at_start_at Cancelled at start at
Cancelled at greater or equal than current date
CharArray Optional Maximum length: GET
cancelled_at_end_at Cancelled at end at
Cancelled at greater or equal than current date
CharArray Optional Maximum length: GET
status Status
Status for current booking
ChoiceFields Optional GET
id Id
Specify this field if you need to retrieve object related to current id.
CharArray Optional Maximum length: Not specified GET
limits Results per page count
Limit of number of elements per page, If 0 return all elements in 1 page. For more information see Pagination section.
Integer Optional Maximum value: Not specified
Minimum value: 0
GET
page Page index
This parameter is used to set up page index for paginator. For more detailed information see Pagination section
Integer Optional Maximum value: Not specified
Minimum value: 1
GET
format Format
request format
ChoiceFields Optional GET
lang Language
Language selected in response
ChoiceFields Optional GET
Test this request

/echannel/api/v0.1/orders/ - Order objects resource

Description:

This resource allows you to retrieve about order set associated with your account.

HTTP response:

Response description of /echannel/api/v0.1/orders/

id Id
Booking id
CharArray
uuid Uuid
Booking uuid
CharArray
phone Phone
Customer's phone (if enabled in hotel settings)
CharArray
email Email
Customer's email (if enabled in hotel settings)
CharArray
first_name First name
Customer's first name
CharArray
last_name Last name
Customer's last name
CharArray
comment Comment
User comment for booking
CharArray
adults Adults
Number of adults
CharArray
children Children
Array of child ages. For example: 2 children 2 and 5 years old will be represented as [2, 5]
Array
arrive_at Arrive at
Date of arrive
Date
depart_at Depart at
Date of departure
Date
created_at Created at
Date Time of creation
CharArray
modified_at Modified at
Date Time of modification
CharArray
cancelled_at Cancelled at
Date Time of cancellation
CharArray
hotel Hotel ID
This is unique identifier of a hotel which object refers to.
Integer
room_category Room ID
This is unique identifier of a room which object refers to.
Integer
rate_plan Rate Plan id
This is unique identifier of a rate plan which object refers to.
Integer
room_capacity Room capacity
Capacity for current room
Integer
bedding Bedding
Information about bedding configuration for current booking
Array
extra_bed_prices Extra bed prices
Information about extra bed price for current booking
Array
child_cot_prices Child cot prices
Information about child cot price for current booking
Array
existing_bed Existing bed
Information about location on existing bed for current booking
Integer
rate_plan_name Rate plan name
Name of booked rate plan
CharArray
min_stay_arrival Min stay arrival
Information about minimum stay on arrival in nights for current booking
Integer
min_stay_through Min stay through
Information about minimum stay through in nights for current booking
Integer
advance Advance
Integer
status Status
Status for current booking (Normal, Missed, Cancelled)
CharArray
allotment_type_per_day Allotment type per day
Information about allotment type per day. List contain info type of booking (fix or flex location) per day
Array
free_nights Free nights
Integer value indicates that each N-th night is free
Integer
price_per_day Price per day
Array of decimal values with two decimal places. Prices for each day of stay are in this array.
Array
rate_per_day Rate per day
Array of integer values.Rate plan for each day of stay are in this array.
Array
is_nightly Is nightly
Boolean
is_credit_card_required Is credit card required
Boolean flag. Said if that booking required credit card
Boolean
is_pre_pay Is pre pay
Boolean flag. Said if current booking booked on pre pay mode
Boolean
payment_error Payment error
Indicates if hotel had problems processing credit card
Boolean
payment_error_reason Payment error reason
Detailed payment error reason.
ChoiceFields
payment_is_cancelable Payment is cancelable
Indicates if booking can be cancelled by hotel manager
Boolean
payment_is_modifiable Payment is modifiable
Indicates if hotel manager is able to report payment error
Boolean
order_id Order id
Order id for booking. Every booking is a part of the order
CharArray
is_multibooking Is multibooking
Indicates if the booking is multybooking. If booking is multybooking there is at least one more booking with same order id
Boolean
guests Guests
List of guest names
CharArray
currency Currency
Currency code. Indicate the currency in which the booking was exposed
CharArray
action_description Action description
Action that initiated push notification
ChoiceFields

HTTP methods:


Test request:

uuid Uuid
Specify this field if you need to retrieve object related to current uuid.
CharArray Optional Maximum length: Not specified GET
order_id Order id
Specify this field if you need to retrieve all objects related to specific order id.
CharArray Optional Maximum length: Not specified GET
hotel Hotel id
Specify this field if you need to retrieve all objects related to specific hotel. To get list of available hotel ids see hotel resource.
Integer Optional Maximum value: Not specified
Minimum value: Not specified
GET
created_at_start_at Created at start at
Created at greater or equal than current date
Date Optional Date format is YYYY-MM-DD GET
created_at_end_at Created at end at
Created at less or equal than current date
Date Optional Date format is YYYY-MM-DD GET
arrive_at_start_at Arrive at start at
Arrive at greater or equal than current date
Date Optional Date format is YYYY-MM-DD GET
arrive_at_end_at Arrive at end at
Arrive at less or equal than current date
Date Optional Date format is YYYY-MM-DD GET
depart_at_start_at Depart at start at
Depart at greater or equal than current date
Date Optional Date format is YYYY-MM-DD GET
depart_at_end_at Depart at end at
Depart at less or equal than current date
Date Optional Date format is YYYY-MM-DD GET
modified_at_start_at Modified at start at
Modified at greater or equal than current date
CharArray Optional Maximum length: GET
modified_at_end_at Modified at end at
Modified at greater or equal than current date
CharArray Optional Maximum length: GET
cancelled_at_start_at Cancelled at start at
Cancelled at greater or equal than current date
CharArray Optional Maximum length: GET
cancelled_at_end_at Cancelled at end at
Cancelled at greater or equal than current date
CharArray Optional Maximum length: GET
status Status
Status for current booking
ChoiceFields Optional GET
id Id
Specify this field if you need to retrieve object related to current id.
CharArray Optional Maximum length: Not specified GET
limits Results per page count
Limit of number of elements per page, If 0 return all elements in 1 page. For more information see Pagination section.
Integer Optional Maximum value: Not specified
Minimum value: 0
GET
page Page index
This parameter is used to set up page index for paginator. For more detailed information see Pagination section
Integer Optional Maximum value: Not specified
Minimum value: 1
GET
format Format
request format
ChoiceFields Optional GET
lang Language
Language selected in response
ChoiceFields Optional GET
Test this request

Push notification

Please, specify booking push notification url in your cabinet. To make it work properly you must setup data format you wish to receive data. We will send you notifications through POST and PUT request in the exact format you receive data through api.

id Id
Booking id
CharArray
uuid Uuid
Booking uuid
CharArray
phone Phone
Customer's phone (if enabled in hotel settings)
CharArray
email Email
Customer's email (if enabled in hotel settings)
CharArray
first_name First name
Customer's first name
CharArray
last_name Last name
Customer's last name
CharArray
comment Comment
User comment for booking
CharArray
adults Adults
Number of adults
CharArray
children Children
Array of child ages. For example: 2 children 2 and 5 years old will be represented as [2, 5]
Array
arrive_at Arrive at
Date of arrive
Date
depart_at Depart at
Date of departure
Date
created_at Created at
Date Time of creation
CharArray
modified_at Modified at
Date Time of modification
CharArray
cancelled_at Cancelled at
Date Time of cancellation
CharArray
hotel Hotel ID
This is unique identifier of a hotel which object refers to.
Integer
room_category Room ID
This is unique identifier of a room which object refers to.
Integer
rate_plan Rate Plan id
This is unique identifier of a rate plan which object refers to.
Integer
room_capacity Room capacity
Capacity for current room
Integer
bedding Bedding
Information about bedding configuration for current booking
Array
extra_bed_prices Extra bed prices
Information about extra bed price for current booking
Array
child_cot_prices Child cot prices
Information about child cot price for current booking
Array
existing_bed Existing bed
Information about location on existing bed for current booking
Integer
rate_plan_name Rate plan name
Name of booked rate plan
CharArray
min_stay_arrival Min stay arrival
Information about minimum stay on arrival in nights for current booking
Integer
min_stay_through Min stay through
Information about minimum stay through in nights for current booking
Integer
advance Advance
Integer
status Status
Status for current booking (Normal, Missed, Cancelled)
CharArray
allotment_type_per_day Allotment type per day
Information about allotment type per day. List contain info type of booking (fix or flex location) per day
Array
free_nights Free nights
Integer value indicates that each N-th night is free
Integer
price_per_day Price per day
Array of decimal values with two decimal places. Prices for each day of stay are in this array.
Array
rate_per_day Rate per day
Array of integer values.Rate plan for each day of stay are in this array.
Array
is_nightly Is nightly
Boolean
is_credit_card_required Is credit card required
Boolean flag. Said if that booking required credit card
Boolean
is_pre_pay Is pre pay
Boolean flag. Said if current booking booked on pre pay mode
Boolean
payment_error Payment error
Indicates if hotel had problems processing credit card
Boolean
payment_error_reason Payment error reason
Detailed payment error reason.
ChoiceFields
payment_is_cancelable Payment is cancelable
Indicates if booking can be cancelled by hotel manager
Boolean
payment_is_modifiable Payment is modifiable
Indicates if hotel manager is able to report payment error
Boolean
order_id Order id
Order id for booking. Every booking is a part of the order
CharArray
is_multibooking Is multibooking
Indicates if the booking is multybooking. If booking is multybooking there is at least one more booking with same order id
Boolean
guests Guests
List of guest names
CharArray
currency Currency
Currency code. Indicate the currency in which the booking was exposed
CharArray
action_description Action description
Action that initiated push notification
ChoiceFields

Test notifications

Notification sent Error occured