🖋️
Bookandlink json pms API
  • PMS Documentation
  • Authentication
  • Get Rooms
  • Update Availability
  • Update Price & Restrictions
  • Reservations
  • Save Room
  • Save Rate
Powered by GitBook
On this page

Was this helpful?

Update Availability

API methods to work with update availability

Update Availability for a specific Room Type and Date.

Header:

Authorization: Bearer [auth_token]

Example - Authorization: Bearer MjAyMS0wNy0xM1QxNDowNTo0OSswNzowMDYwZWQzYjRkNmIxNTU1Nw==

URL:

POST http://bookandlink.com/ota/ota_update/bnl/bnl_api.php?pms_name=[pms_name]

Query body (JSON):

{
   "action":"update_availability",
   "property_id":"57",
   "echo_token":"24325fdxhvv",
   "values":[
      {
         "availability":2,
         "room_type_id":"350",
         "date_from":"2021-07-25",
         "date_to":"2021-07-29"
      },
      {
         "availability":1,
         "room_type_id":"35054345y67",
         "date_from":"2021-07-30",
         "date_to":"2021-07-30"
      }
   ]
}

{
   "meta":{
      "message":"Success"
   }
}

Invalid Request Error Response

{
   "errors":{
      "code":"invalid_request",
      "title":"Invalid request json format, please send an valid json format"
   }
}

Unauthorized Ip Error Response

{
   "errors":{
      "code":"unauthorized_ip",
      "title":"Request IP is not configured for pms, Please contact to support for IP configuration."
   }
}

Invalid Pms Error Response

{
   "errors":{
      "code":"invalid_pms",
      "title":"Invalid pms name, please send an valid pms name"
   }
}

Invalid Date From Error Response

{
   "errors":{
      "code":"invalid_date_from",
      "title":"Invalid date_from format accepted only(yyyy-mm-dd) format."
   }
}
{
   "errors":{
      "code":"invalid_date_from",
      "title":"date_from must be greater than current date."
   }
}

Invalid Date To Error Response

{
   "errors":{
      "code":"invalid_date_to",
      "title":"Invalid date_to format accepted only(yyyy-mm-dd) format."
   }
}
{
   "errors":{
      "code":"invalid_date_to",
      "title":"date_to must be greater than current date."
   }
}

Invalid Room Type Id Error Response

{
   "errors":{
      "code":"invalid_room_type_id",
      "title":"room_type_id is not valid, please send an valid room_type_id."
   }
}

Invalid Availability Error Response

{
   "errors":{
      "code":"invalid_availability",
      "title":"Invalid availability value, please send an valid availability value."
   }
}

Fields

action [required] update_availability

echo_token [required] String value , Unique value for each request

property_id [required] Integer Value.

room_type_id [required] Integer Value. Only one room_type_id can be available into one request.

date_from [required] String with date in ISO 8601 format by mask YYYY-MM-DD. Start of applicable date range.date should not be greater than two year from current date.

date_to [required] String with date in ISO 8601 format by mask YYYY-MM-DD. End of applicable date range.date should not be greater than two year from current date.

availability [required] Non-negative Integer value.

PreviousGet RoomsNextUpdate Price & Restrictions

Last updated 1 year ago

Was this helpful?