🖋️
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 Price & Restrictions

API methods to work with Update Price & Restrictions

Update Rate & Restrictions for specific Rate Plans and Dates.

Header:

Authorization: Bearer [auth_token]

Example - Authorization: Bearer MjAyMS0wNy0xM1QxNDowNTo0

URL:

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

Query body (JSON):

{
   "action":"update_rates_and_restrictions",
   "property_id":"57",
   "echo_token":"dkjshuig7",
   "values":[
      {
         "rate":330.00,
         "stop_sell":0,
         "min_stay":1,
         "closed_to_arrival":0,
         "closed_to_departure":0,
         "room_type_id":"350",
         "rate_plan_id":"624",
         "date_from":"2021-07-25",
         "date_to":"2021-07-29"
      },
      {
         "rate":350.00,
         "stop_sell":0,
         "min_stay":2,
         "closed_to_arrival":1,
         "closed_to_departure":1,
         "room_type_id":"350",
         "rate_plan_id":"624",
         "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 Rate Error Response

{
   "errors":{
      "code":"invalid_rate",
      "title":"Invalid rate value, please send an valid rate value."
   }
}

Invalid Min Stay Error Response

{
   "errors":{
      "code":"invalid_min_stay",
      "title":"Invalid min_stay value, please send an valid min_stay value."
   }
}

Invalid Close To Arrival Error Response

{
   "errors":{
      "code":"invalid_closed_to_arrival",
      "title":"Invalid closed_to_arrival value, accepted only (0, 1) value."
   }
}

Invalid Close To Departure Error Response

{
   "errors":{
      "code":"invalid_closed_to_departure",
      "title":"Invalid closed_to_departure value, accepted only (0, 1) value."
   }
}

Invalid Stopsell Error Response

{
   "errors":{
      "code":"invalid_stop_sell",
      "title":"Invalid stop_sell value, accepted only (0, 1) value."
   }
}

Invalid Rateplan Id Error Response

{
   "errors":{
      "code":"invalid_rate_plan_id",
      "title":"rate_plan_id is not exist, please send an valid rate_plan_id."
   }
}

Invalid Property Id Error Response

{
   "errors":{
      "code":"invalid_property_id",
      "title":"property_id is not valid, please send an valid property_id."
   }
}

Fields

action [required] update_rates_and_restriction

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.

rate [optional] Positive Integer or decimal value. The value should be greater than 0.

min_stay [optional] Positive Integer value.

closed_to_arrival [optional] Boolean value. Also, our API allow pass 0 or 1 as Boolean representation.

closed_to_departure [optional] Boolean value. Also, our API allow pass 0 or 1 as Boolean representation.

stop_sell [optional] Boolean value. Also, our API allow pass 0 or 1 as Boolean representation.

PreviousUpdate AvailabilityNextReservations

Last updated 3 years ago

Was this helpful?