Search

getTimeSlots

Returns first available appointment slots for a chosen service in a selected salon (location).
API will inspect employee’s schedules and find first available times that have not been booked yet.

Using this API call, you can schedule:

  • One appointment for one customer;
  • Several consecutive appointments (eg. multiple hair care services) for one customer;
  • Appointments for a group of customers who want to arrive and leave together.

This API call can only be used if Salon module is enabled on your account. For other salon related functions, see getEmployees and getSchedule.

Returns error 1044 if the service being booked does not have a default length specified in Erply backend.

Input parameters

Parameter nameDescriptionPossible valueRequired
warehouseIDLocation, salon ID.Integer yes
startTimeEarliest possible start time for the time slots.
If unspecified, current time is used.
Must be local time (in that particular location's time zone).
ISO time (yyyy-mm-dd hh:mm:ss)
endTimeLatest possible end time for the time slots.
If unspecified, default value will be startTime + 2 weeks.

If no suitable time slots (or sets of time slots) are found, API call will return no results and you will need to re-run it with another endTime, or adjust the set of services requested.
Must be local time (in that particular location's time zone).
ISO time (yyyy-mm-dd hh:mm:ss)
maxOptionsMaximum number of options offered by the API. By default 5Integer
preserveOrderSet to 1 if it is important that the services would be performed in the exact same order and may not be reordered.Integer (0 or 1)
clockedInEmployeesOnlyIf set to 1, returns only timeslots available for employees who have clocked in for today. (If not set, then API only considers employees' schedule).

Note that it only makes sense to use this option if you are asking for timeslots available today! If you ask for a longer period, then tomorrow's timeslots etc. are also constrained only to these employees who are clocked in at the present moment.
Integer (0 or 1)
returnAllEmployeesIf set to 1, API returns entries for all matching employees (clocked-in employees if clockedInEmployees = 1, otherwise all employees providing that particular service, and scheduled to be working on given day in selected salon.) Even if an employee is already occupied for the whole day, API appends an extra entry at the end of the resultset, with that employee's ID, but startTime and endTime set to "".

This setting makes sense if you are asking only for today's timeslots. May not be compatible with multi-appointments.
Integer (0 or 1)
walkInEmployeesOnlyInteger (0 or 1)
getDuplicateTimeslotsBy default, API returns only one result if multiple emplyees are ready to provide service in the exact same timeslot. (API picks one employee, by its own selection rules, and returns it.) If this option is set to 1, yo will get duplicate timeslots, too. If there are 15 stylists ready to provide haircuts at 9am, then using this setting API returns 15 timeslots (one for each employee), for each hour. The timeslots are ordered by API's own ordering rules.Integer (0 or 1)
customer#employeeID#
customer#productID#
Indicate how many customers will be arriving (of course there might be just one customer) and which services (products) they want appointments for.

All employeeID's are optional parameters (use them only if the customer already knows which stylist they want), but productID is required. So in the simplest case — one customer wants one service — you must provide at least customer1productID1.

If that customer wants to book multiple consecutive appointments (eg. hair coloring, haircut etc.), use parameter customer1productID2, customer1productID3 and so on.

If a group of customers wants to arrive together and have appointments at the same time, use parameters customer2productID1 for the second customer, customer3productID1 for the third and so on.
Integer
Integer
yes

Response

Field nameTypeDescription
--Unlike other API requests, getTimeSlots does not return an array of records, but an array of appointment options - each "option" containing one or more appointment times, depending on whether you requested times for a single appointment or a set of appointments.

An appointment contains the following parameters:
customerNumberInteger# you assigned to this customer in your input parameters.
employeeIDIntegerStylist assigned to this appointment
productIDIntegerService performed
startTimeISO datetime (yyyy-mm-dd hh:mm:ss)Appointment start time
endTimeISO datetime (yyyy-mm-dd hh:mm:ss)Appointment end time

Sample Request

Get appointment times for one customer who wants a haircut (product ID = 19), followed by coloring (product ID = 36). No preference for stylists.

Input parameters:

warehouseID = 1
startTime = 2012-08-22 14:00:00
endTime = 2012-08-24 20:00:00
preserveOrder = 1
customer1productID1 = 19
customer1productID2 = 36

Sample JSON output:

{
"status": { ... },
"records": [
[
/* This is customer's first option: haircut at 4:30pm, coloring at 6pm */

{"customerNumber": 1, employeeID: 14, productID: 19,
"startTime": "2012-08-22 16:15:00", "endTime": "2012-08-22 17:00:00"},

{"customerNumber": 1, employeeID: 16, productID: 36,
"startTime": "2012-08-22 18:00:00", "endTime": "2012-08-22 19:15:00"}
],
[
/* This is customer's second option: haircut at 5:30pm, coloring at 6:15pm */

{"customerNumber": 1, employeeID: 21, productID: 19,
"startTime": "2012-08-22 17:30:00", "endTime": "2012-08-22 18:15:00"},
{"customerNumber": 1, employeeID: 17, productID: 36,
"startTime": "2012-08-22 18:15:00", "endTime": "2012-08-22 19:30:00"}
]
]
}