checkoutBooking( )


Books a service and processes payment for the service.

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

Call 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 specify 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 customer to input payment information, such as credit card information. The method's returned Promise resolves after the customer 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 a site's 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 (SDK | Velo) with the provided booking information.
  • An email is sent to the merchant about the new booking.
  • An email is sent to the customer confirming that the service was booked.

Note: To use checkoutBooking() a site must have 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>
JavaScript
Did this help?