Booking Limits & Restrictions

By default once a time slot is taken it becomes unavailable to the next person booking, however some cases may allow for multiple bookings per slot. Booking limits can be set at the Service level, the Location level, and the Appointment level, to restrict the number of appointments that can be booked per time slot.

👍

Use Case: Group Party Events

In a group party event, you may have each attendee confirm their reservation separately. In this case may want to restrict the number of attendees which can be done with a Booking Limit

There are three different levels of booking limits, all of which can be set in the Dashboard or via the API. if limits are also set at the Service level these limits will override limits at the Location level. Finally, if a limit is set at the Appointment level it will override both the Location and Service level limits

Location Level Booking Limit

Location Level Limits
Limits set at the Location level will apply to every service within that location, but may be overridden by Service or Appointment level limits.

To set booking limits at the Location level in the Dashboard, navigate to the Location you wish to update and edit the Location profile, the booking limits can be found on the Settings tab labelled Bookings Per Slot.

To set Location level limits via the API you will need to make a PUT request to the setup/v1/calendars/{calendarId} endpoint, where calendarId is the ID of the main calendar (accessible from the GET /locations response under the property name primaryCalendarId). The body of the request should contain the property bookingsPerSlot where the value is your Location level limit.

curl -X PUT \
  https://sandbox-api.onsched.com/setup/v1/calendars/{calendarId} \
  -H 'Content-Type: application/json' \
  -d '{
    "bookingsPerSlot": 0
}'
const calendarsURL = 'https://sandbox-api.onsched.com/setup/v1/calendars/{calendarId}'

axios.put( calendarsURL, { bookingsPerSlot: 0 } )
  .then( resp => {
  // return the availability object containing available times array
  resolve( resp.data )
} )
  .catch( error => reject( error ) )
var request = require('request');
var options = {
  'method': 'PUT',
  'url': 'https://sandbox-api.onsched.com/setup/v1/calendars/{calendarId}',
  'headers': {'Content-Type': 'application/x-www-form-urlencoded' },
  'body': { bookingsPerSlot: 0 }
};
request(options, function (error, response) {
  if (error) throw new Error(error);
  console.log(response.body);
});
var settings = {
  "async": true,
  "crossDomain": true,
  "url": "https://sandbox-api.onsched.com/setup/v1/calendars/{calendarId}",
  "method": "PUT",
  "headers": {
    "Content-Type": "application/x-www-form-urlencoded",
    "Accept": "*/*",
    "Cache-Control": "no-cache",
    "Host": "sandbox-api.onsched.com",
    "Accept-Encoding": "gzip, deflate",
    "Content-Length": "110",
    "Connection": "keep-alive",
    "cache-control": "no-cache"
  },
  "data": "{\n\t\"bookingsPerSlot\": 0\n}"
}

$.ajax(settings).done(function (response) {
  console.log(response);
});
package main
import (
  "fmt"
  "strings"
  "net/http"
  "io/ioutil"
)
func main() {
  url := "https://sandbox-api.onsched.com/setup/v1/calendars/{calendarId}"
  method := "PUT"
    payload := strings.NewReader("{\n\t\"bookingsPerSlot\": 0\n}")
  client := &http.Client {
  }
  req, err := http.NewRequest(method, url, payload)
  if err != nil {
    fmt.Println(err)
    return
  }
  req.Header.Add("Content-Type", "application/x-www-form-urlencoded")
  res, err := client.Do(req)
  if err != nil {
    fmt.Println(err)
    return
  }
  defer res.Body.Close()
  body, err := ioutil.ReadAll(res.Body)
  if err != nil {
    fmt.Println(err)
    return
  }
  fmt.Println(string(body))
}
require "uri"
require "net/http"
url = URI("https://sandbox-api.onsched.com/setup/v1/calendars/{calendarId}")
https = Net::HTTP.new(url.host, url.port)
https.use_ssl = true
request = Net::HTTP::Put.new(url)
request["Content-Type"] = "application/x-www-form-urlencoded"
request.body = "{\n\t\"bookingsPerSlot\": 0\n}"
response = https.request(request)
puts response.read_body
import http.client
conn = http.client.HTTPSConnection("sandbox-api.onsched.com")
payload = "{\n\t\"bookingsPerSlot\": 0\n}"
headers = {'Content-Type': 'application/x-www-form-urlencoded'}
conn.request("PUT", "/setup/v1/calendars/{calendarId}", payload, headers)
res = conn.getresponse()
data = res.read()
print(data.decode("utf-8"))
var data = JSON.stringify({ "bookingsPerSlot": 0 });
var xhr = new XMLHttpRequest();
xhr.withCredentials = true;
xhr.addEventListener("readystatechange", function() {
  if(this.readyState === 4) {
    console.log(this.responseText);
  }
});
xhr.open("PUT", "https://sandbox-api.onsched.com/setup/v1/calendars/{calendarId}");
xhr.setRequestHeader("Content-Type", "application/x-www-form-urlencoded");
xhr.send(data);
OkHttpClient client = new OkHttpClient().newBuilder()
  .build();
MediaType mediaType = MediaType.parse("application/x-www-form-urlencoded");
RequestBody body = RequestBody.create(mediaType, "{\n\t\"bookingsPerSlot\": 0\n}");
Request request = new Request.Builder()
  .url("https://sandbox-api.onsched.com/setup/v1/calendars/{calendarId}")
  .method("PUT", body)
  .addHeader("Content-Type", "application/x-www-form-urlencoded")
  .build();
Response response = client.newCall(request).execute();
PUT /setup/v1/calendars/{calendarId} HTTP/1.1
Host: sandbox-api.onsched.com
Content-Type: application/x-www-form-urlencoded
Accept: */*
Cache-Control: no-cache
Accept-Encoding: gzip, deflate
Content-Length: 110
Connection: keep-alive
cache-control: no-cache

{
    "bookingsPerSlot": 0
}

Service Level Booking Limit

Limits set at the Service level will override limits set at the Location, but may be overridden by Appointment level limits.

To set booking limits on the Service in the Dashboard, navigate to the Services tab from the main menu. Select the service for which you plan to configure booking limits, the booking limit can be found on the Profile tab.

To set Service level limits via the API you must make a PUT request to the setup/v1/services/{serviceId} endpoint, where serviceId is the ID of the service for which you are configuring limits. The body of the request should contain the property bookingLimit where the value is your Service level booking limit.

curl -X PUT \
  https://sandbox-api.onsched.com/setup/v1/services/{serviceId} \
  -H 'Content-Type: application/json' \
  -d '{
    "bookingLimit": 0
}'
const servicesUrl = 'https://sandbox-api.onsched.com/setup/v1/services/{serviceId}'

axios.put( servicesUrl, { bookingLimit: 0 } )
  .then( resp => {
  // return the availability object containing available times array
  resolve( resp.data )
} )
  .catch( error => reject( error ) )
var request = require('request');
var options = {
  'method': 'PUT',
  'url': 'https://sandbox-api.onsched.com/setup/v1/services/{serviceId}',
  'headers': {'Content-Type': 'application/x-www-form-urlencoded' },
  'body': { bookingLimit: 0 }
};
request(options, function (error, response) {
  if (error) throw new Error(error);
  console.log(response.body);
});
var settings = {
  "async": true,
  "crossDomain": true,
  "url": "https://sandbox-api.onsched.com/setup/v1/services/{serviceId}",
  "method": "PUT",
  "headers": {
    "Content-Type": "application/x-www-form-urlencoded",
    "Accept": "*/*",
    "Cache-Control": "no-cache",
    "Host": "sandbox-api.onsched.com",
    "Accept-Encoding": "gzip, deflate",
    "Content-Length": "110",
    "Connection": "keep-alive",
    "cache-control": "no-cache"
  },
  "data": "{\n\t\"bookingLimit\": 0\n}"
}

$.ajax(settings).done(function (response) {
  console.log(response);
});
package main
import (
  "fmt"
  "strings"
  "net/http"
  "io/ioutil"
)
func main() {
  url := "https://sandbox-api.onsched.com/setup/v1/services/{serviceId}"
  method := "PUT"
    payload := strings.NewReader("{\n\t\"bookingLimit\": 0\n}")
  client := &http.Client {
  }
  req, err := http.NewRequest(method, url, payload)
  if err != nil {
    fmt.Println(err)
    return
  }
  req.Header.Add("Content-Type", "application/x-www-form-urlencoded")
  res, err := client.Do(req)
  if err != nil {
    fmt.Println(err)
    return
  }
  defer res.Body.Close()
  body, err := ioutil.ReadAll(res.Body)
  if err != nil {
    fmt.Println(err)
    return
  }
  fmt.Println(string(body))
}
require "uri"
require "net/http"
url = URI("https://sandbox-api.onsched.com/setup/v1/services/{serviceId}")
https = Net::HTTP.new(url.host, url.port)
https.use_ssl = true
request = Net::HTTP::Put.new(url)
request["Content-Type"] = "application/x-www-form-urlencoded"
request.body = "{\n\t\"bookingLimit\": 0\n}"
response = https.request(request)
puts response.read_body
import http.client
conn = http.client.HTTPSConnection("sandbox-api.onsched.com")
payload = "{\n\t\"bookingLimit\": 0\n}"
headers = {'Content-Type': 'application/x-www-form-urlencoded'}
conn.request("PUT", "/setup/v1/services/{serviceId}", payload, headers)
res = conn.getresponse()
data = res.read()
print(data.decode("utf-8"))
var data = JSON.stringify({ "bookingLimit": 0 });
var xhr = new XMLHttpRequest();
xhr.withCredentials = true;
xhr.addEventListener("readystatechange", function() {
  if(this.readyState === 4) {
    console.log(this.responseText);
  }
});
xhr.open("PUT", "https://sandbox-api.onsched.com/setup/v1/services/{serviceId}");
xhr.setRequestHeader("Content-Type", "application/x-www-form-urlencoded");
xhr.send(data);
OkHttpClient client = new OkHttpClient().newBuilder()
  .build();
MediaType mediaType = MediaType.parse("application/x-www-form-urlencoded");
RequestBody body = RequestBody.create(mediaType, "{\n\t\"bookingLimit\": 0\n}");
Request request = new Request.Builder()
  .url("https://sandbox-api.onsched.com/setup/v1/services/{serviceId}")
  .method("PUT", body)
  .addHeader("Content-Type", "application/x-www-form-urlencoded")
  .build();
Response response = client.newCall(request).execute();
PUT /setup/v1/services/{serviceId} HTTP/1.1
Host: sandbox-api.onsched.com
Content-Type: application/x-www-form-urlencoded
Accept: */*
Cache-Control: no-cache
Accept-Encoding: gzip, deflate
Content-Length: 110
Connection: keep-alive
cache-control: no-cache

{
    "bookingLimit": 0
}

Appointment Level Booking Limit

Appointment level limits are only applicable to services with a type of Event. Event type Services require Allocations to be created in order to configure availability, when creating an Allocation you may include an optional property named bookingLimit which will override limits set at both the Location and the Service.

By default the Allocation will restrict the number of bookings to the limit set on the Service profile, however if a limit is also provided to the Allocation* it will take priority.

To set booking limits on the Allocation in the Dashboard, navigate to the Services tab from the main menu. Select the Service for which you plan to configure your Allocation, ensure the Service has a type of Event, if it is a type of Event the Events tab will become enabled. Switch to the Events tab and create your Allocation with booking limit settings. Once configured the booking limit will now be set at the Appointment level and may differ for each Event Allocation.

To set Appointment level limits via the API you must make a POST request to the setup/v1/services/{serviceId}/allocations endpoint, where serviceId is the ID of the service for which you are configuring Allocations. The body of the request should contain the property bookingLimit where the value is your Service level booking limit, as well as any additional data required (i.e. startDate, endDate, repeat settings, etc).

curl -X POST \
  https://sandbox-api.onsched.com/setup/v1/services/{serviceId}/allocations \
  -H 'Content-Type: application/json' \
  -d '{
      "locationId": "db730fa7-b081-4dd8-9ee9-dfb359166566",
      "bookingLimit": 5,
      "reason": "Example",
      "repeat": {frequency: "D", interval: 1, weekdays: "", monthDay: "1", monthType: "D"},
      "repeats": false,
      "serviceId": "116425",
      "startDate": "2021-07-16",
      "endDate": "2021-07-16",
      "startTime": 900,
      "endTime": 1700
    }'
const servicesUrl = 'https://sandbox-api.onsched.com/setup/v1/services/{serviceId}/allocations'
const data = {
  "locationId": "db730fa7-b081-4dd8-9ee9-dfb359166566",
  "bookingLimit": 5,
  "reason": "Example",
  "repeat": {frequency: "D", interval: 1, weekdays: "", monthDay: "1", monthType: "D"},
  "repeats": false,
  "serviceId": "116425",
  "startDate": "2021-07-16",
  "endDate": "2021-07-16",
  "startTime": 900,
  "endTime": 1700
}

axios.post( servicesUrl, data )
  .then( resp => {
  // return the availability object containing available times array
  resolve( resp.data )
} )
  .catch( error => reject( error ) )
var request = require('request');
var options = {
  'method': 'POST',
  'url': 'https://sandbox-api.onsched.com/setup/v1/services/{serviceId}/allocations',
  'headers': {'Content-Type': 'application/x-www-form-urlencoded' },
  'body': {
    "locationId": "db730fa7-b081-4dd8-9ee9-dfb359166566",
    "bookingLimit": 5,
    "reason": "Example",
    "repeat": {frequency: "D", interval: 1, weekdays: "", monthDay: "1", monthType: "D"},
    "repeats": false,
    "serviceId": "116425",
    "startDate": "2021-07-16",
    "endDate": "2021-07-16",
    "startTime": 900,
    "endTime": 1700
  }
};
request(options, function (error, response) {
  if (error) throw new Error(error);
  console.log(response.body);
});
var settings = {
  "async": true,
  "crossDomain": true,
  "url": "https://sandbox-api.onsched.com/setup/v1/services/{serviceId}/allocations",
  "method": "POST",
  "headers": {
    "Content-Type": "application/x-www-form-urlencoded",
    "Accept": "*/*",
    "Cache-Control": "no-cache",
    "Host": "sandbox-api.onsched.com",
    "Accept-Encoding": "gzip, deflate",
    "Content-Length": "110",
    "Connection": "keep-alive",
    "cache-control": "no-cache"
  },
  "data": "{\n  \"locationId\": \"db730fa7-b081-4dd8-9ee9-dfb359166566\",\n  \"bookingLimit\": 5,\n  \"reason\": \"Example\",\n  \"repeat\": {frequency: \"D\", interval: 1, weekdays: \"\", monthDay: \"1\", monthType: \"D\"},\n  \"repeats\": false,\n  \"serviceId\": \"116425\",\n  \"startDate\": \"2021-07-16\",\n  \"endDate\": \"2021-07-16\",\n  \"startTime\": 900,\n  \"endTime\": 1700\n}"
}

$.ajax(settings).done(function (response) {
  console.log(response);
});
package main
import (
  "fmt"
  "strings"
  "net/http"
  "io/ioutil"
)
func main() {
  url := "https://sandbox-api.onsched.com/setup/v1/services/{serviceId}/allocations"
  method := "POST"
    payload := strings.NewReader("{\n  \"locationId\": \"db730fa7-b081-4dd8-9ee9-dfb359166566\",\n  \"bookingLimit\": 5,\n  \"reason\": \"Example\",\n  \"repeat\": {frequency: \"D\", interval: 1, weekdays: \"\", monthDay: \"1\", monthType: \"D\"},\n  \"repeats\": false,\n  \"serviceId\": \"116425\",\n  \"startDate\": \"2021-07-16\",\n  \"endDate\": \"2021-07-16\",\n  \"startTime\": 900,\n  \"endTime\": 1700\n}")
  client := &http.Client {
  }
  req, err := http.NewRequest(method, url, payload)
  if err != nil {
    fmt.Println(err)
    return
  }
  req.Header.Add("Content-Type", "application/x-www-form-urlencoded")
  res, err := client.Do(req)
  if err != nil {
    fmt.Println(err)
    return
  }
  defer res.Body.Close()
  body, err := ioutil.ReadAll(res.Body)
  if err != nil {
    fmt.Println(err)
    return
  }
  fmt.Println(string(body))
}
require "uri"
require "net/http"
url = URI("https://sandbox-api.onsched.com/setup/v1/services/{serviceId}/allocations")
https = Net::HTTP.new(url.host, url.port)
https.use_ssl = true
request = Net::HTTP::Post.new(url)
request["Content-Type"] = "application/x-www-form-urlencoded"
request.body = "{\n  \"locationId\": \"db730fa7-b081-4dd8-9ee9-dfb359166566\",\n  \"bookingLimit\": 5,\n  \"reason\": \"Example\",\n  \"repeat\": {frequency: \"D\", interval: 1, weekdays: \"\", monthDay: \"1\", monthType: \"D\"},\n  \"repeats\": false,\n  \"serviceId\": \"116425\",\n  \"startDate\": \"2021-07-16\",\n  \"endDate\": \"2021-07-16\",\n  \"startTime\": 900,\n  \"endTime\": 1700\n}"
response = https.request(request)
puts response.read_body
import http.client
conn = http.client.HTTPSConnection("sandbox-api.onsched.com")
payload = "{\n  \"locationId\": \"db730fa7-b081-4dd8-9ee9-dfb359166566\",\n  \"bookingLimit\": 5,\n  \"reason\": \"Example\",\n  \"repeat\": {frequency: \"D\", interval: 1, weekdays: \"\", monthDay: \"1\", monthType: \"D\"},\n  \"repeats\": false,\n  \"serviceId\": \"116425\",\n  \"startDate\": \"2021-07-16\",\n  \"endDate\": \"2021-07-16\",\n  \"startTime\": 900,\n  \"endTime\": 1700\n}"
headers = {'Content-Type': 'application/x-www-form-urlencoded'}
conn.request("POST", "/setup/v1/services/{serviceId}/allocations", payload, headers)
res = conn.getresponse()
data = res.read()
print(data.decode("utf-8"))
var data = JSON.stringify({
  "locationId": "db730fa7-b081-4dd8-9ee9-dfb359166566",
  "bookingLimit": 5,
  "reason": "Example",
  "repeat": {frequency: "D", interval: 1, weekdays: "", monthDay: "1", monthType: "D"},
  "repeats": false,
  "serviceId": "116425",
  "startDate": "2021-07-16",
  "endDate": "2021-07-16",
  "startTime": 900,
  "endTime": 1700
});
var xhr = new XMLHttpRequest();
xhr.withCredentials = true;
xhr.addEventListener("readystatechange", function() {
  if(this.readyState === 4) {
    console.log(this.responseText);
  }
});
xhr.open("POST", "https://sandbox-api.onsched.com/setup/v1/services/{serviceId}/allocations");
xhr.setRequestHeader("Content-Type", "application/x-www-form-urlencoded");
xhr.send(data);
OkHttpClient client = new OkHttpClient().newBuilder()
  .build();
MediaType mediaType = MediaType.parse("application/x-www-form-urlencoded");
RequestBody body = RequestBody.create(mediaType, "{\n  \"locationId\": \"db730fa7-b081-4dd8-9ee9-dfb359166566\",\n  \"bookingLimit\": 5,\n  \"reason\": \"Example\",\n  \"repeat\": {frequency: \"D\", interval: 1, weekdays: \"\", monthDay: \"1\", monthType: \"D\"},\n  \"repeats\": false,\n  \"serviceId\": \"116425\",\n  \"startDate\": \"2021-07-16\",\n  \"endDate\": \"2021-07-16\",\n  \"startTime\": 900,\n  \"endTime\": 1700\n}");
Request request = new Request.Builder()
  .url("https://sandbox-api.onsched.com/setup/v1/services/{serviceId}/allocations")
  .method("POST", body)
  .addHeader("Content-Type", "application/x-www-form-urlencoded")
  .build();
Response response = client.newCall(request).execute();
POST /setup/v1/services/{serviceId}/allocations HTTP/1.1
Host: sandbox-api.onsched.com
Content-Type: application/x-www-form-urlencoded
Accept: */*
Cache-Control: no-cache
Accept-Encoding: gzip, deflate
Content-Length: 110
Connection: keep-alive
cache-control: no-cache

{
  "locationId": "db730fa7-b081-4dd8-9ee9-dfb359166566",
  "bookingLimit": 5,
  "reason": "Example",
  "repeat": {frequency: "D", interval: 1, weekdays: "", monthDay: "1", monthType: "D"},
  "repeats": false,
  "serviceId": "116425",
  "startDate": "2021-07-16",
  "endDate": "2021-07-16",
  "startTime": 900,
  "endTime": 1700
}

Book Ahead / In Advance Restrictions

The Book in Advance Restriction allows each Business Location to set a minimum amount of time required before an appointment can be booked. If a Book In Advance Restriction is not set, the first available time slot returned will be bookable.

The Book Ahead Restriction allows each Business Location to set a maximum amount of days, weeks, or months in advance that an appointment can be booked. By default the Book Ahead Restriction is set to 1 week, meaning that the returned available times will not show any further ahead than 7 days.

For more information about how these restrictions affect availability results please see Availability Factoring.


Did this page help you?