End-to-End Booking Flow (REST)

Download skill
Copy

Step-by-step flow for implementing a complete booking experience using REST APIs.

Prerequisites

  • Wix Bookings app installed (App ID: 13d21c63-b5ec-5912-8397-c3a5ddb27a97)
  • For paid services: Wix Payments or eCommerce configured

Note: If you receive errors from Bookings APIs, the Wix Bookings app may not be installed on the site. Use List Installed Apps to verify, and Install Wix Apps to install it if missing.

Required APIs


Step 1: Query Available Services

Endpoint: POST https://www.wixapis.com/bookings/v2/services/query

Copy

Service Types:

  • APPOINTMENT — One-on-one sessions with a staff member
  • CLASS — Group sessions at scheduled times
  • COURSE — Multi-session series (customers book the entire course)

Save from the response:

  • id — service ID
  • schedule.id — schedule ID (needed for appointment bookings and course bookings)
  • type — determines the booking flow (slot vs schedule)
  • staffMemberIds — resource IDs of assigned staff (for appointments)

Step 2: Check Availability

Endpoint: POST https://www.wixapis.com/_api/service-availability/v2/time-slots

Important: The old Availability Calendar API (/bookings/v2/availability/query) is deprecated. Always use Time Slots V2.

Copy

Date format

Dates must be in YYYY-MM-DDThh:mm:ss format (local datetime). Plain dates like 2024-06-15 will be rejected with a 400 error.

Parameters

ParameterRequiredDescription
serviceIdYesFrom Step 1
fromLocalDateYesStart of range in YYYY-MM-DDThh:mm:ss format
toLocalDateYesEnd of range in YYYY-MM-DDThh:mm:ss format
timeZoneYesIANA timezone (e.g. America/New_York)
bookableNoSet true to only get bookable slots
includeResourceTypeIdsNoArray of resource type IDs — populates availableResources in response

Save from each time slot

  • serviceId, scheduleId — needed for Create Booking
  • localStartDate, localEndDate — slot times
  • availableResources[].resources[].id — resource ID (only populated if includeResourceTypeIds was provided)
  • location.locationTypewarning: returns BUSINESS but Create Booking requires OWNER_BUSINESS (see Step 3)

For Classes

Use List Event Time Slots instead. Each class session has an eventId — save it for the booking.


Step 3: Create the Booking

Endpoint: POST https://www.wixapis.com/_api/bookings-service/v2/bookings

For Appointments (use slot)

Copy

All slot fields are required for appointments when no eventId is provided:

FieldSourceNotes
serviceIdStep 1Service GUID
scheduleIdStep 2From the time slot response
startDate / endDateStep 2YYYY-MM-DDThh:mm:ss format
timezoneStep 2IANA tz format
resource.idStep 2From availableResources in time slot response
location.locationTypeMust be OWNER_BUSINESS, OWNER_CUSTOM, or CUSTOM. Time Slots returns BUSINESS but that value is not accepted here

For Classes (use slot with eventId)

Copy

When you provide eventId, all other slot fields (startDate, endDate, timezone, resource, location) are auto-derived from the event. You only need serviceId + eventId.

For Courses (use schedule)

Copy

Participants

Specify exactly one of:

  • totalParticipants — for services with fixed pricing and no variants
  • participantsChoices — for services with variants and options

Result

Booking is created with status: CREATED. This is not yet visible in the booking calendar. You must either:

  • Confirm it (Step 4, for offline/free payments), or
  • Process payment (Step 4, for online payments) — confirmation happens automatically after checkout

Step 4: Confirm or Process Payment

For free or offline-payment bookings: Confirm directly

Endpoint: POST https://www.wixapis.com/_api/bookings-service/v2/bookings/<BOOKING_ID>/confirm

Copy

Use the id and revision from the Create Booking response. Set paymentStatus to EXEMPT for free services or NOT_PAID for pay-at-location.

Result: Booking status changes to CONFIRMED and is visible in the booking calendar.

For online payments: Create checkout

4a. Create Checkout

Endpoint: POST https://www.wixapis.com/ecom/v1/checkouts

Copy

Use the booking ID as catalogItemId with the Wix Bookings app ID.

4b. Get Checkout URL

Endpoint: POST https://www.wixapis.com/ecom/v1/checkouts/{checkoutId}/getCheckoutUrl

Redirect the user to the returned checkoutUrl. After payment, the booking is automatically confirmed.

4c. Create Order (alternative, server-to-server)

Endpoint: POST https://www.wixapis.com/ecom/v1/checkouts/{checkoutId}/createOrder

Creates an order directly without redirect.


Service Type Summary

Service TypebookedEntityAvailability APIKey Difference
APPOINTMENTslot (all fields required)Time Slots V2Single session, specific time, needs resource + scheduleId
CLASSslot (only serviceId + eventId)Event Time SlotsGroup session, auto-derives fields from event
COURSEscheduleCheck capacity via Query Extended BookingsMulti-session, books entire schedule

See Also

Did this help?