import { AvailabilityOptions, BookingInfo, BookingResult, CheckoutMethod, CheckoutOptionOptions, PaymentOptions, ServiceAvailability } from './common.types'; /** * **Deprecated.** * Checkout Booking has been replaced with [Create Booking](https://dev.wix.com/docs/sdk/backend-modules/bookings/bookings/create-booking) and Wix eCommerce's [Create Checkout](https://dev.wix.com/docs/sdk/backend-modules/ecom/checkout/create-checkout) SDK methods and will be removed on March 31, 2026. * * To understand how `checkoutBooking()` is used in a typical booking lifecycle, * see Typical Booking Lifecycle ([SDK](https://dev.wix.com/docs/sdk/frontend-modules/bookings/sample-flow) | [Velo](https://dev.wix.com/docs/velo/apis/wix-bookings-frontend/sample-flow)). * * 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](https://dev.wix.com/docs/sdk/frontend-modules/crm/contacts/append-or-create-contact) | [Velo](https://dev.wix.com/docs/velo/apis/wix-crm-frontend/contacts/append-or-create-contact)) 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](https://support.wix.com/en/article/upgrading-wix-bookings). * @param bookingInfo - Information about the slot to be booked. * @requiredField bookingInfo * @servicePath wix-bookings-frontend.BookingInfo * @param options - Information about the payment method and coupon codes. * @servicePath wix-bookings-frontend.PaymentOptions * @returns Fulfilled - Results of the booking checkout. * @servicePath wix-bookings-frontend.BookingResult */ export function checkoutBooking(bookingInfo: BookingInfo, options?: PaymentOptions): Promise; /** * **Deprecated.** * Get Checkout Options will be removed on March 31, 2026. By default, no replacement is needed as the eCommerce purchase flow handles payment options automatically. However, [eCommerce SDK APIs](https://dev.wix.com/docs/sdk/backend-modules/ecom/introduction) are available for custom payment flow implementations. See the [End-to-End Booking Flows](https://dev.wix.com/docs/sdk/backend-modules/bookings/end-to-end-booking-flows) for complete implementation examples. * * To understand how `getCheckoutOptions()` is used in a typical booking lifecycle, * see Typical Booking Lifecycle ([SDK](https://dev.wix.com/docs/sdk/frontend-modules/bookings/sample-flow) | [Velo](https://dev.wix.com/docs/velo/apis/wix-bookings-frontend/sample-flow)). * * The specified `checkoutOptionOptions` object contains the slot ID for the service. Typically, you retrieve the slot ID with the getServiceAvailability() ([SDK](https://dev.wix.com/docs/sdk/frontend-modules/bookings/get-service-availability) | [Velo](https://dev.wix.com/docs/velo/apis/wix-bookings-frontend/get-service-availability)) * method. * * `getCheckoutOptions()` returns the options available for the specified user. For example, if the customer has not * purchased any pricing plans, pricing plans are not returned even if there are pricing plans associated with the service. * @param checkoutOptionOptions - An object containing the information needed to identify the service for which to list the possible checkout options. Currently, you can request the checkout options using the ID of a slot. * @requiredField checkoutOptionOptions * @servicePath wix-bookings-frontend.CheckoutOptionOptions * @returns Fulfilled - The available payment options for the service and the logged-in user. * Rejected - Checkout payment options error object. * @servicePath wix-bookings-frontend.CheckoutMethod */ export function getCheckoutOptions(checkoutOptionOptions: CheckoutOptionOptions): Promise; /** * **Deprecated.** * Get Service Availability has been replaced with [Time Slots](https://dev.wix.com/docs/sdk/backend-modules/bookings/time-slots/introduction) SDK methods and will be removed on March 31, 2026. Depending on your [service type](https://dev.wix.com/docs/sdk/backend-modules/bookings/services/about-service-types), use the appropriate Time Slots API to replace it. See the [End-to-End Booking Flows](https://dev.wix.com/docs/sdk/backend-modules/bookings/end-to-end-booking-flows) for implementation examples. * * > **Note:** `location` in the slot object is not yet available to all sites. * * Service availability means different things for the different service types ([SDK](https://dev.wix.com/docs/sdk/backend-modules/bookings/services/about-service-types) | [Velo](https://dev.wix.com/docs/velo/apis/wix-bookings-v2/services/introduction)): * * + **Appointments**: See [here](https://support.wix.com/en/article/setting-availability-for-appointments-in-wix-bookings) to * understand what affects the availability of an appointment. An * appointment is returned as available if it meets the conditions outlined in the * article linked above and the appointment slot's time falls within the time specified by the * `AvailabilityOptions` or within the default time frame if no options are specified. * + **Classes**: A class slot is returned as available if the slot's * time falls within the time specified by the `AvailabilityOptions` or within * the default time frame if no options are specified. * + **Courses**: The first session slot from a set of course sessions is returned * as available if the first course slot's time falls within the time specified by the * `AvailabilityOptions` or within the default time frame if no options are specified. * * To understand how `getServiceAvailability()` is used in a typical booking lifecycle, * see Typical Booking Lifecycle ([SDK](https://dev.wix.com/docs/sdk/frontend-modules/bookings/sample-flow) | [Velo](https://dev.wix.com/docs/velo/apis/wix-bookings-frontend/sample-flow)). * * The specified `serviceId` must be an ID from the site's **Bookings/Services** * collection. Typically, you retrieve the ID from the collection using a * query or through a dataset. * * Optionally, you can specify an `AvailabilityOptions` * object that defines a date range for which slots should be returned. If you * do not specify an `AvailabilityOptions` object, the * default date range is from the date and time the method is called until one * week later. * @param serviceId - The ID of the service for which to check slot availability. * @requiredField serviceId * @param options - Options that refine which slots should be returned. * @servicePath wix-bookings-frontend.AvailabilityOptions * @returns Fulfilled - A list of available slots. * Rejected - Bookings error object. * @servicePath wix-bookings-frontend.ServiceAvailability */ export function getServiceAvailability(serviceId: string, options?: AvailabilityOptions): Promise;