Sample Flows
This article shares some possible use cases your app could support, as well as a sample flow that could support each use case. This can be a helpful jumping off point as you plan your app's implementation.
Create staff member-based service variants
Your app can set up staff member-based service variants. This allows the site owner to offer customers different service prices depending on which staff member is providing the service.
-
Identify the relevant service ID. For example, call List services and choose the service you want to create options and variants for.
-
Pass the
serviceId
inside thescheduleOwnerIds
array in the List schedules call. This retrieves all schedules related to the service. -
Identify the active schedule from retrieved schedules. The active schedule has a
status
ofCREATED
in contrast to all other retrieved schedules. -
Save the
scheduleOwnerId
from the active schedule'savailability.linkedSchedules
array. These are the IDs of the staff members providing this service. -
Call Create Service Options and Variants and pass the relevant
serviceId
,STAFF_MEMBER
(in theoptions.type
field), as well as the IDs of all staff members providing the service in thevariants.choices
array. You can specify the price for each staff member invariants.price
.
Create service variants based on the booked equipment
Your app can set up service variants based on the booked equipment. This allows them to offer customers different service prices depending on what equipment the customer has booked.
-
Identify the relevant service ID. For example, call List services and choose the service you want to create options and variants for.
-
Call Create Service Options and Variants and pass the relevant
serviceId
,CUSTOM
(in theoptions.type
field),Equipment
(in theoptions.customData.name
field), as well as all supported equipment in theoptions.customData.choices
array. Make sure to also pass all supportedvariants
. You can specify the price for each variant invariants.price
.