Reserves tickets for 20 minutes.
Reserved tickets are deducted from ticket stock and cannot be bought by another site visitor. When the reservation expires, the tickets are added back to the stock.
function createReservation(
eventId: string,
options: CreateReservationOptions,
): Promise<CreateReservationResponse>;
Event ID to which the reservation belongs.
An object representing the available options for creating a reservation.
import { orders } from "wix-events.v2";
async function createReservation(eventId, options) {
try {
const result = await orders.createReservation(eventId, options);
return result;
} catch (error) {
console.error(error);
// Handle the error
}
}
This method doesn’t return any custom errors, but may return standard errors. Learn more about standard Wix errors.