New API available

Great news, we just opened a new world of possibilities based on your favorite vacation rental platform :)

Check the latest BookingSync API

The API described bellow will be retired May 1st, 2016

Bookings

Private   Deprecated

Show

GET /bookings/#{id}.xml

Returns a single booking identified by its integer ID. Even canceled bookings can be returned.

Response

Status: 200 OK

<?xml version="1.0" encoding="UTF-8"?>
<booking>
  <id type="integer">ID</id>
  <start-at type="dateTime">2018-01-18T16:00:00Z</start-at>
  <end-at type="dateTime">2018-01-21T10:00:00Z</end-at>
  <booked type="boolean">true</booked>
  <unavailable type="boolean">false</unavailable>
  <tentative-expires-at type="dateTime" nil="true"/>
  <rental-id type="integer">RENTAL_ID</rental-id>
  <client-id type="integer">CLIENT_ID</client-id>
  <discount>10%</discount>
  <notes nil="true"/>
  <adults type="integer">8</adults>
  <children type="integer" nil="true"/>
  <account-id type="integer">ACCOUNT_ID</account-id>
  <created-at type="dateTime">2018-01-17T10:00:00Z</created-at>
  <updated-at type="dateTime">2018-01-17T11:00:00Z</updated-at>
  <canceled-at type="dateTime" nil="true"/>
  <currency>EUR</currency>
  <damage-deposit type="decimal">0.0</damage-deposit>
  <source-id type="integer" nil="true"/>
  <reference></reference>
  <initial-price type="integer">5000</initial-price>
  <final-price type="integer">4500</final-price>
  <downpayment type="integer">1500</downpayment>
  <bookings_tags></bookings_tags>
</booking>

List all

GET /bookings.xml

Returns a list of all bookings starting after now. A default of maximum 50 bookings is returned per page, ordered by starting date.

Parameters

  • from. Optional.Retrieves all bookings ending after the specified date. (format: yyyymmdd and in UTC, default from now)
    • Example: https://www.bookingsync.com/bookings.xml?from=20180117
  • status. Optional.
    • booked. Retrieves only booked periods.
    • tentative. Retrieves only tentative bookings.
    • unavailable. Retrieves only unavailable periods.
    • Example: https://www.bookingsync.com/bookings.xml?status=tentative
    • Tip: You can also scope more status at once by joining them with a comma : status=booked,unavailable
  • include_canceled. Optional. Include canceled bookings? (disabled by default)
    • Example: https://www.bookingsync.com/bookings.xml?include_canceled=1
  • page. Optional. Specifies the page of bookings to retrieve. (default: 1)
    • Example: https://www.bookingsync.com/bookings.xml?page=2
  • per_page. Optional. Specifies the maximum number of bookings to return per page. (default: 50, maximum: 500)
    • Example: https://www.bookingsync.com/bookings.xml?per_page=500

Response

Status: 200 OK

<?xml version="1.0" encoding="UTF-8"?>
<bookings type="array">
  <booking>
    ...
  </booking>
  <booking>
    ...
  </booking>
  ...
</bookings>

List all within rental

GET /rentals/#{rental-id}/bookings.xml

Returns a list of all bookings made for the rental specified by the integer RENTAL_ID.

Parameters

Use the same parameters as "List all".

Response

Status: 200 OK

<?xml version="1.0" encoding="UTF-8"?>
<bookings type="array">
  <booking>
    ...
  </booking>
  <booking>
    ...
  </booking>
  ...
</bookings>

List all within client

GET /clients/#{client-id}/bookings.xml

Returns a list of all bookings made by the client specified by the integer CLIENT_ID.

Parameters

Use the same parameters as "List all".

Response

Status: 200 OK

<?xml version="1.0" encoding="UTF-8"?>
<bookings type="array">
  <booking>
    ...
  </booking>
  <booking>
    ...
  </booking>
  ...
</bookings>

Create

POST /bookings.xml

Creates a new booking. The XML for the new booking is returned on a successful request with the timestamps recorded.

If the account doesn’t allow for more bookings to be created, a “507 Insufficient Storage” response will be returned.

Request

<?xml version="1.0" encoding="UTF-8"?>
<booking>
  <tentative-expires-at type="datetime">2018-01-20T13:00:00Z</tentative-expires-at>
  <client-id type="integer">1</client-id>
  <end-at type="datetime">2018-04-21T10:00:00Z</end-at>
  <final-price type="integer">3000</final-price>
  <rental-id type="integer">1</rental-id>
  <start-at type="datetime">2018-04-18T16:00:00Z</start-at>
</booking>

Response

Status: 201 Created
Location: https://www.bookingsync.com/bookings/#{new-booking-id}.xml

<?xml version="1.0" encoding="UTF-8"?>
<booking>
  <account-id type="integer">1</account-id>
  <adults type="integer" nil="true"></adults>
  <booked type="boolean">false</booked>
  <canceled-at type="datetime" nil="true"></canceled-at>
  <children type="integer" nil="true"></children>
  <client-id type="integer">1</client-id>
  <created-at type="datetime">2018-01-17T13:11:09Z</created-at>
  <currency>&#8364;</currency>
  <downpayment type="integer" nil="true"></downpayment>
  <discount nil="true"></discount>
  <end-at type="datetime">2018-04-21T10:00:00Z</end-at>
  <final-price type="integer">3000</final-price>
  <id type="integer">1</id>
  <initial-price type="integer" nil="true"></initial-price>
  <notes nil="true"></notes>
  <rental-id type="integer">1</rental-id>
  <start-at type="datetime">2018-04-18T16:00:00Z</start-at>
  <tentative-expires-at type="datetime">2018-01-20T13:00:00Z</tentative-expires-at>
  <unavailable type="boolean">false</unavailable>
  <updated-at type="datetime">2018-01-17T13:11:09Z</updated-at>
  <source-id type="integer" nil="true"></source-id>
</booking>

Update

PUT /bookings/#{id}.xml

Updates an existing booking with new details from the submitted XML. The example below will convert a booking with the status “tentative” to “booked” and therefore confirm this reservation.

Request

<?xml version="1.0" encoding="UTF-8"?>
<booking>
  <tentative-expires-at type="datetime" nil="true"/>
  <booked type="boolean">true</booked>
</booking>

Response

Status: 200 OK

Cancel

DELETE /bookings/#{id}.xml

Cancel the booking identified by its integer ID.

Response

Status: 200 OK

Restore

PUT /bookings/#{id}/restore.xml

Restore the previously canceled booking identified by its integer ID.

Response

Status: 200 OK