Properties

In this section we will see how to add, remove, update and get information about your properties.

Get the list of your properties

URL: https://api.bookingbnb.com/xrws/GetProperties/

To retrieve the list of your properties, use the following function:

GetProperties(user, password, token)

The arguments user and password are the credentials that a partner uses to enter the BookingBnb Control Panel. The argument token is the one our partners acquire when they register to our system.

Here is an example of how your code should be:


/** java /*	
public String GetProperties(String username, String password, String token, Int propertyID) throws Exception {
  Vector params = new Vector();
  params.addElement(username);
  params.addElement(password);
  params.addElement(token);
  Object[] objects = (Object[]) xmlRpcClient.execute(config, "GetProperties", params);
  return (String) objects[1];
}

/* php */
<?php
include("xmlrpc.inc");
$server = new xmlrpc_client($url);
$args = array(
	new xmlrpcval($user, 'string'), 
	new xmlrpcval($pass, 'string'), 
	new xmlrpcval($token, 'string')
);
$message = new xmlrpcmsg('xrws.GetProperties', $args);
$result = $server->send($message);
$struct = $result->value();
}
?>

This function returns a list of properties, each one being represented by a <tag>value</tag> structure. This is an example:


<properties>
	<property>
		<id>31129</id>
		<name>Ocean Villa</name>
		<type>Villa</type>
		<coordinates>45.246776, -13.483807</coordinates>
		<address>14 Ocean View Road, Castlester UZ39 3VH, United Kingdom</address>
	</property>
	<property>
		<id>42687</id>
		<name>Emerald Hotel</name>
		<type>Hotel</type>
		<coordinates>29.068437, -81.274836</coordinates>
		<address>180 Color Road, New Beach, FL 32168, United States</address>
	</property>
</properties>

Create new properties

URL: https://api.bookingbnb.com/xrws/CreateProperties/

As a partner, you can add new properties to the BookingBnb system. Adding properties to our system is a procedure made up of some functions:

CreateProperties(user, password, token, properties)

CreateUnit
CreateSeason
CreateRate

Here is an example of how your code should be:


/** java /*	
public String CreateProperties(String username, String password, String token, Int propertyID, String properties) throws Exception {
  Vector params = new Vector();
  params.addElement(username);
  params.addElement(password);
  params.addElement(token);
  params.addElement(propertyID);
  params.addElement(properties);
  Object[] objects = (Object[]) xmlRpcClient.execute(config, "CreateProperties", params);
  return (String) objects[1];
}

/* php */
<?php
include("xmlrpc.inc");
$server = new xmlrpc_client($url);
$args = array(
	new xmlrpcval($user, 'string'), 
	new xmlrpcval($pass, 'string'), 
	new xmlrpcval($token, 'string'), 
	new xmlrpcval($propertyID, 'int'),
	new xmlrpcval($seasons, 'properties')
);
$message = new xmlrpcmsg('xrws.CreateProperties', $args);
$result = $server->send($message);
$struct = $result->value();
?>

How to correctly encode the properties

Given a multi-dimensional array of properties, that your system will produce, you must include the following parameter:

Key Type Value
name string The name of the property
type string The type of property: Hotel || Bed and Breakfast || Villa || Apartment
rooms int The number of total rooms in the property
bathrooms int The number of total bathrooms in the property
coordinates string The coordinates of the property (format: 00.000000, 00.000000)
countryCode string The ISO 3166-1 alpha-2 country code
address string The full address of the property
city string The city where the property is located
descrEN string A complete description of the property in English
guests int The total number of guests who can be accommodated at the property

Your properties string must look like this:


[property]
	[name]Ocean Villa[/name]";
	[type]Villa[/type]";
	[rooms]5[/rooms]";
	[bathrooms]6[/bathrooms]";
	[coordinates]45.246776, -13.483807[/coordinates]";
	[countryCode]GB[/countryCode]";
	[address]14 Ocean View Road, Castlester UZ39 3VH, United Kingdom[/address]";
	[city]Castlester[/city]";
	[descrEN]This is the description of the Villa.[/descrEN]";
	[guests]10[/guests]";
	[telephone]00441234567890[/telephone]";
	[email]email@example.co.uk[/email]";
	[website]example.co.uk[/website]";
[/property]";

We also support optional parameters:

Key Type Value
stars (NULL) int If type is Hotel: the number of stars
descrIT (NULL) string A complete description of the property in Italian
descrFR (NULL) string A complete description of the property in French
descrDE (NULL) string A complete description of the property in German
descrES (NULL) string A complete description of the property in Spanish
descrPT (NULL) string A complete description of the property in Portuguese
descrJP (NULL) string A complete description of the property in Japanese
descrCN (NULL) string A complete description of the property in Simplified Chinese

The function returns a status code, it can be ok or ko.
To retrieve the property identifier (propertyID), please, call the GetProperties function. Once you get the propertyID, you can call the other functions to correctly complete the creation process.

Update amenities

URL: https://api.bookingbnb.com/xrws/UpdateAmenties/

You can update the list of amenities launching the UpdateAmenties function.
For each Key, the Value can be ok (if it's provided) or ko (if it's not provided).
We currently support the following amenities (and more are coming soon):

Key Amenity
airc Air-conditioning
pool Private swimming pool
wifi Internet Wi-Fi
dish Dishwasher
park Parking
kitc Kitchen
frid Fridge
fans Fans
line Linen and towels
terr Terrace
seaa Direct sea access
seav Sea view
brea Breakfast
wash Washing machine

Update property data

URL: https://api.bookingbnb.com/xrws/UpdateProperty/

To update data about a property, please, call the following function:

UpdateProperty(user, password, token, propertyID, property)

Here is an example of how your code should be:


/** java /*	
public String UpdateProperty(String username, String password, String token, Int propertyID, String property) throws Exception {
  Vector params = new Vector();
  params.addElement(username);
  params.addElement(password);
  params.addElement(token);
  params.addElement(propertyID);
  params.addElement(property);
  Object[] objects = (Object[]) xmlRpcClient.execute(config, "UpdateProperty", params);
  return (String) objects[1];
}

/* php */
<?php
include("xmlrpc.inc");
$server = new xmlrpc_client($url);
$args = array(
	new xmlrpcval($user, 'string'), 
	new xmlrpcval($pass, 'string'), 
	new xmlrpcval($token, 'string'), 
	new xmlrpcval($propertyID, 'int'),
	new xmlrpcval($property, 'string')
);
$message = new xmlrpcmsg('xrws.UpdateProperty', $args);
$result = $server->send($message);
$struct = $result->value();
?>

How to correctly encode the property data

Given an array of data about a property, that your system will produce, you can include the same parameters used to create a property.
This is an example:


  $property[rooms]=20;
  $property[bathrooms]=21;
  $property[guests]=50;
  $property[descrEN]="This is a new description.";

Your rates string must look like this:


[property]
	[rooms]20[/rooms]
	[bathrooms]21[/bathrooms]
	[guests]50[/guests]
	[descrEN]This is a new description.[/descrEN]
[/property]

The function returns a status code, it can be ok or ko.

NEW Let us pull your properties

We are proud to announce a new feature in our API, in agreement with our choice to allow agencies, channel managers and booking engines to get direct bookings through our platform.

If you have a property management system, you can now guarantee to all of your customers a new booking source where fees are very low compared to the OTAs, up to the 5% on each booking. We provide you a partner commission.

To enable this profitable feature, please, get in touch with us right now: visit our partners section or send an email to partners@bookingbnb.com.