Search.../

getTicketDefinition( )

Retrieves a ticket definition.

Admin Method

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

Syntax

function getTicketDefinition(definitionId: string, options: GetTicketDefinitionOptions): Promise<TicketDefinition>

getTicketDefinition Parameters

NAME
TYPE
DESCRIPTION
definitionId
string

Ticket definition ID.

options
Optional
GetTicketDefinitionOptions

Details for the ticket to retrieve.

Returns

Retrieved ticket definition.

Return Type:

Promise<
TicketDefinition
>
NAME
TYPE
DESCRIPTION
_id
string

Ticket definition ID.

dashboard
Dashboard

Sensitive dashboard data.

description
string

Ticket description.

eventId
string

Event ID associated with the ticket.

free
boolean

Whether the ticket is free (read only).

limitPerCheckout
number

Limit of tickets that can be purchased per checkout. Set to 20 for unlimited ticket definition.

name
string

Ticket name.

orderIndex
number

Custom sort index.

policy
string

Policy information plain text block, as printed on the ticket.

price
Money

Ticket price.

pricing
TicketPricing

Ticket pricing.

salePeriod
TicketSalePeriod

Ticket sale period.

saleStatus
string

Ticket sale status.

state
Array<
string
>

Ticket state.

wixFeeConfig
WixFeeConfig

Configuration of the fixed-rate Wix service fee that is applied at checkout to each ticket sold.

Was this helpful?

getTicketDefinition example

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