There are Company Level and Business Level services. Company Level services can be accessed from any location while Business Level can only be accessed from the location where it was created.

👍

Use Case: Services offered at only one location

i.e. My company repairs home appliances. All the locations have someone who can repair fridges, but only one can repair dish washers.
The company level service is "Fridge repair", since all locations have this service. The business level service is "Dish washer repairing" since it is available in only one location.

What's different in the service object?

To tell the difference between company and business level services from the service response there are 2 properties in the response object that must be considered.
companyId and locationId.
Only one of them will hold a value. If companyId has a value, it means that the service is Company Level. Otherwise, if locationId has a value the service is Business Level.

Using a Company Service

To create a company service location, it's as easy as passing the primary location ID in the service object. Any other ID will make the service Business Level.

curl -X POST \
  https://sandbox-api.onsched.com/setup/v1/services \
  -H 'Accept: */*' \
  -H 'Accept-Encoding: gzip, deflate' \
  -H 'Authorization: Bearer {AUTH_TOKEN}' \
  -H 'Cache-Control: no-cache' \
  -H 'Connection: keep-alive' \
  -H 'Content-Length: 102' \
  -H 'Content-Type: application/json' \
  -H 'Cookie: ARRAffinity={RANDOM_STRING}' \
  -H 'Host: sandbox-api.onsched.com' \
  -H 'cache-control: no-cache' \
  -d '{
    "locationId": "e76a39f6-fbe7-48c9-84c9-2fed3ed7b17d",
        "name": "Fridge Repair",
        "description": "Fridge repair",
      }'
POST /setup/v1/services/ HTTP/1.1
Host: sandbox-api.onsched.com
Content-Type: application/json
Authorization: Bearer {AUTH_TOKEN}
Accept: */*
Cache-Control: no-cache
Host: sandbox-api.onsched.com
Accept-Encoding: gzip, deflate
Content-Length: 102
Cookie: ARRAffinity={RANDOM_STRING}
Connection: keep-alive
cache-control: no-cache

'{
    "locationId": "e76a39f6-fbe7-48c9-84c9-2fed3ed7b17d",
        "name": "Fridge Repair",
        "description": "Fridge repair",
}'
var request = require("request");

var options = { method: 'POST',
  url: 'https://sandbox-api.onsched.com/setup/v1/services/',
  headers: 
   { 'cache-control': 'no-cache',
     Connection: 'keep-alive',
     Cookie: 'ARRAffinity={RANDOM_STRING}}',
     'Content-Length': '102',
     'Accept-Encoding': 'gzip, deflate',
     Host: 'sandbox-api.onsched.com',
     'Cache-Control': 'no-cache',
     Accept: '*/*',
     Authorization: 'Bearer {AUTH_TOKEN}',
     'Content-Type': 'application/json' },
  body: 
   '{
    "locationId": "e76a39f6-fbe7-48c9-84c9-2fed3ed7b17d",
        "name": "Fridge Repair",
        "description": "Fridge repair",
    }',
  json: true };

request(options, function (error, response, body) {
  if (error) throw new Error(error);

  console.log(body);
});
var settings = {
  "async": true,
  "crossDomain": true,
  "url": "https://sandbox-api.onsched.com/setup/v1/services/",
  "method": "POST",
  "headers": {
    "Content-Type": "application/json",
    "User-Agent": "PostmanRuntime/7.17.1",
    "Accept": "*/*",
    "Cache-Control": "no-cache",
    "Host": "sandbox-api.onsched.com",
    "Accept-Encoding": "gzip, deflate",
    "Content-Length": "102",
    "Cookie": "ARRAffinity={RANDOM_STRING}",
    "Connection": "keep-alive",
    "cache-control": "no-cache"
  },
  "processData": false,
  "data": "{\n\t\"locationId\" : \"e4d61bd8-cdf3-4fc9-887e-2320dce040e0\",\n\t\"name\" : \"Fridge Repair\",\n\t\"description\" : \"Fridge repair\"\n}"
}

$.ajax(settings).done(function (response) {
  console.log(response);
});

❗️

Unattach a Company level service

You can unlink a Company level service from a Business level location by calling the endpoint: DELETE /services/calendar/{service_id}


Did this page help you?