POST

Create Booking


Creates a booking.

Appointment booking

For appointment-based services, specify the relevant slot in bookedEntity.slot. We recommend specifying the complete availabilityEntries.slot returned in Query Availability (SDK | REST) in your call's request to avoid failed calls due to unavailability.

Class session booking

For class services, specify the relevant event ID (SDK | REST) as bookedEntity.slot.eventId. We recommend retrieving the event ID from Query Availability's (SDK | REST) availabilityEntries.slot.eventId to avoid failed calls due to unavailability. Specifying an event ID leads to automatic calculations of slot.startDate, slot.endDate, slot.timezone, slot.resource, and slot.location. All manually specified values are overridden.

Course booking

For course services, specify the course's schedule ID in bookedEntity.schedule.scheduleId. We recommend following this sample flow to minimize failed calls due to unavailability.

Booking status

Create Booking defaults to status=CREATED. Such bookings aren't visible in the Booking Calendar.

Only identities with Manage Bookings permissions can set status=CONFIRMED.

Specifying a resource triggers an availability check, and the Create Booking call fails if the resource is unavailable.

If you omit resource, resource assignment and availability validation occur during booking confirmation. If no resources are available, the behavior depends on the confirmation method used and payment status.

Participant information

You must specify either participantsChoices or totalParticipants. The call fails if the specified participantsChoices aren't among the supported service options and variants (SDK | REST).

Notify customers

You can specify a participantNotification.message for the customer that's send immediately. Ensure participantNotification.notifyParticipants is set to true to send the message.

If you specify {"sendSmsReminder": true}, the customer receives an SMS 24 hours before the session starts. The phone number is taken from contactDetails.phone.

Payment options

The specified selectedPaymentOption indicates how the customer intends to pay, allowing for later changes to a different method supported by the service.

Payment status

All bookings are created with paymentStatus=UNDEFINED, ignoring the payment status you specify.

For customers paying with a Wix eCommerce checkout (SDK | REST), Wix Bookings automatically syncs the booking's payment status from the corresponding eCommerce order (SDK | REST).

For customers using a custom checkout, call Confirm or Decline Booking (SDK | REST) to update booking's payment status manually.

Booking form data

When customers sign up for a service, they must fill out the booking form. To create a booking with a completed booking form, specify the relevant data in formSubmission. Ensure the values of the corresponding fields in booking.contactDetails and formSubmission are identical. If these values don't match, Create Booking fails. Therefore, we recommend specifying only booking.contactDetails.contactId when providing formSubmission.

Admin overwrites

There are small but important differences when you specify special flowControlSettings:

  • {"skipAvailabilityValidation": true}: The call succeeds regardless of availability. If you don't specify any resource, the call succeeds even if no resource of the relevant type is available.
  • {"skipBusinessConfirmation": true}: Automatically confirms PENDING bookings that require manual confirmation.
  • {"skipSelectedPaymentOptionValidation": true}: Allows customers to pay with payment methods that aren't supported for the service.

When using special flowControlSettings, ensure you have sufficient permissions. If you encounter failed calls due to insufficient permissions, consider the following options:

  • App developers can use a higher permission, such as MANAGE BOOKINGS - ALL PERMISSIONS.
  • Site developers can utilize elevation.

Granting additional permissions and using elevation permits method calls that would typically fail due to authorization checks. Therefore, you should use them intentionally and securely.

Permissions
Manage Bookings
Learn more about app permissions.
Endpoint
POST
https://www.wixapis.com/_api/bookings-service/v2/bookings

Errors
400Invalid Argument

There are 4 errors with this status code.

403Permission Denied

There are 2 errors with this status code.

428Failed Precondition

There are 12 errors with this status code.

This method may also return standard errors. Learn more about standard Wix errors.

Event TriggersThis method triggers the following events:
Did this help?