- Overview
- Introduction to Cal.com Atoms
- Setup
- Apple calendar connect
- Availability settings
- Booker Embed
- Booker
- Bookings hooks
- Cal OAuth Provider
- Cal Provider
- Calendar settings
- Calendar view
- Calendars hooks
- Conferencing Apps
- Create schedule
- Event Type
- Event types hooks
- FAQ
- Google calendar connect
- List Event Types
- List schedules
- Onboarding Embed
- Outlook calendar connect
- Payment form
- Quickstart
- Stripe Connect
- Troubleshooter
- User / Teams hooks
- Bookings hooks
- Calendars hooks
- Event types hooks
- FAQ
- Introduction
- Quickstart
- User / Teams hooks
- Apple calendar connect
- Availability settings
- Booker Embed
- Booker
- Cal OAuth Provider
- Cal Provider
- Calendar settings
- Calendar view
- Conferencing Apps
- Create schedule
- Event Type
- Google calendar connect
- List Event Types
- List schedules
- Outlook calendar connect
- Payment form
- Stripe Connect
- Troubleshooter
- Managing booking fields
- Booking redirects
- Custom booking flow
- Custom slot selection flow
- Global event types
- Managed organizations
- Custom toasts
- Configuring your team
Custom booking flow
Archived Cal.com Atoms documentation for Custom booking flow. These deprecated SDK components are no longer maintained.
This is now deprecated and under maintenance for existing users only - no new customers can sign up for the platform plan
If you want to have a custom payment flow or any other custom action before the booking happens, you can intercept the booking once the user clicks book in the Booker atom, run whatever custom code you need and then finally submit the booking with the intercepted booking data.
In your component that renders the Booker atom create a interceptBooking function that will be passed to the Booker atom handleCreateBooking hook. See Booker atom docs on how to use it - in this tutorial
we focus on the handleCreateBooking hook.
import { Booker, UseCreateBookingInput } from "@calcom/atoms";
export function BookingPage(props: { calUsername: string; calEmail: string }) {
...
const interceptBooking = useCallback((data: UseCreateBookingInput) => {
console.log(data);
}, []);
return (
<Booker
handleCreateBooking={interceptBooking}
...
/>
);
}- When user clicks "Book" in the Booker atom the booking will not happen. Instead, the
interceptBookingfunction will be called and will receive all the booking data. - Then, you can hide the Booker component and instead render another component, show a modal, redirect to a new page or whatever you want to do.
- After your custom action is finished, extract the necessary information from the booking data passed to
interceptBookingand make a POST request to create booking endpoint to actually create the booking.
Last updated