Search.../

bulkCreateBooking( )

Developer Preview

Creates multiple bookings.

Description

See createBooking() documentation.

If for any of the bookings required fields were not passed on the request or if the caller doesn't have the required permissions to create such booking, the call will fail. If the request contains unavailable bookings, the call will be completed successfully, but the unavailable bookings will not be created and will be considered as a failure on the response.

Syntax

function bulkCreateBooking(createBookingsInfo: Array<CreateBookingInfo>, options: BulkCreateBookingOptions): Promise<BulkCreateBookingResponse>

bulkCreateBooking Parameters

NAME
TYPE
DESCRIPTION
createBookingsInfo
Array<
CreateBookingInfo
>

Bookings to create. Max: 8 bookings.

options
Optional
BulkCreateBookingOptions

Returns

Return Type:

Promise<
BulkCreateBookingResponse
>
NAME
TYPE
DESCRIPTION
bulkActionMetadata
BulkActionMetadata

Total successes and failures of the bulk create booking action.

results
Array<
BulkBookingResult
>

Bulk create booking results. Whether it successfully created each booking, providing the corresponding error message if a failure occurred, and includes the created booking entity if the returnFullEntity is true.

Was this helpful?

bulkCreateBooking example

Copy Code
1import { bookings } from 'wix-bookings.v2';
2
3 async function bulkCreateBooking(createBookingsInfo, options) {
4 try {
5 const result = await bookings.bulkCreateBooking(createBookingsInfo, options);
6
7 return result;
8 } catch (error) {
9 console.error(error);
10 // Handle the error
11 }
12 }
13