Introduction
The Ticket Definitions API allows you to manage definitions for tickets to your site's events.
With the Ticket Definitions API you can:
- Create and update the ticket definitions (price, name, description, quantities, etc.) for tickets to an event.
- Change the currency used for event tickets.
Setup
To use the TicketDefinitions API, install the @wix/events
package using npm or Yarn:
1npm install @wix/events
or
1yarn add @wix/events
Then import { ticketDefinitions }
from @wix/events
:
1import { ticketDefinitions } from '@wix/events'
Ticket Definitions: Supported Filters and Sorting
The following table shows field support for filters and sorting for the TicketDefinition object:
Field | Supported Filters | Sortable |
---|---|---|
created | Not filterable | Sortable |
price | Not filterable | Sortable |
orderIndex | Not filterable | Sortable |
ticketDefinitionId | $eq ,$ne ,$hasSome ,$in | |
eventId | $eq ,$ne ,$hasSome ,$in | Sortable |
name | $eq , $ne , $lt , $lte , $gt , $gte , $hasSome , $in , $contains ,$urlized | Sortable |
Related content: API Query Language, queryTicketDefinitions( )
Changes the currency for all tickets per event.
Permission Scopes
For app development, you must have one of the following permission scopes:function changeCurrency(options: ChangeCurrencyOptions): Promise<void>
Creates a ticket definition (and enables ticket sales).
Permission Scopes
For app development, you must have one of the following permission scopes:function createTicketDefinition(eventId: string, options: CreateTicketDefinitionOptions): Promise<CreateTicketDefinitionResponse>
Event ID.
Deletes a ticket definition.
Does not affect tickets that were already ordered.
Permission Scopes
For app development, you must have one of the following permission scopes:function deleteTicketDefinition(eventId: string, options: DeleteTicketDefinitionOptions): Promise<void>
Event ID.
Details of tickets to delete.
Retrieves a ticket definition.
Permission Scopes
For app development, you must have one of the following permission scopes:function getTicketDefinition(definitionId: string, options: GetTicketDefinitionOptions): Promise<TicketDefinition>
Ticket definition ID.
Details for the ticket to retrieve.
Retrieves a list of up to 100 ticket definitions, with basic filter support.
Permission Scopes
For app development, you must have one of the following permission scopes:function listTicketDefinitions(options: ListTicketDefinitionsOptions): Promise<ListTicketDefinitionsResponse>
Details for the tickets to retrieve.
Retrieves a list of up to 100 ticket definitions, supporting structurized queries.
Permission Scopes
For app development, you must have one of the following permission scopes:function queryTicketDefinitions(options: QueryTicketDefinitionsOptions): Promise<QueryTicketDefinitionsResponse>
Updates a ticket definition.
See Partial Updates for more information.
Permission Scopes
For app development, you must have one of the following permission scopes:function updateTicketDefinition(definitionId: string, eventId: string, options: UpdateTicketDefinitionOptions): Promise<UpdateTicketDefinitionResponse>
Ticket definition ID.
Event ID.
Ticket definition details to update.