About Ticket Definitions v3
With the Ticket Definitions API, you can create definitions for tickets. A definition includes the following ticket settings:
- Fee type. Determine whether the fee will be paid by a guest or a seller.
- Pricing. Define different ticket prices based on factors such as early bird discounts, VIP packages, group rates, or special promotions. Several pricing methods are available for you to select from: Fixed price, Guest price, Free. Additionally, you can customize prices for different groups of people using Price options.
- Availability. Set the ticket limit available to buy. Also, you are able to check number of purchased or reserved tickets.
- Sale period. Set the sale start and end dates. Also, when defining the sale period, it is possible to choose to display event tickets to customers even before the sale starts.
Before you begin
It’s important to note the following points before starting to code:
- Install the Wix Events & Tickets app from Wix App Market.
- Ticket definition is not the same as ticket. Ticket definitions are used to define settings for a set of tickets. After paying for selected tickets, the Checkout API automatically generates the ticket.
Use cases
- Add a specific-price ticket counter for an event
- Sync ticket definitions with external ticketing system
- Notify when tickets go on sale
Terminology
- Pricing method: Different pricing methods are available for an event:
- Fixed price: All tickets in the same definition are sold at the exact same price, regardless of when they are purchased or other factors.
- Guest price: A minimum price a guest must pay for a ticket. For example, money goes to donation.
- Price options: All tickets in the same ticket definition are priced at different rates, such as different prices for adults, children, and students.
- Ticket availability: The status of ticket inventory, indicating whether tickets are available or sold out. This type can also include availability limits and timeframes for ticket sales.
- Sale period: Duration of time during which event tickets are available for purchase.
- Event Dashboard: Control center in the Wix site UI for managing site event settings and features.
Ticket Definitions v3: Supported Filters and Sorting
The following table shows field support for filters and sorting for the Ticket Definition object:
Field | Query Filter Operators | Sortable |
---|---|---|
id | $eq , $ne , $lt , $lte , $gt , $gte , $in , $nin , $exists | Sortable |
eventId | $eq , $ne , $lt , $lte , $gt , $gte , $in , $nin , $exists | Sortable |
name | $eq , $ne , $lt , $lte , $gt , $gte , $in , $nin , $exists | Sortable |
description | $eq , $ne , $lt , $lte , $gt , $gte , $in , $nin , $exists | Sortable |
limit | $eq , $ne , $lt , $lte , $gt , $gte , $in , $nin , $exists | Sortable |
pricing_method.pricing_type | $eq , $ne , $lt , $lte , $gt , $gte , $in , $nin , $exists | Sortable |
feeType | $eq , $ne , $lt , $lte , $gt , $gte , $in , $nin , $exists | Sortable |
saleStatus | $eq , $ne , $lt , $lte , $gt , $gte , $in , $nin , $exists | Sortable |
updatedDate | $eq , $ne , $lt , $lte , $gt , $gte , $in , $nin , $exists | Sortable |
createdDate | $eq , $ne , $lt , $lte , $gt , $gte , $in , $nin , $exists | Sortable |
hidden | $eq , $ne , $in , $nin , $exists | Sortable |
pricing_method.free | $eq , $ne , $in , $nin , $exists | Sortable |
Related content: API Query Language, Ticket Definitions Query endpoint
Ticket Definitions v3: Sample Use Cases & Flows
This article presents possible use cases and corresponding sample flows that your app can support. It provides a useful starting point as you plan your app's implementation.
Add a specific-price ticket counter for an event
This use case demonstrates how you can update your event site with a ticket counter for specific-price tickets. This counter provides real-time information on the availability of tickets for customers to see. For example, your page can have a counter that says "Only 3 tickets left for this price." By displaying the number of tickets remaining, you can motivate customers to buy tickets promptly.
Note: This flow assumes you have already created the UI component of the counter for your site.
To create a ticket counter, follow these steps:
- Call Get Ticket Definition and retrieve either:
- The
salesDetails.unsoldCount
andfixedPrice.value
values (forfixedPrice
pricing method). - The
salesDetails.unsoldCount
andpricingOptions.optionDetails.price.value
field values (foroptionalPrice
pricing method).
-
Pass these retrieved values in your app to initialize the counter on your website, displaying the number of available tickets at the specified price.
-
On an ongoing basis, listen for each new ticket purchase using the Order Confirmed Webhook.
-
When the webhook is triggered, you'll receive an order in the payload. Retrieve the
ticketDefinitionId
value from the event data. -
Send the extracted
ticketDefinitionId
value to your site and compare it with the ticket definition ID for which the counter is set. If they match, call Get Ticket Definition again to retrieve the updatedsalesDetails.unsoldCount
value. Send this new decreased value to your website to update the ticket counter.
Sync ticket definitions with an external ticketing system
If you're using a Wix site to manage events and another system to handle ticketing, you can synchronize ticket definitions between them whenever a definition is updated on the site. This includes aspects such as ticket types, pricing, availability, and any other relevant ticket settings. This synchronization eliminates the need for manual updates and reduces the risk of discrepancies between systems.
To upload and update all ticket definitions defined on the Wix site to your external system for the first time, follow these flows:
Part 1: Initial setup
-
Create a custom field in your system that stores the ticket definition ID for a particular event to ensure a 1-to-1 relationship with the external ticketing system. Craft your code so that this ID won't be overwritten by future updates from your app.
-
Create a mapping from the site ticket definition fields to the system fields that will be used whenever site ticket definitions and the external system are synchronized.
-
Query Ticket Definitions by
eventId
and send the relevant information to the external ticketing system.
Part 2: Synchronize to the external system
-
On an ongoing basis, listen for changes to site ticket definitions with these webhooks:
-
When one of the above webhooks is triggered, you'll receive the ticket definition in the payload. You can bring those changes to the ticketing system by retrieving the relevant info from the payload, and use mapping to take action on the external system:
-
For created and updated ticket definitions retrieve the relevant info from the
createdEvent.currentEntity
object. -
For deleted ticket definitions retrieve the
createdEvent.currentEntity.id
value.
-
Notify customers when tickets go on sale
Let customers know when ticket sales for an event begin. You can send automated notifications to customers with email or push notifications. These notifications make customers aware of ticket availability so they can secure their tickets promptly.
Note: This flow assumes your customers already have the ability to subscribe to your newsletters.
To send notifications about the start of ticket sales, follow these steps:
-
Retrieve the
salePeriod.startDate
field value, and write your code so that the value can be passed to your marketing tool. -
Request and filter the list of subscribers in your external marketing tool based on customers subscription status for the current event.
-
When the ticket sale start date arrives, send notifications to your customers who have opted in to receive marketing emails.
- FEE_INCLUDED: The fee is deducted from the ticket price for a seller. For example, if you're selling tickets for $10, then a service fee of $0.25 will be deducted from the price and you'll get $9.75.
- FEE_ADDED_AT_CHECKOUT: The fee is shown in addition to the ticket price at checkout and a guest pays the fee. For example, if you sell tickets for $10, a customer will see a service fee of $0.25 and will pay $10.25 in total.
- SALE_SCHEDULED: Tickets are not on sale yet.
- SALE_STARTED: Tickets are on sale.
- SALE_ENDED: Tickets are not on sale.
Note: This field is only returned when SALES_DETAILS fieldset is included in the request.
Note: If the actuaLimit or salesDetails.unsoldCount field value is smaller than limitPerCheckout, then it overrides this field.
Creates a ticket definition. Allowed to create up to 100 definitions per event.
Permission Scopes
For app development, you must have one of the following permission scopes:Updates a ticket definition.
Each time the ticket definition is updated, revision
increments by 1. The existing revision
must be included when updating the ticket definition. This ensures you're working with the latest ticket definition and prevents unintended overwrites.
Permission Scopes
For app development, you must have one of the following permission scopes:Retrieves a ticket definition by ID.
Permission Scopes
For app development, you must have one of the following permission scopes:Permanently deletes a ticket definition.
Permission Scopes
For app development, you must have one of the following permission scopes:Changes ticket definitions order in an event dashboard and the list of available tickets in the ticket picker.
Note: It is possible to use both beforeTicketDefinitionId
and afterTicketDefinitionId
at the same time but only the last one defined will be executed.
Permission Scopes
For app development, you must have one of the following permission scopes:Retrieves a list of ticket definitions, given the provided paging, filtering, and sorting. Query Ticket Definitions runs with these defaults, which you can override:
createdDate
is sorted inASC
orderpaging.limit
is100
paging.offset
is0
For field support for filters and sorting, see Ticket Definitions: Supported Filters and Sorting. To learn about working with Query endpoints, see API Query Language.
Permission Scopes
For app development, you must have one of the following permission scopes:Deletes multiple ticket definitions.
All ticket definitions that meet the specified filter
criteria are deleted.
Permission Scopes
For app development, you must have one of the following permission scopes:Changes ticket price currency per event.