/** * An object that contains address information. */ export 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. */ export 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. */ export 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. */ export 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)). */ export 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. */ export 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. */ export 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. */ export 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 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. */ export interface CheckoutOption { /** * 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. */ export 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. */ export 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. */ export 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. */ export 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. */ export 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. */ export 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. */ export 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. */ export 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. */ export interface StreetAddress { /** * Address street name. * @requiredField name */ name: string; /** * Address street number. * @requiredField number */ number: string; }