/** * An object that contains address information. */ interface Address { /** * Full text address comprised of street name and number, city, subdivision, country, and postal code. * @requiredField formatted */ formatted: string; /** * Address coordinates. * @requiredField location * @servicePath wix-bookings-frontend.AddressCoordinates */ location: AddressCoordinates; /** * Address street address. * @requiredField streetAddress * @servicePath wix-bookings-frontend.StreetAddress */ streetAddress: StreetAddress; /** * Address city. * @requiredField city */ city: string; /** * Address subdivision, state, prefecture, or province. * @requiredField subdivision */ subdivision: string; /** * Address country. * @requiredField country */ country: string; /** * Address postal code. * @requiredField postalCode */ postalCode: string; } /** * An object that contains the geographic coordinates of the address. */ interface AddressCoordinates { /** * Address latitude. * @requiredField latitude */ latitude: number; /** * Address longitude. * @requiredField longitude */ longitude: number; } /** * An object used when calling 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)) * containing options for which slots should be returned. */ interface AvailabilityOptions { /** * Start date and time of the slots * to be returned. Defaults to the current date and time. */ startDateTime?: Date; /** * End date and time of the slots to * be returned. Defaults to one week from `startDateTime`, which is one week * from the current date and time if `startDateTime` is also omitted. */ endDateTime?: Date; } /** * An object used when calling checkoutBooking() ([SDK](https://dev.wix.com/docs/sdk/frontend-modules/bookings/checkout-booking) | [Velo](https://dev.wix.com/docs/velo/apis/wix-bookings-frontend/checkout-booking)) * containing information about the slot to be booked. */ interface BookingInfo { /** * The slot to be booked. * @requiredField slot * @servicePath wix-bookings-frontend.Slot */ slot: Slot; /** * List of form field values required to book the session. * @requiredField formFields * @servicePath wix-bookings-frontend.FormField */ formFields: FormField[]; /** * Number of spots to book. Default: `1` */ numberOfSpots?: number; } /** * An object representing the result of a call to checkoutBooking() ([SDK](https://dev.wix.com/docs/sdk/frontend-modules/bookings/checkout-booking) | [Velo](https://dev.wix.com/docs/velo/apis/wix-bookings-frontend/checkout-booking)). */ interface BookingResult { /** * ID of the booking that was checked out. * @requiredField bookingId */ bookingId: string; /** * Status of the booking that was checked out. * One of: * * + `"Confirmed"`: Payment was successful or payment is to be done offline. * + `"Pending Payment"`: Payment is pending. * + `"Terminated"`: Payment failed or was cancelled. * @requiredField status */ status: string; } /** * An object describing the business location. */ interface BusinessLocation { /** * Business location ID. * @requiredField id */ id: string; /** * Business location name. * @requiredField name */ name: string; /** * Business location description. * @requiredField description */ description: string; /** * An object describing the address. * @requiredField address * @servicePath wix-bookings-frontend.Address */ address: Address; } /** * An object returned after calling getCheckoutOptions() ([SDK](https://dev.wix.com/docs/sdk/frontend-modules/bookings/get-checkout-options) | [Velo](https://dev.wix.com/docs/velo/apis/wix-bookings-frontend/get-checkout-options)) * containing information about the available payment options for the service and the logged-in user. */ interface CheckoutMethod { /** * Available checkout methods. * @requiredField options * @servicePath wix-bookings-frontend.CheckoutMethodOption */ options: CheckoutMethodOption[]; } /** * An object returned after calling getCheckoutOptions() ([SDK](https://dev.wix.com/docs/sdk/frontend-modules/bookings/get-checkout-options) | [Velo](https://dev.wix.com/docs/velo/apis/wix-bookings-frontend/get-checkout-options)) * containing information about the available payment options for the service and the logged-in user. */ interface CheckoutMethodOption { /** * Type of the available payment option. Valid options are: * * + `"wixPay_Online"`: For online collections. * + `"wixPay_Offline"`: For offline collections. * + `"package"`: For a package-type pricing plan. * + `"membership"`: For a membership-type pricing plan. * @requiredField type */ type: string; /** * Name of the plan package or membership. For booking with pricing plans only. */ planName?: string; /** * Order ID of the plan package or membership. For booking with pricing plans only. */ planOrderId?: string; /** * ID of the benefit provided by the plan package. For booking with package-type pricing plans only. */ benefitId?: string; /** * Number of sessions remaining in the plan package. For booking with package-type pricing plans only. */ remainingCredits?: number; /** * Number of sessions initially provided with the plan package. For booking with package-type pricing plans only. */ totalCredits?: number; /** * Date by which the plan package or membership expires. For booking with pricing plans only. */ planExpiration?: Date; } /** * An object used to request checkout options for the service. Currently, you can request the checkout options using the ID of a slot. */ interface CheckoutOptionOptions { /** * Unique slot identifier. * @requiredField slotId */ slotId: string; /** * Member ID ([SDK](https://dev.wix.com/docs/sdk/frontend-modules/members/introduction) | [Velo](https://dev.wix.com/docs/velo/apis/wix-members-v2/members/introduction)) for the customer making the booking. Used for retrieving valid payment plans for the customer for the selected slot. * @requiredField userId */ userId: string; } /** * An object that defines a booking window for limiting when a member can book a slot. For example, * you can prevent members from booking a service too far in advance, because perhaps the service might * be discontinued by then. Or, you can prevent members from booking a service right before it starts, as * this would make it hard to schedule resources. */ interface Constraints { /** * Date from which a member is allowed to book a slot. * @requiredField bookableFrom */ bookableFrom: Date; /** * Date until which a member is allowed to book a slot. * @requiredField bookableUntil */ bookableUntil: Date; } /** * An object used when calling checkoutBooking() ([SDK](https://dev.wix.com/docs/sdk/frontend-modules/bookings/checkout-booking) | [Velo](https://dev.wix.com/docs/velo/apis/wix-bookings-frontend/checkout-booking)) * containing values for form fields required to book the session. */ interface FormField { /** * ID of the form field from the **form** property in the **Booking/Services** collection. * @requiredField _id */ _id: string; /** * Form field value. * @requiredField value */ value: string; } /** * The location where a service is offered. */ interface Location { /** * Location type. Valid options are: * - `"OWNER_BUSINESS"`: The business address set by the merchant. This type is set when choosing **Business Address** in the Service Details page of a site's dashboard, and populates the `businessLocation` object. * - `"OWNER_CUSTOM"`: A custom address set by the merchant. This type is set when choosing **Custom Location** in the Service Details page of a site's dashboard, and populates the `locationText` property. * - `"CUSTOM"`: An address set for the individual booking, usually chosen by the customer and entered in the booking form. * @requiredField type */ type: string; /** * Text describing the location. * @requiredField locationText */ locationText: string; /** * An object describing the business location. * @requiredField businessLocation * @servicePath wix-bookings-frontend.BusinessLocation */ businessLocation: BusinessLocation; } /** * An object used when calling checkoutBooking() ([SDK](https://dev.wix.com/docs/sdk/frontend-modules/bookings/checkout-booking) | [Velo](https://dev.wix.com/docs/velo/apis/wix-bookings-frontend/checkout-booking)) * containing details about the pricing plan used to pay for the booking. */ interface PaidPlan { /** * Order ID of the plan package or membership. For booking with pricing plans only. */ planOrderId?: string; /** * ID of the benefit provided by the plan package. For booking with package-type pricing plans only. */ benefitId?: string; } /** * An object used when calling checkoutBooking() ([SDK](https://dev.wix.com/docs/sdk/frontend-modules/bookings/checkout-booking) | [Velo](https://dev.wix.com/docs/velo/apis/wix-bookings-frontend/checkout-booking)) * containing information about the payment options. */ interface PaymentOptions { /** * Type of payment. Valid options are: * * + `"wixPay_Online"`: For online collections. * + `"wixPay_Offline"`: For offline collections. * + `"package"`: For a package-type pricing plan. * + `"membership"`: For a membership-type pricing plan. * @requiredField paymentType */ paymentType: string; /** * A coupon code to be used with the payment. */ couponCode?: string; /** * Information about the pricing plan used to pay for the booking. * @servicePath wix-bookings-frontend.PaidPlan */ paidPlan?: PaidPlan; } /** * An object returned from [`getServiceAvailability()`](#getServiceAvailability) * containing the available bookings slots. */ interface ServiceAvailability { /** * List of the available slots. * * Max: 500 slots * @requiredField slots * @servicePath wix-bookings-frontend.Slot */ slots: Slot[]; } /** * An object representing a booking slot. */ interface Slot { /** * Unique slot identifier. * @requiredField _id */ _id: string; /** * Starting date and time of the slot. * @requiredField startDateTime */ startDateTime: Date; /** * Ending date and time of the slot. * @requiredField endDateTime */ endDateTime: Date; /** * ID of the service that the slot belongs to. * @requiredField serviceId */ serviceId: string; /** * Maximum number of participants that can book the service for this slot. * @requiredField capacity */ capacity: number; /** * Number of remaining spots that can be booked for the slot. * @requiredField remainingSpots */ remainingSpots: number; /** * ID of the slot's staff member. * @requiredField staffMemberId */ staffMemberId: string; /** * The location where this slot is offered. * @requiredField location * @servicePath wix-bookings-frontend.Location */ location: Location; /** * Whether the slot can be booked right now, meaning today's date is within the booking window defined by `constraints`. Not available for courses. * @requiredField bookable */ bookable: boolean; /** * The dates between which the slot can be booked. The constraints define the booking window. The booking window prevents site members from booking way in advance or just right before the slot starts. Not available for courses. * @requiredField constraints * @servicePath wix-bookings-frontend.Constraints */ constraints: Constraints; } /** * An object representing information about the street name and street number of an address. */ interface StreetAddress { /** * Address street name. * @requiredField name */ name: string; /** * Address street number. * @requiredField number */ number: string; } /** * **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 */ declare 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 */ declare 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 */ declare function getServiceAvailability(serviceId: string, options?: AvailabilityOptions): Promise; declare const bookingsSdkModuleContext_checkoutBooking: typeof checkoutBooking; declare const bookingsSdkModuleContext_getCheckoutOptions: typeof getCheckoutOptions; declare const bookingsSdkModuleContext_getServiceAvailability: typeof getServiceAvailability; declare namespace bookingsSdkModuleContext { export { bookingsSdkModuleContext_checkoutBooking as checkoutBooking, bookingsSdkModuleContext_getCheckoutOptions as getCheckoutOptions, bookingsSdkModuleContext_getServiceAvailability as getServiceAvailability }; } type Methods = { [P in keyof T as T[P] extends Function ? P : never]: T[P]; }; declare const bookingsContext: Methods; export { bookingsContext as bookings };