Sample Flows

This article provides sample flows for retrieving booking pricing information using Preview Price and Calculate Price. Use these flows as a starting point to implement tailored booking experiences.

Build a custom checkout flow

You can display services and available slots to customers, let them choose their preferred options, then show accurate pricing in your custom checkout before creating the booking.

  1. Display a service list to the customer, let them select a service and an available slot. For example, as described in the appointment end-to-end booking flow.
  2. Call Preview Price specifying bookingLineItems with serviceId, numberOfParticipants, and choices for each variant.
  3. Display the pricing breakdown in your custom checkout interface using priceInfo.calculatedPrice for the total cost and priceInfo.bookingLineItems[].pricePerParticipant for individual line item pricing.
  4. Call Create Booking to complete the booking with the selected slot and pricing information.
  5. Once the customer completes the checkout, call Confirm Or Decline Booking. Set options.paymentStatus to PAID to update the booking status to CONFIRMED.
  6. Call Create Order with your custom payment details.

Display booking costs in an external app

To show booking pricing in external apps or 3rd-party systems:

  1. Call Query Extended Bookings to retrieve the relevant booking object.
  2. Call Calculate Price specifying the complete booking object.
  3. Use the returned priceInfo.calculatedPrice to display accurate booking costs in your external interface. Make sure to handle deposits and non-numerical prices properly:
    • If priceInfo.deposit is present, show deposit requirements separately.
    • Handle responses where priceInfo.priceDescriptionInfo contains custom pricing text instead of calculatedPrice for services with CUSTOM rate types.
Did this help?