REST API Method: bookings/fetch-details

Fetches the details of a booking. Requires the parameters specified below. Request must be a POST.

URL

http://api.bookingmarkets.com/bookings/fetch-details?api_key=your_key

Formats:

  • xml
  • json

HTTP Method(s):

  • POST
  • GET (maximum of 2048 characters) 

Requires Authentication:

true

API rate limited:

false

Parameters:

  • listing token="XXX". Required. Identifies the listing for which the booking is being fetched. Hosts can get the tokens for their listings by visiting the URL /tokens in any of the sites powered by the BookingMarkets Engine (for example: http://localo.com/tokens). For testing purposes you can use the listingtoken czY2YnRPa0JFOE9QTXJpVU9ma0dWQT09.
  • booking id="XXX". Required. Identifies the booking being fetched. You can get a list of confirmed bookings that haven't been fetched yet using the bookings/fetech-new-confirmed method.

Response

  • ok. The request was successfully processed.
    • timestamp. Timestamp of the transaction in UnixTime (GMT).
    • booking id. Identifies the booking being fetched.
      • arrival. Date of arrival, YYYY-MM-DD format.
      • departure. Date of departure, YYYY-MM-DD format.
      • numberofguestsNumber of guests for this booking. Includes both adults and children.
      • currency. The currency in which the booking was made following the ISO 4217 standard.
      • totalcost. The total price for all units for all nights combined for all guests. Includes all taxes, mandatory fees, and expected gratuity). Doesn't include deposit.
      • deposit. Security deposit refunded to the traveller after departure or when cancelling the booking.
      • advancedpayment. Portion of the totalcost to be paid in advanced for securing this booking.
      • hostremarks. Remarks regarding this booking supplied by the host.
      • guestremarks. Remarks regarding this booking supplied by the traveller.
      • guestname. Name of the guest as provided by the person that created the booking.
      • guestemail. Email address of the guest. The value will be empty if there isn't an available email address.
      • guestphonenumber. Phone number of the guest including country code.
      • status. 1 = Pending confirmation number. 2 = Confirmed. 3 = Cancelled by the BookingMarkets Engine. 4 = Cancelled by host.
      • confirmationnumber. Confirmation number provided by the lodging.  The value will be empty if a confirmation number wasn't provided (even if the booking has been confirmed).
      • unittype id. Multiple occurences possible. One entry for every guest unit booked. If the booking includes two or more guest units of the same type, identical ids will be returned.
        • namelatinchar.  The name of the unit type in latin characters.
        • namenonlatinchar. The name of the unit type in non-latin characters. Only available in listings from countries with official languages that use non-latin characters (for example: China). The value will be empty if there isn't a non-latin name.
  • error. The request wasn't successfully processed.
    • errorcode. Error code.
    • errormessage. Error message explaining the issue.

Examples

Request (XML):

http://api.bookingmarkets.com/bookings/fetch-details?api_key=your_key&xml=
<request>
     <listing token="czY2YnRPa0JFOE9QTXJpVU9ma0dWQT09"></listing>
     <booking id="2127"></booking>
</request>

Successful Response:

<?xml version="1.0" encoding="UTF-8"?>
<ok>
     <timestamp>1287186106</timestamp>
     <booking id=2127>
          <arrival>2011-07-31</arrival>
          <departure>2011-08-05></departure>
          <numberofguests>2</numberofguests>
          <currency>EUR</currency>
          <totalcost>5000.00</totalcost>
          <deposit>0.00</deposit>
          <advancedpayment>2500.00</advancedpayment>
          <hostremarks></hostremarks>
          <guestremarks>From this distant vantage point, the Earth might not seem of particular interest. But for us, it's different. Look again at that dot. That's here, that's home, that's us. On it everyone you love, everyone you know, everyone you ever heard of, every human being who ever was, lived out their lives. The aggregate of our joy and suffering, thousands of confident religions, ideologies, and economic doctrines, every hunter and forager, every hero and coward, every creator and destroyer of civilization, every king and peasant, every young couple in love, every mother and father, hopeful child, inventor and explorer, every teacher of morals, every corrupt politician, every "superstar," every "supreme leader," every saint and sinner in the history of our species lived there – on a mote of dust suspended in a sunbeam.</guestremarks>
          <guestname>Carl Sagan</guestname>
          <guestphonenumber>+1 6467553259</guestphonenumber>
          <status>2</status>
          <unittype id=24945>
               <namelatinchar>Chang Zheng 2F</namelatinchar>
               <namenonlatinchar>长征二号F火箭</namenonlatinchar>
          </unittype>
          <unittype id=24945>
               <namelatinchar>Chang Zheng 2F</namelatinchar>
               <namenonlatinchar>长征二号F火箭</namenonlatinchar>
          </unittype>
     </booking>
</ok>

Failed Response:

<?xml version="1.0" encoding="UTF-8"?>
<error>
     <errorcode>0300a</errorcode>
     <errormessage>The booking id is not valid</errormessage>
</error>

Sandbox

You can test your application using the following test listing:

  • Public listing: BookingMarkets APIs Test Listing in LetMeGo.
  • Listing token: czY2YnRPa0JFOE9QTXJpVU9ma0dWQT09
  • Booking id: 2127

Have questions or need help? We are eager to help. Contact us!

 


1 Comment

  1. Nirali Vora1 year ago

    Api key which you have given for our website it is shows error.

Please sign in to post a comment.