checkoutBooking( )


Books a service and processes payment for the service.

The checkoutBooking() function returns a Promise that resolves to a unique booking ID when the service is booked successfully.

To understand how checkoutBooking() is used in a typical booking lifecycle, see Typical Booking Lifecycle.

Call the checkoutBooking() with a BookingInfo object that contains the slot to book, values for all the form fields, and the number of spots to book.

The form fields contain additional information required for the booking.

If the service being checked out is not a free service, you also need to pass a PaymentOptions object containing information about the method of payment and any coupon codes. If an online method of payment is specified, a payment popup is presented for the user to input payment information, such as credit card information. The function's returned Promise resolves after the user finishes entering the payment information and the service has been successfully booked. If no payment or an offline method of payment is specified, the payment popup is not presented and the Promise resolves when the service has been successfully booked.

If a service is configured as a paid service in the Dashboard, attempting to perform a checkout as if it is a free service results in an error.

When a service is booked successfully:

  • A site contact is automatically created or appended with the provided booking information.
  • An email is sent to you about the new booking.
  • An email is sent to the user confirming that the service was booked.

Note: To use checkoutBooking() you need to upgrade to a Business Premium Plan.

Method Declaration
Copy
Method Parameters
bookingInfoBookingInfoRequired

Information about the slot to be booked.


optionsPaymentOptions

Information about the payment method and coupon codes.

Returns
Return Type:Promise<BookingResult>
Was this helpful?
Yes
No