Let your clients book services without leaving your app!

Make your website or app more relevant, engaging and profitable by providing the action your clients wish to take upon discovering local businesses. Our API lets you easily include a 'Book Now' button directly in your web page, allowing your clients to schedule appointments in real-time, day or night.

Our API gives you access to all the booking data you need to build and deploy scheduling capabilities to your audience of clients.

Connecting a client with your business schedule, we are bridging an entirely new layer of commerce. We believe that direct appointment booking on your app or website allows us to provide you with client delivery, not just a client potential.

Why do thousands of clients choose the Simplybook API?

Clear and simple interface. Building your own booking service is easy peasy
You can easily plug-in all the functionality you need
Real-time scheduling – your clients can book appointments wherever they want, whenever they want, 24/7
Our app gives you plenty of another useful features. Click here to learn more about our features.

Help Center

Use our developer API to create your own booking interface. You can design any solution you want varying from simpliest widget to multifunctional application with functionality customized according to your business specific.

Simplybook Application Programming Interface uses JSON-RPC 2.0 protocol.

See an example of API-based booking interface, and also read the source code of this solution.

Authorization

Using Simplybook API methods require an authentification. To authorize in Simplybook API you need to get an access key — access-token. In order to get this access-token you should call the JSON-RPC method getToken on http://user-api.simplybook.me/login service passing your personal API-key. You can copy your API-key at admin interface: go to the 'Custom Features' link and select API custom feature 'Settings'. Then you have to init remote access to Simplybook API. Your request should contain the following headers: 'X-Company-Login', 'X-Token'.

Getting the access-token can be implemented either from client side or from your server which is the more secure solution.

You may use javascript JSON-RPC-client library and php JSON-RPC-client library from our examples for your own solution development.


Client API (Company public service) authorization

Authorization from client side code

Getting the token-key.


var loginClient = new JSONRpcClient({
	'url': 'http://user-api.simplybook.me' + '/login',
	'onerror': function (error) {},
});
var token = loginClient.getToken(YOUR_COMPANY_LOGIN, YOUR_API_KEY);

Initialization JSON-RPC-client.


this.client = new JSONRpcClient({
	'url': 'http://user-api.simplybook.me',
	'headers': {
		'X-Company-Login': YOUR_COMPANY_LOGIN,
		'X-Token': token
	},
	'onerror': function (error) {}
});

Authorization from server side code

Getting the token-key.


$loginClient = new JsonRpcClient('http://user-api.simplybook.me' . '/login/');
$token = $loginClient->getToken(YOUR_COMPANY_LOGIN, YOUR_API_KEY);

Initialization JSON-RPC-client.


$client = new JsonRpcClient('http://user-api.simplybook.me' . '/', array(
    'headers' => array(
        'X-Company-Login: ' . YOUR_COMPANY_LOGIN,
        'X-Token: ' . $token
    )
));

User/Admin API (Company administration service) authorization

Authorization from client side code

Getting the token-key.


var loginClient = new JSONRpcClient({
'url': 'http://user-api.simplybook.me' + '/login',
'onerror': function (error) {},
});
var token = loginClient.getUserToken(YOUR_COMPANY_LOGIN, YOUR_USER_LOGIN, YOUR_USER_PASSWORD);

Initialization JSON-RPC-client.


this.client = new JSONRpcClient({
'url': 'http://user-api.simplybook.me' + '/admin/',
'headers': {
'X-Company-Login': YOUR_COMPANY_LOGIN,
'X-User-Token': token
},
'onerror': function (error) {}
});

Authorization from server side code

Getting the token-key.


$loginClient = new JsonRpcClient('http://user-api.simplybook.me' . '/login/');
$token = $loginClient->getUserToken(YOUR_COMPANY_LOGIN, YOUR_USER_LOGIN, YOUR_USER_PASSWORD);

Initialization JSON-RPC-client.


$client = new JsonRpcClient('http://user-api.simplybook.me' . '/admin/', array(
'headers' => array(
'X-Company-Login: ' . YOUR_COMPANY_LOGIN,
'X-User-Token: ' . $token
)
));

Getting data from Simplybook server

A booking page usually is a page where clients choose service they need, an employee and a time of their meeting. Then a client enters some contact info and confirms the booking. The more complex solutions may include filling different intake forms, making some group or multy-times booking and so on. Lets describe the workflow of creation the simpliest booking page. Then if you need to add some extra functionality to your page, see here the full list of Simplybook API methods.

So the first thing you should display is the list of services and the list of employes. Get this data by getEventList and getUnitList methods. They both return a list with complete information about each item in it, so you have many possibilities how to display services and employees at your page. To make employee filtration use unit_map property of the service list, it contains the info about employees who can provide the selected service.

Code example of getting services list


$services = $client->getEventList();
// returns array(array(
//     'id' => 1, - service id
//     'name' => 'Service 1', - service's name
//     'description' => 'Describe your service...', - service description
//     'duration' => 60, - service duration
//     'hide_duration' => 0, - Hide duration to clients flag,
//     'picture' => null, - file name of picture or null
//     'picture_path' => '/uploads/apidemo/event__picture/small/', - full path to picture,
//     'position' => 1 - service position
//     'is_active' => 1, - the service is activated
//     'is_public' => 1, - the service is allowed to book by clients
// ), ...)

Code example of getting service performers list


$services = $client->getUnitList();
// returns array(array(
//    'id' => 1, - performer id
//    'name' => 'Provider 1', - performer name
//    'phone' => '111111111', - perfomer phone number
//    'description' => 'Describe your performer...', - performer description
//    'email' => 'test@gmail.com', - perfomer email,
//    'is_active' => 1, - the performer is activated
//    'is_visible' => 1, - the perfomer is visible for clients,
//    'picture' => null, - file name of picture or null,
//    'picure_path' => '/uploads/apidemo/unit_group__picture/small/', - full path to picture
//    'position' => 1, - performer position
//    'qty' => 1, performer quantity
// ), ...)

The next step to a client is to pick a date and time of his service. We've used a Bootstrap date-picker in API-usage example, you can also use this or any other calendar. To set your calendar first date use getFirstWorkingDay method. It can take employee id as a parameter and returns the next date when the selected employee (or any employee in the company by default) is avaiable for booking. To show time slots inside a selected date you need getWorkCalendar and getStartTimeMatrix methods. The first method give you an information about working day start and end time, and about day-offs. And the second one returns the list of time-slots which can be booked for a certain date.

Code example of getting work days info


$year = 2015;
$month = 3; // March
$performerId = 1; // Can be null 
$workDaysInfo = $client->getWorkCalendar($year, $month, $performerId);				
// returns array(
//     '2015-03-01' => array('from' => '09:00:00', 'to' => '18:00:00', 'is_day_off' => 0),
//     '2015-03-02' => array('from' => '09:00:00', 'to' => '18:00:00', 'is_day_off' => 0),
//     ...
//);

Code example of getting start time matrix


$dateFrom = '2015-03-03';
$dateTo = '2015-03-04';
$serviceId = 1;
$performerId = 1;
$qty = 1;
$availableTime = $client->getStartTimeMatrix($dateFrom, $dateTo, $serviceId, $performerId, $qty);
// returns array(
//     '2015-03-03' => array('09:00:00', '09:30:00', '10:00:00', ....),
//     '2015-03-04' => array('09:00:00', '09:30:00', '10:00:00', ....),
//);

Another usefull method you may need is calculateEndTime. Each service can have its own duration, also your company's employees possible have different work schedule form day to day. So using this method you can show to a client an end date and time of the service he've booked in a correct way.

Code example of calculating booking end time


$startDateTime = '2015-03-03 09:00:00';
$serviceId = 1;
$performerId = 1;
$availableTime = $client->calculateEndTime($startDateTime, $serviceId, $performerId);
// returns '2015-03-03 10:00:00'

When a client clicks confirm booking button you have to call book method. This is the main function which performs all necessary validations and registers a new booking in Simplybook system. It takes information about booking, client data like name and phone and some additional params. See all params descriptions of this method in API functions list. The book method responce contains an uniqe code and other details of the new booking or the list of errors if some problems occured, so you can use this information to show booking result to a client in convinient and intuitive way


Using of API secret key

In some cases the book method may require the confirmation, e.g. if your accept payments from clients you confirm booking only after the payment is already came. The Simplybook API confirmBookng method takes booking-id and secure signature as params (another method which requires secure signature is cancelBookng). For the secure signature generation your secret API-key should be used. See how it can be done in the example below. You can find the secret key at admin interface under 'Settings' link of API custom feature in 'Custom Features' list.

Code example of service booking and its confirmation using secret API key


$additionalFields = array(
	'6740d3bce747107ddb9a789cbb78abf3' => 'value1', 
	'b0657bafaec7a2c9800b923f959f8163' => 'value2'
);
$clientData = array(
	'name' => 'Client name',
	'email' => 'client@email.com',
	'phone' => '+13152108338'
);
		
$bookingsInfo = $client->book($eventId, $unitId, $date, $time, $clientData, $additionalFields);

if ($bookingsInfo->require_confirm) {
   foreach ($bookingsInfo->bookings as $booking) {
	   $sign = md5($booking->id . $booking->hash . YOUR_API_SECRET_KEY);
	   $result = $client->confirmBooking($booking->id, $sign);
	   echo '
Confirm result
'; var_dump($result); } }

Code example of getting intake form fields


$fields = $client->getAdditionalFields($eventId);
// returns - array(array(
//		'name' => 'b0657bafaec7a2c9800b923f959f8163', - field name
//		'title' => 'Test digits', - field title
//		'type' => 'digits', - field type
//		'values' => null, - available values for select field type
//		'default' => null, - default value for field
//		'is_null' => null, - is filed nullable
//		'on_main_page' => 1, 
//		'pos' => 1, - field position
//		'value' => null
// )), ...)

Simplybook Custom Features

If your company specific requires some additional functionality you can activate some of our additional custom features. The complete custom feature list with detailed description is avaiable in your admin interface under the 'Custom Features' link. After the necessary custom feature is enabled the corresponding API methods will be activated so you can use them in your code.

Booking functionality codeflow

Authorize in Simplybook API using loginClient.getToken(companyLogin, apiKey); function.


Check if Service categories custom feature is activated by isPluginActivated("event_category") if yes then display list of categories getCategoriesList().


Get list of services (events) and performers (units) using getEventList() and geUnitList() functions. If "unit_map" array is available for service it means this service can be provided by given performers only.


If Any Employee selector custom feature is activated isPluginActivated("any_unit") and no special duration is set for service-performer pair in "unit_map" array then user should be allowed to select Any provider option or choose provider manually. But manual selection of performers should not be possible if getCompanyParam("any_unit__hide_other_units") is enabled.


Use getStartTimeMatrix ($from as current date, $to as current date, $eventId, $unitId, $count as selected participants value ) to get available timeslots for given date. $unitId should be null if Any employee option is selected.


If Any Employee selector is active and Any employee was selected call getAvailableUnits($eventId, $dateTime, $count) to get available $unitId


If Intake forms custom feature is activated isPluginActivated("event_field") call getAdditionalFields($eventId) function to get list of fields for client to fill.


Call book($eventId, $unitId, $date, $time, $clientData, $additional, $count, $batchId) to make a booking.


Get api token
Using Simplybook API methods require an authentification. To authorize in Simplybook API you need to get an access key — access-token. In order to get this access-token you should call the JSON-RPC method getToken on http://user-api.simplybook.me/login service passing your personal API-key. You can copy your API-key at admin interface: go to the 'Custom Features' link and select API custom feature 'Settings'.
var token = loginClient.getToken(companyLogin, apiKey);
Method result
Response body
HTTP Request
Get event list
You have just received auth token. Now you need to create JSON RPC Client, set http headers and then use this client to get data from Simplybook server. To get services list use getEventList() function as it is shown in code example below.
var events = client.getEventList();
Method result
Response body
HTTP Request
Get performer list
Also you need to get list of all service performers. For this purpose use getUnitList() function.
var units = client.getUnitList();
Method result
Response body
HTTP Request
Filter performers by service
Now let users select service and then performer. Please note that services can be attached to certain performer or can be provided by any performer from list. That is why you should filter performers before users make selection, use unit_map param in service object for this. See code example below.
Get closest day with available time slots
After user has selected service and perfomer you should get first working day for the selected performer and set it as datepicker active date. Use getFirstWorkingDay() function for this purpose.
var firstWorkingDay = client.getFirstWorkingDay(performerId);
Method result
Response body
HTTP Request
Disable not working time in calendar
Becides setting active date in your datepicker you also can disable dayoffs in it using data of work calendar. See how the getWorkCalendar() function works in code example.
workCalendar = client.getWorkCalendar(year, month, performerId);
Method result
Response body
HTTP Request
Get available time slots
When user has selected a date you can load time intervals when service is available to be booked. Use the getStartTimeMatrix() function to get list of start time of time slots.
var startMatrix = client.getStartTimeMatrix(from, to, eventId, unitId, count)
Method result
Response body
HTTP Request
Check if Intake forms custom feature is activated
Now check if Intake forms custom feature is active to define what should be shown to client in the next step. See isPluginActivated() function usage example.
var additionalFieldsActivated = client.isPluginActivated('event_field');
Method result
Response body
HTTP Request
Get intake form fields
If Intake forms custom feature is active, you should load intake form field list using getAdditionalFields() function and add them to client details form.
Method result
Response body
HTTP Request
Perform booking
After client has filled his information into intake form fields you should start booking process by calling book() method.
Client name
Client email
Client phone
Method result
Response body
HTTP Request
Summary
It was simple example how you can use Simplybook API. Check out all available API methods here. Feel free to contact us and ask any questions.
Thank you for reading!

Service URL  https://user-api.simplybook.me/

  • getUnitList ($isVisibleOnly, $asArray, $handleClasses)

    {@inheritdoc}
    • @param bool $isVisibleOnly
    • @param bool $asArray
    • @param integer $handleClasses (1 - classes only, -1 without classes, null - skip classes check)
    • @return Array
  • getEventList ($isVisibleOnly, $asArray, $handleClasses)

    {@inheritdoc}
    • @param bool $isVisibleOnly
    • @param bool $asArray
    • @param integer $handleClasses (1 - classes only, -1 without classes, null - skip classes check)
    • @return Array
  • getCategoriesList ($isPublic)

    {@inheritdoc}
    • @param bool $isPublic
    • @return Array
  • getLocationsList ($isPublic)

    {@inheritdoc}
    • @param Boolean $isPublic
    • @return Array
  • getPaymentProcessorConfig ($paymentProcessor)

    Returns payment processor config
    • @param String $paymentProcessor
    • @return Array
  • validatePayment ($paymentInfo, $cartId)

    Validate application payment.
    • @param mixed $paymentInfo
    • @param Integer $cartId
    • @return Boolean
  • getBookingCart ($bookingIds)

    Returns cart information by bookings ids.
    cart_id and cart_hash is used to create secure signature to confirm cart payment.
    status - current cart status
    amount - is total amount to payment
    currency - cart currency
    cart - contains cart items. You can use them to provide information for payment system. Each item is object with following fields:
    id - booking id
    event_id - service id
    name - event name + start date time (use it to provide cart information for payment system)
    price - booking price
    qty - qty of bookings
    • @param Array $bookingIds
    • @return Object
  • getBookingCartInfo ($cartId, $sign)

    Returns current cart information
    cart_id and cart_hash is used to create secure signature to confirm cart payment.
    amount - is total amount to payment
    currency - cart currency
    cart - contains cart items. You can use them to provide information for payment system. Each item is object with following fields:
    id - booking id
    event_id - service id
    name - event name + start date time (use it to provide cart information for payment system)
    price - booking price
    qty - qty of bookings
    • @param Integer $cartId cart id
    • @param String $sign signature. (md5($cartId . $cartHash . $secretKey))
    • @return Object
  • getBookingCartStatus ($id)

    Returns current cart status
    Possible result values:
    cancel - user has canceled payment
    paid - user has paid
    error - error has been occurred on validation payment
    not_paid - cart is not paid yet or payment status is pending
    • @param Integer $id
    • @return String
  • confirmBookingCart ($cartId, $paymentProcessor, $sign)

    Confirm booking cart. Use it to confirm payment. Signature is required.
    • @param Integer $cartId cart id
    • @param String $paymentProcessor payment processor name
    • @param String $sign signature. (md5($cartId . $cartHash . $secretKey))
    • @return Boolean
  • confirmBooking ($id, $sign)

    Confirm booking. Signature is required.
    $sign = md5($bookingId . $bookingHash . $secretKey);
    Call this method from server side only
    • @param Integer $id
    • @param String $sign
    • @return Boolean
  • confirmBookingPayment ($id, $paymentProcessor, $sign)

    Confirm booking payment. Signature is required.
    $sign = md5($bookingId . $bookingHash . $secretKey);
    Call this method from server side only
    • @param Integer $id
    • @param String $paymentProcessor
    • @param String $sign
    • @return Boolean
  • confirmBookingBatch ($batchId, $batchType, $sign)

    Confirms booking batch. Signature is required.
    $sign = md5($batchId . $batchHash . $secret)
    Call this method from server side only
    • @param Integer $batchId
    • @param String $batchType
    • @param String $sign
    • @return Boolean
  • cancelBooking ($id, $sign)

    Cancels a booking. $sign parameter must be a string created with formula: md5($bookingId . $bookingHash . $secretKey)
    . You can get $bookingHash value as result of [[#book|book]] API method call. Method
    return an error with code -32080 (Appointment couldn't be found) if record with specified id not exists. Methods returns
    an error with code -32085 (Signature error) if $sign parameter is wrong.
    • @param Integer $id
    • @param String $sign
    • @return Boolean
  • getBooking ($id, $sign)

    Returns an object with details information about booking. $sign parameter must be a string created
    with formula: md5($bookingId . $bookingHash . $secretKey). You can get $bookingHash
    value as result of [[#book|book]] API method call. Method return an error with code -32080
    (Appointment couldn't be found) if record with specified id not exists. Methods returns an error with code -32085
    (Signature error) if $sign parameter is wrong.
    • @param Integer $id
    • @param String $sign
    • @return Object
  • getBookingDetails ($id, $sign)

    Returns an object with details information about booking. $sign parameter must be a string created
    with formula: md5($bookingId . $bookingHash . $secretKey). You can get $bookingHash
    value as result of [[#book|book]] API method call. Method return an error with code -32080
    (Appointment couldn't be found) if record with specified id not exists. Methods returns an error with code -32085
    (Signature error) if $sign parameter is wrong.
    • @param Integer $id
    • @param String $sign
    • @return Object
  • isPaymentRequired ($eventId)

    Returns true if [[Plugins#Accept_payments|Accept payments]] plugin activated and event with specified id has
    configured price. If no paramentes specified then method returns true if payments plugin activated and at least
    one event has configured price. Otherwise returns false.
    • @param Integer $eventId
    • @return Boolean
  • book ($eventId, $unitId, $date, $time, $clientData, , $count, $batchId, $recurringData)

    Creates new booking record. Returns an object with appointment information or throw exception if booking time not
    available or any of required parameters missed. If appointment requires confirmation, in result object will be
    require_confirm = true. $startDate and $startTime specifies a date of
    booking and time slot. Time value should be multiple to 'timeframe' configuration of company (see
    [[#getTimeframe|getTimeframe]] API method). $endDate and $endTime parameters
    should be calculated according to service duration. However you can specify different values to make appointment
    longer or shorter then service configuration. Note that $endDate and $endTime should be
    later in time than $startDate and $startTime. If your clients located in different time
    zone you should specify 'client_time_offset' value in $clientData object as difference
    between client's time zone and company's time zone in minutes. For example if company located in city with time
    zone GMT+2 and customer located in city with GMT+3 then $clientTimeOffset will be 60 minutes. You
    can get information about company's time zone using [[#getCompanyInfo|getCompanyInfo]] API method. To
    create batch booking you can specify either count more then 1 or valid batchId (only one
    parameter can be specified). You should specify an $additionalFields parameter if service requires
    some additional fields (see [[Plugins#Additional fields|Additional fields plugin]]). To create a booking with promo code you
    should pass it as additional field. For example: {"name": "promocode", "value": "some code", "type": "text"}

    See [[#book response|example]] of book API method response.
    • @see http://wiki.simplybook.me/index.php/Settings#Timeframe Timeframe information
    • @param Integer $eventId
    • @param Integer $unitId
    • @param String $date in Y-m-d format
    • @param String $time in H:i:s format
    • @param Object $clientData eg. {name: 'Name', email: 'test@gmail.com', phone: '+38099999999'}
    • @param array
    • @param Integer $count bookings count, min. 1 (using for group bookings batch). (optional)
    • @param Integer $batchId add booking to multiple bookings batch. (optional)
    • @param Array $recurringData make booking recurrent. (optional)
    • @return Object
  • getRecurringDatetimes ($eventId, $unitId, $date, $time, $recurringData)

    Get list of dates for recurring booking
    • @param Integer $eventId
    • @param Integer $unitId
    • @param String $date
    • @param String $time
    • @param Array $recurringData
    • @return Array
  • hasUpcommingPromotions ()

    Returns availability of active promotions
    • @return Boolean
  • validatePromoCode ($code, $startDateTime, $eventId, $count, )

    Validate promotion code.
    Returns true in case promocode is valid otherwise throws exception with error.
    • @param String $code
    • @param String $startDateTime
    • @param Integer $eventId
    • @param Integer $count
    • @param array
    • @return Boolean
  • getPromocodeInfo ($code)

    Returns an object with detailed information about promotion by promotion code. Returns null if no promotions with
    specified code were not found.
    • @param String $code
    • @return Array
  • getPromotionRewardInfo ($commonPromotionId, $clientId, $hash)

    Returns promotion reward by common promotion id, client id and hash.
    • @param Integer $commonPromotionId
    • @param Integer $clientId
    • @param String $hash
    • @return Array
  • getUserLicenseText ()

    Returns user license text if user license plugin is turned on,
    otherwise throws exception
    • @return String
  • getClientInfo ($clientId, $sign)

    Returns client info by client id
    • @param Integer $clientId
    • @param String $sign signature = md5($clientId . $clientHash . $secretKey)
    • @return Object
  • getClientInfoByLoginPassword ($login, $password)

    Returns client information by clients login (email)/password
    • @param String $login
    • @param String $password
    • @return Object
  • remindClientPassword ($email)

    Sends remind email for client
    • @param String $email
    • @return Boolean
  • getClientByLoginHash ($hash)

    Get client information by client login hash
    • @param String $hash
    • @return Object
  • modifyClientInfo ($clientId, $data, $sign)

    Edit client information data
    • @param Integer $clientId
    • @param Array $data
    • @param String $sign signature = md5($clientId . $clientHash . $secretKey)
    • @return Object
  • getMembershipList ()

    Returns list of available memberships
    • @return Array
  • getClientMembershipList ($filter, $clientId, $sign)

    Returns purchased membership list
    • @param Array $filter
    • @param Integer $clientId
    • @param String $sign
    • @return Array
  • getClientBookings ($clientId, $sign, $filter)

    Returns client bookings, accepts $filter ($filter {upcoming_only: true/false, confirmed_only: true/false})
    • @param integer $clientId
    • @param string $sign
    • @param object $filter
    • @return array
  • membershipCheckClientAccess ($eventId, $clientId, $clientSign, $date, $count)

    Checks if client has access to book with $eventId at $startDateTime
    • @param Integer $eventId
    • @param Integer $clientId
    • @param String $clientSign signature = md5($clientId . $clientHash . $secretKey)
    • @param String $date
    • @param int $count
    • @return Boolean
  • makeMembershipPayment ($membershipId, $clientId, $sign)

    Creates membership payment by membership id and client data
    • @param Integer $membershipId
    • @param Integer $clientId
    • @param String $sign signature = md5($clientId . $clientHash . $secretKey)
    • @return Object
  • getMembershipPaymentHistory ($clientId, $sign)

    Returns membership payment history by client id and sign
    • @param integer $clientId
    • @param string $sign signature = md5($clientId . $clientHash . $secretKey)s
    • @return array
  • getProductList ($filter)

    Returns product list with filter.
    At this time filter can accept only service_id parameter
    • @param object $filter
    • @return array
  • getClassesList ($filter)

    Returns company's classes list. Ordered by position
    • @param Array $filter
    • @return Array
  • getCompanyParam ($key)

    Returns company config value for key. A different set of keys available for public API and for company
    administration API. Method return 'invalid params' error (code -32602) in case if access to specified key not
    allowed. See [[#Company_params|list of available keys]].
    • @param String $key
    • @return mixed
  • getCompanyParams ($keys)

    Returns company's config values for specified keys as key-value map. For non-existent and not-allowed param keys
    it will return '''false''' as result. A different set of keys available for public API and for company
    administration API. See [[#Company_params|list of available keys]].
    • @param Array $keys
    • @return Array
  • getTimelineType ()

    Returns company timeline type
    • @return String
  • addPluginDataToServiceList ($events, $isVisibleOnly)

    • @internal Change $events data, add plugins info to each event
    • @param array $events
    • @param bool $isVisibleOnly
    • @return array $events
  • calculateEndTime ($startDateTime, $eventId, $unitId)

    Returns end datetime if booking is available, else return false
    • @param String $startDateTime a date and time string in format 'Y-m-d H:i:s', eg. '2001-10-02 13:30:00'.
    • @param Integer $eventId
    • @param Integer $unitId
    • @return String
  • getWorkCalendar ($year, $month, )

    Returns company work schedule as array
    Eg.: {'2014-05-01': {'from': '09:00:00', 'to': '21:00:00', 'is_day_off': '0'}, '2014-05-02': ...}
    • @param Integer $year
    • @param Integer $month
    • @param Integer
    • @return Object
  • getReservedTime ($from, $to, $eventId, $unitId, $count)

    Returns map of objects for each day in specified date range. The key of the result mps is a date string. The value
    is an array of two objects. Both objects contains list of time slots for type reserved_time and type
    not_worked_time. reserved_time type represents time slots working time but already booked
    by clients. Nobody knows what kind of data represented by not_worked_time type. Please don't use it.

    If [[Plugins#Google calendar sync plugin|Google calendar sync plugin]] enabled then object with
    reserved_time type will contain not empty list of time slots marked as busy in Google calendar. Call
    [[#isPluginActivated|isPluginActivated('google_calendar_export')]] API method to check if Google
    calendar sync plugin activated.


    Example:

    {
    "2016-02-05": [
    {
    "dd": [], // time slots from Google calendar
    "events": [ // reserved time slots
    { "from": "16:00", "to": "16:30" },
    { "from": "16:30", "to": "17:00" },
    ... ],
    "type": "reserved_time",
    },
    {
    "events": [
    { "from": "09:00", "to": "09:30" },
    { "from": "09:30", "to": "10:00" },
    ... ],
    "type": "not_worked_time"
    }],
    ...
    }
    • @param String $from
    • @param String $to
    • @param Integer $eventId
    • @param Integer $unitId
    • @param Integer $count
    • @return Object
  • getWorkDaysInfo ($from, $to, $unitId, $eventId, $count)

    Returns an information about working hours and break times for specified service and performer for a period
    between two dates. If only service specified then information about performer (or performers) will be taken from
    service configuration. Method returns a list of objects for each date in specified period. Count of objects in
    list depends on break times. For example if performer works from 9:00 till 19:00 with one hour break at 13:00 method
    returns:


    {'2014-05-14' : [
    {'from': '09:00:00', 'to': '13:00:00'},
    {'from': '14:00:00', 'to': '19:00:00'}
    ] }


    Warning! Method can return a time string '24:00:00' as right edge of time range. This happens in case if time
    range finishes on midnight.
    • @param String $from
    • @param String $to
    • @param Integer $unitId (optional)
    • @param Integer $eventId (optional)
    • @param Integer $count (optional)
    • @return Object
  • getFirstWorkingDay ()

    Returns first working date for unit
    • @param Integer
    • @return String
  • getStartTimeMatrix ($from, $to, $eventId, $unitId, $count)

    Returns available start time, taking into account breaktimes, start and end working time
    Eg.: {'2014-05-14': ['09:00:00', ...], ...}

    If locations plugin activated for company you should pass a list as $unitID parameter for filter results with
    units available only for selected location. See [[Plugins#Unit_location|Unit location]] plugin description for
    more details.
    • @param String $from
    • @param String $to
    • @param Integer $eventId
    • @param Mixed $unitId can be Integer or Array of Integers
    • @param Integer $count
    • @return Object
  • getAvailableTimeIntervals ($dateFrom, $dateTo, $eventId, $unitId, $count)

    Returns available time intervals for all service providers for given period, taking into account breaktimes, start and end working time
    Eg.: {['2016-03-04': ['1': [['09:00:00','09:30:00'], ['11:15:00','14:45:00']] , ...], ...]}
    • @param String $dateFrom
    • @param String $dateTo
    • @param Integer $eventId
    • @param Mixed $unitId can be Integer or Array of Integers
    • @param Integer $count
    • @return Object
  • getServiceAvailableTimeIntervals ($dateFrom, $dateTo, $eventId, $unitId, $count)

    Returns available time intervals for all servics for given period, taking into account breaktimes, start and end working time
    Eg.: {['2016-03-04': ['1': [['09:00:00','09:30:00'], ['11:15:00','14:45:00']] , ...], ...]}
    • @param String $dateFrom
    • @param String $dateTo
    • @param Mixed $eventId can be Integer or Array of Integers
    • @param Integer $unitId
    • @param Integer $count
    • @return Object
  • getReservedTimeIntervals ($dateFrom, $dateTo, $eventId, , $count)

    Returns not available time
    Eg.: {'2014-05-14': [{'reserved_time': [{'from': '14:00', 'to': '16:30'}], 'type': "reserved_time"}, ...], ...}
    • @param String $dateFrom
    • @param String $dateTo
    • @param Integer $eventId
    • @param Integer
    • @param Integer $count
    • @return Object
  • getAvailableUnits ($eventId, $dateTime, $count)

    Returns list of available unit ids for specified date and service or empty array if all units are not allowed.
    Eg.: [1, 2, 3]
    • @param Integer $eventId
    • @param String $dateTime a date and time string in format 'Y-m-d H:i:s'
    • @param Integer $count
    • @return Array
  • filterAvailableUnits ($eventId, $dateTime, , $count)

    Returns list of available unit ids for specified date and service from provided $unitIds list.
    You can use this method with location plugin.
    Returns empty array if all units are not allowed.
    Eg.: [1, 2, 3]
    • @param Integer $eventId
    • @param String $dateTime a date and time string in format 'Y-m-d H:i:s'
    • @param Array
    • @param Integer $count
    • @return Array
  • getAnyUnitData ()

    Returns information about [[Plugins#Any_Employee_selector|Any Employee selector plugin]] configuration. Returns
    null if plugin not enabled.

    Example:
    {
    "description" : "Select this option, if you want to find an available time with any of the employees",
    "hide_other_units" : 1, // 1 or 0
    "image" : null,
    "name" : "Any employee",
    "picture_path" : null,
    "random_selection" : 0 // 1 or 0
    }
    • @return Object
  • getAdditionalFields ($eventId)

    Return additional fields for certain event if [[Plugins#Additional_fields|Additional fields plugin]] is
    activated. Returns empty array otherwise. Call [[#isPluginActivated|isPluginActivated('event_field')]]
    API method to check if 'event_field' plugin activated.
    • @param Integer $eventId
    • @return Array
  • getTimeframe ()

    Returns company's timeframe configuration (in minutes). Timeframe can be either 5, 10, 15, 20, 30 or 60 minutes.
    You can find more details about timeframe [[Settings#Timeframe|here]].
    • @return Integer
  • isPluginActivated ($pluginName)

    Return plugin status true if status active, else false. $pluginName parameter is a plugin identifier.
    See [[Plugins|plugins]] page for full plugins description. See [[#Plugin's identifiers|list of available plugin's names]].
    • @param String $pluginName
    • @return Boolean
  • getPluginStatuses ($pluginNames)

    Return plugin status true if status active, else false. See [[#Plugin's identifiers|list of available plugin's names]].
    • @param Array $pluginNames
    • @return Array
  • getCompanyInfo ()

    Returns an object with detailed information about company. See [[#getCompanyInfo response|example of response]].
    • @return Object
  • createBatch ()

    Creates new booking batch record. Returns newly created batch id. You can use this id in [[#book|book]]
    API method.
    • @return Integer
  • getCountryPhoneCodes ()

    Returns country phone code list
    • @return Array
  • getPluginPromoInfoByCode ()

    Returns an object with detailed information about promotion by promotion code. You can get promotion code
    using [[Catalogue#getPromotionList|getPromotionList]] API method. If promotion record with specified
    code not found then method returns an empty array (an empty object). If [[Plugins#Simply Smart Promotions|Simply Smart Promotions plugin]]
    not enabled then method returns an error with code -32001 (Plugin is not activated). Use
    [[#isPluginActivated|isPluginActivated('promo')]] API method call to check if plugin enabled.


    See [[#getPromotionList response|example]] of getPromotionList API method response. Please note that
    response contains a list of services for wich promotion discount can be applied (service_ids key).
    • @param String
    • @return Array
  • getCompanyTimezoneOffset ()

    Returns company timezone offset and company timezone
    • @return array

Service URL  https://user-api.simplybook.me/admin

  • getBookings ()

    Returns list of bookings filtered by given params. Filter params represented as object with following fields:

    * '''date_from''' a date of booking in string format 'Y-m-d'
    * '''time_from''' a time string in format 'H:i:s'
    * '''date_to''' a date string in format 'Y-m-d'
    * '''time_to''' a time string in format 'H:i:s'
    * '''created_date_from''' a date string in format 'Y-m-d'
    * '''created_date_to''' a date string in format 'Y-m-d'
    * '''unit_group_id''' an integer. Use it to get bookings assigned for certain service provider.
    * '''event_id''' an integer. Use it to get bookings only for certain service.
    * '''is_confirmed''' 1 or 0. If [[Plugins#Approve booking|Approve booking]] plugin enabled then method will return confirmed bookings with approve status 'new'.
    * '''client_id''' an integer. Use it to get bookings only for certain client.
    * '''order''' string either 'record_date', 'date_start' or 'date_start_asc'. By default used 'date_start' value.
    * '''booking_type''' a string. Value of this field depends on Approve booking plugin status.
    *: If plugin not active:
    ** '''all''' for all bookings (default value)
    ** '''cancelled''' alias to 'is_confirmed' equal to 0
    ** '''non_cancelled''' alias to 'is_confirmed' equal to 1
    *: If plugin active:
    ** '''all''' for all bookings (default value)
    ** '''cancelled''' returns bookings with 'is_confirmed' field equals to 0 and approve booking status equals to 'cancelled' (or booking does not have any approve status)
    ** '''non_cancelled''' returns bookings with either 'is_confirmed' field equals to 1 or approve booking status equals to 'new'
    ** '''cancelled_by_client''' returns bookings approved by admin but cancelled by client
    ** '''cancelled_by_admin''' returns bookings cancelled by admin
    ** '''non_approved_yet''' returns bookings with approve status 'new'
    ** '''approved''' returns bookings with either 'is_confirmed' field equals to 1 and approve booking status equals to 'approved' (or booking does not have any approve status)

    Example:
    {
    "date_from":"2015-12-29",
    "date_to":"2015-12-29",
    "booking_type":"cancelled",
    "event_id":"5",
    "order":"start_date"
    }
    • @param Array
    • @return Array
  • getBookingsZapier ()

    Returns list of bookings filtered by given params
    • @return Array
  • getBookingDetails ($id)

    Returns detailed bookings object by booking id. See [[#getBookingDetails_response|response example]].
    • @param integer $id booking id
    • @return Array
  • getWorkDaysTimes ($startDateTime, $endDateTime, $type)

    Return busy time by unit id by GoogleCalendar plugin if enabled.
    Please note that this method may return not actual data because data synchronization between server and
    Google Calendar may take some time and synchronized data are cached for 15 minutes.
    • @param string $startDateTime
    • @param string $endDateTime
    • @param string $type either 'unit_group' or 'event'. Default value is 'unit_group'.
    • @return Array
  • getGoogleCalendarBusyTime ($startDateTime, $endDateTime, $unitId)

    Returns a list of objects represented a time intervals marked as busy in Google Calendar. Each object of result
    contains from and to properties with datetime string as value. This method only actual if
    [Plugins#Google calendar sync plugin|Google calendar sync plugin] enabled. If plugin not enabled an empty list will
    be returned. You should call [[#isPluginActivated|isPluginActivated('google_calendar_export')]] to
    check status of the plugin. Each object of result contains from and to properties with
    datetime string as value. Please note that this method may return not actual data because data synchronization
    between server and Google Calendar may take some time and synchronized data are cached for 15 minutes.


    Example:

    [
    {"from" : "2016-02-16 13:30:00",
    "to" : "2016-02-16 16:00:00"},
    ...
    ]
    • @param string $startDateTime a date and time string in format 'Y-m-d H:i:s'
    • @param string $endDateTime a date and time string in format 'Y-m-d H:i:s'. You can date string avoiding time in this parameter. In this case method will use time value '23:59:59'.
    • @param int $unitId
    • @return Array
  • getGoogleCalendarBusyTimeAvailableUnits ()

    Returns configured unit ids, allowed to sync busy time
    • @return Array
  • getBookingLimitUnavailableTimeInterval ($startDateTime, $endDateTime, $eventId)

    Returns time intervals not available for bookings because of configuration of [[Plugins#Limit bookings|Limit bookings]]
    plugin for period of time. Returns empty array if plugin not available.
    • @param string $startDateTime a date and time string in format 'Y-m-d H:i:s'
    • @param string $endDateTime a date and time string in format 'Y-m-d H:i:s'
    • @param int $eventId
    • @return Array
  • getUnitWorkingDurations ($dateStart, $dateEnd, $unitGroupId)

    Return working durations
    • @param string $dateStart
    • @param string $dateEnd
    • @param int $unitGroupId
    • @return Array
  • getWorkload ($dateStart, $dateEnd, $unitGroupId)

    Return workload data for units in period of time. Workload for each unit represented as array with work hours
    at index 0, confirmed booking hours as load at index 1 and cancelled bookings hours at index 2.

    Example:
    ['2015-10-21' : {
    5 : [
    10, // working hours
    10, // load hours (confirmed bookings hours)
    0 // cancelled bookings hours
    ] }]
    • @param string $dateStart
    • @param string $dateEnd
    • @param int $unitGroupId
    • @return Array
  • getBookingRevenue ($dateStart, $dateEnd, $unitGroupId, $serviceId)

    Return bookings count and revenue value for each date in specified period. Data grouped by unit id and
    represented as array with bookings count at index 0 and revenue amount at index 1. You can filter data either
    by unit or by service. Set $dateStart and $dateEnd to null to get data for current week.

    Example:
    ['2015-11-12' : {
    3 : [
    11, // bookings count
    128.53 // revenue
    ]}
    • @param string $dateStart a date string in format 'Y-m-d'.
    • @param string $dateEnd a date string in format 'Y-m-d'
    • @param int $unitGroupId
    • @param int $serviceId
    • @return Array
  • getUnitWorkdayInfo ($dateStart, $dateEnd, $unitGroupId)

    Return workday info (date_start and date_end)
    • @param string $dateStart
    • @param string $dateEnd
    • @param int $unitGroupId
    • @return Array
  • cancelBooking ($id)

    Cancels booking. Returns true on success. Returns an error with code -32080 (Appointment couldn't be found) if
    no booking with specified id were found.
    • @param Integer $id
    • @return Boolean
  • cancelBatch ($id, $bookingIds)

    Cancel batch of bookings. Returns true on success. Returns an error with code -32080 (Appointment couldn't be found)
    if no booking with specified id were found. A booking with first id in $bookingIds list is used for
    information in notifications.
    • @param Integer $id identifier of batch. See [[#createBatch|createBatch]] API method.
    • @param Array $bookingIds ids of bookings included to batch.
    • @return bool
  • book ($eventId, $unitId, $clientId, $startDate, $startTime, $endDate, $endTime, $clientTimeOffset, , $count, $batchId, $recurringData)

    Creates new booking record. Returns an object with appointment information or throw exception if booking time not
    available or any of required parameters missed. If appointment requires confirmation, in result object will be
    require_confirm = true. $startDate and $startTime specifies a date of
    booking and time slot. Time value should be multiple to 'timeframe' configuration of company (see
    [[#getTimeframe|getTimeframe]] API method). $endDate and $endTime parameters
    should be calculated according to service duration. However you can specify different values to make appointment
    longer or shorter then service configuration. Note that $endDate and $endTime should be
    later in time than $startDate and $startTime. If your clients located in different time
    zone you should specify 'client_time_offset' value in $clientData object as difference
    between client's time zone and company's time zone in minutes. For example if company located in city with time
    zone GMT+2 and customer located in city with GMT+3 then $clientTimeOffset will be 60 minutes.
    You can get information about company's
    time zone using [[#getCompanyInfo|getCompanyInfo]] API method. To create batch booking you can
    specify either count more then 1 or valid batchId (only one parameter can be
    specified). You should specify an $additionalFields parameter if service requires some additional
    fields (see [[Plugins#Additional fields|Additional fields plugin]]).

    To create a booking with promo code you should pass it as additional field. For example: {"promocode": "some code"}

    If [[Plugins#Unit location|Unit location]] enabled you need to pass locations ID parameter as additional field
    location_id. For example: {"location_id": "1"}. Use [[#isPluginActivated|isPluginActivated('location')]]
    to check if plugin active and [[#getLocationsList|getLocationsList()]] method to get list of
    available locations.

    See [[#book response|example]] of book API method response.
    • @see http://wiki.simplybook.me/index.php/Settings#Timeframe Timeframe information
    • @param Integer $eventId
    • @param Integer $unitId
    • @param Integer $clientId
    • @param string $startDate a date string in format 'Y-m-d'
    • @param string $startTime a time string in format 'H:i:s'
    • @param string $endDate a date string in format 'Y-m-d'
    • @param string $endTime a time string in format 'H:i:s'
    • @param Integer $clientTimeOffset
    • @param array
    • @param Integer $count bookings count used to make group bookings batch. This parameter can't be less than 1. (optional)
    • @param Integer $batchId add booking to group bookings batch. You can't use $count and $batchId in one call. Please specify only one parameter. (optional)
    • @param Array $recurringData make booking recurrent. (optional)
    • @return Object
  • editBook ($shedulerId, $eventId, $unitId, $clientId, $startDate, $startTime, $endDate, $endTime, $clientTimeOffset, )

    Edit existing booking record. See [[#book|book]] API method description for more details about date/time parameters,
    time zone handling and additional fields. Returns null if parameters not valid.
    • @param Integer $shedulerId an id of booking to edit. See [[#book|book]] or [[#getBookings|getBookings]] API methods.
    • @param Integer $eventId
    • @param Integer $unitId
    • @param Integer $clientId
    • @param String $startDate in Y-m-d format
    • @param String $startTime in H:i:s format
    • @param String $endDate in Y-m-d format
    • @param String $endTime in H:i:s format
    • @param Integer $clientTimeOffset
    • @param array
    • @return Object
  • addClient ($clientData)

    Adds new client with specified data. You can specify name, email, phone, address1, address2, city, zip,
    country_id. If client record with specified data exists method will return an id of this record. Otherwise data
    will be stored to database and method will return an id of newly created record. NOTE: name is mandatory field.
    Also email, phone number or both of them can be mandatory fields. You should call
    getCompanyParam('require_fields') method to check which fields are required.

    Method returns an error:

    * -32061 Client name value is wrong
    * -32062 Client email value is wrong
    * -32063 Client phone value is wrong


    Example:

    {
    name: "Frances T. Perez",
    phone: "+1502-810-4521",
    email: "FrancesTPerez@teleworm.us",
    address1: "3872 Earnhardt Drive",
    address2: "Louisville, KY 40219",
    city: Louisville,
    zip: 3872
    }
    • @param Object $clientData
    • @return Integer
  • editClient ($clientId, $clientData)

    Edits client's record. See [[#addClient|addClient]] method description for list of available fields.
    Method returns an id of client's record.
    • @param Integer $clientId
    • @param Object $clientData
    • @return Integer
  • changeClientPassword ($clientId, $password, $sendEmail)

    Change client password and send password email changing
    • @param Integer $clientId
    • @param String $password
    • @param Boolean $sendEmail
  • resetClientsPassword ($clientIds)

    Resets client password and send them emails
    • @param Array $clientIds
  • getClientList ($searchString, $limit)

    Returns list of clients associated with company. You can use either phone number, email address or name as value
    for $searchString. Pass an empty string for $searchString and null for $limit
    parameters to get all records. See [[#addClient|addClient]] API method for list of available fields
    of client data object.
    • @param String $searchString
    • @param Integer $limit
    • @return Array
  • getStatuses ()

    Returns list of available statuses or an empty list if [[Plugins#Status|Status plugin]] not enabled.
    • @return Array
  • setStatus ($bookingId, $statusId)

    Sets specified status for booking. Returns an error with code -32020 if logged in user don't have access to edit
    bookings. This method does nothing if [[Plugins#Status|Status plugin]] not enabled.
    • @param Integer $bookingId
    • @param Integer $statusId
    • @return Boolean
  • getRecurringSettings ($eventId)

    Returns an object with recurring settings for an event. Returns false if specified event does not configured as
    recurring.
    • @see http://blog.simplybook.me/recurring-and-periodic-bookings/ Recurring services desription
    • @param Integer $eventId
    • @return Array
  • getTopServices ($dateStart, $dateEnd)

    Returns a list with statistics for services for a period of time. This data contains number of bookings and
    revenues value for each service.
    • @param String $dateStart
    • @param String $dateEnd
    • @return Array
  • getTopPerformers ()

    Returns a list with statistics for performers. This data contains number of bookings and revenues value for each performer.
    • @return Array
  • getRecurringDatetimes ($eventId, $unitId, $date, $time, $recurringData, $endDateTime)

    Get list of dates for recurring booking
    • @param Integer $eventId
    • @param Integer $unitId
    • @param String $date
    • @param String $time
    • @param Array $recurringData
    • @param String $endDateTime (optional)
    • @return Array
  • addDeviceToken ($token, $device)

    Subscribe a mobile device to push notifications service. Device will recieve notifications about new bookings or
    changes in already created bookings. Use either 'apple' or 'android' for device
    parameter.
    • @param String $token a device token string
    • @param String $device a device type ('android' or 'apple')
    • @return bool
  • deleteDeviceToken ($token)

    Unsubscribe from push notifications service.
    • @param String $token device token
    • @return bool
  • getCountryList ()

    Get list of all countries
    • @return Array
  • getFeedbacks ($approvedOnly, $reviewsOnly, $lastOnly, $limit)

    Get list of feedbacks
    • @param Boolean $approvedOnly
    • @param Boolean $reviewsOnly
    • @param Boolean $lastOnly
    • @param Integer $limit
    • @return Array
  • getRecentActions ($lastOnly, $limit)

    Returns latest actions
    • @param Boolean $lastOnly
    • @param Integer $limit
    • @return Array
  • getWarnings ($lastObly)

    Returns a list of objects represented system warnings. Each warning contains warning_type and warning_text
    properties. warning_text property contains localized message. warning_type can be one of the values:

    * '''sms_limit''' – warning indicates low amount of SMS credits
    * '''sheduler_limit''' – warning indicates low amount of available bookings
    • @param Boolean $lastObly Default value is '''false'''.
    • @return Array
  • updateNotification ($type)

    Mark notifications as readed
    • @param String $type
  • getLastNotificationUpdate ($type)

    Returns last update datetime
    • @param String $type
    • @return String
  • getBookingCancellationsInfo ($dateStart, $dateEnd)

    Returns statistics about created bookings and cancellations for a time period. Data presented as array of hashes for
    each type of operation (created or cancelled booking) groped by clients. "type" field can be either
    "create", "cancel" or "nopayment_cancel". If "user_id" not specified then bookings where created or
    cancelled by admin or employee. Data with type "nopayment_cancel" represents bookings cancelled
    automatically by system.

    Example:
    3 bookings where created by admin or employee and 2 bookings where automatically cancelled by system.
    [{
    "cnt" : 3,
    "firstname" : null,
    "lastname" : null,
    "login" : null,
    "type" : "create",
    "user_id"" : null
    }, {
    "cnt" : 2,
    "firstname" : null,
    "lastname" : null,
    "login" : null,
    "type" : "nopayment_cancel",
    "user_id"" : null
    }]
    • @param String $dateStart a date string in format 'Y-m-d'. Pass null to get data from first day of current week.
    • @param String $dateEnd a date string in format 'Y-m-d'. Pass null to get data filtered to last day of current week.
    • @return Array
  • pluginApproveBookingApprove ($id)

    Sets approve booking status to 'approved' if [[Plugins#Approve booking|Approve booking]] plugin enabled and returns
    list of approved booking IDs. Returns false if plugin not enabled. Use [[#isPluginActivated|isPluginActivated('approve_booking')]]
    API method call to check if plugin enabled.
    • @param Integer $id
    • @return Array
  • pluginApproveBookingCancel ($id)

    Sets approve booking status to 'canceled' if [[Plugins#Approve booking|Approve booking]] plugin enabled and returns
    true. Returns false if plugin not enabled. Use [[#isPluginActivated|isPluginActivated('approve_booking')]]
    API method call to check if plugin enabled.
    • @param Integer $id
    • @return Boolean
  • pluginApproveGetPendingBookingsCount ()

    Returns count of bookings pending approval if [[Plugins#Approve booking|Approve booking]] plugin enabled. Returns
    0 if plugin not enabled. Use [[#isPluginActivated|isPluginActivated('approve_booking')]] API method
    call to check if plugin enabled.
    • @return Integer
  • pluginApproveGetPendingBookings ()

    Returns list of objects with information about bookings pending approval if [[Plugins#Approve booking|Approve booking]]
    plugin enabled. Returns empty list if plugin not enabled. Use [[#isPluginActivated|isPluginActivated('approve_booking')]]
    API method call to check if plugin enabled.
    • @return array
  • getPluginList ()

    Returns a list of all plugins associated with company with status.
    • @return Array
  • getBookingComment ($id)

    Returns booking comment
    • @param Integer $id
    • @return String
  • setBookingComment ($id, $comment)

    Set booking comment
    • @param Integer $id
    • @param String $comment
    • @return Integer
  • getCurrentTariffInfo ()

    Returns all information about current tariff (subscription). For example:
    {
    "name" : "gold",
    "expire_date" : "2016-02-11 12:32:00",
    "rest" : 41, // number of days until subscription expiration
    "color" : "#fcb322"
    }
    • @return Array
  • getRegistrations ($groupBy)

    Returns number of clients registrations by 'day', 'week' or 'month'. A time period depends on selected
    grouping parameter:

    * for 'day' methods returns statistics for last 31 days
    * for 'week' methods returns data last 10 weeks period
    * for 'month' time period is last 12 months
    • @param String $groupBy either 'day', 'week' or 'month'
    • @return Array
  • getBookingStats ($groupBy)

    Returns statistic about bookings count grouped by 'day', 'week' or 'month'. A time period depends on selected
    grouping parameter:

    * for 'day' methods returns statistics for last 31 days
    * for 'week' methods returns data last 10 weeks period
    * for 'month' time period is last 12 months
    • @param String $groupBy either 'day', 'week' or 'month'
    • @return Array
  • getVisitorStats ($groupBy)

    Returns statistics about page visits if plugin [[Plugins#Visitor Counter|Visitor Counter plugin]] enabled. Returns
    an empty list if plugin not enabled. Use [[#isPluginActivated|isPluginActivated('counter')]] API method
    call to check if plugin enabled. Results can be grouped by 'day', 'week' or 'month'. A time period depends on
    selected grouping parameter:

    * for 'day' methods returns statistics for last 31 days
    * for 'week' methods returns data last 10 weeks period
    * for 'month' time period is last 12 months
    • @param String $groupBy
    • @return Array
  • getSocialCounterStats ($provider)

    Returns social counters value for your domain
    • @param String $provider
    • @return Integer
  • getCompanyCurrency ()

    Returns company's currency as three chars code (ISO 4217).
    • @return String
  • getClientComments ($clientId, $shedulerId)

    Returns list of all comments for given client
    • @param Integer $clientId
    • @param Integer $shedulerId
    • @return Array
  • getCurrentUserDetails ()

    Returns an object with information about logged in user. Note: you are responsible for implementation of some
    access rights based on group property value. Most of API methods returns an error if user has low access
    rights but not all. There are 4 roles:

    * '''Administrator''' - have full access to the system
    * '''Senior Employee''' - have access to calendar, services and providers, and can modify bookings related with user
    * '''Junior Employee''' - can access caledar (but only to own bookings), services associated with user
    * '''Viewer''' - have only access to calendar and services in read only mode

    group property can be one of the values:

    * shop_user - "Senior Employee" access role
    * station_user - "Junior Employee" access role
    * admin - "Administrator" access role
    * viewer - "Viewer" access role
    * reseller_company_admin - reserved

    Example:

    {
    "id": 1,
    "login": admin,
    "email": "admin@mycoolcompany.com";
    "firstname": "Michail",
    "lastname": " ",
    "phone": "",
    "group": "admin",
    "is_blocked": 0,
    "last_access_time": "2016-06-06 17:55:51",
    "unit_group_id": null
    }
    • @return Array
  • getClientSoapData ($clientId)

    Returns current SOAP information by client id
    • @param integer $clientId
    • @return array
  • getClientSoapHistory ($clientId)

    Returns SOAP history by client id
    • @param integer $clientId
    • @return array
  • updateClientSoapData ($clientId, $data)

    Updates SOAP information if it was changed
    • @param integer $clientId
    • @param array $data
  • deleteServices ($services)

    • @internal Delete given services if it is possible
    • @param array $services
    • @return bool
  • deletePerformers ($performers)

    • @internal Delete given services if it is possible
    • @param array $performers
    • @return bool
  • deleteCategories ($categories)

    Delete given set of categories if it is possible
    Returns an error with code -32001 if plugin is not activated. Use [[#isPluginActivated|isPluginActivated('event_category')]]
    API method to check if plugin activated.
    Returns an error with code -32101 if trying to delete default category and
    an error with code -32102 if trying to delete all categories
    Return an error with code -32002 if no $categories provided
    • @param array $categories
    • @return bool
  • deleteLocations ($locations)

    Delete given set of locations if it is possible
    Returns an error with code -32001 if plugin is not activated.
    Use [[#isPluginActivated|isPluginActivated('location')]] API method to check if plugin activated.
    Returns an error with code -32074 if trying to delete default location and
    an error with code -32075 if trying to delete all locations
    Returns an error with code -32002 if no $locations provided
    • @param array $locations
    • @return bool
  • addServiceProvider ($data)

    Adds new service provider

    Example:

    {
    "name" : "newtagg1 - 4",
    "description" : "Description - 1",
    "phone" : "1234567890",
    "email" : "test@test.com",
    "qty" : "2",
    "is_visible" : 1,
    "is_active" : 1,
    "position" : 2,
    "position_in_location" : null,
    "locations" : [ 3 ],
    "services" : [ 1, 2 ]
    }
    • @param array $data
    • @return Array
  • editServiceProvider ($id, $data)

    Edit service provider
    there is no way to delete provider via API, in this case set is_active = 0


    Example:

    {
    "name" : "newtagg1 - 4",
    "description" : "Description - 1",
    "phone" : "1234567890",
    "email" : "test@test.com",
    "qty" : "2",
    "is_visible" : 1,
    "is_active" : 1,
    "position" : 2,
    "position_in_location" : null,
    "locations" : [ 3 ],
    "services" : [ 1, 2 ]
    }
    • @param integer $id
    • @param array $data
    • @return Array
  • addService ($data)

    Adds new service

    Example:


    {
    "name":"Service name",
    "duration":"60",
    "hide_duration":"0",
    "description":"Service description",
    "is_public":"1",
    "is_active":"1",
    "position":"1",
    "file_id":null,
    "seo_url":null,
    "is_recurring":"0",
    "picture":null,
    "picture_sub_path":null,
    "picture_path":null,
    "recurring_settings":{
    "days":7,
    "repeat_count":1,
    "type":"fixed",
    "mode":"skip",
    "is_default_settings":true,
    "days_names":[
    "Friday",
    "Saturday",
    "Sunday"
    ]
    },
    "units":[
    2, 3
    ],
    "price":10,
    "currency":"USD",
    }
    • @param array $data
    • @return Array
  • editService ($id, $data)

    Edit service
    there is no way to delete service via API, in this case set is_active = 0


    Example:

    {
    "name":"Service name",
    "duration":"60",
    "hide_duration":"0",
    "description":"Service description",
    "is_public":"1",
    "is_active":"1",
    "position":"1",
    "file_id":null,
    "seo_url":null,
    "is_recurring":"0",
    "picture":null,
    "picture_sub_path":null,
    "picture_path":null,
    "recurring_settings":{
    "days":7,
    "repeat_count":1,
    "type":"fixed",
    "mode":"skip",
    "is_default_settings":true,

    "days_names":[
    "Friday",
    "Saturday",
    "Sunday"
    ]
    },
    "units":[
    2, 3
    ],
    "categories":[
    2
    ]
    "price":10,
    "currency":"USD",
    }
    • @param integer $id
    • @param array $data
    • @return Array
  • editServiceCategory ($id, $data)

    Edit service category

    Example:


    {
    "name":"Category name",
    "description":"Category description",
    "is_default":1,
    "position":0,
    • @param integer $id
    • @param array $data
    • @return Array
  • deleteServiceCategory ($id)

    Delete service category
    • @param integer $id
    • @return Array
  • deleteServiceProviderLocation ($id)

    Delete service provider location
    • @param integer $id
    • @return Array
  • addServiceCategory ($data)

    Edit service category

    Example:


    {
    "name":"Category name",
    "description":"Category description",
    "is_default":1,
    "position":0,
    • @param array $data
    • @return Array
  • editServiceProviderLocation ($id, $data)

    Edit service provider location

    Example:


    {
    "title":"Location mame",
    "description":"Locartion description",
    "address1":"Address 1",
    "address2":"Address 2",
    "city":"City",
    "zip":"12345",
    "country_id":"US",
    "lat":"0.00000000000000000000",
    "lng":"0.00000000000000000000",
    "phone":"11234567",
    "position":"1",
    "is_default":"1"
    }
    • @param integer $id
    • @param array $data
    • @return Array
  • addServiceProviderLocation ($data)

    Add service provider location

    Example:


    {
    "title":"Location mame",
    "description":"Locartion description",
    "address1":"Address 1",
    "address2":"Address 2",
    "city":"City",
    "zip":"12345",
    "country_id":"US",
    "lat":"0.00000000000000000000",
    "lng":"0.00000000000000000000",
    "phone":"11234567",
    "position":"1",
    "is_default":"1"
    }
    • @param array $data
    • @return Array
  • getMembership ($membershipId)

    Returns membership's data object.
    • @param int $membershipId
    • @return Array
  • saveConfigKeys ($data, $module, $plugin)

    Save configuration keys
    • @param array $data
    • @param string $module optional
    • @param string $plugin optional
    • @return array
  • getNotificationConfigStructure ($plugin)

    Get structure of SMS and Email notification config params
    • @param string $plugin optional
    • @return mixed
  • setWorkDayInfo ($info)

    Set work day schedule for company|service|provider for week_day|date

    Example:

    {
    "start_time":"10:00",
    "end_time":"18:00",
    "is_day_off":0,
    "breaktime":[{"start_time":"14:00","end_time":"15:00"}],
    "index":"1",
    "name":"Monday",
    "date":"",
    "unit_group_id":"",
    "event_id":""
    }


    index is 1-7 for Monday - Sunday (used for weekly settings)
    date is used to set worktime for special date
    unit_group_id is provider id
    event_id is service id
    if unit_group_id and event_id not passed then it set data for company
    • @param array $info
    • @return boolean true on success
  • deleteSpecialDay ($date, $params)

    Delete special date if set

    Example:

    {
    "unit_group_id":"",
    "event_id":""
    }
    • @param string $date 'Y-m-d'
    • @param array $params = null
    • @return boolean true on success
  • getCompanyWorkCalendarForYear ($year)

    Returns company special days and vacations
    • @param Integer $year
    • @return Object
  • getServiceWorkCalendarForYear ($year, $eventId)

    Returns special days and vacations, defined for given service (event)
    • @param Integer $year
    • @param Integer $eventId
    • @return Object
  • getCompanyVacations ()

    Get list of company vacations in format array(vacation_id => array())
    • @return array
  • getServiceVacations ($serviceId)

    Get list of service vacations
    • @param Integer $serviceId
    • @return array
  • getPerformerVacations ($performerId)

    Get list of performer vacations
    • @param Integer $performerId
    • @return array
  • getCompanyVacation ($vacationId)

    Get company vacation by id
    • @param Integer $vacationId
    • @return array vacation table row data
  • getServiceVacation ($vacationId, $serviceId)

    Get service vacation by id
    • @param Integer $vacationId
    • @param Integer $serviceId
    • @return array vacation table row data
  • getPerformerVacation ($vacationId, $performerId)

    Get service vacation by id
    • @param Integer $vacationId
    • @param Integer $performerId
    • @return array vacation table row data
  • saveCompanyVacation ($data)

    Save company vacation data
    (create or update table depending on 'id' param existing in $data)
    • @param array $data
    • @return Integer id of saved vacation
  • saveServiceVacation ($data, $serviceId)

    Save company vacation data
    (create or update table depending on 'id' param existing in $data)
    • @param array $data
    • @param Integer $serviceId
    • @return Integer id of saved vacation
  • savePerformerVacation ($data, $performerId)

    Save company vacation data
    (create or update table depending on 'id' param existing in $data)
    • @param array $data
    • @param Integer $performerId
    • @return Integer id of saved vacation
  • deleteCompanyVacation ($vacationId)

    Delete company vacation with all it's bindings
    (including created special days in work_day_special table)
    • @param Integer $vacationId
  • deleteServiceVacation ($vacationId, $serviceId)

    Delete service vacation with all it's bindings
    (including created special days in work_day_special table)
    • @param Integer $vacationId
    • @param Integer $serviceId
  • deletePerformerVacation ($vacationId, $unigGroupId)

    Delete performer vacation with all it's bindings
    (including created special days in work_day_special table)
    • @param Integer $vacationId
    • @param Integer $unigGroupId
  • getClassesList ($isVisibleOnly, $asArray)

    Returns company's classes list. If $asArray is false then method returns a map with event id as key
    and details object as value. If parameter set to true then method returns a list sorted by 'position' property of
    class's details object.
    • @param Boolean $isVisibleOnly
    • @param Boolean $asArray
    • @return Array
  • deleteClasses ($services)

    • @internal Delete given classes if it is possible
    • @param array $services
    • @return bool
  • getProductList ($filter)

    Returns product list with filter.
    At this time filter can accept only service_id parameter
    • @param object $filter
    • @return array
  • deleteProduct ()

    Delete given product or products if it is possible, otherwise set it as inactive
    The $id param can be int or array of int
    • @param integer
    • @return bool
  • getCompanyParam ($key)

    Returns company config value for key. A different set of keys available for public API and for company
    administration API. Method return 'invalid params' error (code -32602) in case if access to specified key not
    allowed. See [[#Company_params|list of available keys]].
    • @param String $key
    • @return mixed
  • getCompanyParams ($keys)

    Returns company's config values for specified keys as key-value map. For non-existent and not-allowed param keys
    it will return '''false''' as result. A different set of keys available for public API and for company
    administration API. See [[#Company_params|list of available keys]].
    • @param Array $keys
    • @return Array
  • getTimelineType ()

    Returns company timeline type
    • @return String
  • getEventList ($isVisibleOnly, $asArray, $handleClasses)

    Returns company's events list. If $asArray is false then method returns a map with event id as key
    and details object as value. If parameter set to true then method returns a list sorted by 'position' property of
    event's details object.
    • @param Boolean $isVisibleOnly
    • @param Boolean $asArray
    • @param integer $handleClasses 1 - classes only, -1 without classes, null - skip classes check
    • @return Array
  • addPluginDataToServiceList ($events, $isVisibleOnly)

    • @internal Change $events data, add plugins info to each event
    • @param array $events
    • @param bool $isVisibleOnly
    • @return array $events
  • getUnitList ($isVisibleOnly, $asArray, $handleClasses)

    Returns list of service performers. If $asArray is false then method returns a map with event id as
    key and details object as value. If parameter set to true then method returns a list sorted by 'position' property
    of event's details object.
    • @param Boolean $isVisibleOnly
    • @param Boolean $asArray
    • @param integer $handleClasses 1 - classes only, -1 without classes, null - skip classes check
    • @return Array
  • getCategoriesList ($isPublic)

    Returns company categories list if [[Plugins#Service categories|Service categories plugin]] is activated. Returns
    an error with code -32001 if plugin is not activated. Use [[#isPluginActivated|isPluginActivated('event_category')]]
    API method to check if plugin activated.
    • @param Boolean $isPublic
    • @return Array
  • getLocationsList ($isPublic, $asArray)

    Returns available locations for company if plugin [[Plugins#Unit location|Unit location plugin]] is activated. Return
    an error with code -32001 if plugin is not activated. Use [[#isPluginActivated|isPluginActivated('location')]]
    API method to check if plugin activated.

    This method accepts two boolean flags as parameters. If '''isPublic''' flag is '''true''' then method returns only
    public locations. If '''asArray''' flag is '''true''' method returns list of objects. Otherwise method returns
    map of objects with object id as key. You can omit both parameters.
    • @param Boolean $isPublic Optional. Default value is '''false'''.
    • @param bool $asArray Optional. Default value is '''false'''.
    • @return Array
  • calculateEndTime ($startDateTime, $eventId, $unitId)

    Returns end datetime if booking is available, else return false
    • @param String $startDateTime a date and time string in format 'Y-m-d H:i:s', eg. '2001-10-02 13:30:00'.
    • @param Integer $eventId
    • @param Integer $unitId
    • @return String
  • getWorkCalendar ($year, $month, )

    Returns company work schedule as array
    Eg.: {'2014-05-01': {'from': '09:00:00', 'to': '21:00:00', 'is_day_off': '0'}, '2014-05-02': ...}
    • @param Integer $year
    • @param Integer $month
    • @param Integer
    • @return Object
  • getReservedTime ($from, $to, $eventId, $unitId, $count)

    Returns map of objects for each day in specified date range. The key of the result mps is a date string. The value
    is an array of two objects. Both objects contains list of time slots for type reserved_time and type
    not_worked_time. reserved_time type represents time slots working time but already booked
    by clients. Nobody knows what kind of data represented by not_worked_time type. Please don't use it.

    If [[Plugins#Google calendar sync plugin|Google calendar sync plugin]] enabled then object with
    reserved_time type will contain not empty list of time slots marked as busy in Google calendar. Call
    [[#isPluginActivated|isPluginActivated('google_calendar_export')]] API method to check if Google
    calendar sync plugin activated.


    Example:

    {
    "2016-02-05": [
    {
    "dd": [], // time slots from Google calendar
    "events": [ // reserved time slots
    { "from": "16:00", "to": "16:30" },
    { "from": "16:30", "to": "17:00" },
    ... ],
    "type": "reserved_time",
    },
    {
    "events": [
    { "from": "09:00", "to": "09:30" },
    { "from": "09:30", "to": "10:00" },
    ... ],
    "type": "not_worked_time"
    }],
    ...
    }
    • @param String $from
    • @param String $to
    • @param Integer $eventId
    • @param Integer $unitId
    • @param Integer $count
    • @return Object
  • getWorkDaysInfo ($from, $to, $unitId, $eventId, $count)

    Returns an information about working hours and break times for specified service and performer for a period
    between two dates. If only service specified then information about performer (or performers) will be taken from
    service configuration. Method returns a list of objects for each date in specified period. Count of objects in
    list depends on break times. For example if performer works from 9:00 till 19:00 with one hour break at 13:00 method
    returns:


    {'2014-05-14' : [
    {'from': '09:00:00', 'to': '13:00:00'},
    {'from': '14:00:00', 'to': '19:00:00'}
    ] }


    Warning! Method can return a time string '24:00:00' as right edge of time range. This happens in case if time
    range finishes on midnight.
    • @param String $from
    • @param String $to
    • @param Integer $unitId (optional)
    • @param Integer $eventId (optional)
    • @param Integer $count (optional)
    • @return Object
  • getFirstWorkingDay ()

    Returns first working date for unit
    • @param Integer
    • @return String
  • getStartTimeMatrix ($from, $to, $eventId, $unitId, $count)

    Returns available start time, taking into account breaktimes, start and end working time
    Eg.: {'2014-05-14': ['09:00:00', ...], ...}

    If locations plugin activated for company you should pass a list as $unitID parameter for filter results with
    units available only for selected location. See [[Plugins#Unit_location|Unit location]] plugin description for
    more details.
    • @param String $from
    • @param String $to
    • @param Integer $eventId
    • @param Mixed $unitId can be Integer or Array of Integers
    • @param Integer $count
    • @return Object
  • getAvailableTimeIntervals ($dateFrom, $dateTo, $eventId, $unitId, $count)

    Returns available time intervals for all service providers for given period, taking into account breaktimes, start and end working time
    Eg.: {['2016-03-04': ['1': [['09:00:00','09:30:00'], ['11:15:00','14:45:00']] , ...], ...]}
    • @param String $dateFrom
    • @param String $dateTo
    • @param Integer $eventId
    • @param Mixed $unitId can be Integer or Array of Integers
    • @param Integer $count
    • @return Object
  • getServiceAvailableTimeIntervals ($dateFrom, $dateTo, $eventId, $unitId, $count)

    Returns available time intervals for all servics for given period, taking into account breaktimes, start and end working time
    Eg.: {['2016-03-04': ['1': [['09:00:00','09:30:00'], ['11:15:00','14:45:00']] , ...], ...]}
    • @param String $dateFrom
    • @param String $dateTo
    • @param Mixed $eventId can be Integer or Array of Integers
    • @param Integer $unitId
    • @param Integer $count
    • @return Object
  • getReservedTimeIntervals ($dateFrom, $dateTo, $eventId, , $count)

    Returns not available time
    Eg.: {'2014-05-14': [{'reserved_time': [{'from': '14:00', 'to': '16:30'}], 'type': "reserved_time"}, ...], ...}
    • @param String $dateFrom
    • @param String $dateTo
    • @param Integer $eventId
    • @param Integer
    • @param Integer $count
    • @return Object
  • getAvailableUnits ($eventId, $dateTime, $count)

    Returns list of available unit ids for specified date and service or empty array if all units are not allowed.
    Eg.: [1, 2, 3]
    • @param Integer $eventId
    • @param String $dateTime a date and time string in format 'Y-m-d H:i:s'
    • @param Integer $count
    • @return Array
  • filterAvailableUnits ($eventId, $dateTime, , $count)

    Returns list of available unit ids for specified date and service from provided $unitIds list.
    You can use this method with location plugin.
    Returns empty array if all units are not allowed.
    Eg.: [1, 2, 3]
    • @param Integer $eventId
    • @param String $dateTime a date and time string in format 'Y-m-d H:i:s'
    • @param Array
    • @param Integer $count
    • @return Array
  • getAnyUnitData ()

    Returns information about [[Plugins#Any_Employee_selector|Any Employee selector plugin]] configuration. Returns
    null if plugin not enabled.

    Example:
    {
    "description" : "Select this option, if you want to find an available time with any of the employees",
    "hide_other_units" : 1, // 1 or 0
    "image" : null,
    "name" : "Any employee",
    "picture_path" : null,
    "random_selection" : 0 // 1 or 0
    }
    • @return Object
  • getAdditionalFields ($eventId)

    Return additional fields for certain event if [[Plugins#Additional_fields|Additional fields plugin]] is
    activated. Returns empty array otherwise. Call [[#isPluginActivated|isPluginActivated('event_field')]]
    API method to check if 'event_field' plugin activated.
    • @param Integer $eventId
    • @return Array
  • getTimeframe ()

    Returns company's timeframe configuration (in minutes). Timeframe can be either 5, 10, 15, 20, 30 or 60 minutes.
    You can find more details about timeframe [[Settings#Timeframe|here]].
    • @return Integer
  • isPluginActivated ($pluginName)

    Return plugin status true if status active, else false. $pluginName parameter is a plugin identifier.
    See [[Plugins|plugins]] page for full plugins description. See [[#Plugin's identifiers|list of available plugin's names]].
    • @param String $pluginName
    • @return Boolean
  • getPluginStatuses ($pluginNames)

    Return plugin status true if status active, else false. See [[#Plugin's identifiers|list of available plugin's names]].
    • @param Array $pluginNames
    • @return Array
  • getCompanyInfo ()

    Returns an object with detailed information about company. See [[#getCompanyInfo response|example of response]].
    • @return Object
  • createBatch ()

    Creates new booking batch record. Returns newly created batch id. You can use this id in [[#book|book]]
    API method.
    • @return Integer
  • getCountryPhoneCodes ()

    Returns country phone code list
    • @return Array
  • getPluginPromoInfoByCode ()

    Returns an object with detailed information about promotion by promotion code. You can get promotion code
    using [[Catalogue#getPromotionList|getPromotionList]] API method. If promotion record with specified
    code not found then method returns an empty array (an empty object). If [[Plugins#Simply Smart Promotions|Simply Smart Promotions plugin]]
    not enabled then method returns an error with code -32001 (Plugin is not activated). Use
    [[#isPluginActivated|isPluginActivated('promo')]] API method call to check if plugin enabled.


    See [[#getPromotionList response|example]] of getPromotionList API method response. Please note that
    response contains a list of services for wich promotion discount can be applied (service_ids key).
    • @param String
    • @return Array
  • getCompanyTimezoneOffset ()

    Returns company timezone offset and company timezone
    • @return array

Service URL  https://user-api.simplybook.me/login

  • getServiceUrl ($companyLogin)

    Returns API url for given company login
    • @param String $companyLogin
    • @return String
  • getToken ($companyLogin, $apiKey)

    Returns an application's token string for a company. You should use this token to authenticate all calls of
    [[Company public service methods|Company public service API methods]] and [[Catalogue|Catalogue API methods]]. To
    get application API key you need to enable [[Plugins#API|API plugin]].
    • @param String $companyLogin
    • @param String $apiKey
    • @return String
  • getUserToken ($companyLogin, $userLogin, $userPassword)

    Returns an authentication token string for certain user registered for company. You should use this token to
    authenticate all calls of [[Company administration service methods|Company administration service API methods]] and
    [[Catalogue|Catalogue API methods]].
    • @param String $companyLogin a company identifier (login)
    • @param String $userLogin user's login associated with company
    • @param String $userPassword user's password
    • @return String
  • getApplicationToken ($applicationApiKey)

    Returns an application's token string for an application. You should use this token to authenticate all calls of
    [[Company public service methods|Company public service API methods]] and [[Catalogue|Catalogue API methods]]. To
    get application API key please contact SimplyBook.me support team.
    • @param String $applicationApiKey
    • @return String

Service URL  https://user-api.simplybook.me/catalog

  • getCompanyList ($filter, $from, $limit)

    Returns companies list
    $filter filter params. Object that contains following params

    'search_string': String,
    'service_name': String,
    'company_name': String,
    'company_address': String,
    'category_id': Integer,
    'tag_ids': [Integer, Integer, ...],
    'tags': String,
    'country_id': String,
    'city_id': String,
    'nearby': {
    'radius': Integer,
    'center': {
    'lat': Number,
    'lng': NUmber
    }
    }

    Use tag_ids OR tags
    • @param Object $filter filter object
    • @param Integer $from from position
    • @param Integer $limit rows limit
    • @return array
  • getPromotionList ($filter, $from, $limit)

    Returns active promotion list
    $filter filter params. Object that contains following params

    'search_string': String,
    'service_name': String,
    'company_name': String,
    'company_address': String,
    'tag_ids': [Integer, Integer, ...],
    'tags': String,
    'country_id': String,
    'city_id': String,
    'nearby': {
    'radius': Integer,
    'center': {
    'lat': Number,
    'lng': NUmber
    }
    }

    Use tag_ids OR tags
    • @param Object $filter filter object
    • @param Integer $from from position
    • @param Integer $limit rows limit
    • @return array
  • getPromotionListByIds ()

    Returns active promotion list
    • @param array
    • @return array
  • getCompanyCount ($filter)

    Returns total companies count with specified filter
    $filter filter params. Object that contains following params

    'search_string': String,
    'service_name': String,
    'company_name': String,
    'company_address': String,
    'tag_ids': [Integer, Integer, ...],
    'tags': String,
    'country_id': String,
    'city_id': String,
    'nearby': {
    'radius': Integer,
    'center': {
    'lat': Number,
    'lng': NUmber
    }
    }

    Use tag_ids OR tags
    • @param Object $filter filter object
    • @return array
  • getPromotionCount ($filter)

    Returns total active promotions count with specified filter
    $filter filter params. Object that contains following params

    'search_string': String,
    'service_name': String,
    'company_name': String,
    'company_address': String,
    'tag_ids': [Integer, Integer, ...],
    'tags': String,
    'country_id': String,
    'city_id': String,
    'nearby': {
    'radius': Integer,
    'center': {
    'lat': Number,
    'lng': NUmber
    }
    }

    Use tag_ids OR tags
    • @param Object $filter filter object
    • @return array
  • getTopCountries ()

    Returns country list as Array order by company count in country
    • @return Array [{'id': ..., 'country': ...., 'count': ....}, ...]
  • getTopCities ()

    Returns city list as Array order by company count in city
    • @return Array [{'id': ..., 'city': ...., 'country_id': ...., 'count': .....}, ....]
  • getCountries ()

    Returns a list of objects with just two properties each: id and country. An id
    is a two character string with ISO 3166-1 country code.
    • @return Array [{'id': ..., 'country': ...., 'count': ....}, ...]
  • getCities ($country)

    Returns a list of objects. If $country parametr specified then method returns only cities of this
    country. Each object in list has 4 properties:

    * id - number. A unique identificator of city. You should use it as filter options in methods getCompanyList.
    * city - string. A city name.
    * count_id - string. Two chars ISO 3166-1 country code.
    * count - number.

    Example:

    [{
    "cnt" : 7,
    "country_id"" : "GB",
    "id" : 4607,
    "name" : "Uxbridge"
    },
    ...]
    • @param String $country Optional. A two character ISO 3166-1 country code.
    • @return Array [{'id': ..., 'city': ...., 'country_id': ...., 'count': .....}, ....]
  • getTags ($filter)

    Returns tags list
    $filter filter params. Object that contains following params

    'tag_ids': [Integer, Integer, ...],
    'tags': String,
    'country_id': String,
    'city_id': String

    Use tag_ids OR tags
    • @param Object $filter filter object
    • @return Array [{'id': ..., 'tag': ...}, ....]
  • getCompanyInfo ($login)

    Returns company information by company login
    • @param String $login
    • @return Object
  • getPromotionInfo ($id, $feedbackFrom, $feedbackCount)

    Returns promotion information by id
    • @param Integer $id
    • @param Integer $feedbackFrom = 0
    • @param Integer $feedbackCount = 100
    • @return Object
  • getRelatedPromotions ($id, $count)

    Returns related promotions by given promotion id
    • @param Integer $id
    • @param Integer $count = 10
    • @return Array
  • getCompanyReviews ($login, $count)

    Returns a list of company's review objects.

    [{
    "company_id" : 86409,
    "domain" : "simplybook.me",
    "feedback_datetime" : "2015-10-27 13:06:57",
    "feedback_id" : 4623,
    "feedback_link" : "",
    "id" : 17384,
    "image" : "http://graph.facebook.com/1020443689023222/picture",
    "link" : "https://www.facebook.com/app_scoped_user_id/1020443689023222/",
    "message" : "Brilliant!",
    "name" : "Simply Booker",
    "provider" : "",
    "provider_data" : "...", // String. An object encoded with PHP's serialize method.
    "rate" : 5, // 0 to 5 rate
    "status" : "approved", // 'new' or 'approved'
    "subject" : "Good",
    "with_comment" : 1
    },
    ...]
    • @see http://php.net/serialize
    • @param String $login
    • @param Integer $count
    • @return Object
  • addCompanyReview ($login, $subject, $message, $rate, $provider, $accessToken)

    Adds company review
    • @param String $login
    • @param String $subject
    • @param String $message
    • @param Integer $rate
    • @param String $provider
    • @param String $accessToken
    • @return Boolean
  • addPromotionReview ($promotionId, $subject, $message, $rate, $provider, $accessToken)

    Add promotion review
    • @param Integer $promotionId
    • @param String $subject
    • @param String $message
    • @param Integer $rate
    • @param String $provider
    • @param String $accessToken
    • @return Boolean
  • getPromotionReviews ($promotionId)

    Returns promotion reviews list
    • @param Integer $promotionId
    • @return Object
  • getRecentPromotions ($count)

    Returns list of promotions ordered by date DESC
    • @param Integer $count
    • @return Array
  • getRecentFeedbacks ($count)

    Returns list of feedbacs ordered by date DESC
    • @param Integer $count
    • @return Array
  • getRecentCompanies ($count)

    Returns list of companies ordered by date DESC
    • @param Integer $count
    • @return Array
  • getCategories ()

    Returns all categories as list of objects. Each category can have a subcategories. Each subcategory contains parent
    category id in company_category_id field. For top level categories this field is null and
    is_header field is true.


    Example:

    [{
    "company_category_id": null,
    "id": "1",
    "image": "/common/images/category_icons/car.png",
    "is_active": "1",
    "is_header": "1",
    "name": "Cars",
    },
    {
    "company_category_id": "1",
    "id" = 11;
    "image": null,
    "is_active": "1",
    "is_header": "0",
    "name": "Car wash",
    },
    ...]
    • @return Array
  • getFeedbackList ()

    Get list of ALL simplybook feedbacks
    • @return Array
  • getCompanyPromotionList ($promotionCompanyLogin, $count)

    Returns a list of promotions objects associated with specified company. If company doesn't have any promotions or
    [[Plugins#Simply_Smart_Promotions|Simply Smart Promotions plugin]] not active for this company method returns an
    empty list.
    • @param String $promotionCompanyLogin
    • @param Integer $count Optional. Maximum amount of objects in response. Default value is 100.
    • @return Array
  • getUserLocation ($ip)

    Returns user location info
    • @param String $ip optional
    • @return Object
  • getAutocompleete ($filter, )

    Returns suggestions for autocompeter
    $filter filter params. Object that contains following params

    'search_string': String,
    'service_name': String,
    'company_name': String,
    'company_address': String,
    'category_id': Integer,
    'tag_ids': [Integer, Integer, ...],
    'tags': String,
    'country_id': String,
    'city_id': String,
    'nearby': {
    'radius': Integer,
    'center': {
    'lat': Number,
    'lng': NUmber
    }
    }

    Use tag_ids OR tags
    • @param Object $filter filter object
    • @param Boolean
    • @return array