🖋️
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
  • Pull Reservation
  • Fields
  • Push Reservation
  • Reservation Confirmation

Was this helpful?

Reservations

API methods to work with Reservations

BNL api have two different methods to work with Reservations, such as Pull Reservation & Push Reservation.

Pull Reservation

Pms send a request on bnl api file then bnl api file return reservations response.

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":"reservation",
   "property_id":"57"
}
{
   "data":[
      {
         "id":"1591893",
         "type":"booking",
         "attributes":{
            "amount":"0.00",
            "arrival_date":"2021-07-27",
            "booking_id":"1591893",
            "currency":"IDR",
            "departure_date":"2021-07-28",
            "guarantee":null,
            "inserted_at":"2020-02-14 18:33:01",
            "notes":"No Smoking  ",
            "ota_name":"TRA",
            "status":"cancelled",
            "ota_reservation_code":"1000789000-10000186:RETAIL",
            "payment_collect":"ota",
            "payment_type":"",
            "property_id":"57",
            "customer":{
               "address":"Lucknow",
               "city":"",
               "country":"",
               "mail":"Gomti Nagar",
               "name":"asfdasdfas",
               "phone":"35646757",
               "surname":"dfasdfasdf",
               "zip":""
            },
            "occupancy":{
               "adults":1,
               "children":0,
               "infants":0
            },
            "rooms":[
               {
                  "amount":"0.00",
                  "checkin_date":"2021-07-27",
                  "checkout_date":"2021-07-28",
                  "days":{
                     "2021-07-27":0
                  },
                  "occupancy":{
                     "adults":1,
                     "children":0,
                     "infants":0
                  },
                  "rate_plan_id":"45677",
                  "rate_plan_name":"Test room",
                  "room_type_id":"12223",
                  "room_type_name":"Test Rate"
               },
               {
                  "amount":"0.00",
                  "checkin_date":"2021-07-27",
                  "checkout_date":"2021-07-28",
                  "days":{
                     "2021-07-27":0
                  },
                  "occupancy":{
                     "adults":1,
                     "children":0,
                     "infants":0
                  },
                  "rate_plan_id":"45677",
                  "rate_plan_name":"Test room",
                  "room_type_id":"12223",
                  "room_type_name":"Test Rate"
               }
            ]
         }
      },
      {
         "id":"1719597",
         "type":"booking",
         "attributes":{
            "amount":"0.00",
            "arrival_date":"2021-07-27",
            "booking_id":"1719597",
            "currency":"IDR",
            "departure_date":"2021-07-28",
            "guarantee":null,
            "inserted_at":"2020-04-03 17:49:46",
            "notes":"Nice villa  ",
            "ota_name":"TRA",
            "status":"modified",
            "ota_reservation_code":"TVLK1000200027-10000186:PRIVATESALE",
            "payment_collect":"ota",
            "payment_type":"",
            "property_id":"57",
            "customer":{
               "address":"N\/A",
               "city":"",
               "country":"",
               "mail":"erainfotech@gmail.com",
               "name":"E2x philippe",
               "phone":"0908978",
               "surname":"Dixit",
               "zip":""
            },
            "occupancy":{
               "adults":1,
               "children":0,
               "infants":0
            },
            "rooms":[
               {
                  "amount":"0.00",
                  "checkin_date":"2021-07-27",
                  "checkout_date":"2021-07-28",
                  "days":{
                     "2021-07-27":"648000"
                  },
                  "occupancy":{
                     "adults":1,
                     "children":0,
                     "infants":0
                  },
                  "rate_plan_id":"45677",
                  "rate_plan_name":"Test room",
                  "room_type_id":"12223",
                  "room_type_name":"Test Rate"
               },
               {
                  "amount":"0.00",
                  "checkin_date":"2021-07-27",
                  "checkout_date":"2021-07-28",
                  "days":{
                     "2021-07-27":"648000"
                  },
                  "occupancy":{
                     "adults":1,
                     "children":0,
                     "infants":0
                  },
                  "rate_plan_id":"45677",
                  "rate_plan_name":"Test room",
                  "room_type_id":"12223",
                  "room_type_name":"Test Rate"
               }
            ]
         }
      }
   ]
}

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"
   }
}

Reservation Disable Error Response

{
   "errors":{
      "code":"reservation_disabled",
      "title":"Reservation is disabled for this hotel, Please contact to suport for enable."
   }
}

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] reservation

property_id ID of associated Property.

id Unique Booking id identification record at Bnl internal system

ota_reservation_code Booking number at platform, where guest create booking. Unique per booking message.

ota_name Name of OTA where booking was originally created

status Status of Booking Revision, can be one of three values: new, modified, cancelled.

Rooms List of Booking Room objects.

rate_plan_id Associated Rate Plan identification record.

room_type_id Associated Room Type identification record.

Customer Object with information about Customer.

Occupancy Object with information about total Booking Occupancy, provide three keys: adults, children and infants.

arrival_date Arrival Date represented as string with date in ISO 8601 format by mask YYYY-MM-DD.

departure_date Departure Date represented as string with date in ISO 8601 format by mask YYYY-MM-DD.

amount Total booking amount.

Currency Booking currency code.

notes Customer comments for booking.

payment_type Information about where payment should be collected. Can be hotel collect (pay at hotel),channel collect (Pay at booking), and null if payment type is not specified.

inserted_at Timestamp, when Booking was received at bnl.

days Price per night.

Push Reservation

In push reservation BNl api send reservation automatic to the pms without wait any request.

Reservation response format is same as pull reservation response format. When BNL api post reservations to the pms then pms return a confirmation response.

{
   "data":[
      {
         "id":"1591893",
         "type":"booking",
         "attributes":{
            "amount":"0.00",
            "arrival_date":"2021-07-27",
            "booking_id":"1591893",
            "currency":"IDR",
            "departure_date":"2021-07-28",
            "guarantee":null,
            "inserted_at":"2020-02-14 18:33:01",
            "notes":"No Smoking  ",
            "ota_name":"TRA",
            "status":"cancelled",
            "ota_reservation_code":"1000789000-10000186:RETAIL",
            "payment_collect":"ota",
            "payment_type":"",
            "property_id":"57",
            "customer":{
               "address":"Lucknow",
               "city":"",
               "country":"",
               "mail":"Gomti Nagar",
               "name":"asfdasdfas",
               "phone":"35646757",
               "surname":"dfasdfasdf",
               "zip":""
            },
            "occupancy":{
               "adults":1,
               "children":0,
               "infants":0
            },
            "rooms":[
               {
                  "amount":"0.00",
                  "checkin_date":"2021-07-27",
                  "checkout_date":"2021-07-28",
                  "days":{
                     "2021-07-27":0
                  },
                  "occupancy":{
                     "adults":1,
                     "children":0,
                     "infants":0
                  },
                  "rate_plan_id":"45677",
                  "rate_plan_name":"Test room",
                  "room_type_id":"12223",
                  "room_type_name":"Test Rate"
               },
               {
                  "amount":"0.00",
                  "checkin_date":"2021-07-27",
                  "checkout_date":"2021-07-28",
                  "days":{
                     "2021-07-27":0
                  },
                  "occupancy":{
                     "adults":1,
                     "children":0,
                     "infants":0
                  },
                  "rate_plan_id":"45677",
                  "rate_plan_name":"Test room",
                  "room_type_id":"12223",
                  "room_type_name":"Test Rate"
               }
            ]
         }
      },
      {
         "id":"1719597",
         "type":"booking",
         "attributes":{
            "amount":"0.00",
            "arrival_date":"2021-07-27",
            "booking_id":"1719597",
            "currency":"IDR",
            "departure_date":"2021-07-28",
            "guarantee":null,
            "inserted_at":"2020-04-03 17:49:46",
            "notes":"Nice villa  ",
            "ota_name":"TRA",
            "status":"modified",
            "ota_reservation_code":"TVLK1000200027-10000186:PRIVATESALE",
            "payment_collect":"ota",
            "payment_type":"",
            "property_id":"57",
            "customer":{
               "address":"N\/A",
               "city":"",
               "country":"",
               "mail":"erainfotech@gmail.com",
               "name":"E2x philippe",
               "phone":"0908978",
               "surname":"Dixit",
               "zip":""
            },
            "occupancy":{
               "adults":1,
               "children":0,
               "infants":0
            },
            "rooms":[
               {
                  "amount":"0.00",
                  "checkin_date":"2021-07-27",
                  "checkout_date":"2021-07-28",
                  "days":{
                     "2021-07-27":"648000"
                  },
                  "occupancy":{
                     "adults":1,
                     "children":0,
                     "infants":0
                  },
                  "rate_plan_id":"45677",
                  "rate_plan_name":"Test room",
                  "room_type_id":"12223",
                  "room_type_name":"Test Rate"
               },
               {
                  "amount":"0.00",
                  "checkin_date":"2021-07-27",
                  "checkout_date":"2021-07-28",
                  "days":{
                     "2021-07-27":"648000"
                  },
                  "occupancy":{
                     "adults":1,
                     "children":0,
                     "infants":0
                  },
                  "rate_plan_id":"45677",
                  "rate_plan_name":"Test room",
                  "room_type_id":"12223",
                  "room_type_name":"Test Rate"
               }
            ]
         }
      }
   ]
}

{
   "action":"confirmation",
   "property_id":"57",
   "data":[
      {
         "ota_reservation_code":"TT1577367381"
      },
      {
         "ota_reservation_code":"2844476"
      },
      {
         "ota_reservation_code":"15773673814TT"
      }
   ]
}

Reservation Confirmation

Reservation confirmation request pms send to bnl api.

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":"confirmation",
   "property_id":"57",
   "data":[
      {
         "ota_reservation_code":"TT1577367381"
      },
      {
         "ota_reservation_code":"2844476"
      },
      {
         "ota_reservation_code":"15773673814TT"
      }
   ]
}
{
   "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 Ota Reservation Code Error Response

{
   "errors":{
      "code":"invalid_ota_reservation_code",
      "title":"Invalid ota_reservation_code, please send an valid ota_reservation_code"
   }
}

Reservation Disable Error Response

{
   "errors":{
      "code":"reservation_disabled",
      "title":"Reservation is disabled for this hotel, Please contact to suport for enable."
   }
}

Invalid Property Id Error Response

{
   "errors":{
      "code":"invalid_property_id",
      "title":"property_id is not valid, please send an valid property_id"
   }
}
PreviousUpdate Price & RestrictionsNextSave Room

Last updated 1 year ago

Was this helpful?