Skip to content
Try For Free
Bizstim
Free tools
Pricing Contact Log in
Try For Free Book Demo
Home / API Reference / Services
Resource

Services

What you sell: each service with its price, type, booking rules and, for tiered services, its group.

The service object

Every service record carries these fields in this order, after object, which is always "service".

FieldTypeDescription
idinteger
group_idintegerThe service group this service is a tier of (Service Groups page); 0 = in no group. Read-only.
group_numintegerThe tier's size: the hours (hourly service) or sessions (fixed fee) bought at this tier's price, shown as HRS on the Service Groups page. 0 when in no group. Read-only.
namestring, up to 255 charactersThe service group's name; null when the service is in no group. Read-only.
service_descriptiontextThe service name, shown wherever the service is booked or billed (HTML).
service_costdecimalThe price, 2 decimals: per hour (service_type 0) or a fixed fee per session (service_type 1).
service_taxableinteger1 = sales tax applies, 0 = not.
service_typeinteger0 = hourly, 1 = fixed fee.
service_statusinteger1 = active, 0 = inactive. Deleted services are never returned.
service_securityintegerWho sees the service: 0 = all users, 1 = everyone but clients, 2 = admin and staff only.
service_remindersinteger1 = session reminders go out for sessions with this service, 0 = none.
online_bookinginteger1 = clients can choose it on the online booking page, 0 = not.
min_durationintegerShortest session, in minutes, a client or practitioner may add with this service; 0 = no minimum.
max_durationintegerLongest session, in minutes, a client or practitioner may add with this service; 0 = no maximum.
start_intervalintegerStart times for sessions a client or practitioner adds: 0 = any time, 1 = on the hour, 2 = at 30 minutes past the hour.
service_subinteger1 = a subscription or membership (a fixed fee for access to your services); sessions with it cannot be added through the API. 0 = a regular service.
service_frequencyintegerThe period service_frequency_number counts in: 0 = no limit, 1 = week (Monday to Sunday), 2 = calendar month, 3 = calendar year.
service_frequency_numberintegerThe most sessions with this service one client may have per service_frequency period (cancelled sessions do not count), checked whenever a session is added, API included. 0 = no limit.

Example

{
    "object": "service",
    "id": 42,
    "group_id": 7,
    "group_num": 1,
    "name": "Example name",
    "service_description": "An example description.",
    "service_cost": 25.5,
    "service_taxable": 1,
    "service_type": 1,
    "service_status": 1,
    "service_security": 1,
    "service_reminders": 1,
    "online_booking": 1,
    "min_duration": 1,
    "max_duration": 1,
    "start_interval": 1,
    "service_sub": 1,
    "service_frequency": 1,
    "service_frequency_number": 1
}

List services

GET /api/v1/services

Parameters

ParameterInDescription
limitqueryRecords per page, 1 to 1000 (default 100).
offsetqueryRecords to skip (default 0).

Returns

A list envelope of service records (see Pagination).

Request

curl "https://www.bizstim.com/api/v1/services" \
  -H "X-API-KEY: YOUR_API_KEY" \
  -H "Accept: application/json"

Response

{
    "object": "list",
    "total": 2,
    "limit": 100,
    "offset": 0,
    "has_more": false,
    "data": [
        {
            "object": "service",
            "id": 42,
            "group_id": 7,
            "group_num": 1,
            "name": "Example name",
            "service_description": "An example description.",
            "service_cost": 25.5,
            "service_taxable": 1,
            "service_type": 1,
            "service_status": 1,
            "service_security": 1,
            "service_reminders": 1,
            "online_booking": 1,
            "min_duration": 1,
            "max_duration": 1,
            "start_interval": 1,
            "service_sub": 1,
            "service_frequency": 1,
            "service_frequency_number": 1
        },
        {
            "object": "service",
            "id": 43,
            "group_id": 7,
            "group_num": 1,
            "name": "Example name",
            "service_description": "An example description.",
            "service_cost": 25.5,
            "service_taxable": 1,
            "service_type": 1,
            "service_status": 1,
            "service_security": 1,
            "service_reminders": 1,
            "online_booking": 1,
            "min_duration": 1,
            "max_duration": 1,
            "start_interval": 1,
            "service_sub": 1,
            "service_frequency": 1,
            "service_frequency_number": 1
        }
    ]
}

Retrieve a service

GET /api/v1/services/{id}

Parameters

ParameterInDescription
idpathThe record's id.

Returns

One service record, or 404 not_found when no record with that id exists on your account.

Request

curl "https://www.bizstim.com/api/v1/services/42" \
  -H "X-API-KEY: YOUR_API_KEY" \
  -H "Accept: application/json"

Response

{
    "object": "service",
    "id": 42,
    "group_id": 7,
    "group_num": 1,
    "name": "Example name",
    "service_description": "An example description.",
    "service_cost": 25.5,
    "service_taxable": 1,
    "service_type": 1,
    "service_status": 1,
    "service_security": 1,
    "service_reminders": 1,
    "online_booking": 1,
    "min_duration": 1,
    "max_duration": 1,
    "start_interval": 1,
    "service_sub": 1,
    "service_frequency": 1,
    "service_frequency_number": 1
}

Create a service

POST /api/v1/services

Request body

A JSON object (Content-Type: application/json) with these fields.

FieldTypeRequiredDescription
service_descriptionstringyesThe service name, shown wherever the service is booked or billed. HTML is cleaned on save.
service_costnumber, 0 to 99999999.99yesThe price: per hour or a fixed fee, as service_type says. Stored with 2 decimals.
service_typeintegerno0 hourly (default), 1 fixed fee.
service_taxablebooleannoSales tax applies. Default false.
service_remindersbooleannoSession reminders are sent for this service. Default true.
service_securityintegernoWho sees the service: 0 everyone (default), 1 everyone but clients, 2 admin and staff only.
online_bookingbooleannoClients can choose it on the online booking page. Default false.
service_subbooleannoPlans replace subscription services: true is refused ("Subscription services are replaced by Plans."). Default false.
min_durationinteger, minutesnoThe shortest session allowed with this service, checked when a client or practitioner adds a session (not for admin, staff or the API). 0 = no minimum (default).
max_durationinteger, minutesnoThe longest session allowed with this service, checked when a client or practitioner adds a session (not for admin, staff or the API). 0 = no maximum (default).
start_intervalintegernoStart times for sessions a client or practitioner adds: 0 any time (default), 1 on the hour, 2 at 30 minutes past the hour.
service_frequency_numberintegernoThe most sessions with this service one client may have per service_frequency period (cancelled sessions do not count). Set both to restrict; 0 = no limit (default).
service_frequencyintegernoThe period of service_frequency_number: 0 none (default), 1 week, 2 month, 3 year.

Returns

201 with the new service record: active, in no group. The default wage, the calendar colour and the service's skills are set in the app. 400 invalid_request names the field to fix.

Request

curl -X POST "https://www.bizstim.com/api/v1/services" \
  -H "X-API-KEY: YOUR_API_KEY" \
  -H "Accept: application/json" \
  -H "Content-Type: application/json" \
  -d '{
    "service_description": "Math tutoring",
    "service_cost": 60
}'

Response (201)

{
    "object": "service",
    "id": 42,
    "group_id": 7,
    "group_num": 1,
    "name": "Example name",
    "service_description": "An example description.",
    "service_cost": 25.5,
    "service_taxable": 1,
    "service_type": 1,
    "service_status": 1,
    "service_security": 1,
    "service_reminders": 1,
    "online_booking": 1,
    "min_duration": 1,
    "max_duration": 1,
    "start_interval": 1,
    "service_sub": 1,
    "service_frequency": 1,
    "service_frequency_number": 1
}

Update a service

PATCH /api/v1/services/{id}

Parameters

ParameterInDescription
idpathThe record's id.

Request body

A JSON object (Content-Type: application/json) with these fields.

FieldTypeRequiredDescription
service_descriptionstringnoThe service name (cannot be emptied).
service_costnumber, 0 to 99999999.99noThe price, stored with 2 decimals.
service_statusintegerno1 active, 0 inactive. A service with upcoming sessions or covered by a live plan stays active (409). To delete a service, use DELETE (2 is refused).
service_typeintegerno0 hourly, 1 fixed fee.
service_taxablebooleannoSales tax applies.
service_remindersbooleannoSession reminders are sent for this service.
service_securityintegerno0 everyone, 1 everyone but clients, 2 admin and staff only. A service in a group keeps its visibility (409); a service visible to everyone that a plan sold online covers cannot be hidden (409).
online_bookingbooleannoClients can choose it on the online booking page.
service_subbooleannofalse switches a subscription service off; true is refused unless the service already is one (Plans replace subscription services).
min_durationinteger, minutesnoShortest session a client or practitioner may add; 0 = no minimum.
max_durationinteger, minutesnoLongest session a client or practitioner may add; 0 = no maximum.
start_intervalintegernoStart times for sessions a client or practitioner adds: 0 any time, 1 on the hour, 2 at 30 minutes past the hour.
service_frequency_numberintegernoThe most sessions one client may have per service_frequency period; 0 = no limit.
service_frequencyintegerno0 none, 1 week, 2 month, 3 year.

Returns

200 with the updated service record. Fields left out keep their values; the default wage, the calendar colour and the service's skills are kept too. group_id, group_num and name are read-only: service groups are managed in the app. 400 invalid_request names the field to fix; 404 not_found (deleted services too); 409 conflict for the Smart Learn service, for a service_security change on a service in a group, and for hiding (1 or 2) a service covered by a plan sold online. 409 conflict also for service_status 0 on a service with upcoming sessions or covered by a live plan (ServicesAPI_model::updateService(), the list page's rule).

Request

curl -X PATCH "https://www.bizstim.com/api/v1/services/42" \
  -H "X-API-KEY: YOUR_API_KEY" \
  -H "Accept: application/json" \
  -H "Content-Type: application/json" \
  -d '{
    "service_cost": 65,
    "service_status": 0
}'

Response

{
    "object": "service",
    "id": 42,
    "group_id": 7,
    "group_num": 1,
    "name": "Example name",
    "service_description": "An example description.",
    "service_cost": 25.5,
    "service_taxable": 1,
    "service_type": 1,
    "service_status": 1,
    "service_security": 1,
    "service_reminders": 1,
    "online_booking": 1,
    "min_duration": 1,
    "max_duration": 1,
    "start_interval": 1,
    "service_sub": 1,
    "service_frequency": 1,
    "service_frequency_number": 1
}

Delete a service

DELETE /api/v1/services/{id}

Parameters

ParameterInDescription
idpathThe record's id.

Returns

200 with {"id", "object": "service", "deleted": true}. As in the app, the service is marked deleted: sessions that use it keep it, it is taken off every client's list of services, and the API no longer returns it. 404 not_found; 409 conflict for the Smart Learn service, and for a service with upcoming sessions or covered by a live plan (it is kept).

Request

curl -X DELETE "https://www.bizstim.com/api/v1/services/42" \
  -H "X-API-KEY: YOUR_API_KEY" \
  -H "Accept: application/json"

Response

{
    "id": 42,
    "object": "service",
    "deleted": true
}