Search.../

onReservationCreated( )

A backend event that fires when a ticket reservation is created.

Description

The onReservationCreated() event handler runs when a ticket reservation is created. The received ReservationCreatedEvent object contains information about the created reservation.

Note: Backend events are not fired when previewing your site.

Syntax

function onReservationCreated(event: ReservationCreatedEvent): void

onReservationCreated Parameters

NAME
TYPE
DESCRIPTION
event
ReservationCreatedEvent

Information about the ticket reservation that was created.

Returns

This function does not return anything.

Return Type:

void

Was this helpful?

A backend event that occurs when tickets are reserved

Copy Code
1// Place this code in the events.js file
2// of your site's Backend section.
3// Add the file if it doesn't exist.
4
5export function wixEvents_onReservationCreated(event) {
6 let eventId = event.eventId;
7 let reservationId = event.reservationId;
8}
9
10/* Full event object:
11 * {
12 * "timestamp": "2020-04-26T13:00:00.000Z",
13 * "eventId": "46dc2337-d725-4f7e-a0ae-a94a9a1f0c0b",
14 * "reservationId": "d72874cb-012a-4ad2-afbb-57fe8cf1e308",
15 * "expires": "2020-04-26T13:20:00.000Z",
16 * "status": "RESERVATION_PENDING"
17 * }
18 */