Search.../
  1. Home
  2. Getting Started
  3. Overview
Generate a test token to explore our APIs

Book With Checkout

Developer Preview

Book a service.
This method has 2 modes of operation:

  1. Book by a customer.
  2. Book by the business (e.g. the business owner) on behalf of a customer.

When the booking is done by the customer, the following takes place:

  • Validation of the booking details according to the bookings policy and the service form mandatory fields.
  • Payment rules are applied. It can be creating a new order in Wix Payments, or redeeming the given paid plan.
    When online payment is required, the response contains the details of which the user of this api can complete the payment using Wix Payment Service.
  • When booking an approval required service, The booking is not charged until it is confirmed by the business.
    • BySessionId: The participant added to session is marked as PENDING until the booking is confirmed by the business.
    • Slot: A new session is created with affected availability based on the configuration defined in the service policy.

Permissions
This endpoint requires the Read Bookings - Public data or the Manage Bookings permission scope.
With the Read Bookings - Public data permission scope, a customer booking flow is applied. With the Manage Bookings permission scope, a business 'book on behalf' flow is applied.

Authorization

This endpoint requires an authorization header - pass the access token from the OAuth installation flow.

POST

https://www.wixapis.com/bookings/v1/bookings/book

Body Params

NAME
TYPE
DESCRIPTION
formInfo
Required

object

Form filled information. Mandatory. contains contact details, participants, other form fields specified by the owner for the chosen service. Contact information. Mandatory. contains contact details, participants, other form fields specified by the owner for the choosen service.

bookingSource

object

Identifies the source (platform, actor and app) that created this booking

This property of the Booking can not be changed. It will be published in the BookingNotification callback for every update of this Booking.

The app_def_id and app_name will be resolved automatically and should not be provided

sendSmsReminder

boolean

When value is set to True, an SMS reminder would be sent to the phone number specified in the ContactDetails, 24 hours before the session starts.

couponCode

string

Coupon code to apply for this booking

notifyParticipants

boolean

planSelection

object

Describes the selected paid plan to use for this booking.

externalUserId

string

A user identifier of an external application user that initiated the book request. Allows an external application to later identify its own bookings and correlate to its own internal users

ONE OF:
createSession

object

bySessionId

object

scheduleId

string

sessionId
Deprecated

string

Response Object

NAME
TYPE
DESCRIPTION
booking

object

Status/Error Codes

The response will include an HTTP status code.

Was this helpful?

Book an existing session

Books an existing session, by the session id. For example - book a class session.

Request

curl

Copy Code
1curl -X POST \
2 'http://www.wixapis.com/bookings/v1/bookings/book' \
3 -H 'Authorization: <AUTH>' \
4 --data '{
5 "formInfo": {
6 "contactDetails": {
7 "email": "Doh@Doh.com",
8 "firstName": "Homer",
9 "lastName": "Simpson",
10 "phone": "5558707"
11 },
12 "paymentSelection": [
13 {
14 "rateLabel": "general",
15 "numberOfParticipants": 1
16 }
17 ]
18 },
19 "bySessionId": {
20 "sessionId": "193ZPR9ppP9emJUCLevcLf6orynNEIDt5nc0520xjGQILnPPaF5s62yK3BWz7ExgIRM1U16wP6xWxScBjow6BsCpOlYupqA0QEQ9iVUZQC7LnzPEwgmdkeL2mPMg4UEDj7PK4pWOmHDGvYT1V4YoaQmwnPv0FxC5bBGhQNUFNHttRaMtX7DKss09teHQYtpUGwSLyOYTc1X5h9OVDl2VIegWnebzV3qXVr60atkfMzYqsrcLlwPUgaRVdKBmnXSMRM9g9QLABYThdww8BpiLW1rHnKm5rEi6wtZE9oxrsiRFsWuvoCogaXK9C20Ee9GmJiKVkqNtZpWaab",
21 "start": {
22 "dayOfMonth": 28,
23 "hourOfDay": 10,
24 "minutesOfHour": 0,
25 "monthOfYear": 4,
26 "year": 2020
27 },
28 "end": {
29 "dayOfMonth": 28,
30 "hourOfDay": 11,
31 "minutesOfHour": 0,
32 "monthOfYear": 4,
33 "year": 2020
34 }
35 }
36 }'

Response

json

1
2{"booking": {
3 "id": "b9297727-30b6-4187-bd6e-6768059b71ea",
4 "bookedEntity": {
5 "serviceId": "f9969221-88b0-442d-9bfa-b7f0b739b0fc",
6 "scheduleId": "a1239c6f-5984-4e2e-af5d-fa54726c63a5",
7 "singleSession": {
8 "sessionId": "193ZPR9ppP9emJUCLevcLf6orynNEIDt5nc0520xjGQILnPPaF5s62yK3BWz7ExgIRM1U16wP6xWxScBjow6BsCpOlYupqA0QEQ9iVUZQC7LnzPEwgmdkeL2mPMg4UEDj7PK4pWOmHDGvYT1V4YoaQmwnPv0FxC5bBGhQNUFNHttRaMtX7DKss09teHQYtpUGwSLyOYTc1X5h9OVDl2VIegWnebzV3qXVr60atkfMzYqsrcLlwPUgaRVdKBmnXSMRM9g9QLABYThdww8BpiLW1rHnKm5rEi6wtZE9oxrsiRFsWuvoCogaXK9C20Ee9GmJiKVkqNtZpWaab",
9 "start": "2020-04-28T07:00:00Z",
10 "end": "2020-04-28T08:00:00Z"
11 },
12 "title": "Yoga class over Zoom",
13 "location": {"locationType": "OWNER_BUSINESS"},
14 "rate": {
15 "labeledPriceOptions": {"general": {
16 "amount": "14",
17 "currency": "USD",
18 "downPayAmount": "0"
19 }},
20 "priceText": ""
21 },
22 "tags": ["GROUP"]
23 },
24 "bookedResources": [ {
25 "id": "936d2078-79ba-49ca-b82d-8f12b8a050ac",
26 "name": "",
27 "email": ""
28 }],
29 "formInfo": {
30 "contactDetails": {
31 "firstName": "Homer",
32 "lastName": "Simpson",
33 "email": "Doh@Doh.com",
34 "phone": "5558707"
35 },
36 "paymentSelection": [ {
37 "rateLabel": "general",
38 "numberOfParticipants": 1
39 }],
40 "customFormFields": {},
41 "additionalFields": [
42 {
43 "id": "5688a46e-aa0b-424d-b929-810f0cce25e2",
44 "label": "Add Your Message",
45 "valueType": "LONG_TEXT"
46 },
47 {
48 "id": "de68bdad-b006-4a2c-909e-9fe628a9009c",
49 "label": "I agree to the Terms & Conditions",
50 "valueType": "CHECK_BOX"
51 }
52 ]
53 },
54 "paymentDetails": {
55 "balance": {
56 "finalPrice": {
57 "amount": "14",
58 "currency": "USD",
59 "downPayAmount": "0"
60 },
61 "amountReceived": "0"
62 },
63 "state": "READY",
64 "wixPayMultipleDetails": []
65 },
66 "status": "CONFIRMED",
67 "created": "2020-04-27T12:33:06.742Z"
68}}
Book an appointment
Book a set of sessions