bulkCreateBooking( )
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
Bookings to create. Max: 8 bookings.
Returns
Return Type:
NAME
TYPE
DESCRIPTION
Total successes and failures of the bulk create booking action.
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
1import { bookings } from 'wix-bookings.v2';23 async function bulkCreateBooking(createBookingsInfo, options) {4 try {5 const result = await bookings.bulkCreateBooking(createBookingsInfo, options);67 return result;8 } catch (error) {9 console.error(error);10 // Handle the error11 }12 }13