API Documentation

Index

Getting Started

The TrustedStays API enables you to integrate your existing software with the TrustedStays platform. You can use it to manage and maintain your property listings, pricing and availability on TrustedStays. You can also use it to retrieve booking data from TrustedStays enabling you to keep your other software up to date.

Bearer Tokens

In order to communicate with the TrustedStays server you must first generate a bearer token for your account. To do this, log into your account and select "API" from the main menu. You should then click the "issue new token" button.

Make sure that you store the token securely (as you would your username and password) as it will grant the bearer full access to your account. If lost, you will not be able to recover it, but you will be able to revoke it and generate a new one if neccessary.

Making a connection

To connect to the API your client will need to pass your token in the Authorization header when making requests as follows:

Authorization: Bearer #yourTokenGoesHere

Responses

If you make a request to a valid API endpoint then you will receive an html response, with an appropriate status code, and a json object in the body. The content will vary depending on the endpoint but will always inlcude a boolean value in the "ok" parameter to specify success of failure.

If the request fails then the response will include some contextual information to help you understand the issue.

Webhooks

TrustedStays uses a webhook system to keep your software informed when bookings are created or updated. To set this up, visit the API section of your dashboard and specify a publically accessible webhook URL that can receive an http POST request.

Whenever a booking is created or updated we will post the ID and status of the booking to the supplied URL. We do not send sensitive data in webhook requests so on receipt your system may then trigger an API call in order to retrieve the up to date booking information securely.

Note that while webhooks are a useful tool for keeping your system as up to date as possible, there is always potential for networking issues to prevent delivery of a given webhook request. For this reason we recommend setting up a cron routine to pull booking data from our system once an hour as a fail safe.

Logs

You will be able to see a list of the most recent requests received by our server, and webhook calls sent be our server, in the API section of your dashboard. If you click on a request you will be able to see exactly what data was received in the request, as well as the respoinse that was returned.

Example Implementations

Making a connection

We recommend writing a generic function for making connections to the API. Here is an example using Curl:

function trustedStaysRequest(string $url, string $method, ?array $data = null) {
    //you may wish to consider storing this in an environment file
    $token = "zkGy4cwiTBnTqrGPaoebk8iUZskGNyIApNxiHgQa";

    $headers = array(
        "Accept: application/json",
        "Authorization: Bearer {$token}",
        'Content-Type:application/json',
    );

    $curl = curl_init();
    if($method == 'post'){
        curl_setopt($curl, CURLOPT_POST, true);
        curl_setopt($curl, CURLOPT_POSTFIELDS, json_encode($data));
    }
    curl_setopt($curl, CURLOPT_HTTPHEADER, $headers);
    curl_setopt($curl, CURLOPT_URL, $url);
    curl_setopt($curl, CURLOPT_RETURNTRANSFER, true);
    curl_setopt($curl, CURLOPT_VERBOSE, true);

    $response = curl_exec($curl);
    if(!$response){
        error_log(curl_error($curl));
        return;
    }

    $returnedData = json_decode($response,true);

    if($returnedData['ok'] ?? false){
        //successful request
        return $returnedData;
    } else {
        //something went wrong
        error_log($returnedData['message'] ?? "No message"); // you should have a message parameter summarising the issue
        error_log(print_r($returnedData['data'] ?? null, true)); //and a data parameter providing more context
        return false;
    }

    curl_close($curl);
}
        

Creating a property


//whatever method is required to load the property that you want to push to TrustedStays
$yourProperty = yourGetPropertyMethod($yourPropertyId);

$createPropertyUrl = "https://www.trustedstays.co.uk/api/v1/property";

// in practice, you would populate this array from the the $yourProperty variable
$property = [
    'title' => 'Luxury apartment in the heart of Kensington',
    'status' => 'active',
    'max_guests' => 3,
    'availability_mode' => 'api',
    'price_mode' => 'api',
    'num_bedrooms' => 2,
    'beds' => [
        [
            'room_type' => 'bedroom',
            'room_number' => 1,
            'amenity_id' => 61, //double bed
        ],
        [
            'room_type' => 'bedroom',
            'room_number' => 2,
            'amenity_id' => 323, //single bed
        ],
    ]
];

$data = trustedStaysRequest($createPropertyUrl,'post',$property);
if($data){
    //the property has been successfully created
    //update your local property record with the trustedstays ID for future use
    $yourProperty->trustedstays_id = $data['data']['id'];
    $yourProperty->save();
} else {
    //handle error
}
        

Updating a property


// this assumes that you have already created your property on TrustedStays as above.

//whatever method is required to load the property that you want to push to TrustedStays
$yourProperty = yourGetPropertyMethod($yourPropertyId);

//build the url using the ID you saved earlier
$updatePropertyUrl = "https://www.trustedstays.co.uk/api/v1/property/".$yourProperty->trustedstays_id;

// in practice, you would populate this array from the the $yourProperty variable
$propertyUpdate = [
    'address_line1' => "1 Example Street",
    'city' => "Exampleville",
    'postcode' => "EX43PL",
    'latitude' => 51.1234567,
    'longitude' => 01.1234567,
];

$data = trustedStaysRequest($createPropertyUrl,'post',$property);

        

Pushing your price and availability details

If you are using the API to specify pricing and availability then once you have created a property you will need to push a full calendar of dates. We ask that you keep at least 1 year of dates on our system at all times but you may supply data for up to 3 years in the future.


//whatever method is required to load the property that you want to push to TrustedStays
$yourProperty = yourGetPropertyMethod($yourPropertyId);

$calendarUrl = "https://www.trustedstays.co.uk/api/v1/calendar";

// in practice, you would populate this array from your locally stored availability and pricing data
$propertyDates = [
    properties => [
        property_id => $yourProperty->trustedstays_id,
        entries => [
            [
                "date" : "2023-11-01",
                "availability" :"available",
                "price" : 12500
            ],
            [
                "date" : "2023-11-02",
                "availability" :"unavailable",
                "price" : 12500
            ],
            [
                "date" : "2023-11-03",
                "availability" :"available",
                "price" : 14500
            ],
            // ... and so on, for at least 1 year.
        ]

    ]
];

$data = trustedStaysRequest($calendarUrl,'post',$propertyDates);

        

Note that it is possible to supply this data for more than 1 property at a time. It is advisable to push a day's worth of new calendar data into the system for each passing day. You can do this for all of your properties in a single call using a pattern like this:


//whatever method is required to load your complete list of properties
$yourProperties = yourGetAllPropertyMethod();

$calendarUrl = "https://www.trustedstays.co.uk/api/v1/calendar";

$propertyDates = [];
$propertyDates['properties'] = array_map(function($property){
    return [
        property_id => $property->trustedstays_id,
        entries => [
            [
                date => date('Y-m-d', strtotime('+2 years')),
                availability => 'available',
                price => $property->yourGetPriceInPenceMethod(),
            ]
        ]
    ];
}, $yourProperties);

$data = trustedStaysRequest($calendarUrl,'post',$propertyDates);

        

Pulling booking data from TrustedStays

Here we will use the TrustedStays webhook system in order to collect a new booking as soon as it is confirmed. The trustedStays Webhook function demonstrated here would need to be called from the URL that you supply as your Webhook URL in the TrustedStays API admin panel.

We have also included a method for syncing all future bookings, this should run on a cron job in order to ensure your database is kept reasonably up to date, even if a webhook should fail.


protected function syncBookingFromTrustedStays($trustedStaysId) {
    $bookingUrl = "https://www.trustedstays.co.uk/api/v1/booking/".$trustedStaysId;
    $tsBooking = trustedStaysRequest($bookingUrl,'get');
    if($tsBooking){
        // collected successfully.
        // you should check your database to see if you already have $tsBooking['data']['id'].
        // if you already have this booking in your database you should update it, otherwise you can assume it is a new booking and create it
    } else {
        // request failed. Handle the error
    }
}

public function trustedStaysWebhook($request) {
    switch($request->type){
        case 'booking' :
            $this->syncBookingFromTrustedStays($request->id)
        default:
            //currently only bookings are supported
    }
}


public function syncFutureBookingsFromTrustedStays() {
    $bookingUrl = "https://www.trustedstays.co.uk/api/v1/booking?check_out_after=".date('Y-m-d');
    $tsBookings = trustedStaysRequest($bookingUrl,'get');
    if($tsBookings){
        // collected successfully.
        foreach($tsBookings as $tsBooking){
            // you should check your database to see if you already have $tsBooking['data']['id'].
            // if you already have this booking in your database you should update it, otherwise you can assume it is a new booking and create it
        }
    } else {
        // request failed. Handle the error
    }
}
        

Resources

Bookings

Endpoint: List Bookings

Method URL
GET www.trustedstays.co.uk/api/v1/booking
Request
Param Type Required Description Example
updated_before String False Get only bookings that were created or updated before or at the given date time (Y-m-d H:i:s). "2021-11-03 12:32:00"
updated_after String False Get only bookings that were created or updated after or at the given date time (Y-m-d H:i:s). "2021-11-03 12:32:00"
booked_to String False Get only bookings that were confirmed before or on the given date. "2021-11-03"
booked_from String False Get only bookings that were confirmed after or on the given date. "2021-11-03"
booked_to String False Get only bookings that were confirmed before or on the given date. "2021-11-03"
check_in_before String False Get only bookings for which check in is before or on the given date. "2021-11-03"
check_in_after String False Get only bookings for which check in is before or on the given date. "2021-11-03"
check_out_before String False Get only bookings for which check out is before or on the given date. "2021-11-03"
check_out_after String False Get only bookings for which check out is before or on the given date. "2021-11-03"
property_id Integer False Get only bookings for a specific property. 123

Endpoint: Get Booking

Method URL
GET www.trustedstays.co.uk/api/v1/booking/{bookingId}

Attachments

Endpoint: List Attachments

Method URL
GET www.trustedstays.co.uk/api/v1/attachment
Request
Param Type Required Description Example
property_id Integer False Get only attachments associated with a specific property. 123

Endpoint: Get Attachment

Method URL
GET www.trustedstays.co.uk/api/v1/attachment/{attachmentId}

Endpoint: Create Attachment

Method URL
POST www.trustedstays.co.uk/api/v1/attachment
Request
Param Type Required Description Example
file File True A file with one of the following mime types: jpg, jpeg, png, pdf
title String True The name of the image. "1 Example Gardens, Exterior"
property_id Integer True The ID of the image to which the image will be attached. 123
image_type_id Integer True The ID representing the type of image.
Allowed Values

There are too many options to list here. Use the download link below

Download the list
4

Contacts

Endpoint: List Contacts

Method URL
GET www.trustedstays.co.uk/api/v1/contact
Request
Param Type Required Description Example

Endpoint: Get Contact

Method URL
GET www.trustedstays.co.uk/api/v1/contact/{contactId}

Endpoint: Create Contact

Method URL
POST www.trustedstays.co.uk/api/v1/contact
Request
Param Type Required Description Example
first_name String True First name of contact.
last_name String True Las name of contact.
email String True The email address of the contact.
phone String False Main phone number for the contact.
mobile String False Mobile number if different from main phone number.
job_title String False Job title / position within the company

Endpoint: Update Contact

Method URL
POST www.trustedstays.co.uk/api/v1/contact/{contactId}
Request
Param Type Required Description Example
first_name String True First name of contact.
last_name String True Las name of contact.
email String True The email address of the contact.
phone String False Main phone number for the contact.
mobile String False Mobile number if different from main phone number.
job_title String False Job title / position within the company

Properties

Endpoint: List Properties

Method URL
GET www.trustedstays.co.uk/api/v1/property

Endpoint: Get Property

Method URL
GET www.trustedstays.co.uk/api/v1/property/{propertyId}

Endpoint: Create Property

Method URL
POST www.trustedstays.co.uk/api/v1/property
Request
Param Type Required Description Example
title String True The display name for the property. Used in public listings "Luxury apartment in the heart of Kensington"
status String True One of: 'active' (listed publicly), 'inactive' (temporarily off sale), 'archived' 'permenantly off sale) "active"
max_guests Integer True Maximum number of guests allowed to stay at the property 4
max_adults Integer False Maximum number of adults allowed to stay at the property 2
num_bedrooms Integer False 2
num_toilets Integer False 1
num_living_areas Integer False 1
num_kitchens Integer False 1
vatable Boolean False Do you charge VAT on stays at this property? 1
availability_mode String True Defines how you will supply availability information for this property. ie which dates may be booked, and which may not.
Allowed Values
"request" We do not store availability information for this property (unless a booking is made through TS). Availability is requested from you whenever an enquiry is received.
"manual" We maintain a local calendar of availability that you will keep up to date using the calendar tool in the TrustedStays web control panel
"connectivity_partner" Availability will be taken from your chosen Connectivity Partner
"api" We maintain a local calendar of availability that you will keep up to date using the TrustedStays API
Download the list
"connectivity_partner"
ical_url String False "https://yourdomain.com/thispropertycalendar.ical"
price_mode String False Defines how you will control pricing for this property
Allowed Values
"manual" You will manually set pricing through the web interface
"flat" We will use the default_gross_nightly_cost price every day
"connectivity_partner" Availability will be taken from your chosen Connectivity Partner
"api" You will use the api to keep our system up to date with your pricing
Download the list
"connectivity_partner"
price_includes_fees Boolean False Are the prices you supply inclusive of TrustedStays' fees? If TRUE, the price you supply will be the total charged to the customer, and we will deduct our fees from that amount. If FALSE, we will add our fees on top of the price you specify 1
default_gross_nightly_cost Integer False Required for 'flat' price mode. Supply in pence including VAT if charged. 12300
contact_id Integer False The ID of the contact for this property. You will need to retrieve the ID by using the Contacts endpoints 4
home_type_id Integer False
Allowed Values
3 Apartment
4 Bed and breakfast
7 Chalet
16 Guest house
20 Hotel
22 Lodge
30 Resort
35 Villa
37 Castle
63 Aparthotel
64 Boat
65 Cottage
66 Camping
67 House
Download the list
3
floor_area Integer False Total floor area of accommodation, in meters squared 120
storey Integer False On which storey is the front door of the accommodation situated? Enter 0 for ground floor. 1
levels String False Is the accommodation on a single level or multiple levels?
Allowed Values
"single_level" Single
"multi_level" Multiple
"single_level"
offer_blue_light_discount Boolean False Do you wish to offer a 10% discount to Bluelight card holders (emergency service workers) 0
cancellation_policy String False
Allowed Values
"7-day" 7-day Policy
"14-day" 14-day Policy
"30-day" 30-day Policy
Download the list
"14-day"
cleaning_fee Integer False Fixed cost added to all stays at property to cover cleaning. Supply in pence, including any applicable VAT. 3500
security_deposit Integer False A refundable security deposit. Supply in pence, reported to the buyer at checkout but not collected by TS 50000
min_max_stay_mode String True Defines how you will supply minimum stay length for this property.
Allowed Values
"flat" Minimum stay is the same every day.
"variable" Minimum stay varies day to day, and can be set over API or using the calendar interface.
Download the list
"variable"
min_stay_length Integer False Default minimum number of nights that can be booked at a time. Defaults to 1 if left blank. Can be overwritten for specific dates by setting 'min_max_stay_mode' to 'variable'. 2
max_stay_length Integer False Default maximum number of nights that can be booked at a time. Defaults to 1 if left blank. Can be overwritten for specific dates by setting 'min_max_stay_mode' to 'variable'. 60
release_period Integer False Minimum number of nights notice required for a booking. ie if you set the value to 2, then bookings will not be allowed for today, or tomorrow. 2
entrance_info String False
check_in_notes String False
check_in_time String False Supply as HH:MM "15:00"
check_out_time String False Supply as HH:MM "11:00"
address_line1 String False "1 Example Street"
address_line2 String False "Example Hill"
city String False "Exampleville"
county String False "Exampleshire"
postcode String False "EX43PL"
latitude Float False Supply as a float, with 7 points of precision 51.1234567
longitude Float False Supply as a float, with 7 points of precision 01.1234567
marketing_description String False Marketing copy used on the property's listing page. Supply in plain text, linebreaks with be preserved "Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat."
slug String False The unique identifier for this property that will be used to generate the public url for the property. May contain only lower case alpha numeric characters and hyphens. Must be unique. "your-property-listing-name"
beds Array False Define what beds are available in the accommodation and in which room they are situated [ "room_type" => "bedroom" , "room_number" => 1 , "amenity_id" => 1 , ]
beds.*.room_type String True
Allowed Values
"bedroom" Bedroom
"bathroom" Bathroom
"toilet" Toilet
"living_area" Living Area
"kitchen" Kitchen
Download the list
beds.*.room_number Integer True Used to seperate out rooms of the same type. If you have 3 bedrooms in the property then the options here would be 1,2 or 3
beds.*.amenity_id Integer True ID that represents the type of bed
Allowed Values
833 Baby Cot
444 Bunk Bed
61 Double Bed
200 Double Sofa Bed
324 King Size Bed
440 Pair Of Twin Beds
624 Pull-Out Bed
485 Queen Size Bed
323 Single Bed
432 Sleeper Chair
237 Sofa Bed
957 Tribunk Bed
Download the list
los_discounts Array False Define discounts for guests booking for 1 week or more [ "discount_percent" => 5 , "min_nights" => 7 , ]
los_discounts.*.discount_percent Integer True Percantage discount to apply to the booking. Supply as an integer so a 5% discount would be supplied as 5
los_discounts.*.min_nights Integer True Minimum number of nights that must be booked for the discount to be applied
distances Array False Allows you to list prominant locations and specify the distance they are from the accommodation [ "distance_value" => 10 , "unit_id" => 6 , "destination_id" => 3842 , ]
distances.*.distance_value Integer True How far from the property? You will specify the unit of measurement seperately
distances.*.unit_id Integer True ID that represents the type of unit
Allowed Values
1 meters
2 minutes
3 km
6 minutes walk
8 miles
16 minutes by tube
18 minutes by train
19 minutes by bus
20 On location
21 minutes drive
22 yards
Download the list
distances.*.destination_id Integer True ID that represents the destination. See spreadsheet [INSERT LINK] for possible IDs
Allowed Values

There are too many options to list here. Use the download link below

Download the list
accessibility Array False [ "amenity_id" => 1226 , "details" => "Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua" , ]
accessibility.*.amenity_id Integer True ID that represents the type of image
Allowed Values

There are too many options to list here. Use the download link below

Download the list
accessibility.*.details String False Supplemental information about this amenity
core_safety Array False [ "amenity_id" => 943 , "details" => "Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua" , ]
core_safety.*.amenity_id Integer True ID that represents the type of image
Allowed Values
943 Carbon Monoxide Detector
955 Fire Extinguisher
1211 First Aid Kit
781 Smoke Detectors
Download the list
core_safety.*.details String False Supplemental information about this amenity
parking Array False [ "amenity_id" => 803 , "details" => "Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua" , ]
parking.*.amenity_id Integer True ID that represents the type of image
Allowed Values
803 Free Parking On The Street
805 Free Parking With Garage
804 Paid Parking On The Street
806 Paid Parking With Garage
793 Parking
1546 Parking Limited Spaces Available
1728 Parking Reservation Required
296 Underground Parking
795 Valet Parking
Download the list
parking.*.details String False Supplemental information about this amenity
outdoor_features Array False [ "amenity_id" => 89 , "details" => "Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua" , ]
outdoor_features.*.amenity_id Integer True ID that represents the type of image
Allowed Values
89 Balcony
408 Bbq Grill
451 Courtyard
1006 Furnished Balcony
1008 Furnished Patio
626 Garden (Common)
625 Garden (Private)
1339 Kids Outdoor Play Equipment
514 Mezzanine
1022 Outdoor Dining Area
1023 Outdoor Fireplace
1024 Outdoor Furniture
895 Patio
950 Patio Heater
1030 Porch
837 Rooftop Access
100 Terrace
894 Veranda
Download the list
outdoor_features.*.details String False Supplemental information about this amenity
views Array False [ "amenity_id" => 638 , "details" => "Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua" , ]
views.*.amenity_id Integer True ID that represents the type of image
Allowed Values

There are too many options to list here. Use the download link below

Download the list
views.*.details String False Supplemental information about this amenity
policies Array False [ "amenity_id" => 942 , "details" => "Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua" , ]
policies.*.amenity_id Integer True ID that represents the type of image
Allowed Values

There are too many options to list here. Use the download link below

Download the list
policies.*.details String False Supplemental information about this amenity
home_entertainment Array False [ "amenity_id" => 1371 , "details" => "Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua" , ]
home_entertainment.*.amenity_id Integer True ID that represents the type of image
Allowed Values

There are too many options to list here. Use the download link below

Download the list
home_entertainment.*.details String False Supplemental information about this amenity
housekeeping Array False [ "amenity_id" => 978 , "details" => "Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua" , ]
housekeeping.*.amenity_id Integer True ID that represents the type of image
Allowed Values
978 Cleaning Products
966 Eco Friendly Cleaning Products
448 Free Weekly Cleaning
1282 Housekeeping Daily
1283 Housekeeping Once Per Stay
900 Housekeeping Service
1285 Housekeeping Weekdays Only
1284 Housekeeping Weekends Only
225 Maid Service
940 Toilet Paper
395 Towels
916 Turndown Service
Download the list
housekeeping.*.details String False Supplemental information about this amenity
indoor_features_furnishings Array False [ "amenity_id" => 180 , "details" => "Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua" , ]
indoor_features_furnishings.*.amenity_id Integer True ID that represents the type of image
Allowed Values

There are too many options to list here. Use the download link below

Download the list
indoor_features_furnishings.*.details String False Supplemental information about this amenity
utensils Array False [ "amenity_id" => 21 , "details" => "Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua" , ]
utensils.*.amenity_id Integer True ID that represents the type of image
Allowed Values

There are too many options to list here. Use the download link below

Download the list
utensils.*.details String False Supplemental information about this amenity
local_amenities Array False [ "amenity_id" => 822 , "details" => "Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua" , ]
local_amenities.*.amenity_id Integer True ID that represents the type of image
Allowed Values
822 Local Groceries
821 Local Hospital
Download the list
local_amenities.*.details String False Supplemental information about this amenity
security Array False [ "amenity_id" => 751 , "details" => "Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua" , ]
security.*.amenity_id Integer True ID that represents the type of image
Allowed Values
751 24 Hour Security
601 Safe
831 Security Camera At Entrance
910 Security Guard
Download the list
security.*.details String False Supplemental information about this amenity

Endpoint: Update Property

Method URL
POST www.trustedstays.co.uk/api/v1/property/{propertyId}
Request
Param Type Required Description Example
title String False The display name for the property. Used in public listings "Luxury apartment in the heart of Kensington"
status String False One of: 'active' (listed publicly), 'inactive' (temporarily off sale), 'archived' 'permenantly off sale) "active"
max_guests Integer False Maximum number of guests allowed to stay at the property 4
max_adults Integer False Maximum number of adults allowed to stay at the property 2
num_bedrooms Integer False 2
num_toilets Integer False 1
num_living_areas Integer False 1
num_kitchens Integer False 1
vatable Boolean False Do you charge VAT on stays at this property? 1
availability_mode String False Defines how you will supply availability information for this property. ie which dates may be booked, and which may not.
Allowed Values
"request" We do not store availability information for this property (unless a booking is made through TS). Availability is requested from you whenever an enquiry is received.
"manual" We maintain a local calendar of availability that you will keep up to date using the calendar tool in the TrustedStays web control panel
"connectivity_partner" Availability will be taken from your chosen Connectivity Partner
"api" We maintain a local calendar of availability that you will keep up to date using the TrustedStays API
Download the list
"connectivity_partner"
ical_url String False "https://yourdomain.com/thispropertycalendar.ical"
price_mode String False Defines how you will control pricing for this property
Allowed Values
"manual" You will manually set pricing through the web interface
"flat" We will use the default_gross_nightly_cost price every day
"connectivity_partner" Availability will be taken from your chosen Connectivity Partner
"api" You will use the api to keep our system up to date with your pricing
Download the list
"connectivity_partner"
price_includes_fees Boolean False Are the prices you supply inclusive of TrustedStays' fees? If TRUE, the price you supply will be the total charged to the customer, and we will deduct our fees from that amount. If FALSE, we will add our fees on top of the price you specify 1
default_gross_nightly_cost Integer False Required for 'flat' price mode. Supply in pence including VAT if charged. 12300
contact_id Integer False The ID of the contact for this property. You will need to retrieve the ID by using the Contacts endpoints 4
home_type_id Integer False
Allowed Values
3 Apartment
4 Bed and breakfast
7 Chalet
16 Guest house
20 Hotel
22 Lodge
30 Resort
35 Villa
37 Castle
63 Aparthotel
64 Boat
65 Cottage
66 Camping
67 House
Download the list
3
floor_area Integer False Total floor area of accommodation, in meters squared 120
storey Integer False On which storey is the front door of the accommodation situated? Enter 0 for ground floor. 1
levels String False Is the accommodation on a single level or multiple levels?
Allowed Values
"single_level" Single
"multi_level" Multiple
"single_level"
offer_blue_light_discount Boolean False Do you wish to offer a 10% discount to Bluelight card holders (emergency service workers) 0
cancellation_policy String False
Allowed Values
"7-day" 7-day Policy
"14-day" 14-day Policy
"30-day" 30-day Policy
Download the list
"14-day"
cleaning_fee Integer False Fixed cost added to all stays at property to cover cleaning. Supply in pence, including any applicable VAT. 3500
security_deposit Integer False A refundable security deposit. Supply in pence, reported to the buyer at checkout but not collected by TS 50000
min_max_stay_mode String False Defines how you will supply minimum stay length for this property.
Allowed Values
"flat" Minimum stay is the same every day.
"variable" Minimum stay varies day to day, and can be set over API or using the calendar interface.
Download the list
"variable"
min_stay_length Integer False Default minimum number of nights that can be booked at a time. Defaults to 1 if left blank. Can be overwritten for specific dates by setting 'min_max_stay_mode' to 'variable'. 2
max_stay_length Integer False Default maximum number of nights that can be booked at a time. Defaults to 1 if left blank. Can be overwritten for specific dates by setting 'min_max_stay_mode' to 'variable'. 60
release_period Integer False Minimum number of nights notice required for a booking. ie if you set the value to 2, then bookings will not be allowed for today, or tomorrow. 2
entrance_info String False
check_in_notes String False
check_in_time String False Supply as HH:MM "15:00"
check_out_time String False Supply as HH:MM "11:00"
address_line1 String False "1 Example Street"
address_line2 String False "Example Hill"
city String False "Exampleville"
county String False "Exampleshire"
postcode String False "EX43PL"
latitude Float False Supply as a float, with 7 points of precision 51.1234567
longitude Float False Supply as a float, with 7 points of precision 01.1234567
marketing_description String False Marketing copy used on the property's listing page. Supply in plain text, linebreaks with be preserved "Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat."
slug String False The unique identifier for this property that will be used to generate the public url for the property. May contain only lower case alpha numeric characters and hyphens. Must be unique. "your-property-listing-name"
beds Array False Define what beds are available in the accommodation and in which room they are situated [ "room_type" => "bedroom" , "room_number" => 1 , "amenity_id" => 1 , ]
beds.*.room_type String True
Allowed Values
"bedroom" Bedroom
"bathroom" Bathroom
"toilet" Toilet
"living_area" Living Area
"kitchen" Kitchen
Download the list
beds.*.room_number Integer True Used to seperate out rooms of the same type. If you have 3 bedrooms in the property then the options here would be 1,2 or 3
beds.*.amenity_id Integer True ID that represents the type of bed
Allowed Values
833 Baby Cot
444 Bunk Bed
61 Double Bed
200 Double Sofa Bed
324 King Size Bed
440 Pair Of Twin Beds
624 Pull-Out Bed
485 Queen Size Bed
323 Single Bed
432 Sleeper Chair
237 Sofa Bed
957 Tribunk Bed
Download the list
los_discounts Array False Define discounts for guests booking for 1 week or more [ "discount_percent" => 5 , "min_nights" => 7 , ]
los_discounts.*.discount_percent Integer True Percantage discount to apply to the booking. Supply as an integer so a 5% discount would be supplied as 5
los_discounts.*.min_nights Integer True Minimum number of nights that must be booked for the discount to be applied
distances Array False Allows you to list prominant locations and specify the distance they are from the accommodation [ "distance_value" => 10 , "unit_id" => 6 , "destination_id" => 3842 , ]
distances.*.distance_value Integer True How far from the property? You will specify the unit of measurement seperately
distances.*.unit_id Integer True ID that represents the type of unit
Allowed Values
1 meters
2 minutes
3 km
6 minutes walk
8 miles
16 minutes by tube
18 minutes by train
19 minutes by bus
20 On location
21 minutes drive
22 yards
Download the list
distances.*.destination_id Integer True ID that represents the destination. See spreadsheet [INSERT LINK] for possible IDs
Allowed Values

There are too many options to list here. Use the download link below

Download the list
accessibility Array False [ "amenity_id" => 1226 , "details" => "Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua" , ]
accessibility.*.amenity_id Integer True ID that represents the type of image
Allowed Values

There are too many options to list here. Use the download link below

Download the list
accessibility.*.details String False Supplemental information about this amenity
core_safety Array False [ "amenity_id" => 943 , "details" => "Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua" , ]
core_safety.*.amenity_id Integer True ID that represents the type of image
Allowed Values
943 Carbon Monoxide Detector
955 Fire Extinguisher
1211 First Aid Kit
781 Smoke Detectors
Download the list
core_safety.*.details String False Supplemental information about this amenity
parking Array False [ "amenity_id" => 803 , "details" => "Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua" , ]
parking.*.amenity_id Integer True ID that represents the type of image
Allowed Values
803 Free Parking On The Street
805 Free Parking With Garage
804 Paid Parking On The Street
806 Paid Parking With Garage
793 Parking
1546 Parking Limited Spaces Available
1728 Parking Reservation Required
296 Underground Parking
795 Valet Parking
Download the list
parking.*.details String False Supplemental information about this amenity
outdoor_features Array False [ "amenity_id" => 89 , "details" => "Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua" , ]
outdoor_features.*.amenity_id Integer True ID that represents the type of image
Allowed Values
89 Balcony
408 Bbq Grill
451 Courtyard
1006 Furnished Balcony
1008 Furnished Patio
626 Garden (Common)
625 Garden (Private)
1339 Kids Outdoor Play Equipment
514 Mezzanine
1022 Outdoor Dining Area
1023 Outdoor Fireplace
1024 Outdoor Furniture
895 Patio
950 Patio Heater
1030 Porch
837 Rooftop Access
100 Terrace
894 Veranda
Download the list
outdoor_features.*.details String False Supplemental information about this amenity
views Array False [ "amenity_id" => 638 , "details" => "Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua" , ]
views.*.amenity_id Integer True ID that represents the type of image
Allowed Values

There are too many options to list here. Use the download link below

Download the list
views.*.details String False Supplemental information about this amenity
policies Array False [ "amenity_id" => 942 , "details" => "Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua" , ]
policies.*.amenity_id Integer True ID that represents the type of image
Allowed Values

There are too many options to list here. Use the download link below

Download the list
policies.*.details String False Supplemental information about this amenity
home_entertainment Array False [ "amenity_id" => 1371 , "details" => "Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua" , ]
home_entertainment.*.amenity_id Integer True ID that represents the type of image
Allowed Values

There are too many options to list here. Use the download link below

Download the list
home_entertainment.*.details String False Supplemental information about this amenity
housekeeping Array False [ "amenity_id" => 978 , "details" => "Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua" , ]
housekeeping.*.amenity_id Integer True ID that represents the type of image
Allowed Values
978 Cleaning Products
966 Eco Friendly Cleaning Products
448 Free Weekly Cleaning
1282 Housekeeping Daily
1283 Housekeeping Once Per Stay
900 Housekeeping Service
1285 Housekeeping Weekdays Only
1284 Housekeeping Weekends Only
225 Maid Service
940 Toilet Paper
395 Towels
916 Turndown Service
Download the list
housekeeping.*.details String False Supplemental information about this amenity
indoor_features_furnishings Array False [ "amenity_id" => 180 , "details" => "Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua" , ]
indoor_features_furnishings.*.amenity_id Integer True ID that represents the type of image
Allowed Values

There are too many options to list here. Use the download link below

Download the list
indoor_features_furnishings.*.details String False Supplemental information about this amenity
utensils Array False [ "amenity_id" => 21 , "details" => "Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua" , ]
utensils.*.amenity_id Integer True ID that represents the type of image
Allowed Values

There are too many options to list here. Use the download link below

Download the list
utensils.*.details String False Supplemental information about this amenity
local_amenities Array False [ "amenity_id" => 822 , "details" => "Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua" , ]
local_amenities.*.amenity_id Integer True ID that represents the type of image
Allowed Values
822 Local Groceries
821 Local Hospital
Download the list
local_amenities.*.details String False Supplemental information about this amenity
security Array False [ "amenity_id" => 751 , "details" => "Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua" , ]
security.*.amenity_id Integer True ID that represents the type of image
Allowed Values
751 24 Hour Security
601 Safe
831 Security Camera At Entrance
910 Security Guard
Download the list
security.*.details String False Supplemental information about this amenity
marketing_images Array False Allows you to manage the images you want to use for this property. Note that you cannot upload images through this route and should use the `create attachment` endpoint for that purpose. You can however make changes to, or remove, the marketing images for the property through this route. [ "image_type_id" => 6 , "attachment_id" => 123 , ]
marketing_images.*.image_type_id Integer True ID that represents the type of image
Allowed Values

There are too many options to list here. Use the download link below

Download the list
marketing_images.*.attachment_id Integer True ID of the attachment

Endpoint: Get Pricing and Availability

Method URL
GET www.trustedstays.co.uk/api/v1/calendar
Request
Param Type Required Description Example
start_date String False Get values only after or on the date specified. YYYY-MM-DD format "2021-10-01"
end_date String False Get values only before or on the date specified. YYYY-MM-DD format "2021-10-08"
property_id Integer False Get values only for the given property ID. 123

Endpoint: Update Pricing and Availability

Method URL
POST www.trustedstays.co.uk/api/v1/calendar
Request
Param Type Required Description Example
properties Array True Array that contains an item for each property that is to have their dates updated [ "property_id" => 123 , "entries" => [ "date" => "2021-11-03" , "availability" => "available" , "price" => 12500 , "min_stay_length" => 2 , "max_stay_length" => 60 , "closed_to_arrival" => , "closed_to_departure" => , ] ]
properties.*.property_id Integer True The ID of the property to update
properties.*.entries Array True Array of dates to be updated for this property
properties.*.entries.*.date String True The date you are setting the values for in YYYY-MM-DD format
properties.*.entries.*.availability String False The availability status for this date
Allowed Values
"request" We do not know if the property is available. We will need to check with the PM before allowing a booking.
"available" Property is available on this date.
"unavailable" Property is unavailable on this date
Download the list
properties.*.entries.*.price Integer False The price for the night of this date in pence, including VAT if applicable
properties.*.entries.*.min_stay_length Integer False This minimum number of nights stay that can be booked by someone checking in on this date
properties.*.entries.*.max_stay_length Integer False This maximum number of nights stay that can be booked by someone checking in on this date
properties.*.entries.*.closed_to_arrival Boolean False Specifies whether guests may check in on this date
properties.*.entries.*.closed_to_departure Boolean False Specifies whether guests may check out on this date