Search.../

createTicketDefinition( )

Developer Preview

Creates a ticket definition (and enables ticket sales).

Description

Note: Only visitors with Manage Ticket Definitions permissions can create a ticket definition. You can override the permissions with the wix-auth elevate() function.

Admin Method

This function requires elevated permissions to run. This function is not universal and runs only on the backend.

Authorization

Request

This endpoint does not take any parameters

Response Object

NAME
TYPE
DESCRIPTION
definition
TicketDefinition

Created ticket definition.

Status/Error Codes

Was this helpful?

createTicketDefinition example

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