-
getUserList ()
Get list of all users (non-blocked)
in format array(id => array(data), ...)
-
getUserReport ()
-
deleteUsers ($users)
Delete given users if it is possible
Return an error with code -32002 if no $users provided
Return an error with code -32043 if try to delete user, which is logged currently in admin interface
Return an error with code -32044 if try to delete 'admin' user
-
getUserPhoneValidationInfo ($userId, $number)
Get user db data (id, phone, is_validated)
-
getConfigKeys ($module, $plugin, $asArray, $includeHidden)
Get list of company configuration keys with selected value
(and with list of all options for select - type keys)
-
getEmptyConfigKeys ($module, $plugin, $asArray)
Get list of company configuration keys with values
-
saveConfigKeys ($data, $module, $plugin)
Save configuration keys
-
getNotificationConfigStructure ($plugin)
Get structure of SMS and Email notification config params
-
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'
* '''edited_date_from''' a date string in format 'Y-m-d'
* '''edited_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.
* '''code''' booking code
*: 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"
}
-
pluginZapierSubscribe ($url, $notificationType)
'create', 'cancel', 'new_client', 'change', 'create_invoice'
-
getBookingDetailsZapierMock ()
-
getClientInfo ($clientId)
Returns client data
-
getClientInfoZapier ($clientId)
Returns client data
-
getClientInfoZapierMock ()
Returns client data
-
getBookingsZapier ()
Returns list of bookings filtered by given params
-
getInvoiceDetailsMock ()
-
getBookingDetails ($id)
Returns detailed bookings object by booking id. See [[#getBookingDetails_response|response example]].
-
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.
-
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"},
...
]
-
getGoogleCalendarBusyTimeAvailableUnits ()
Returns configured unit ids, allowed to sync busy time
-
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.
-
getUnitWorkingDurations ($dateStart, $dateEnd, $unitGroupId)
Return working durations
-
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
] }]
-
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
]}
-
getUnitWorkdayInfo ($dateStart, $dateEnd, $unitGroupId)
Return workday info (date_start and date_end)
-
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.
-
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.
-
book ($eventId, $unitId, $clientId, $startDate, $startTime, $endDate, $endTime, $clientTimeOffset, $additional, $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.
-
editBook ($shedulerId, $eventId, $unitId, $clientId, $startDate, $startTime, $endDate, $endTime, $clientTimeOffset, $additional)
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.
-
addClient ($clientData, $sendEmail)
Adds new client with specified data. You can specify name, email, phone, address1, address2, city, zip,
country_id.
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
}
-
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.
-
changeClientPassword ($clientId, $password, $sendEmail)
Change client password and send password email changing
-
resetClientsPassword ($clientIds)
Resets client password and send them emails
-
remindClientsPassword ($email)
Sends remind email for client
-
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.
-
getStatuses ()
Returns list of available statuses or an empty list if [[Plugins#Status|Status plugin]] not enabled.
-
getBookingStatus ($bookingId)
Returns status of given booking (if status plugin is enabled)
default status will be returned if bookingId does not exists
-
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.
-
getRecurringSettings ($eventId)
Returns an object with recurring settings for an event. Returns false if specified event does not configured as
recurring.
-
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.
-
Returns a list with statistics for performers. This data contains number of bookings and revenues value for each performer.
-
getRecurringDatetimes ($eventId, $unitId, $date, $time, $recurringData, $endDateTime, $productIds)
Get list of dates for recurring booking
-
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.
-
deleteDeviceToken ($token)
Unsubscribe from push notifications service.
-
getCountryList ()
Get list of all countries
-
getStates ()
Get list of all country states
-
getFeedbacks ($approvedOnly, $reviewsOnly, $lastOnly, $limit)
Get list of feedbacks
-
getRecentActions ($lastOnly, $limit)
Returns latest actions
-
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
-
updateNotification ($type)
Mark notifications as readed
-
getLastNotificationUpdate ($type)
Returns last update datetime
-
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
}]
-
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.
-
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.
-
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.
-
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.
-
getPluginList ()
Returns a list of all plugins associated with company with status.
-
Returns booking comment
-
Set booking comment
-
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"
}
-
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
-
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
-
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
-
getSocialCounterStats ($provider)
Returns social counters value for your domain
-
getCompanyCurrency ()
Returns company's currency as three chars code (ISO 4217).
-
Returns list of all comments for given client
-
getClientSoapData ($clientId)
Returns current SOAP information by client id
-
getClientSoapHistory ($clientId)
Returns SOAP history by client id
-
updateClientSoapData ($clientId, $data)
Updates SOAP information if it was changed
-
getClientSoapCryptData ($clientId)
Returns current SOAP (crypt) information by client id
-
getClientSoapCryptHistory ($clientId)
Returns SOAP (crypt) history by client id
-
updateClientSoapCryptData ($clientId, $data)
Updates SOAP (crypt) information if it was changed
-
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
}
-
saveServiceDetails ($data)
Save service details (both for create and edit service)
NB only what is related to service directly should be saved in this function,
save plugins data, binding with performers and service schedule should be saved separatelly
NB it is not obligatory to pass all data, you can pass only params which were changed
-
setServicesPositions ($servicesPositions, $categoryId)
Update position param for given services
return error code -32077 if any exception happens
-
setClassesPositions ($servicesPositions, $categoryId)
Update position param for given classes
(basically, for services of these classes)
return error code -32077 if any exception happens
-
Update position param for given performers,
return error code -32077 if any exception happens
-
setServicesVisibility ($servicesPositions)
Update 'is_public' param for given services
-
deleteServices ($services)
Delete given services if it is possible
Returns an error with code -32103 if trying to delete all existing services
Return an error with code -32002 if no $services provided
-
Delete given services if it is possible
Returns an error with code -32076 if trying to delete all existing services
Return an error with code -32002 if no $performers provided
-
saveCategoryDetails ($data)
Save event category details for admin interface
-
setCategoriesPositions ($categoriesPositions)
Update position param for given categories if [[Plugins#Service categories|Service categories plugin]] is activated. Returns
an error with code -32001 if plugin is not activated. Returns an error with code -32077 if any exception happens during reordering
Use [[#isPluginActivated|isPluginActivated('event_category')]]
API method to check if plugin activated.
-
setLocationsPositions ($positions)
Update position param for given categories if [[Plugins#Locations|Locations plugin]] is activated. Returns
an error with code -32001 if plugin is not activated. Returns an error with code -32077 if any exception happens during reordering
Use [[#isPluginActivated|isPluginActivated('location')]]
API method to check if plugin activated.
-
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
-
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
-
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 ]
}
-
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 ]
}
-
addService ($data)
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",
}
-
editService ($id, $data)
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",
}
-
editServiceCategory ($id, $data)
Edit service category
Example:
{
"name":"Category name",
"description":"Category description",
"is_default":1,
"position":0,
-
deleteServiceCategory ($id)
Delete service category
-
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.
-
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.
-
deleteServiceProviderLocation ($id)
Delete service provider location
-
addServiceCategory ($data)
Edit service category
Example:
{
"name":"Category name",
"description":"Category description",
"is_default":1,
"position":0,
-
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"
}
-
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"
}
-
saveServicePluginsData ($serviceId, $data)
Save plugins data for given service
(the function checks what is passed in params and which plugin is activated)
-
Save performer details (both for create and edit performer)
NB only what is related to performer directly should be saved in this function,
save plugins data, binding with services, users and performer schedule should be saved separatelly
NB it is not obligatory to pass all data, you can pass only params which were changed
-
saveLocationDetails ($data)
Save location details for admin interface
-
setEventUnitGroups ($eventId, $unitGroups)
Save connection of event with unit groups
-
setEventCategories ($eventId, $categories)
Save connection of event with categories
-
setCategoryEvents ($categoryId, $events)
Save connection of category with attached events
-
setUnitGroupEvents ($unitGroupId, $events)
Save connection of unit group with events
-
setUnitGroupLocations ($unitGroupId, $locations)
Save connection of unit group with locations
-
setLocationUnitGroups ($locationId, $unitGroups)
Save connection of location with attached unit groups
-
getCampaignList ($asArray)
Get list of campaigns with details
-
getMembershipList ($visibleMembershipsOnly, $asArray)
Get list of memberships with details and attached services
used in admin part, use the same function in IndexService for public part
-
getMembershipListForCombobox ($searchString, $limit)
Returns list of memberships. You can use either name or duration as value for $searchString
.
Pass an empty string for $searchString
and null for $limit
parameters to get all records.
-
getMembership ($membershipId)
Returns membership's data object.
-
getClientMembershipList ($clientId)
Returns purchased membership list
-
deleteMemberships ($memberships)
Delete given memberships
Return an error with code -32002 if no $memberships provided
-
getAdditionalFieldList ()
Return all list of additional fields or an empty array.
Used both for admin and public parts.
Call [[#isPluginActivated|isPluginActivated('event_field')]]
API method to check if 'event_field' plugin activated.
-
deleteAdditionalFields ($additionalFields)
Delete given additional fields
Return an error with code -32002 if no $additionalFields provided
-
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
-
deleteSpecialDay ($date, $params)
Delete special date if set
Example:
{
"unit_group_id":"",
"event_id":""
}
-
getCompanyWorkCalendarForYear ($year)
Returns company special days and vacations
-
getServiceWorkCalendarForYear ($year, $eventId)
Returns special days and vacations, defined for given service (event)
-
getCompanyVacations ()
Get list of company vacations in format array(vacation_id => array())
-
getServiceVacations ($serviceId)
Get list of service vacations
-
Get list of performer vacations
-
getCompanyVacation ($vacationId)
Get company vacation by id
-
getServiceVacation ($vacationId, $serviceId)
Get service vacation by id
-
Get service vacation by id
-
saveCompanyVacation ($data)
Save company vacation data
(create or update table depending on 'id' param existing in $data)
-
saveServiceVacation ($data, $serviceId)
Save company vacation data
(create or update table depending on 'id' param existing in $data)
-
Save company vacation data
(create or update table depending on 'id' param existing in $data)
-
deleteCompanyVacation ($vacationId)
Delete company vacation with all it's bindings
(including created special days in work_day_special table)
-
deleteServiceVacation ($vacationId, $serviceId)
Delete service vacation with all it's bindings
(including created special days in work_day_special table)
-
Delete performer vacation with all it's bindings
(including created special days in work_day_special table)
-
getCompanyIntersectedVacations ($dateFrom, $dateTo)
Return array of vacations, which interval includes one or both of given dates (in sql format)
-
getServiceIntersectedVacations ($dateFrom, $dateTo, $serviceId)
Return array of vacations, which interval includes one or both of given dates (in sql format)
-
Return array of vacations, which interval includes one or both of given dates (in sql format)
-
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.
-
deleteClasses ($services)
-
saveClassDetails ($data)
Save (create/update) class,
which means saving service, performer and their binding
// @todo: write here $data example (e.g. as it is done for setWorkDayInfo function)
-
setClassesVisibility ($classesVisibility)
Show/hide both service and provider of the given classes
-
getProductList ($filter)
Returns product list with filter.
At this time filter can accept only service_id parameter
-
getProductCategoriesList ()
-
saveProductCategoryDetails ()
-
setProductCategoryPositions ()
-
setProductPositions ()
Update position param for given products if [[Plugins#Products|Products plugin]] is activated. Returns
an error with code -32001 if plugin is not activated. Use [[#isPluginActivated|isPluginActivated('product')]]
API method to check if plugin activated.
-
deleteProduct ($id)
Delete given product or products if it is possible, otherwise set it as inactive
The $id param can be int or array of int
-
saveProductDetails ($data)
Save product details (both for create and edit product)
Returns product item id
-
setProductCategories ()
-
deleteProductCategory ($categoryId)
-
getBookingReport ()
Get paginated data for Booking report
The following filters can be provided in request param:
Date date_from, date_to, created_date_from, created_date_to
Integer unit_group_id, client_id
String code, promo_code
String booking_type = 'approved' | 'not_approved_yet' | 'cancelled_by_admin' | 'cancelled_by_client' | 'non_cancelled' | 'cancelled' | 'all'
Order can be one of the following values: record_date, date_start, date_start_asc
Return data in the following format:
array(
'data' => $data,
'metadata' => array(
'items_count'
'pages_count'
'page'
'on_page'
)
or Api_Service_Exception in error case
-
getClientReport ()
Get paginated data for Client report
The following filters can be provided in request param:
Date date_from, date_to
Integer event_id, unit_group_id, client_id
String client_search (search string, can contains client name, address, phone)
String service_using_type = 'used_in_period' | 'not_used_in_period' | 'not_used_in_period_but_used_before'
No custom ordering implemented yet
Group data = 'client' | 'client_email_phone' | 'client_email' | 'client_phone'
Return data in the following format:
array(
'data' => $data,
'metadata' => array(
'items_count'
'pages_count'
'page'
'on_page'
)
or Api_Service_Exception in error case
-
getSmsReport ()
Get paginated data for SMS report
The following filters can be provided in request param:
Date date_from, date_to
Integer unit_group_id, client_id
String phone, message
No custom ordering implemented yet (always ordered by client name)
Return data in the following format:
array(
'data' => $data,
'metadata' => array(
'items_count'
'pages_count'
'page'
'on_page'
)
or Api_Service_Exception in error case
-
getSmsGateways ()
gets differend sms providers(transport) used by system
-
getEmailReport ()
Get paginated data for email report
Return data in the following format:
array(
'data' => $data,
'metadata' => array(
'items_count'
'pages_count'
'page'
'on_page'
)
or Api_Service_Exception in error case
-
getPosReport ()
Get paginated data for Pos report
Return data in the following format:
array(
'data' => $data,
'metadata' => array(
'items_count'
'pages_count'
'page'
'on_page'
)
or Api_Service_Exception in error case
-
getFeedbackReport ()
Get paginated data for Feedback report
The following filters can be provided in request param:
Date date_from, date_to
Integer from 1 to 5 rate_from, rate_to
String name, subject, message
Report can be ordered by one of the following fields:
date, rate, name, message, subject, answer
Return data in the following format:
array(
'data' => $data,
'metadata' => array(
'items_count'
'pages_count'
'page'
'on_page'
)
or Api_Service_Exception in error case
-
Get detailed list of promotions (new)
-
Save connection of promotion with events
-
Save connection of promotion with memberships
-
Save connection of promotion with packages
-
Save connection of promotion with plugin_product
-
Save connection of promotion with plugin_product
-
Delete given promotions if it is possible
Return an error with code -32002 if no $promotions provided
-
Update position param for given promotions
return error code -32077 if any exception happens
-
Update 'is_public' param for given promotions
-
The following filters can be provided in request param:
Return data in the following format:
array(
'data' => $data,
'metadata' => array(
'items_count'
'pages_count'
'page'
'on_page'
)
or Api_Service_Exception in error case
-
Get all list of promotion instances
-
Return promotion detailed info
-
Delete given promotion instances if it is possible
Return an error with code -32002 if no $instances provided
Return an error with code -32078 if trying to delete promotion instance which has messages sent
-
Disabled given promotion instances
-
getStaticPageList ()
Get static page list
-
confirmInvoice ($id, $paymentSystem)
Confirms invoice by id
-
Applies promo code to order (Coupons & Gift Cards custom feature)
-
applyTip ($id, $percent, $amount)
Applies tip to order (Tips custom feature)
You can apply tip by percent or by amount
-
getCountByShedulerChannels ($startDate, $endDate)
-
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]].
-
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]].
-
getCancellationPolicy ()
Returns cancellation policy rules.
If cancellation policy custom feature is not activated, method returns null.
-
getTimelineType ()
Returns company timeline type
-
getEventList ($isVisibleOnly, $asArray, $handleClasses, $searchString)
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.
-
addPluginDataToServiceList ($events, $isVisibleOnly)
Change $events data, add plugins info to each event
-
getUnitList ($isVisibleOnly, $asArray, $handleClasses, $searchString)
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.
-
addPluginDataToProviderList ($units, $isVisibleOnly)
Change $units data, add plugins info to each unit
-
calculateEndTime ($startDateTime, $eventId, $unitId, $productIds)
Returns end datetime if booking is available, else return false
-
getWorkCalendar ($year, $month, $data)
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': ...}
-
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"
}],
...
}
-
getWorkDaysInfo ($from, $to, $unitId, $eventId, $count, $productIds)
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.
-
getFirstWorkingDay ($data)
Returns first working date for unit
-
getStartTimeMatrix ($from, $to, $eventId, $unitId, $count, $bookingId, $productIds)
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.
-
getCartesianStartTimeMatrix ($from, $to, $eventId, $unitId, $count, $bookingId, $productIds)
Returns available start time, taking into account breaktimes, start and end working time.
The difference between getStartTimeMatrix and getCartesianStartTimeMatrix is that getCartesianStartTimeMatrix
provides time slots for each individual provider.
Eg.: {"provider_id": 1, "service_id": 1, "timeslots": {"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.
-
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']] , ...], ...]}
-
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']] , ...], ...]}
-
getReservedTimeIntervals ($dateFrom, $dateTo, $eventId, $unitId, $count, $bookingId)
Returns not available time
Eg.: {'2014-05-14': [{'reserved_time': [{'from': '14:00', 'to': '16:30'}], 'type': "reserved_time"}, ...], ...}
-
getAvailableUnits ($eventId, $dateTime, $count, $unitId, $productIds)
Returns list of available unit ids for specified date and service or empty array if all units are not allowed.
Eg.: [1, 2, 3]
-
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
}
-
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.
-
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]].
-
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]].
-
getPluginStatuses ($pluginNames)
Return plugin status true if status active, else false. See [[#Plugin's identifiers|list of available plugin's names]].
-
getCompanyInfo ()
Returns an object with detailed information about company. See [[#getCompanyInfo response|example of response]].
-
createBatch ()
Creates new booking batch record. Returns newly created batch id. You can use this id in [[#book|book]]
API method.
-
getCountryPhoneCodes ()
Returns country phone code list
-
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).
-
getCompanyTimezoneOffset ()
Returns company timezone offset and company timezone