createReservation( )


Developer Preview

This API is subject to change. Bug fixes and new features will be released based on developer feedback throughout the preview period.

Creates a new reservation.

createReservation() accepts and requires different fields depending on the status provided and your permissions.

Status and source

If a status is not provided, it will be set to:

  • RESERVED if manual approval is not required for confirmation
  • REQUESTED if manual approval is required for confirmation.

A reservation created with any source other than WALK_IN requires the reservation.reservee.phone and reservation.reservee.firstName fields. Attempting to create a reservation without these fields will result in an error.

Permissions

Including the fields status, source, reservation.details.tableIds, reservation.details.endDate, ignoreReservationLocationConflicts, or ignoreTableCombinationConflicts in the request requires additional permissions. See this API's Introduction article for more information.

If source is not provided, its value is set depending on the permissions of the user making the call. See this API's Introduction article for more information.

Note: createReservation() requires all details of the reservation upfront. The process of creating a reservation can be broken up using createHeldReservation. createHeldReservation creates a temporary reservation that expires automatically unless it is completed with the addition of more details using reserveReservation().

Authentication
  • When developing websites or building an app with Blocks, this method may require elevated permissions, depending on the identity of the user calling it and the calling user's permissions.
  • When building apps without Blocks or for headless projects, you can only call this method directly when authenticated as a Wix app or Wix user identity. When authenticated as a different identity, you can call this method using elevation.
  • Elevation permits users to call methods they typically cannot access. Therefore, you should only use it intentionally and securely.
Permissions
Manage Reservations (Basic)
Manage Reservations (Full)
Manage Reservations (Medium)
Manage Restaurants - all permissions
Learn more about app permissions.
Method Declaration
Copy
Method Parameters
reservationReservationRequired

Reservation details.


optionsCreateReservationOptions

Options for creating the reservation.

Returns
Return Type:Promise<Reservation>
Errors
400Invalid Argument

There is 1 error with this status code.

428Failed Precondition

There is 1 error with this status code.

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

Did this help?