Booking Policies API: Sample Use Cases and Flows

This article shares some possible use cases you 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 implementation.

Assign a booking policy to an existing service

You 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 (SDK | REST) 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. Call Query Booking Policies (SDK | REST) 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 (SDK | REST) Let the owner input all relevant parameters for the policy and save the ID of the new policy.
  4. Call Update Service (SDK | REST) and provide service.id, service.revision, and service.booking.policy.id.

Change the default policy

You could allow the business owners to set a new default booking policy for their site.

To change the default policy:

  1. Call Query Booking Policies (SDK | REST) 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 (SDK | REST). Let the owner input all relevant parameters for the policy and save the ID of the new policy.
  3. Call Set Default Booking Policy (SDK | REST) and pass the relevant bookingPolicy.id.
Did this help?