Home
Random
Log in
Settings
About SimplyBook.me
Disclaimers
SimplyBook.me
Search
Export translations
Translate
Settings
Group
1 is not greater than 2 (when trying to change number of clients per provider)
Accept deposits custom feature
Accept payments custom feature
Add elements to booking page
Adding other users to the system
Adding services, providers and availability(new interface)
Additional Bookings
Additional tips
Adjust your terminology/language
Adjusting client invoices
Adjusting notifications
Anti-Fraud/Spam Protection Custom Feature
Any Employee Selector custom feature
API
API custom feature
Appointment at Fixed Time custom feature
Approve Bookings custom feature
Authentication
Book days
Book Soon Notification System custom feature
Booking reports
Booking site SEO settings
Booking website
Booking Website QR Code
Bookings on Facebook
Break times
Brief overview of the system
Buffer time
Business enhancements
Calendar and Bookings
Calendar Notes
Calendar Sync custom feature
Campaign custom feature
Cancellation Policy custom feature
Catalogue
Categories and Locations
Classes custom feature
ClassPass custom feature
Clean History custom feature
Client Fields Custom Feature
Client Login custom feature
Client mobile app
Client Rescheduling custom feature
Client's report
Company administration service methods
Contact Widget custom feature
Cookie Banners: Essentials and Tips for Removal
Coupons and Gift Cards custom feature
Creating a Private Service/Event with a Direct Link
Custom CSS custom feature
Custom Domain custom feature
Custom Email custom feature
Custom Features
Custom Features by category
Custom Features dependent on other Custom Features
Custom interval before service reservation custom feature
Custom Page custom feature
Daily Report custom feature
Design
Display Remaining Spaces
Duda integration
Email notifications with Zapier
Email whitelisting instructions
Events (services on particular dates)
External Booking Validator custom feature
Facebook and Instagram Bookings
Facebook Client Info custom feature
Facebook Pixel Custom Feature
File Uploader - Google Drive custom feature
First and Last Names
Flexible Notifications custom feature
FreshBooks integration
Getting started
Giving access to the system to other people
Go Daddy
Google AdWords and Analytics custom feature
Google Authenticator custom feature
Google Business custom feature
Google Reviews custom feature
Google Tag Manager custom feature
Google Translate custom feature
Group Bookings custom feature
Help Center
HIPAA custom feature
How to add Google Meet links to appointments
How to cancel booking
How to Cancel SimplyBook.me subscription
How to change the way time slots are shown
How to change the way time slots are shown?
How to connect location with service?
How to delete account
How to enable custom feature
How to get invoice
How to manage bookings
How to remove "Reviews" tab?
How to reschedule booking
How to set my availability
How to unblock account
HTML button
HTML Description Field for Events custom feature
I have clients in different time zones
ICal
Import Clients custom feature
Important for Free accounts
Importing the list of clients
Insights custom feature
Instagram Photo Sharing custom feature
Intake Forms custom feature
Integration
Integration with Mailchimp
Is the system free?
Joomla integration
Kiosk custom feature
Limit Bookings custom feature
Line bot custom feature
LINE LIFF Custom Feature
Link removal and custom domain
Login and password
Loyalty System custom feature
Make me look busy custom feature
MediaWiki:Sidebar
Medical test custom feature
Membership custom feature
Memberships vs Packages: Choosing the Right Custom Feature for Your Business
Multiple Bookings custom feature
Multiple Locations custom feature
My SimplyBook.me subscription and how to renew
My subscription and how to renew
N8N Integration
Need to change interval (timeframe)
News custom feature
Notification is different from the template in Settings//Email and SMS settings
Number of clients per time slot
Online Video Meetings Custom Feature
Online Video Meetings via Zoom
Opening hours of the company vs Working hours of provider/service
Other Integrations
Own domain
Packages custom feature
Password Security Settings custom feature
Photo Gallery custom feature
Point of Sale custom feature
Popular custom features by business category
Products for Sale custom feature
Provider Color Coding custom feature
Quest rooms
QuickBooks integration
Recurring services(packs)
Related Resources custom feature
Remove Elements from booking page
Rentals
SBPay.me
SBPay.me - How to create account
SBPay.me integration
SBPay.me User Roles
Service Add-Ons custom feature
Service Categories custom feature
Service/Provider relations
Shopify
Should I use Classes or Services
SimplyBook.me Subscription Pricing and Additional Items
SITE123 integration
SMS Gateway custom feature
SMS Pricing
SMTP custom feature
SOAP with Encryption custom feature
Socials and Ads
Squarespace
SSL custom feature
SSO-SAML Custom Feature
Statistics & Analytics
Status custom feature
Tags Custom Feature
Take Me Back Home custom feature
Telegram Notifications custom feature
Terms and Conditions custom feature
Ticket's QR Code
Tickets custom feature
Time and date settings
Time settings
Time slots are not bookable
Time slots are not showing up
Tips Custom Feature
Tips for specific businesses
Tips for your business
Upgrade from lower to higher subscription before current subscription expired.
User API guide
Video
Views of the calendar
Visitor Counter custom feature
Waiting List custom feature
Weebly
What Custom Features do not work with each other
What image sizes are recommended for my booking website
What will happen if I don't pay?
Where to change logo and background?
Where to change my info
Where to change theme?
Where to find payment history?
Widgets for your own website
Wix integration
WordPress integration
Xero integration
Zapier Connector custom feature
Zapier integration wit SBPay.me
Language
aa - Afar
aae - Arbëresh
ab - Abkhazian
abs - Ambonese Malay
ace - Acehnese
acf - Saint Lucian Creole
acm - Iraqi Arabic
ady - Adyghe
ady-cyrl - Adyghe (Cyrillic script)
aeb - Tunisian Arabic
aeb-arab - Tunisian Arabic (Arabic script)
aeb-latn - Tunisian Arabic (Latin script)
af - Afrikaans
aln - Gheg Albanian
alt - Southern Altai
am - Amharic
ami - Amis
an - Aragonese
ang - Old English
ann - Obolo
anp - Angika
apc - Levantine Arabic
ar - Arabic
arc - Aramaic
arn - Mapuche
arq - Algerian Arabic
ary - Moroccan Arabic
arz - Egyptian Arabic
as - Assamese
ase - American Sign Language
ast - Asturian
atj - Atikamekw
av - Avaric
avk - Kotava
awa - Awadhi
ay - Aymara
az - Azerbaijani
azb - South Azerbaijani
ba - Bashkir
ban - Balinese
ban-bali - Balinese (Balinese script)
bar - Bavarian
bbc - Batak Toba
bbc-latn - Batak Toba (Latin script)
bcc - Southern Balochi
bci - Baoulé
bcl - Central Bikol
bdr - West Coast Bajau
be - Belarusian
be-tarask - Belarusian (Taraškievica orthography)
bew - Betawi
bg - Bulgarian
bgc - Haryanvi
bgn - Western Balochi
bh - Bhojpuri
bho - Bhojpuri
bi - Bislama
bjn - Banjar
blk - Pa'O
bm - Bambara
bn - Bangla
bo - Tibetan
bpy - Bishnupriya
bqi - Bakhtiari
br - Breton
brh - Brahui
bs - Bosnian
btm - Batak Mandailing
bto - Rinconada Bikol
bug - Buginese
bxr - Russia Buriat
ca - Catalan
cbk-zam - Chavacano
ccp - Chakma
cdo - Mindong
ce - Chechen
ceb - Cebuano
ch - Chamorro
chn - Chinook Jargon
cho - Choctaw
chr - Cherokee
chy - Cheyenne
ckb - Central Kurdish
co - Corsican
cps - Capiznon
cpx - Puxian
cpx-hans - Puxian (Simplified Han script)
cpx-hant - Puxian (Traditional Han script)
cpx-latn - Puxian (Latin script)
cr - Cree
crh - Crimean Tatar
crh-cyrl - Crimean Tatar (Cyrillic script)
crh-latn - Crimean Tatar (Latin script)
crh-ro - Dobrujan Tatar
cs - Czech
csb - Kashubian
cu - Church Slavic
cv - Chuvash
cy - Welsh
da - Danish
dag - Dagbani
de - German
de-at - Austrian German
de-ch - Swiss High German
de-formal - German (formal address)
dga - Southern Dagaare
din - Dinka
diq - Dimli
dsb - Lower Sorbian
dtp - Central Dusun
dty - Doteli
dua - Duala
dv - Divehi
dz - Dzongkha
ee - Ewe
efi - Efik
egl - Emilian
el - Greek
eml - Emiliano-Romagnolo
en - English
en-ca - Canadian English
en-gb - British English
eo - Esperanto
es - Spanish
es-419 - Latin American Spanish
es-formal - Spanish (formal address)
et - Estonian
eu - Basque
ext - Extremaduran
fa - Persian
fat - Fanti
ff - Fula
fi - Finnish
fit - Tornedalen Finnish
fj - Fijian
fo - Faroese
fon - Fon
fr - French
frc - Cajun French
frp - Arpitan
frr - Northern Frisian
fur - Friulian
fy - Western Frisian
ga - Irish
gaa - Ga
gag - Gagauz
gan - Gan
gan-hans - Gan (Simplified Han script)
gan-hant - Gan (Traditional Han script)
gcf - Guadeloupean Creole
gcr - Guianan Creole
gd - Scottish Gaelic
gl - Galician
gld - Nanai
glk - Gilaki
gn - Guarani
gom - Goan Konkani
gom-deva - Goan Konkani (Devanagari script)
gom-latn - Goan Konkani (Latin script)
gor - Gorontalo
got - Gothic
gpe - Ghanaian Pidgin
grc - Ancient Greek
gsw - Alemannic
gu - Gujarati
guc - Wayuu
gur - Frafra
guw - Gun
gv - Manx
ha - Hausa
hak - Hakka Chinese
hak-hans - Hakka (Simplified Han script)
hak-hant - Hakka (Traditional Han script)
hak-latn - Hakka (Latin script)
haw - Hawaiian
he - Hebrew
hi - Hindi
hif - Fiji Hindi
hif-latn - Fiji Hindi (Latin script)
hil - Hiligaynon
hno - Northern Hindko
ho - Hiri Motu
hr - Croatian
hrx - Hunsrik
hsb - Upper Sorbian
hsn - Xiang
ht - Haitian Creole
hu - Hungarian
hu-formal - Hungarian (formal address)
hy - Armenian
hyw - Western Armenian
hz - Herero
ia - Interlingua
iba - Iban
ibb - Ibibio
id - Indonesian
ie - Interlingue
ig - Igbo
igl - Igala
ii - Sichuan Yi
ik - Inupiaq
ike-cans - Eastern Canadian (Aboriginal syllabics)
ike-latn - Eastern Canadian (Latin script)
ilo - Iloko
inh - Ingush
io - Ido
is - Icelandic
isv-cyrl - Interslavic (Cyrillic script)
isv-latn - Interslavic (Latin script)
it - Italian
iu - Inuktitut
ja - Japanese
jam - Jamaican Creole English
jbo - Lojban
jut - Jutish
jv - Javanese
ka - Georgian
kaa - Kara-Kalpak
kab - Kabyle
kai - Karekare
kbd - Kabardian
kbd-cyrl - Kabardian (Cyrillic script)
kbp - Kabiye
kcg - Tyap
kea - Kabuverdianu
kg - Kongo
kge - Komering
khw - Khowar
ki - Kikuyu
kiu - Kirmanjki
kj - Kuanyama
kjh - Khakas
kjp - Eastern Pwo
kk - Kazakh
kk-arab - Kazakh (Arabic script)
kk-cn - Kazakh (China)
kk-cyrl - Kazakh (Cyrillic script)
kk-kz - Kazakh (Kazakhstan)
kk-latn - Kazakh (Latin script)
kk-tr - Kazakh (Turkey)
kl - Kalaallisut
km - Khmer
kn - Kannada
knc - Central Kanuri
ko - Korean
ko-kp - Korean (North Korea)
koi - Komi-Permyak
kr - Kanuri
krc - Karachay-Balkar
kri - Krio
krj - Kinaray-a
krl - Karelian
ks - Kashmiri
ks-arab - Kashmiri (Arabic script)
ks-deva - Kashmiri (Devanagari script)
ksh - Colognian
ksw - S'gaw Karen
ku - Kurdish
ku-arab - Kurdish (Arabic script)
ku-latn - Kurdish (Latin script)
kum - Kumyk
kus - Kusaal
kv - Komi
kw - Cornish
ky - Kyrgyz
la - Latin
lad - Ladino
lb - Luxembourgish
lbe - Lak
lez - Lezghian
lfn - Lingua Franca Nova
lg - Ganda
li - Limburgish
lij - Ligurian
liv - Livonian
lki - Laki
lld - Ladin
lmo - Lombard
ln - Lingala
lo - Lao
loz - Lozi
lrc - Northern Luri
lt - Lithuanian
ltg - Latgalian
lua - Luba-Lulua
lus - Mizo
luz - Southern Luri
lv - Latvian
lzh - Literary Chinese
lzz - Laz
mad - Madurese
mag - Magahi
mai - Maithili
map-bms - Banyumasan
mdf - Moksha
mg - Malagasy
mh - Marshallese
mhr - Eastern Mari
mi - Māori
min - Minangkabau
mk - Macedonian
ml - Malayalam
mn - Mongolian
mnc - Manchu
mnc-latn - Manchu (Latin script)
mnc-mong - Manchu (Mongolian script)
mni - Manipuri
mnw - Mon
mo - Moldovan
mos - Mossi
mr - Marathi
mrh - Mara
mrj - Western Mari
ms - Malay
ms-arab - Malay (Jawi script)
mt - Maltese
mui - Musi
mus - Muscogee
mwl - Mirandese
my - Burmese
myv - Erzya
mzn - Mazanderani
na - Nauru
nah - Nahuatl
nan - Minnan
nan-hant - Minnan (Traditional Han script)
nan-latn-pehoeji - Minnan (Pe̍h-ōe-jī)
nan-latn-tailo - Minnan (Tâi-lô)
nap - Neapolitan
nb - Norwegian Bokmål
nds - Low German
nds-nl - Low Saxon
ne - Nepali
new - Newari
ng - Ndonga
nia - Nias
nit - Southeastern Kolami
niu - Niuean
nl - Dutch
nl-informal - Dutch (informal address)
nmz - Nawdm
nn - Norwegian Nynorsk
no - Norwegian
nod - Northern Thai
nog - Nogai
nov - Novial
nqo - N’Ko
nr - South Ndebele
nrm - Norman
nso - Northern Sotho
nup - Nupe
nv - Navajo
ny - Nyanja
nyn - Nyankole
nyo - Nyoro
nys - Nyungar
oc - Occitan
ojb - Northwestern Ojibwa
olo - Livvi-Karelian
om - Oromo
or - Odia
os - Ossetic
pa - Punjabi
pag - Pangasinan
pam - Pampanga
pap - Papiamento
pcd - Picard
pcm - Nigerian Pidgin
pdc - Pennsylvania German
pdt - Plautdietsch
pfl - Palatine German
pi - Pali
pih - Pitcairn-Norfolk
pl - Polish
pms - Piedmontese
pnb - Western Punjabi
pnt - Pontic
prg - Prussian
ps - Pashto
pt - Portuguese
pt-br - Brazilian Portuguese
pwn - Paiwan
qqq - Message documentation
qu - Quechua
qug - Chimborazo Highland Quichua
rgn - Romagnol
rif - Riffian
rki - Arakanese
rm - Romansh
rmc - Carpathian Romani
rmy - Vlax Romani
rn - Rundi
ro - Romanian
roa-tara - Tarantino
rsk - Pannonian Rusyn
ru - Russian
rue - Rusyn
rup - Aromanian
ruq - Megleno-Romanian
ruq-cyrl - Megleno-Romanian (Cyrillic script)
ruq-latn - Megleno-Romanian (Latin script)
rut - Rutul
rw - Kinyarwanda
ryu - Okinawan
sa - Sanskrit
sah - Yakut
sat - Santali
sc - Sardinian
scn - Sicilian
sco - Scots
sd - Sindhi
sdc - Sassarese Sardinian
sdh - Southern Kurdish
se - Northern Sami
se-fi - Northern Sami (Finland)
se-no - Northern Sami (Norway)
se-se - Northern Sami (Sweden)
sei - Seri
ses - Koyraboro Senni
sg - Sango
sgs - Samogitian
sh - Serbo-Croatian
sh-cyrl - Serbo-Croatian (Cyrillic script)
sh-latn - Serbo-Croatian (Latin script)
shi - Tachelhit
shi-latn - Tachelhit (Latin script)
shi-tfng - Tachelhit (Tifinagh script)
shn - Shan
shy - Shawiya
shy-latn - Shawiya (Latin script)
si - Sinhala
simple - Simple English
sjd - Kildin Sami
sje - Pite Sami
sk - Slovak
skr - Saraiki
skr-arab - Saraiki (Arabic script)
sl - Slovenian
sli - Lower Silesian
sm - Samoan
sma - Southern Sami
smn - Inari Sami
sms - Skolt Sami
sn - Shona
so - Somali
sq - Albanian
sr - Serbian
sr-ec - Serbian (Cyrillic script)
sr-el - Serbian (Latin script)
srn - Sranan Tongo
sro - Campidanese Sardinian
ss - Swati
st - Southern Sotho
stq - Saterland Frisian
sty - Siberian Tatar
su - Sundanese
sv - Swedish
sw - Swahili
syl - Sylheti
szl - Silesian
szy - Sakizaya
ta - Tamil
tay - Atayal
tcy - Tulu
tdd - Tai Nuea
te - Telugu
tet - Tetum
tg - Tajik
tg-cyrl - Tajik (Cyrillic script)
tg-latn - Tajik (Latin script)
th - Thai
ti - Tigrinya
tig - Tigre
tk - Turkmen
tl - Tagalog
tly - Talysh
tly-cyrl - Talysh (Cyrillic script)
tn - Tswana
to - Tongan
tok - Toki Pona
tpi - Tok Pisin
tr - Turkish
tru - Turoyo
trv - Taroko
ts - Tsonga
tt - Tatar
tt-cyrl - Tatar (Cyrillic script)
tt-latn - Tatar (Latin script)
ttj - Tooro
tum - Tumbuka
tw - Twi
ty - Tahitian
tyv - Tuvinian
tzm - Central Atlas Tamazight
udm - Udmurt
ug - Uyghur
ug-arab - Uyghur (Arabic script)
ug-latn - Uyghur (Latin script)
uk - Ukrainian
ur - Urdu
uz - Uzbek
uz-cyrl - Uzbek (Cyrillic script)
uz-latn - Uzbek (Latin script)
ve - Venda
vec - Venetian
vep - Veps
vi - Vietnamese
vls - West Flemish
vmf - Main-Franconian
vmw - Makhuwa
vo - Volapük
vot - Votic
vro - Võro
wa - Walloon
wal - Wolaytta
war - Waray
wls - Wallisian
wo - Wolof
wuu - Wu
wuu-hans - Wu (Simplified Han script)
wuu-hant - Wu (Traditional Han script)
xal - Kalmyk
xh - Xhosa
xmf - Mingrelian
xsy - Saisiyat
yi - Yiddish
yo - Yoruba
yrl - Nheengatu
yue - Cantonese
yue-hans - Cantonese (Simplified Han script)
yue-hant - Cantonese (Traditional Han script)
za - Zhuang
zea - Zeelandic
zgh - Standard Moroccan Tamazight
zgh-latn - Standard Moroccan Tamazight (Latin script)
zh - Chinese
zh-cn - Chinese (China)
zh-hans - Simplified Chinese
zh-hant - Traditional Chinese
zh-hk - Chinese (Hong Kong)
zh-mo - Chinese (Macau)
zh-my - Chinese (Malaysia)
zh-sg - Chinese (Singapore)
zh-tw - Chinese (Taiwan)
zu - Zulu
Format
Export for off-line translation
Export in native format
Export in CSV format
Fetch
{{DISPLAYTITLE:Company administration service methods}}<languages/> {{#seo: |title=Company administration service methods - SimplyBook.me |description=Learn about service methods for internal company administration. Manage bookings tailored to your operations. Start here! |titlemode=append |keywords=faq, frequently asked questions, booking software, appointment system questions, appointments online, calendar software, booking system, booking calendar, scheduling software, online appointment scheduling, online scheduling, setup, setup help, support, help content }} ==General Information== SimplyBook.me API service build on [https://en.wikipedia.org/wiki/JSON-RPC JSON-RPC] remote procedure call protocol. A remote method is invoked by sending a request to a remote service using HTTPS. All transfer types are single objects, serialized using [http://www.json.org JSON]. A request is a call to a specific method provided by a remote system. It must contain three certain properties: * <code>jsonrpc</code> - a version of JSON-RPC protocol. Always <code>"2.0"</code> * <code>method</code> - A String with the name of the method to be invoked. * <code>params</code> - An Array of objects to be passed as parameters to the defined method. * <code>id</code> - A value of any type, which is used to match the response with the request that it is replying to. The receiver of the request must reply with a valid response to all received requests. A response must contain the properties mentioned below. * <code>result</code> - The data returned by the invoked method. If an error occurred while invoking the method, this value must be null. * <code>error</code> - A specified error code if there was an error invoking the method, otherwise null. * <code>id</code> - The id of the request it is responding to. Example <pre> Request { "jsonrpc": "2.0", "method": "getEventList", "params":[], "id":1 } Response { "result": { "1": { "id": "1", "name": "Часовая фотосесcия", "duration": "60", "hide_duration": "0", "description": "<p>Если Вы хотите попробовать себя в роли модели, но не определились с образом. <br /> 5-7 отретушированных и готовых к печати фотографий + отснятый материал на диске</p>", "picture": "a200edab10b669225e22d2b3803a38b5.jpg", "is_public": "1", "is_active": "1", "position": "0", "is_recurring": "0", "picture_path": "/uploads/mib/event__picture/small/a200edab10b669225e22d2b3803a38b5.jpg", "price": "300.0000", "currency": "UAH", "categories": ["1"] }, ... }, "id": "1", "jsonrpc": "2.0" } </pre> Example of request with error response: <pre> Request { "jsonrpc": "2.0", "method": "someNotExistingMethod", "params":[], "id":1 } Response { "jsonrpc": "2.0", "id":1, "error": { "code": -32601, "message": "Method not found" } } </pre> All calls of public service methods should have additional HTTP header: * <code>X-Token</code> an authentication token. See [[#Authentication|authentication]] section. ===Endpoint=== Use URL <code>https://user-api.simplybook.me/admin</code> for all administration service API calls. ===Authentication=== 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 <code>[[Authentication#getUserToken|getUserToken]]</code> API method on https://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 [[Custom_Features#API|API Custom Feature]] 'Settings'. == Methods == === addClient === <code>addClient($clientData)</code> Parameters: * '''$clientData''' Object Returns Integer. 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 <code>getCompanyParam('require_fields')</code> 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 } ---- === addDeviceToken === <code>addDeviceToken($token, $device)</code> Parameters: * '''$token''' String a device token string * '''$device''' String a device type ('android' or 'apple') Returns boolean. Subscribe a mobile device to push notifications service. Device will recieve notifications about new bookings or changes in already created bookings. Use either <code>'apple'</code> or <code>'android'</code> for <code>device</code> parameter. ---- === book === <code>book($eventId, $unitId, $clientId, $startDate, $startTime, $endDate, $endTime, $clientTimeOffset, $additional, $count, $batchId, $recurringData)</code> Parameters: * '''$eventId''' Integer * '''$unitId''' Integer * '''$clientId''' Integer * '''$startDate''' string a date string in format 'Y-m-d' * '''$startTime''' string a time string in format 'H:i:s' * '''$endDate''' string a date string in format 'Y-m-d' * '''$endTime''' string a time string in format 'H:i:s' * '''$clientTimeOffset''' Integer * '''$additional''' array|Object - additional params and fields. * '''$count''' Integer bookings count used to make group bookings batch. This parameter can't be less than 1. (optional) * '''$batchId''' Integer add booking to group bookings batch. You can't use $count and $batchId in one call. Please specify only one parameter. (optional) * '''$recurringData''' Array - make booking recurrent. (optional) Returns Object. 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 <code>require_confirm = true</code>. <code>$startDate</code> and <code>$startTime</code> specifies a date of booking and time slot. Time value should be multiple to 'timeframe' configuration of company (see <code>[[#getTimeframe|getTimeframe]]</code> API method). <code>$endDate</code> and <code>$endTime</code> 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 <code>$endDate</code> and <code>$endTime</code> should be later in time than <code>$startDate</code> and <code>$startTime</code>. If your clients located in different time zone you should specify <code>$clientTimeOffset</code> parameter as difference between company's time zone and client's time zone in seconds. For example if company located in city with time zone GMT+2 and customer located in city with GMT+3 then <code>$clientTimeOffset</code> will be -3600 seconds. You can get information about company's time zone using <code>[[#getCompanyInfo|getCompanyInfo]]</code> API method. To create batch booking you can specify either <code>count</code> more then 1 or valid <code>batchId</code> (only one parameter can be specified). You should specify an <code>$additionalFields</code> parameter if service requires some intake forms (see [[Custom_Features#Intake_Forms|Intake Forms Custom feature]]).To create a booking with promo code you should pass it as additional field. For example: <code>{"promocode": "some code"}</code> If [[Custom_Features#Multiple_Locations| Multiple locations]] enabled you need to pass locations ID parameter as additional field <code>location_id</code>. For example: <code>{"location_id": "1"}</code>. Use <code>[[#isPluginActivated|isPluginActivated('location')]]</code> to check if Custom feature active and <code>[[#getLocationsList|getLocationsList()]]</code> method to get list of available locations. See [[#book response|example]] of <code>book</code> API method response. See also: * [https://help.simplybook.me/index.php/Need_to_change_interval_(timeframe) Timeframe information] ---- === calculateEndTime === <code>calculateEndTime($startDateTime, $eventId, $unitId)</code> Parameters: * '''$startDateTime''' String a date and time string in format 'Y-m-d H:i:s', eg. '2001-10-02 13:30:00'. * '''$eventId''' Integer * '''$unitId''' Integer Returns String|Boolean. Returns end datetime if booking is available, else return false ---- === cancelBatch === <code>cancelBatch($id, $bookingIds)</code> Parameters: * '''$id''' Integer identifier of batch. See <code>[[#createBatch|createBatch]]</code> API method. * '''$bookingIds''' Array ids of bookings included to batch. Returns boolean. 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 <code>$bookingIds</code> list is used for information in notifications. ---- === cancelBooking === <code>cancelBooking($id)</code> Parameters: * '''$id''' Integer Returns Boolean. 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. ---- === createBatch === <code>createBatch()</code> No arguments. Returns Integer. Creates new booking batch record. Returns newly created batch id. You can use this id in <code>[[#book|book]]</code> API method. ---- === deleteDeviceToken === <code>deleteDeviceToken($token)</code> Parameters: * '''$token''' String - device token Returns boolean. Unsubscribe from push notifications service. ---- === editBook === <code>editBook($shedulerId, $eventId, $unitId, $clientId, $startDate, $startTime, $endDate, $endTime, $clientTimeOffset, $additional)</code> Parameters: * '''$shedulerId''' Integer an id of booking to edit. See <code>[[#book|book]]</code> or <code>[[#getBookings|getBookings]]</code> API methods. * '''$eventId''' Integer * '''$unitId''' Integer * '''$clientId''' Integer * '''$startDate''' String - in Y-m-d format * '''$startTime''' String - in H:i:s format * '''$endDate''' String - in Y-m-d format * '''$endTime''' String - in H:i:s format * '''$clientTimeOffset''' Integer * '''$additional''' array|Object - additional params and fields. Returns Object. 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. ---- === editClient === <code>editClient($clientId, $clientData)</code> Parameters: * '''$clientId''' Integer * '''$clientData''' Object Returns Integer. Edits client's record. See <code>[[#addClient|addClient]]</code> method description for list of available fields.Method returns an id of client's record. ---- === filterAvailableUnits === <code>filterAvailableUnits($eventId, $dateTime, $unitIds, $count)</code> Parameters: * '''$eventId''' Integer * '''$dateTime''' String a date and time string in format 'Y-m-d H:i:s' * '''$unitIds''' * '''$count''' Integer Returns Array. Returns list of available unit ids for specified date and service from provided $unitIds list.You can use this method with location Custom Feature. Returns empty array if all units are not allowed. Eg.: <code>[1, 2, 3]</code> ---- === getAdditionalFields === <code>getAdditionalFields($eventId)</code> Parameters: * '''$eventId''' Integer Returns Array. Return intake forms for certain event if [[Custom_Features#Intake_Forms|Intake Forms Custom Feature]] is activated. Returns empty array otherwise. Call <code>[[#isPluginActivated|isPluginActivated('event_field')]]</code> API method to check if 'event_field' Custom Feature activated. ---- === getAnyUnitData === <code>getAnyUnitData()</code> No arguments. Returns Object|null. Returns information about [[Custom_Features#Any_Employee_Selector|Any Employee selector Custom Feature]] configuration. Returns null if Custom Feature 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 } ---- === getAvailableTimeIntervals === <code>getAvailableTimeIntervals($dateFrom, $dateTo, $eventId, $unitId, $count)</code> Parameters: * '''$dateFrom''' String * '''$dateTo''' String * '''$eventId''' Integer * '''$unitId''' Mixed can be Integer or Array of Integers * '''$count''' Integer Returns Object. Returns available time intervals for all service providers for given period, taking into account breaktimes, start and end working time Eg.: <code>{['2016-03-04': ['1': [['09:00:00','09:30:00'], ['11:15:00','14:45:00']] , ...], ...]}</code> ---- === getAvailableUnits === <code>getAvailableUnits($eventId, $dateTime, $count)</code> Parameters: * '''$eventId''' Integer * '''$dateTime''' String a date and time string in format 'Y-m-d H:i:s' * '''$count''' Integer Returns Array. Returns list of available unit ids for specified date and service or empty array if all units are not allowed.Eg.: <code>[1, 2, 3]</code> ---- === getBookingCancellationsInfo === <code>getBookingCancellationsInfo($dateStart, $dateEnd)</code> Parameters: * '''$dateStart''' String a date string in format 'Y-m-d'. Pass null to get data from first day of current week. * '''$dateEnd''' String a date string in format 'Y-m-d'. Pass null to get data filtered to last day of current week. Returns Array. 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. <code>"type"</code> field can be either "create", "cancel" or "nopayment_cancel". If <code>"user_id"</code> not specified then bookings where created or cancelled by admin or employee. Data with type <code>"nopayment_cancel"</code> 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 }] ---- === getBookingComment === <code>getBookingComment($id)</code> Parameters: * '''$id''' Integer Returns String. Returns booking comment ---- === getBookingDetails === <code>getBookingDetails($id)</code> Parameters: * '''$id''' integer booking id Returns Array. Returns detailed bookings object by booking id. See [[#getBookingDetails_response|response example]]. ---- === getBookingLimitUnavailableTimeInterval === <code>getBookingLimitUnavailableTimeInterval($startDateTime, $endDateTime, $eventId)</code> Parameters: * '''$startDateTime''' string a date and time string in format 'Y-m-d H:i:s' * '''$endDateTime''' string a date and time string in format 'Y-m-d H:i:s' * '''$eventId''' integer Returns Array. Returns time intervals not available for bookings because of configuration of [[Custom_Features#Limit_Bookings|Limit bookings]] Custom Feature for period of time. Returns empty array if Custom Feature not available. ---- === getBookingRevenue === <code>getBookingRevenue($dateStart, $dateEnd, $unitGroupId, $serviceId)</code> Parameters: * '''$dateStart''' string a date string in format 'Y-m-d'. * '''$dateEnd''' string a date string in format 'Y-m-d' * '''$unitGroupId''' integer * '''$serviceId''' integer Returns Array. 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 <code>$dateStart</code> and <code>$dateEnd</code> to null to get data for current week.Example: ['2015-11-12' : { 3 : [ 11, // bookings count 128.53 // revenue ]} ---- === getBookingStats === <code>getBookingStats($groupBy)</code> Parameters: * '''$groupBy''' String either 'day', 'week' or 'month' Returns Array. 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 ---- === getBookings === <code>getBookings($params)</code> Parameters: * '''$params''' Returns Array. 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 [[Custom_Features#Approve_Bookings|Approve booking]] Custom Feature 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 Custom Feature status. *: If Custom Feature 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 Custom Feature 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" } ---- === getBookingsZapier === <code>getBookingsZapier()</code> No arguments. Returns Array. Returns list of bookings filtered by given params ---- === getCategoriesList === <code>getCategoriesList($isPublic)</code> Parameters: * '''$isPublic''' Boolean Returns Array. Returns company categories list if [[Custom_Features#Service_Categories|Service Categories Custom Feature]] is activated. Returns an error with code -32001 if Custom Feature is not activated. Use <code>[[#isPluginActivated|isPluginActivated('event_category')]]</code> API method to check if Custom Feature activated. ---- === getClient === <code>getClient($clientId)</code> Parameters: * '''$clientId''' Returns Array. Returns client's data object. See <code>[[#addClient|addClient]]</code> API method for list of available fields of client data object. ---- === getClientComments === <code>getClientComments($clientId, $shedulerId)</code> Parameters: * '''$clientId''' Integer * '''$shedulerId''' Integer Returns Array. Returns list of all comments for given client ---- === getClientList === <code>getClientList($searchString, $limit)</code> Parameters: * '''$searchString''' String * '''$limit''' Integer Returns Array. Returns list of clients associated with company. You can use either phone number, email address or name as value for <code>$searchString</code>. Pass an empty string for <code>$searchString</code> and null for <code>$limit</code> parameters to get all records. See <code>[[#addClient|addClient]]</code> API method for list of available fields of client data object. ---- === getCompanyCurrency === <code>getCompanyCurrency()</code> No arguments. Returns String. Returns company's currency as three chars code (ISO 4217). ---- === getCompanyInfo === <code>getCompanyInfo()</code> No arguments. Returns Object. Returns an object with detailed information about company. See [[#getCompanyInfo response|example of response]]. ---- === getCompanyParam === <code>getCompanyParam($key)</code> Parameters: * '''$key''' String Returns mixed. 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 === <code>getCompanyParams($keys)</code> Parameters: * '''$keys''' Array Returns Array. Returns company config values for keys. 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]].For non-existent and not-allowed params it will return false as result ---- === getCompanyTimezoneOffset === <code>getCompanyTimezoneOffset()</code> No arguments. Returns array. Returns company timezone offset and company timezone ---- === getCountryList === <code>getCountryList()</code> No arguments. Returns Array. Get list of all countries ---- === getCountryPhoneCodes === <code>getCountryPhoneCodes()</code> No arguments. Returns Array. Returns country phone code list ---- === getCurrentTariffInfo === <code>getCurrentTariffInfo()</code> No arguments. Returns Array. 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" } ---- === getCurrentUserDetails === <code>getCurrentUserDetails()</code> No arguments. Returns Object. Returns an object with information about logged in user. Note: you are responsible for implementation of some access rights based on <code>group</code> 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 <code>group</code> property can be one of the values: * <code>shop_user</code> - "Senior Employee" access role * <code>station_user</code> - "Junior Employee" access role * <code>admin</code> - "Administrator" access role * <code>viewer</code> - "Viewer" access role * <code>reseller_company_admin</code> - 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 } ---- === getEventList === <code>getEventList($isVisibleOnly, $asArray)</code> Parameters: * '''$isVisibleOnly''' Boolean * '''$asArray''' Boolean Returns Array. Returns company's events list. If <code>$asArray</code> 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. ---- === getFeedbacks === <code>getFeedbacks($approvedOnly, $reviewsOnly, $lastOnly, $limit)</code> Parameters: * '''$approvedOnly''' Boolean * '''$reviewsOnly''' Boolean * '''$lastOnly''' Boolean * '''$limit''' Integer Returns Array. Get list of feedbacks ---- === getFirstWorkingDay === <code>getFirstWorkingDay($unitId)</code> Parameters: * '''$unitId''' Integer Returns String. Returns first working date for unit ---- === getGoogleCalendarBusyTime === <code>getGoogleCalendarBusyTime($startDateTime, $endDateTime, $unitId)</code> Parameters: * '''$startDateTime''' string a date and time string in format 'Y-m-d H:i:s' * '''$endDateTime''' string 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'. * '''$unitId''' integer Returns Array. Returns a list of objects represented a time intervals marked as busy in Google Calendar. Each object of result contains <code>from</code> and <code>to</code> properties with datetime string as value. This method only actual if [Custom_Features#Calendar_Sync|Calendar Sync Custom Feature] enabled. If Custom Feature not enabled an empty list will be returned. You should call <code>[[#isPluginActivated|isPluginActivated('google_calendar_export')]]</code> to check status of the Custom Feature. Each object of result contains <code>from</code> and <code>to</code> properties with datetime string as value. Please note that this method may return not actual data because data synchronization between server and Google/Outlook Calendar may take some time and synchronized data are cached for 15 minutes.Example: <code> [ {"from" : "2016-02-16 13:30:00", "to" : "2016-02-16 16:00:00"}, ... ] </code> ---- === getGoogleCalendarBusyTimeAvailableUnits === <code>getGoogleCalendarBusyTimeAvailableUnits()</code> No arguments. Returns Array. Returns configured unit ids, allowed to sync busy time ---- === getLastNotificationUpdate === <code>getLastNotificationUpdate($type)</code> Parameters: * '''$type''' String Returns String. Returns last update datetime ---- === getLocationsList === <code>getLocationsList($isPublic, $asArray)</code> Parameters: * '''$isPublic''' Boolean Optional. Default value is '''false'''. * '''$asArray''' boolean Optional. Default value is '''false'''. Returns Array. Returns available locations for company if Custom Feature [[Custom_Features#Multiple_Locations|Multiple locations Custom Feature]] is activated. Return an error with code -32001 if Custom Feature is not activated. Use <code>[[#isPluginActivated|isPluginActivated('location')]]</code> API method to check if Custom Feature 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. ---- === getPluginList === <code>getPluginList()</code> No arguments. Returns Array. Returns a list of all Custom Features associated with company with status. ---- <!---=== getPluginPromoInfoByCode === <code>getPluginPromoInfoByCode($code)</code> Parameters: * '''$code''' Returns Array. Returns an object with detailed information about Rewards and referrals promotion by promotion code. You can get promotion code using <code>[[Catalogue#getPromotionList|getPromotionList]]</code> API method. If promotion record with specified code not found then method returns an empty array (an empty object). If [[Rewards_and_Referrals_custom_feature|Rewards and Referrals Custom Feature]] not enabled then method returns an error with code -32001 (Custom Feature is not activated). Use <code>[[#isPluginActivated|isPluginActivated('promo')]]</code> API method call to check if Custom Feature enabled. See [[#getPromotionList response|example]] of <code>getPromotionList</code> API method response. Please note that response contains a list of services for wich promotion discount can be applied (<code>service_ids</code> key). ---> ---- === getPluginStatuses === <code>getPluginStatuses($pluginNames)</code> Parameters: * '''$pluginNames''' Array Returns Array. Return Custom Feature status true if status active, else false. See [[Company_administration_service_methods#Custom_Features.27_identifiers|list of available plugin's names]]. ---- === getRecentActions === <code>getRecentActions($lastOnly, $limit)</code> Parameters: * '''$lastOnly''' Boolean * '''$limit''' Integer Returns Array. Returns latest actions ---- === getRecurringDatetimes === <code>getRecurringDatetimes($eventId, $unitId, $date, $time, $recurringData, $endDateTime)</code> Parameters: * '''$eventId''' Integer * '''$unitId''' Integer * '''$date''' String * '''$time''' String * '''$recurringData''' Array * '''$endDateTime''' String (optional) Returns Array. Get list of dates for recurring booking ---- === getRecurringSettings === <code>getRecurringSettings($eventId)</code> Parameters: * '''$eventId''' Integer Returns Array. Returns an object with recurring settings for an event. Returns false if specified event does not configured as recurring. See also: * [http://blog.simplybook.me/recurring-and-periodic-bookings/ Recurring services desription] ---- === getRegistrations === <code>getRegistrations($groupBy)</code> Parameters: * '''$groupBy''' String either 'day', 'week' or 'month' Returns Array. 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 ---- === getReservedTime === <code>getReservedTime($from, $to, $eventId, $unitId, $count)</code> Parameters: * '''$from''' String * '''$to''' String * '''$eventId''' Integer * '''$unitId''' Integer * '''$count''' Integer Returns Object. 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 <code>reserved_time</code> and type <code>not_worked_time</code>. <code>reserved_time</code> type represents time slots working time but already booked by clients. Nobody knows what kind of data represented by <code>not_worked_time</code> type. Please don't use it.If [[Custom_Features#Calendar_Sync| Calendar Sync Custom Feature]] enabled then object with <code>reserved_time</code> type will contain not empty list of time slots marked as busy in Google calendar. Call <code>[[#isPluginActivated|isPluginActivated('google_calendar_export')]]</code> API method to check if Calendar Sync Custom Feature activated. Example: <pre> { "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" }], ... } </pre> ---- === getReservedTimeIntervals === <code>getReservedTimeIntervals($dateFrom, $dateTo, $eventId, $unitId, $count)</code> Parameters: * '''$dateFrom''' String * '''$dateTo''' String * '''$eventId''' Integer * '''$unitId''' Integer|Array * '''$count''' Integer Returns Object. Returns not available time Eg.: <code>{'2014-05-14': [{'reserved_time': [{'from': '14:00', 'to': '16:30'}], 'type': "reserved_time"}, ...], ...}</code> ---- === getSocialCounterStats === <code>getSocialCounterStats($provider)</code> Parameters: * '''$provider''' String Returns Integer. Returns social counters value for your domain ---- === getStartTimeMatrix === <code>getStartTimeMatrix($from, $to, $eventId, $unitId, $count)</code> Parameters: * '''$from''' String * '''$to''' String * '''$eventId''' Integer * '''$unitId''' Mixed can be Integer or Array of Integers * '''$count''' Integer Returns Object. Returns available start time, taking into account breaktimes, start and end working time Eg.: <code>{'2014-05-14': ['09:00:00', ...], ...}</code> If locations Custom Feature activated for company you should pass a list as $unitID parameter for filter results with units available only for selected location. See [[Custom_Features#Multiple_Locations|Multiple locations]] Custom Feature description for more details. ---- === getStatuses === <code>getStatuses()</code> No arguments. Returns Array. Returns list of available statuses or an empty list if [[Custom_Features#Status|Status Custom feature]] not enabled. ---- === getTimeframe === <code>getTimeframe()</code> No arguments. Returns Integer. 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 [[Need_to_change_interval_(timeframe)|here]]. ---- === getTimelineType === <code>getTimelineType()</code> No arguments. Returns String. Returns company calendar layout type ---- === getTopPerformers === <code>getTopPerformers()</code> No arguments. Returns Array. Returns a list with statistics for performers. This data contains number of bookings and revenues value for each performer. ---- === getTopServices === <code>getTopServices($dateStart, $dateEnd)</code> Parameters: * '''$dateStart''' String * '''$dateEnd''' String Returns Array. Returns a list with statistics for services for a period of time. This data contains number of bookings and revenues value for each service. ---- === getUnitList === <code>getUnitList($isVisibleOnly, $asArray)</code> Parameters: * '''$isVisibleOnly''' Boolean * '''$asArray''' Boolean Returns Array. Returns list of service performers. If <code>$asArray</code> 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. ---- === getUnitWorkdayInfo === <code>getUnitWorkdayInfo($dateStart, $dateEnd, $unitGroupId)</code> Parameters: * '''$dateStart''' string * '''$dateEnd''' string * '''$unitGroupId''' integer Returns Array. Return workday info (date_start and date_end) ---- === getUnitWorkingDurations === <code>getUnitWorkingDurations($dateStart, $dateEnd, $unitGroupId)</code> Parameters: * '''$dateStart''' string * '''$dateEnd''' string * '''$unitGroupId''' integer Returns Array. Return working durations ---- === getVisitorStats === <code>getVisitorStats($groupBy)</code> Parameters: * '''$groupBy''' String Returns Array. Returns statistics about page visits if Custom Feature [[Custom_Features#Visitor_Counter|Visitor Counter Custom Feature]] enabled. Returns an empty list if Custom Feature not enabled. Use <code>[[#isPluginActivated|isPluginActivated('counter')]]</code> API method call to check if Custom Feature 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 ---- === getWarnings === <code>getWarnings($lastOnly)</code> Parameters: * '''$lastOnly''' Boolean. Default value is '''false'''. Returns Array. Returns a list of objects represented system warnings. Each warning contains <code>warning_type</code> and <code>warning_text</code> properties. <code>warning_text</code> property contains localized message. <code>warning_type</code> can be one of the values: * '''sms_limit''' – warning indicates low amount of SMS credits * '''sheduler_limit''' – warning indicates low amount of available bookings ---- === getWorkCalendar === <code>getWorkCalendar($year, $month, $unitId)</code> Parameters: * '''$year''' Integer * '''$month''' Integer * '''$unitId''' Integer Returns Object. Returns company work schedule as array Eg.: <code>{'2014-05-01': {'from': '09:00:00', 'to': '21:00:00', 'is_day_off': '0'}, '2014-05-02': ...}</code> ---- === getWorkDaysInfo === <code>getWorkDaysInfo($from, $to, $unitId, $eventId, $count)</code> Parameters: * '''$from''' String * '''$to''' String * '''$unitId''' Integer (optional) * '''$eventId''' Integer (optional) * '''$count''' Integer (optional) Returns Object. 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:<pre> {'2014-05-14' : [ {'from': '09:00:00', 'to': '13:00:00'}, {'from': '14:00:00', 'to': '19:00:00'} ] } </pre> 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. ---- === getWorkDaysTimes === <code>getWorkDaysTimes($startDateTime, $endDateTime, $type = 'unit_group')</code> Parameters: * '''$startDateTime''' string * '''$endDateTime''' string * '''$type''' string. Optional. Either 'unit_group' or 'event'. Returns Array. Return busy time by unit id by Calendar Sync Custom Feature if enabled. Please note that this method may return not actual data because data synchronization between server and Google/Outlook Calendar may take some time and synchronized data are cached for 15 minutes. ---- === getWorkload === <code>getWorkload($dateStart, $dateEnd, $unitGroupId)</code> Parameters: * '''$dateStart''' string * '''$dateEnd''' string * '''$unitGroupId''' integer Returns Array. 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 ] }] ---- === isPluginActivated === <code>isPluginActivated($pluginName)</code> Parameters: * '''$pluginName''' String Returns Boolean. Return Custom Feature status true if status active, else false. <var>$pluginName</var> parameter is a Custom Feature identifier.See [[Custom_Features|Custom Features]] page for full Custom Features description. See [[Company_administration_service_methods#Custom_Features.27_identifiers|list of available plugin's names]]. ---- === pluginApproveBookingApprove === <code>pluginApproveBookingApprove($id)</code> Parameters: * '''$id''' Integer Returns Array. Sets approve booking status to 'approved' if [[Custom_Features#Approve_Bookings|Approve booking]] Custom Feature enabled and returns list of approved booking IDs. Returns false if Custom Feature not enabled. Use <code>[[#isPluginActivated|isPluginActivated('approve_booking')]]</code> API method call to check if Custom Feature enabled. ---- === pluginApproveBookingCancel === <code>pluginApproveBookingCancel($id)</code> Parameters: * '''$id''' Integer Returns Boolean. Sets approve booking status to 'canceled' if [[Custom_Features#Approve_Bookings|Approve bookings]] Custom Feature enabled and returns true. Returns false if Custom Feature not enabled. Use <code>[[#isPluginActivated|isPluginActivated('approve_booking')]]</code> API method call to check if Custom Feature enabled. ---- === pluginApproveGetPendingBookings === <code>pluginApproveGetPendingBookings()</code> No arguments. Returns array. Returns list of objects with information about bookings pending approval if [[Custom_Features#Approve_Bookings|Approve bookings]] Custom Feature enabled. Returns empty list if Custom Feature not enabled. Use <code>[[#isPluginActivated|isPluginActivated('approve_booking')]]</code> API method call to check if Custom Feature enabled. ---- === pluginApproveGetPendingBookingsCount === <code>pluginApproveGetPendingBookingsCount()</code> No arguments. Returns Integer. Returns count of bookings pending approval if [[Custom_Features#Approve_Bookings|Approve bookings]] Custom Feature enabled. Returns 0 if Custom Feature not enabled. Use <code>[[#isPluginActivated|isPluginActivated('approve_booking')]]</code> API method call to check if Custom Feature enabled. ---- === setBookingComment === <code>setBookingComment($id, $comment)</code> Parameters: * '''$id''' Integer * '''$comment''' String Returns Integer. Set booking comment ---- === getBookingStatus === <code>getBookingStatus ($bookingId)</code> Parameters: * '''$bookingId''' Integer Returns Array. Returns an object of status of given booking (if status plugin is enabled) default status will be returned if bookingId does not exists ---- === setStatus === <code>setStatus($bookingId, $statusId)</code> Parameters: * '''$bookingId''' Integer * '''$statusId''' Integer Returns Boolean. 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 [[Custom_Features#Status|Status Custom feature]] not enabled. ---- === updateNotification === <code>updateNotification($type)</code> Parameters: * '''$type''' String Returns . Mark notifications as readed ---- === setWorkDayInfo=== <code>setWorkDayInfo($info)</code> Parameters: * '''$info''' Array Returns true on success Set work day schedule for company|service|provider for week_day|date Example: <pre> { "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 </pre> ---- === deleteSpecialDay=== <code>deleteSpecialDay($date, $params = null)</code> Parameters: * '''$date''' String * '''$params''' Array Returns true on success Delete special date if set Example: <pre> '2017-08-21', { "unit_group_id":"", "event_id":"" } </pre> ---- === addServiceProvider=== <code>addServiceProvider($data)</code> Parameters: * '''$data''' Array Returns Array with result and id of new service provider (unit_group) Create new service provider Example: <pre> { "name" : "newtagg1 - 4", "description" : "Description - 1", "phone" : "1234567890", "email" : "test@test.com", "qty" : "2", "is_visible" : 1, "is_active" : 1, "position" : 2, "seo_url" : null, "position_in_location" : null, } </pre> ---- === editServiceProvider=== <code>editServiceProvider($id, $data)</code> Parameters: * '''$id''' Integer * '''$data''' Array Returns Array with result and id of new service provider (unit_group) Edit service provider (there is no way to delete provider via API, in this case set is_active = 0) Example: <pre> 1, { "name" : "newtagg1 - 4", "description" : "Description - 1", "phone" : "1234567890", "email" : "test@test.com", "qty" : "2", "is_visible" : 1, "is_active" : 1, "position" : 2, "seo_url" : null, "position_in_location" : null, } </pre> - ---- == Constants == === Error codes === See [[Errors handling]] for details. * -32001 Custom Feature is not activated * -32010 Some required params are missed * -32011 Params is not array * -32012 Sheduler id not found * -32015 Passed event id is not reccuren * -32020 Sorry, you have no permissions to perform this action * -32030 Invalid promotion code * -32031 Promotion has expired * -32032 Promotion is not active yet * -32033 This promocode is not valid for selected service * -32034 Exceed max usage limit * -32035 Exceed max usage per customer limit'const * -32036 This promocode is not available for datetime range * -32051 Selected event id is not available * -32052 Selected unit id is not available * -32053 Selected date start is not available * -32054 Selected time start is not available * -32055 One or more appointments couldn't be reserved * -32056 Booking is not allowed at this time * -32061 Client name value is wrong * -32062 Client email value is wrong * -32063 Client phone value is wrong * -32070 Intake form values are wrong * -32080 Appointemnt couldn't be found * -32081 Service can't be performed when company does not work * -32082 Service performer can't work when company does not work * -32085 Signature error * -32090 Confirmation with this key type is not available * -32095 Batch not found * -32097 Unsupported payment system * -32099 Payment failed * -32600 *: An error with this code can be thrown with one of the following messages: ** Access denied ** Company does not exists * -32601 Method not found * -32602 Invalid params * -32603 Internal error * -3264 Client with given id not found ---- ===Company params=== Use these values to get configuration params for company with <code>[[#getCompanyParam|getCompanyParam]]</code> API method. =====General params===== Administration API inherits all [[Company public service methods#Company_params|keys]] allowed for public API and extends this list with keys: * attach_ical * auto_redirect * auto_redirect_text * blockchain_address * blockchain_secret * borgun_merchant_id * borgun_payment_gateway_id * borgun_secret_code * client_batch_cancel_template * client_batch_cancel_template_email * client_batch_cancel_template_email_subject * client_event_cancel_template * client_event_cancel_template_email * client_event_cancel_template_email_subject * client_event_change_template * client_event_change_template_email * client_event_change_template_email_subject * client_event_creation_template * client_event_creation_template_email * client_event_creation_template_email_subject * client_event_group_creation_template * client_event_group_creation_template_email * client_event_group_creation_template_email_subject * client_event_multiple_creation_template * client_event_multiple_creation_template_email * client_event_multiple_creation_template_email_subject * client_group_notification_template * client_group_notification_template_email * client_group_notification_template_email_subject * client_multiple_notification_template * client_multiple_notification_template_email * client_multiple_notification_template_email_subject * client_notification_template * client_notification_template_email * client_notification_template_email_subject * client_notification_time * client_recurring_event_creation_template * client_recurring_event_creation_template_email * client_recurring_event_creation_template_email_subject * common_limit_booking * company_ga_tracking_id * default_phone * disconnect_on_timeout * email_event_list * email_events_list_template * email_group_events_list_template * event_list_style * feed_back_interval * feedback_invite_template_email * feedback_invite_template_email_subject * google_conversion_color * google_conversion_currency * google_conversion_format * google_conversion_id * google_conversion_label * google_conversion_language * google_conversion_value * hide_working_hours_block * include_cancel_link * kortais_merchant * kortais_secret_code * kortais_terminal * layout_background * layout_background_repeat * mobile_site_link * mobile_site_link_title * no_show_period * on_success_button_link * on_success_button_text * recap_interval * recap_send_after_time * recap_send_canceled_bookings * recap_send_new_bookings * recap_send_upcomming_bookings * send_cancel_to_client * send_cancel_to_client_email * send_cancel_to_unit * send_cancel_to_unit_email * send_contact_widget_email_notification * send_contact_widget_sms_notification * send_notify_to_client * send_notify_to_client_email * send_notify_to_unit * send_notify_to_unit_email * send_onchange_to_client * send_onchange_to_client_email * send_onchange_to_unit * send_onchange_to_unit_email * send_oncreate_to_client * send_oncreate_to_client_email * send_oncreate_to_unit * send_oncreate_to_unit_email * send_sms_if_push_enabled * site_link * site_link_title * skip_limits_for_admin * skip_show_mobile_app_ads * skip_show_on_success_button * sms_event_list * sms_events_list_template * sms_group_events_list_template * unit_batch_cancel_template * unit_batch_cancel_template_email * unit_batch_cancel_template_email_subject * unit_event_cancel_template * unit_event_cancel_template_email * unit_event_cancel_template_email_subject * unit_event_change_template * unit_event_change_template_email * unit_event_change_template_email_subject * unit_event_creation_template * unit_event_creation_template_email * unit_event_creation_template_email_subject * unit_event_group_creation_template * unit_event_group_creation_template_email * unit_event_group_creation_template_email_subject * unit_group_notification_template * unit_group_notification_template_email * unit_group_notification_template_email_subject * unit_notification_template * unit_notification_template_email * unit_notification_template_email_subject * unit_notification_time * unit_recurring_event_creation_template * unit_recurring_event_creation_template_email * unit_recurring_event_creation_template_email_subject * use_common_client_db * user_confirmation * user_public_layout * user_public_theme * waiting_video ---- =====Accept payments Custom Feature params===== Read more about [[Custom_Features#Accept_Payments|Accept Payments Custom Feature configuration]]. * allow_delay_payment *: Allow delay payment option. Boolean. * company_currency *: * hide_sale_tax *: Hide sales tax option. Boolean. * payment_timeout *: Payment timeout option. String ("5 minutes", "1 hour", ...) * sale_tax *: Sales tax option. Integer. You should divide by 100 to get percent value. * paypal_account *: PayPal payment processor configuration. String. * skrill_account *: Skrill payment processor configuration parameter. String. * skrill_secret *: Skrill payment processor configuration parameter. String. * zooz_app_id *: ZooZ payment processor configuration parameter. String. * zooz_app_key *: ZooZ payment processor configuration parameter. String. * dwolla_application_key *: Dwolla payment processor configuration parameter. String. * dwolla_id *: Dwolla payment processor configuration parameter. String. * dwolla_secret_key *: Dwolla payment processor configuration parameter. String. * liqpay_merchant_id * liqpay_merchant_pass ---- =====Term & Conditions Custom Feature params===== Read more about [[Custom_Features#Terms_and_Conditions|Terms and Conditions Custom Feature]]. * user_license_text *: Terms and conditions text. String. ---- ===Custom Features' identifiers=== Custom Feature identifier is a string constant which represents a Custom Feature in system. These constants used in <code>[[#isPluginActivated|isPluginActivated]]</code> and <code>[[#getPluginStatuses|getPluginStatuses]]</code> API methods. * advanced_notification *:Book Soon notification system * any_unit *:Any Employee selector * api *:API * approve_booking *:Approve booking * back_to_site *:Take me back home * contact_widget *:Contact widget * counter *:Visitor Counter * custom_css *:Custom CSS * data_security *:Clean history * description *:HTML description field for events * event_category *:Service categories * event_field *:Intake forms * facebookImage *:Facebook client info * financial_dashboard *:Insights * google_analytics *:Google Adwords and analytics * google_calendar_export *:Calendar sync * group_booking *:Group bookings * hipaa *:HIPAA * limit_bookings *:Limit bookings * location *:Multiple locations * mobile_app_backend *:Mobile application * multiple_booking *:Multiple bookings * news *:News * paid_events *:Accept payments <!--* promo *:Rewards and Referrals--> * recap *:Daily report * secure *:SSL * status *:Status * unit_colors *:Providers color coding * user_license *:Terms and conditions * cancelation_policy *:Cancellation Policy See [[Custom_Features|Custom Features]] page for description for each Custom Feature. == Examples == ====getBookingDetails response==== An example of data returned by [[#getBookingDetails|getBookingDetails]] API method. { "id": "321", "event_id": "5", "event_name": "Massage", "unit_id": "3", "unit_name": "John", "client_id": "1", "client_name": "Bob", "start_date_time": "2015-11-25 15:00:00", "end_date_time": "2015-11-25 16:00:00", "is_confirmed": "1", "code": "h8v8w5ls", "record_date": "2015-11-19 04:06:38", "comment": null, "company_login": "testzt", "company_name": "My Cool Company", "company_phone": "+1-555-55-55", "company_email": "into@mycoolcompany.com", "additional_fields": [{ "value": "on", "field_name": "201a89517de509f6b3a60858918faac3", "field_title": "Include washing", "field_position": "4", "field_type": "checkbox", "field_id": "4" }], "comments": [], "history": [{ "id": "536", "sheduler_id": "321", "datetime": "2015-11-19 11:06:38", "type": "create", "user_id": "1", "agent": "SimplyBook.me\/55 CFNetwork\/758.0.2 Darwin\/15.0.0", "ip": "213.174.0.53, 158.69.224.50:127.0.0.1", "referer": "", "login": "admin", "firstname": "Mikhail", "lastname": "" }], "status": { "id": "3", "name": "Fancy Status", "description": null, "color": "4cbadb", "is_default": "1" }, "location": { "id": "1", "title": "location", "description": null, "picture": "e1e9409fe9682c78b2f8f294dc151af0.jpg", "address1": null, "address2": "Saint Margaret Street", "city": "\u041b\u043e\u043d\u0434\u043e\u043d", "zip": null, "country_id": "GB", "lat": "51.50013000000000000000", "lng": "-0.12630500000000000000", "phone": "44", "position": "1", "is_default": "1" }, "price": [], "promo": false } Location field is present in response only if [[Custom_Features#Multiple_Locations|Multiple locations Custom Feature]] is enabled. Otherwise this field will be an empty array. If locations Custom Feature is enabled but booking doesn't have any locations this fields also will be an empty array. Status field is present in response only if [[Custom_Features#Status|Status Custom Feature]] is enabled. Otherwise this field will be an empty array. If Custom Feature enabled but booking doesn't have any statues specified the default status returned. Price field is present in response only if [[Custom_Features#Accept_Payments|Accept payments Custom Feature]] is enabled. Otherwise this field will be an empty array. This field contains an empty array if Custom Feature is enabled but booking was created for a free service. <!--Promo field is present in response only if [[Rewards_and_Referrals_custom_feature|Rewards and Referrals Custom Feature]] is enabled. Otherwise this field will be an empty array. This field contains false if Custom Feature is enabled but booking was created without any promo codes. --> <code>additional_fields</code> field is present in response only if [[Custom_Features#Intake_Forms|Intake Forms Custom Feature]] is enabled. Otherwise this field will be an empty array. This field contains an empty array if Custom Feature is enabled but booking was created for a service with no intake forms. ---- ====book response==== [[#book|<code>book</code>]] API method returns an object which contains list of objects with short description of newly create bookings. Method returns only one item in 'bookings' array for regular appointment and more than one item for recurring or batch bookings. { "require_confirm":false, "bookings":[ { "id":"434", "event_id":"7", "unit_id":"3", "client_id":"34", "start_date_time":"2015-12-30 13:00:00", "end_date_time":"2015-12-30 13:30:00", "is_confirmed":"1", "code":"h8vc14ca", "hash":"785cb8cce316e64765b94c05a635f4be" }, { "id":"435", "event_id":"7", "unit_id":"3", "client_id":"34", "start_date_time":"2015-12-31 13:00:00", "end_date_time":"2015-12-31 13:30:00", "is_confirmed":"1", "code":"h8vc2pge", "hash":"8b92d634541bfd93c0830967e56f4653" }, { "id":"436", "event_id":"7", "unit_id":"3", "client_id":"34", "start_date_time":"2016-01-04 13:00:00", "end_date_time":"2016-01-04 13:30:00", "is_confirmed":"1", "code":"h8vc3urb", "hash":"cd22a0bf183f7350e595988dd2486e5b" }, { "id":"437", "event_id":"7", "unit_id":"3", "client_id":"34", "start_date_time":"2016-01-05 13:00:00", "end_date_time":"2016-01-05 13:30:00", "is_confirmed":"1", "code":"h8vc44d9", "hash":"53f98ff4e4a0323aa907156c59c99362" } ], "batch_type":"batch_recurrent_booking", "recurrent_batch_id":"1", "batch_hash":"357178bce290381bb7235080941ec143" } ---- ====getCompanyInfo response==== An example of data returned by [[#getCompanyInfo|getCompanyInfo]] API method. { "login": "pierrecoetzee", "name": "Pierre", "description": "Write a description about your company or about you as a service provider. You can add other service providers inside the system and each can have his own description.", "address1": "", "address2": "Storey's Gate, ", "city": "London", "country_id": "GB", "lat": "51.500435", "lng": "-0.129811", "email": "pierre.coe@gmail.com", "phone": "", "web": null, "skip_address": null, "logo": null, "address": "GB, London, Storey's Gate, ", "description_text": "Write a description about your company or about you as a service provider. You can add other service providers inside the system and each can have his own description.", "timezone": "Europe London", "show_in_client_timezone": false, "timeframe": "60", "timeline_type": "modern_week", "allow_event_day_break": "0", "allow_event_breaktime_break": "0" } <code>timeline_type</code> field can be one the following values: * flexible * modern * flexible_week * modern_week * classic * classes Please note that <code>classic</code> timeline type is deprecated and not supported anymore. <code>description</code> field contains raw data of company's description which can include HTML tags. <code>description_text</code> field contains only text information without HTML tags. For information about <code> timeframe</code>, <code>timezone</code>, <code>allow_event_day_break</code> and <code>allow_event_breaktime_break</code> see [[#Company params|Company params section]]. ---- <!--====getPluginPromoInfoByCode response==== { "id": "1", "title": "[service\/services] with [discount]% discount!", "code": "yvuvugum", "description": "We are offering [service\/services] with an amazing [discount]% discount! We are running this deal for a limited time only.", "discount": "99.9999", "start_date": "2015-12-23", "expired_date": "2016-01-23", "sheduler_start_date": "2015-12-23", "sheduler_end_date": "2015-12-31", "sheduler_start_time": "09:00:00", "sheduler_end_time": "22:30:00", "allow_usage_count": "20", "fineprint_text": "Deal is limited for new clients only. Reward is claimable [client_claim_times_number] times per client. Deal is only claimable for the locations specified. Deal is cannot be combined with any other promotion. Must be redeemed prior to the expiration date shown on the deal.", "redemption_text": "Present your confirmation code when you want to redeem your deal. You may either to print off your confirmation email or show your confirmation code by loggin into Simplybook on your mobile phone\/Pc.\r\n[promocode]\r\n[discount]\r\n[reward]\r\n[referal_qty]", "headline": "[service\/services] with [discount]% discount!", "image": null, "allow_customer_count": "1", "show_in_catalogue": "1", "status": "active", "plugin_promo_message_id": "1", "common_promotion_id": "132", "service_ids": ["1"] } <code>service_ids</code> contains a list of services for wich promotion discount can be applied.