Booking Policies API: Sample Use Cases and 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.

Assign a booking policy to an existing service

Your app could allow the business owner to assign a booking policy to one of their services.

To assign a booking policy to a service:

  1. Call Query Services to retrieve all relevant services and display them to the business owner. Make sure to save id and revision of the service for which the owner wants to change the booking policy.
  2. Use Query Booking Policy to retrieve all relevant booking policies and display them to the owner. Let them pick one and save the bookingPolicy.id.
  3. Optional: Allow the owner to create a new policy if they can't find a policy that meets all their needs by calling Create Booking Policy. Let the owner input all relevant parameters for the policy and save the ID of the new policy.
  4. Call Update Service and provide service.id, service.revision, and service.booking.policy.id.

Change the default policy

Your app could allow the user to set a new default booking policy for their site.

To change the default policy:

  1. Call Query Booking Policy to retrieve all relevant booking policies and display them to the business owner. Let them choose a policy and save its ID.
  2. Optional: Allow the owner to create a new policy if they can't find a policy that meets all their needs by calling Create Booking Policy. Let the owner input all relevant parameters for the policy and save the ID of the new policy.
  3. Call Set Default Booking Policy and pass the relevant bookingPolicy.id.
Did this help?