> To build or manage a Wix site with an AI agent, follow https://www.wix.com/headless/skill.md
> It builds a new Wix site or puts your own site online, from a prompt, and keeps changing it afterwards. The pages are code in any web technology, and Wix runs the backend.
> It works through the Wix plugin (the Wix MCP and the Wix skills), the Wix CLI or no Wix login, and puts the site live on Wix hosting or on another host.
> Business features include a store, bookings, events and tickets, a restaurant, a blog, forms, members and many more.
> Read the Wix skills online at https://www.wix.com/skills
> 
> Portal Navigation:
> 
> - Append `.md` to any URL under `https://dev.wix.com/docs/` to get its markdown version.
> - Pages are either content pages (article or reference text) or menu pages (a list of links to child pages).
> - To get a menu page, truncate any URL to a parent path and append `.md` (e.g. `https://dev.wix.com/docs/sdk.md`, `https://dev.wix.com/docs/sdk/core-modules.md`).
> - If a reference page seems to be missing its schema (parameters, return types, or type definitions), append `?schema=true` to its `.md` URL (e.g. `https://dev.wix.com/docs/contexts/contexts/stores/category-info/use-category-info-context.md?schema=true`).
> - Top-level index of all portals: https://dev.wix.com/docs/llms.txt
> - Full concatenated docs: https://dev.wix.com/docs/llms-full.txt

# QueryTicketDefinitions

# Package: eventManagement

# Namespace: TicketDefinitionManagement

# Method link: https://dev.wix.com/docs/api-reference/business-solutions/events/event-management/ticket-definitions-v3/query-ticket-definitions.md

## Permission Scopes:
Manage Ticket Definitions: SCOPE.DC-EVENTS.MANAGE-TICKET-DEF

## Introduction

Retrieves a list of ticket definitions with the specified paging, filtering, and sorting.

Query Ticket Definitions runs with these defaults, which you can override:
- `createdDate` is sorted in `ASC` order
- `paging.limit` is `100`
- `paging.offset` is `0`
<br>
To learn about working with _Query_ methods, see [API Query Language](https://dev.wix.com/docs/rest/articles/get-started/api-query-language.md).

---

## REST API

### Schema

```
 Method: queryTicketDefinitions
 Description: Retrieves a list of ticket definitions with the specified paging, filtering, and sorting.  Query Ticket Definitions runs with these defaults, which you can override: - `createdDate` is sorted in `ASC` order - `paging.limit` is `100` - `paging.offset` is `0` <br> To learn about working with _Query_ methods, see [API Query Language](https://dev.wix.com/docs/rest/articles/get-started/api-query-language.md).
 URL: https://www.wixapis.com/events-ticket-definitions/v3/ticket-definitions/query
 Method: POST
 # Note: If the parameter `a.b` is listed under required parameters, `b` is only required if `a` is also present.
 Required parameters:  query
 Method parameters: 
   param name: fields | type: array<fields> | description: Predefined sets of fields to return.  | validation: maxItems 5
                 - enum:
                 -     SALES_DETAILS: Returns `salesDetails` in the response.
                 -     EVENT_DETAILS: Returns `eventDetails` in the response.
                 -     SEATING_DETAILS: Returns `seatingDetails` with available seats in the response.
   param name: query | type: QueryV2   | required: true 
     - name: cursorPaging | type: CursorPaging | description: Cursor token pointing to a page of results. Not used in the first request. Following requests use the cursor token and not `filter` or `sort` parameters.  
        - name: limit | type: integer | description: Number of items to load per page.  | validation: minimum 0, maximum 100, format int32
        - name: cursor | type: string | description: Pointer to the next or previous page in the list of results. You can get the relevant cursor token from the `pagingMetadata` object in the previous call's response. Not relevant for the first request.  | validation: maxLength 16000
        - name: filter | type: object | description: Filter object in the following format: <br/> `"filter" : { "fieldName1": "value1", "fieldName2":{"$operator":"value2"} }`. <br/> <br/> **Example:** <br/> `"filter" : { "id": "2224a9d1-79e6-4549-a5c5-bf7ce5aac1a5", "revision": {"$ne":"1"} }`  
        - name: sort | type: array<Sorting> | description: Sort object in the following format: <br/> `[{"fieldName":"sortField1"},{"fieldName":"sortField2","direction":"DESC"}]` <br/> <br/> **Example:** <br/> `[{"fieldName":"createdDate","direction":"DESC"}]` <br/> <br/> See [supported fields](https://dev.wix.com/api/rest/wix-events/policy-v2/filter-and-sort) for more information.  | validation: maxItems 10
           - name: fieldName | type: string | description: Name of the field to sort by.  | validation: maxLength 100
           - name: order | type: SortOrder | description: Defaults to `ASC`  
                 - enum: ASC, DESC
 Query fields:
   - field: id | operators: $eq, $ne, $in, $nin, $lt, $lte, $gt, $gte, $exists | sort: ASC, DESC | aggregatable: undefined | searchable: undefined
   - field: eventId | operators: $eq, $ne, $in, $nin, $lt, $lte, $gt, $gte, $exists | sort: ASC, DESC | aggregatable: undefined | searchable: undefined
   - field: revision | operators: $eq, $ne, $in, $nin, $lt, $lte, $gt, $gte, $exists | sort: ASC, DESC | aggregatable: undefined | searchable: undefined
   - field: name | operators: $eq, $ne, $in, $nin, $lt, $lte, $gt, $gte, $exists | sort: ASC, DESC | aggregatable: undefined | searchable: undefined
   - field: description | operators: $eq, $ne, $in, $nin, $lt, $lte, $gt, $gte, $exists | sort: ASC, DESC | aggregatable: undefined | searchable: undefined
   - field: initialLimit | operators: $eq, $ne, $in, $nin, $lt, $lte, $gt, $gte, $exists | sort: ASC, DESC | aggregatable: undefined | searchable: undefined
   - field: pricingMethod.fixedPrice.value | operators: $eq, $ne, $in, $nin, $lt, $lte, $gt, $gte, $exists | sort: ASC, DESC | aggregatable: undefined | searchable: undefined
   - field: pricingMethod.fixedPrice.currency | operators: $eq, $ne, $in, $nin, $lt, $lte, $gt, $gte, $exists | sort: ASC, DESC | aggregatable: undefined | searchable: undefined
   - field: createdDate | operators: $eq, $ne, $in, $nin, $lt, $lte, $gt, $gte, $exists | sort: ASC, DESC | aggregatable: undefined | searchable: undefined
   - field: updatedDate | operators: $eq, $ne, $in, $nin, $lt, $lte, $gt, $gte, $exists | sort: ASC, DESC | aggregatable: undefined | searchable: undefined
   - field: hidden | operators: $eq, $ne, $in, $nin, $exists | sort: ASC, DESC | aggregatable: undefined | searchable: undefined
   - field: pricingMethod.free | operators: $eq, $ne, $in, $nin, $exists | sort: ASC, DESC | aggregatable: undefined | searchable: undefined
   - field: pricingMethod.pricingType | operators: $eq, $ne, $in, $nin, $exists | sort: ASC, DESC | aggregatable: undefined | searchable: undefined
   - field: feeType | operators: $eq, $ne, $in, $nin, $exists | sort: ASC, DESC | aggregatable: undefined | searchable: undefined
   - field: saleStatus | operators: $eq, $ne, $in, $nin, $exists | sort: ASC, DESC | aggregatable: undefined | searchable: undefined
 Return type: QueryTicketDefinitionsResponse
  - name: ticketDefinitions | type: array<TicketDefinition> | description: List of ticket definitions.  
     - name: id | type: string | description: Ticket definition GUID.  | read-only: true | validation: format GUID
     - name: eventId | type: string | description: Event GUID to which the ticket definition belongs.  | validation: format GUID, immutable
     - name: revision | type: string | description: Revision number, which increments by 1 each time the ticket definition is updated. To prevent conflicting changes, the existing `revision` must be used when updating a ticket definition.  | read-only: true | validation: format int64
     - name: createdDate | type: string | description: Date and time the ticket definition was created.  | read-only: true | validation: format date-time
     - name: updatedDate | type: string | description: Date and time the ticket definition was updated.  | read-only: true | validation: format date-time
     - name: name | type: string | description: Ticket definition name.  | validation: minLength 1, maxLength 30
     - name: description | type: string | description: Ticket definition description.  | validation: maxLength 500
     - name: policyText | type: string | description: Ticket definition policy.  | validation: maxLength 1000
     - name: hidden | type: boolean | description: Whether this ticket definition is hidden from site visitors and can't be purchased.  
     - name: limited | type: boolean | description: Whether the ticket has a limited maximum quantity.  | read-only: true 
     - name: initialLimit | type: integer | description: The maximum number of tickets that can be sold for the event when first defining the event. If a seating map is defined after you created a ticket definition, this property is ignored and `actualLimit` is used instead. To create unlimited tickets, skip this field in the request.  | validation: format int32
     - name: actualLimit | type: integer | description: The maximum number of tickets that can be sold for the event after adding a seating map to the event. If no seating map is defined, this property is the same as `initialLimit`.  | read-only: true | validation: format int32
     - name: pricingMethod | type: PricingMethod | description: Ticket pricing method.  
        - ONE-OF: 
           - name: fixedPrice | type: Money | description: Same ticket price for everyone.  
              - name: value | type: string | description: Monetary amount. Decimal string with a period as a decimal separator (e.g., 3.99). Optionally, a single (-), to indicate that the amount is negative.  | validation: format DECIMAL_VALUE
              - name: currency | type: string | description: Currency code. Must be a valid [ISO 4217](https://www.iso.org/iso-4217-currency-codes.html) currency code (e.g., USD).  | validation: format CURRENCY
           - name: guestPrice | type: Money | description: Guests choose how much they'd like to pay for the ticket. You can set the minimum price, or specify `"0"` in the request to make the ticket free. The price can be updated to a higher amount by a guest during the checkout.  
           - name: pricingOptions | type: PricingOptions | description: Sets of various ticket prices. For example, you can charge different prices for children and adults.  
              - name: optionDetails | type: array<OptionDetails> | description: Ticket price options.  | validation: maxItems 100
                 - name: optionId | type: string | description: Ticket price option GUID.  | validation: format GUID
                 - name: name | type: string | description: Ticket price option name, such as "Child Ticket".  | validation: minLength 1, maxLength 200
                 - name: price | type: Money | description: Ticket price.  
        - name: pricingType | type: Type | description: Ticket price type.  | read-only: true 
             - enum:
             -     STANDARD: All money goes to a seller. Applies to all ticket pricing methods except for `guestPrice`.
             -     DONATION: All collected money is a donation. This pricing type is automatically assigned when you select the `guestPrice` pricing method.
        - name: free | type: boolean | description: Whether the ticket is free. To create a free ticket, enter `"0"` in `pricingMethod.fixedPrice.value`.  | read-only: true 
     - name: feeType | type: Type | description: Type of ticket service fee to collect.  
         - enum:
         -     FEE_INCLUDED: The fee is deducted from the ticket price for a seller. <br><br> For example, if you're selling tickets for $10, then a ticket 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. <br><br> For example, if you sell tickets for $10, a customer will see a ticket service fee of $0.25 and will pay $10.25 in total.
         -     NO_FEE: Ticket service fee isn't collected. Available only for free tickets and legacy Wix users.
     - name: salePeriod | type: SalePeriod | description: Ticket sale period.  
        - name: startDate | type: string | description: Date and time the ticket sale starts. Rounded down to the nearest minute.  | validation: format date-time
        - name: endDate | type: string | description: Date and time the ticket sale ends. Rounded down to the nearest minute.  | validation: format date-time
        - name: displayNotOnSale | type: boolean | description: Whether to display the ticket if it's not available to buy.  
     - name: saleStatus | type: Status | description: Ticket sale status.  | read-only: true 
         - enum:
         -     SALE_SCHEDULED: Tickets aren't on sale yet.
         -     SALE_STARTED: Tickets are on sale.
         -     SALE_ENDED: Tickets are no longer on sale.
     - name: salesDetails | type: SalesDetails | description: Ticket sales information. <br> <br> **Note:** This field is only returned when `SALES_DETAILS` is specified in `field` in the request.  | read-only: true 
        - name: unsoldCount | type: integer | description: Number of tickets that haven't been purchased yet. The field is `null` if the ticket quantity is unlimited.  | read-only: true | validation: format int32
        - name: soldCount | type: integer | description: Number of purchased tickets.  | read-only: true | validation: format int32
        - name: reservedCount | type: integer | description: Number of reserved tickets.  | read-only: true | validation: format int32
        - name: soldOut | type: boolean | description: Whether the tickets are sold out.  | read-only: true 
     - name: limitPerCheckout | type: integer | description: Number of tickets that can be purchased per checkout. <br> <br> **Note:** If the `actualLimit` or `salesDetails.unsoldCount` field value is smaller than `limitPerCheckout`, then it overrides this field.  | read-only: true | validation: minimum 0, maximum 50, format int32
     - name: extendedFields | type: ExtendedFields | description: Data extensions.  
        - name: namespaces | type: object | description: Extended field data. Each key corresponds to the namespace of the app that created the extended fields. The value of each key is structured according to the schema defined when the extended fields were configured.  You can only access fields for which you have the appropriate permissions.  Learn more about [extended fields](https://dev.wix.com/docs/rest/articles/getting-started/extended-fields.md).  | validation: format map
     - name: eventDetails | type: EventDetails | description: Information about the even the ticket is for. <br> **Note:** This field is only returned when `EVENT_DETAILS` is specified in `field` in the request.  | read-only: true 
        - name: title | type: string | description: Event title.  | read-only: true | validation: minLength 1, maxLength 120
        - name: shortDescription | type: string | description: Short description of the event.  | read-only: true | validation: maxLength 500
        - name: location | type: Location | description: Event location.  | read-only: true 
           - name: name | type: string | description: Location name. This value is displayed instead of the address when the location is defined as TBD by setting the `locationTbd` property to `true`.  | validation: maxLength 50
           - name: type | type: LocationType | description: Location type.  
                 - enum:
                 -     VENUE: Event is on-site at a specific physical location.
                 -     ONLINE: Event is online, such as a virtual video conference.
           - name: address | type: Address | description: Exact location address.  
              - ONE-OF: 
                 - name: streetAddress | type: StreetAddress | description: Street address.  
                    - name: number | type: string | description: Street number.  | validation: maxLength 100
                    - name: name | type: string | description: Street name.  | validation: maxLength 250
                 - name: addressLine | type: string | description: Primary address information (street and building number).  | validation: maxLength 250
              - name: country | type: string | description: 2-letter country code in [ISO-3166 alpha-2](https://en.wikipedia.org/wiki/ISO_3166-1_alpha-2#Officially_assigned_code_elements) format.  | validation: format COUNTRY
              - name: subdivision | type: string | description: Code for a subdivision (such as state, prefecture, or province) in [ISO 3166-2](https://en.wikipedia.org/wiki/ISO_3166-2).  | validation: maxLength 20
              - name: city | type: string | description: City name.  | validation: maxLength 100
              - name: postalCode | type: string | description: Zip or postal code.  | validation: maxLength 100
              - name: addressLine2 | type: string | description: Secondary address information (suite or apartment number and room number).  | validation: maxLength 250
              - name: formattedAddress | type: string | description: A string containing the full address of this location.  | validation: maxLength 1000
              - name: geocode | type: AddressLocation | description: Coordinates of the physical address.  
                 - name: latitude | type: number | description: Address latitude coordinates.  | validation: minimum -90, maximum 90, format double
                 - name: longitude | type: number | description: Address longitude coordinates.  | validation: minimum -180, maximum 180, format double
           - name: locationTbd | type: boolean | description: Whether the event location is TBD.  
        - name: dateAndTimeSettings | type: DateAndTimeSettings | description: Event date and time settings.  | read-only: true 
           - name: dateAndTimeTbd | type: boolean | description: Whether the event date and time are TBD.  
           - name: dateAndTimeTbdMessage | type: string | description: Message that is displayed when time and date is TBD.  **Note:** This field is only used when the `dateAndTimeTbd` field value is `true`.  | validation: maxLength 100
           - name: startDate | type: string | description: Event start date.  **Note:** This field is only returned when the `dateAndTimeTbd` field value is `false`.  | validation: format date-time
           - name: endDate | type: string | description: Event end date.  **Note:** This field is only returned when the `dateAndTimeTbd` field value is `false`.  | validation: format date-time
           - name: timeZoneId | type: string | description: Event time zone GUID in the [TZ database](https://www.iana.org/time-zones) format.  **Note:** This field is only returned when the `dateAndTimeTbd` field value is `false`.  | validation: maxLength 100
           - name: hideEndDate | type: boolean | description: Whether the end date is hidden in the formatted date and time.  
           - name: showTimeZone | type: boolean | description: Whether the time zone is displayed in the formatted schedule.  
           - name: recurrenceStatus | type: Status | description: Repeating event status.  | read-only: true 
                 - enum:
                 -     ONE_TIME: Event happens only once and can last multiple days.
                 -     RECURRING: A series of events that repeat.
                 -     RECURRING_UPCOMING: Next event in a schedule of recurring events.
                 -     RECURRING_RECENTLY_ENDED: Latest event that ended in a schedule of recurring events.
                 -     RECURRING_RECENTLY_CANCELED: Latest canceled event in a schedule of recurring events
           - name: recurringEvents | type: Recurrences | description: Event repetitions.  
              - name: individualEventDates | type: array<Occurrence> | description: Individual event dates for recurring events.  *Note:** Each date must be manually calculated and provided. There is no support for automatic generation using recurrence rules or patterns (for example, "Weekly").  When you create a recurring event: - Each occurrence is created as an independent event with its own unique GUID. - All occurrences in the series share the same `categoryId`, which allows you to identify all events in the recurring series. - To retrieve all events in a recurring series, query events by `recurringEvents.categoryId`. - Each event in the series can be independently updated or deleted using its individual event GUID.  | validation: maxItems 1000
                 - name: startDate | type: string | description: Event start date.  | validation: format date-time
                 - name: endDate | type: string | description: Event end date.  | validation: format date-time
                 - name: timeZoneId | type: string | description: Event time zone GUID in the [TZ database](https://www.iana.org/time-zones) format.  | validation: maxLength 100
                 - name: showTimeZone | type: boolean | description: Whether the time zone is displayed in a formatted schedule.  
              - name: categoryId | type: string | description: Recurring event category GUID.  This read-only field is automatically generated and shared by all events in a recurring series. Use this GUID to query and retrieve all occurrences of a recurring event.  | read-only: true | validation: maxLength 100
           - name: formatted | type: Formatted | description: Formatted date and time settings.  
              - name: dateAndTime | type: string | description: Formatted date and time representation. <br> Example of formatting when an event lasts multiple days and is in the UTC time zone: `September 1, 2015 at 10:20 AM – September 5, 2015 at 12:14 PM`. <br> Example of formatting when an event lasts 1 day and is in the GMT+2 time zone: `February 1, 2018, 12:10 – 2:50 PM GMT+2`.  | read-only: true | validation: maxLength 500
              - name: startDate | type: string | description: Formatted start date of the event. Empty for TBD schedules.  | read-only: true | validation: maxLength 500
              - name: startTime | type: string | description: Formatted start time of the event. Empty for TBD schedules.  | read-only: true | validation: maxLength 500
              - name: endDate | type: string | description: Formatted end date of the event. Empty for TBD schedules or when the end date is hidden.  | read-only: true | validation: maxLength 500
              - name: endTime | type: string | description: Formatted end time of the event. Empty for TBD schedules or when the end date is hidden.  | read-only: true | validation: maxLength 500
        - name: eventPageUrl | type: PageUrl | description: Event page URL components.  | read-only: true 
           - name: base | type: string | description: The base URL. For premium sites, the base is the domain. For free sites, the base is the Wix site URL (for example, `https://mysite.wixsite.com/mysite`).  | validation: maxLength 500
           - name: path | type: string | description: The path to the page. For example, `/product-page/a-product`.  | validation: maxLength 500
        - name: status | type: Status | description: Event status.  | read-only: true 
             - enum:
             -     UPCOMING: Event is published and scheduled to start.
             -     STARTED: Event has started.
             -     ENDED: Event has ended.
             -     CANCELED: Event is canceled.
             -     DRAFT: Event is not public.
     - name: seatingDetails | type: SeatingDetails | description: Seating information including available seats and areas for this ticket definition. <br> **Note:** This field is only returned when `SEATING_DETAILS` is specified in `field` in the request, and when the event has a [seating plan](https://support.wix.com/en/article/wix-events-creating-a-seating-map).  | read-only: true 
        - name: places | type: array<AvailablePlace> | description: List of available places.  | validation: maxItems 50000
           - name: placeId | type: string | description: Place GUID in the format `{sectionId}-{elementId}-{label}`. For example, `0-1-A5`.  | read-only: true | validation: minLength 1, maxLength 20
           - name: label | type: string | description: Human-readable label for this place, such as `A1`, `12`, or `VIP1`.  | read-only: true | validation: minLength 1, maxLength 4
           - name: sectionLabel | type: string | description: High-level division of the venue, where the place is located, such as `Orchestra`, `Balcony`, or `VIP Section`.  | read-only: true | validation: minLength 1, maxLength 20
           - name: elementLabel | type: string | description: Seating element within the section, such as `Row`, `Table`, or `General Admission`.  | read-only: true | validation: minLength 1, maxLength 50
           - name: availableCapacity | type: integer | description: Available capacity at this place.  For general seating type returns the number of remaining spots.  For other types returns `1`. For example, if a table has 5 chairs, each chair is treated as a separate place, which has a capacity of 1.  | read-only: true | validation: minimum 0, maximum 50000
  - name: metadata | type: PagingMetadataV2 | description: Metadata for the paginated results.  
     - name: count | type: integer | description: Number of items returned in the response.  | validation: format int32
     - name: offset | type: integer | description: Offset that was requested.  | validation: format int32
     - name: total | type: integer | description: Total number of items that match the query. Returned if offset paging is used and the `tooManyToCount` flag is not set.  | validation: format int32
     - name: tooManyToCount | type: boolean | description: Flag that indicates the server failed to calculate the `total` field.  
     - name: cursors | type: Cursors | description: Cursors to navigate through the result pages using `next` and `prev`. Returned if cursor paging is used.  
        - name: next | type: string | description: Cursor pointing to next page in the list of results.  | validation: maxLength 36
        - name: prev | type: string | description: Cursor pointing to previous page in the list of results.  | validation: maxLength 36


```

### Examples

### Query ticket definitions by created date with sales details
```curl
curl -X POST 'https://www.wixapis.com/events/v3/ticket-definitions/query' \
-H 'Content-Type: application/json' \
-H 'Authorization: <AUTH TOKEN>' \
-d '{
  "query": {
    "filter": {
      "createdDate": {
        "$gt": "2023-05-25T00:00:00.000Z"
      }
    }
  },
  "fields": [ "SALES_DETAILS" ]
}'
```

---

## JavaScript SDK

### Schema

```
 Method: wixClientAdmin.events.ticketDefinitionsV2.queryTicketDefinitions(query, options)
 Description: Retrieves a list of ticket definitions with the specified paging, filtering, and sorting.  Query Ticket Definitions runs with these defaults, which you can override: - `createdDate` is sorted in `ASC` order - `paging.limit` is `100` - `paging.offset` is `0` <br> To learn about working with _Query_ methods, see [API Query Language](https://dev.wix.com/docs/rest/articles/get-started/api-query-language.md).
 # Note: If the parameter `a.b` is listed under required parameters, `b` is only required if `a` is also present.
 Required parameters:  query
 Method parameters: 
   param name: query | type: TicketDefinitionQuery   | required: true 
     - name: cursorPaging | type: CursorPaging | description: Cursor token pointing to a page of results. Not used in the first request. Following requests use the cursor token and not `filter` or `sort` parameters.  
        - name: limit | type: integer | description: Number of items to load per page.  | validation: minimum 0, maximum 100, format int32
        - name: cursor | type: string | description: Pointer to the next or previous page in the list of results. You can get the relevant cursor token from the `pagingMetadata` object in the previous call's response. Not relevant for the first request.  | validation: maxLength 16000
        - name: filter | type: object | description: Filter object in the following format: <br/> `"filter" : { "fieldName1": "value1", "fieldName2":{"$operator":"value2"} }`. <br/> <br/> **Example:** <br/> `"filter" : { "id": "2224a9d1-79e6-4549-a5c5-bf7ce5aac1a5", "revision": {"$ne":"1"} }`  
        - name: sort | type: array<Sorting> | description: Sort object in the following format: <br/> `[{"fieldName":"sortField1"},{"fieldName":"sortField2","direction":"DESC"}]` <br/> <br/> **Example:** <br/> `[{"fieldName":"createdDate","direction":"DESC"}]` <br/> <br/> See [supported fields](https://dev.wix.com/api/rest/wix-events/policy-v2/filter-and-sort) for more information.  | validation: maxItems 10
           - name: fieldName | type: string | description: Name of the field to sort by.  | validation: maxLength 100
           - name: order | type: SortOrder | description: Defaults to `ASC`  
                 - enum: ASC, DESC
   param name: options | type: QueryTicketDefinitionsOptions  none  
        - name: fields | type: array<Field> | description: Predefined sets of fields to return.  | validation: maxItems 5
             - enum:
             -     SALES_DETAILS: Returns `salesDetails` in the response.
             -     EVENT_DETAILS: Returns `eventDetails` in the response.
             -     SEATING_DETAILS: Returns `seatingDetails` with available seats in the response.
 Query fields:
   - field: _id | operators: $eq, $ne, $in, $nin, $lt, $lte, $gt, $gte, $exists | sort: ASC, DESC | aggregatable: undefined | searchable: undefined
   - field: eventId | operators: $eq, $ne, $in, $nin, $lt, $lte, $gt, $gte, $exists | sort: ASC, DESC | aggregatable: undefined | searchable: undefined
   - field: revision | operators: $eq, $ne, $in, $nin, $lt, $lte, $gt, $gte, $exists | sort: ASC, DESC | aggregatable: undefined | searchable: undefined
   - field: name | operators: $eq, $ne, $in, $nin, $lt, $lte, $gt, $gte, $exists | sort: ASC, DESC | aggregatable: undefined | searchable: undefined
   - field: description | operators: $eq, $ne, $in, $nin, $lt, $lte, $gt, $gte, $exists | sort: ASC, DESC | aggregatable: undefined | searchable: undefined
   - field: initialLimit | operators: $eq, $ne, $in, $nin, $lt, $lte, $gt, $gte, $exists | sort: ASC, DESC | aggregatable: undefined | searchable: undefined
   - field: pricingMethod.fixedPrice.value | operators: $eq, $ne, $in, $nin, $lt, $lte, $gt, $gte, $exists | sort: ASC, DESC | aggregatable: undefined | searchable: undefined
   - field: pricingMethod.fixedPrice.currency | operators: $eq, $ne, $in, $nin, $lt, $lte, $gt, $gte, $exists | sort: ASC, DESC | aggregatable: undefined | searchable: undefined
   - field: _createdDate | operators: $eq, $ne, $in, $nin, $lt, $lte, $gt, $gte, $exists | sort: ASC, DESC | aggregatable: undefined | searchable: undefined
   - field: _updatedDate | operators: $eq, $ne, $in, $nin, $lt, $lte, $gt, $gte, $exists | sort: ASC, DESC | aggregatable: undefined | searchable: undefined
   - field: hidden | operators: $eq, $ne, $in, $nin, $exists | sort: ASC, DESC | aggregatable: undefined | searchable: undefined
   - field: pricingMethod.free | operators: $eq, $ne, $in, $nin, $exists | sort: ASC, DESC | aggregatable: undefined | searchable: undefined
   - field: pricingMethod.pricingType | operators: $eq, $ne, $in, $nin, $exists | sort: ASC, DESC | aggregatable: undefined | searchable: undefined
   - field: feeType | operators: $eq, $ne, $in, $nin, $exists | sort: ASC, DESC | aggregatable: undefined | searchable: undefined
   - field: saleStatus | operators: $eq, $ne, $in, $nin, $exists | sort: ASC, DESC | aggregatable: undefined | searchable: undefined
 Return type: PROMISE<QueryTicketDefinitionsResponse>
  - name: ticketDefinitions | type: array<TicketDefinition> | description: List of ticket definitions.  
     - name: _id | type: string | description: Ticket definition GUID.  | read-only: true | validation: format GUID
     - name: eventId | type: string | description: Event GUID to which the ticket definition belongs.  | validation: format GUID, immutable
     - name: revision | type: string | description: Revision number, which increments by 1 each time the ticket definition is updated. To prevent conflicting changes, the existing `revision` must be used when updating a ticket definition.  | read-only: true | validation: format int64
     - name: _createdDate | type: Date | description: Date and time the ticket definition was created.  | read-only: true 
     - name: _updatedDate | type: Date | description: Date and time the ticket definition was updated.  | read-only: true 
     - name: name | type: string | description: Ticket definition name.  | validation: minLength 1, maxLength 30
     - name: description | type: string | description: Ticket definition description.  | validation: maxLength 500
     - name: policyText | type: string | description: Ticket definition policy.  | validation: maxLength 1000
     - name: hidden | type: boolean | description: Whether this ticket definition is hidden from site visitors and can't be purchased.  
     - name: limited | type: boolean | description: Whether the ticket has a limited maximum quantity.  | read-only: true 
     - name: initialLimit | type: integer | description: The maximum number of tickets that can be sold for the event when first defining the event. If a seating map is defined after you created a ticket definition, this property is ignored and `actualLimit` is used instead. To create unlimited tickets, skip this field in the request.  | validation: format int32
     - name: actualLimit | type: integer | description: The maximum number of tickets that can be sold for the event after adding a seating map to the event. If no seating map is defined, this property is the same as `initialLimit`.  | read-only: true | validation: format int32
     - name: pricingMethod | type: PricingMethod | description: Ticket pricing method.  
        - ONE-OF: 
           - name: fixedPrice | type: Money | description: Same ticket price for everyone.  
              - name: value | type: string | description: Monetary amount. Decimal string with a period as a decimal separator (e.g., 3.99). Optionally, a single (-), to indicate that the amount is negative.  | validation: format DECIMAL_VALUE
              - name: currency | type: string | description: Currency code. Must be a valid [ISO 4217](https://www.iso.org/iso-4217-currency-codes.html) currency code (e.g., USD).  | validation: format CURRENCY
           - name: guestPrice | type: Money | description: Guests choose how much they'd like to pay for the ticket. You can set the minimum price, or specify `"0"` in the request to make the ticket free. The price can be updated to a higher amount by a guest during the checkout.  
           - name: pricingOptions | type: PricingOptions | description: Sets of various ticket prices. For example, you can charge different prices for children and adults.  
              - name: optionDetails | type: array<OptionDetails> | description: Ticket price options.  | validation: maxItems 100
                 - name: optionId | type: string | description: Ticket price option GUID.  | validation: format GUID
                 - name: name | type: string | description: Ticket price option name, such as "Child Ticket".  | validation: minLength 1, maxLength 200
                 - name: price | type: Money | description: Ticket price.  
        - name: pricingType | type: Type | description: Ticket price type.  | read-only: true 
             - enum:
             -     STANDARD: All money goes to a seller. Applies to all ticket pricing methods except for `guestPrice`.
             -     DONATION: All collected money is a donation. This pricing type is automatically assigned when you select the `guestPrice` pricing method.
        - name: free | type: boolean | description: Whether the ticket is free. To create a free ticket, enter `"0"` in `pricingMethod.fixedPrice.value`.  | read-only: true 
     - name: feeType | type: Type | description: Type of ticket service fee to collect.  
         - enum:
         -     FEE_INCLUDED: The fee is deducted from the ticket price for a seller. <br><br> For example, if you're selling tickets for $10, then a ticket 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. <br><br> For example, if you sell tickets for $10, a customer will see a ticket service fee of $0.25 and will pay $10.25 in total.
         -     NO_FEE: Ticket service fee isn't collected. Available only for free tickets and legacy Wix users.
     - name: salePeriod | type: SalePeriod | description: Ticket sale period.  
        - name: startDate | type: Date | description: Date and time the ticket sale starts. Rounded down to the nearest minute.  
        - name: endDate | type: Date | description: Date and time the ticket sale ends. Rounded down to the nearest minute.  
        - name: displayNotOnSale | type: boolean | description: Whether to display the ticket if it's not available to buy.  
     - name: saleStatus | type: Status | description: Ticket sale status.  | read-only: true 
         - enum:
         -     SALE_SCHEDULED: Tickets aren't on sale yet.
         -     SALE_STARTED: Tickets are on sale.
         -     SALE_ENDED: Tickets are no longer on sale.
     - name: salesDetails | type: SalesDetails | description: Ticket sales information. <br> <br> **Note:** This field is only returned when `SALES_DETAILS` is specified in `field` in the request.  | read-only: true 
        - name: unsoldCount | type: integer | description: Number of tickets that haven't been purchased yet. The field is `null` if the ticket quantity is unlimited.  | read-only: true | validation: format int32
        - name: soldCount | type: integer | description: Number of purchased tickets.  | read-only: true | validation: format int32
        - name: reservedCount | type: integer | description: Number of reserved tickets.  | read-only: true | validation: format int32
        - name: soldOut | type: boolean | description: Whether the tickets are sold out.  | read-only: true 
     - name: limitPerCheckout | type: integer | description: Number of tickets that can be purchased per checkout. <br> <br> **Note:** If the `actualLimit` or `salesDetails.unsoldCount` field value is smaller than `limitPerCheckout`, then it overrides this field.  | read-only: true | validation: minimum 0, maximum 50, format int32
     - name: extendedFields | type: ExtendedFields | description: Data extensions.  
        - name: namespaces | type: object | description: Extended field data. Each key corresponds to the namespace of the app that created the extended fields. The value of each key is structured according to the schema defined when the extended fields were configured.  You can only access fields for which you have the appropriate permissions.  Learn more about [extended fields](https://dev.wix.com/docs/rest/articles/getting-started/extended-fields.md).  | validation: format map
     - name: eventDetails | type: EventDetails | description: Information about the even the ticket is for. <br> **Note:** This field is only returned when `EVENT_DETAILS` is specified in `field` in the request.  | read-only: true 
        - name: title | type: string | description: Event title.  | read-only: true | validation: minLength 1, maxLength 120
        - name: shortDescription | type: string | description: Short description of the event.  | read-only: true | validation: maxLength 500
        - name: location | type: Location | description: Event location.  | read-only: true 
           - name: name | type: string | description: Location name. This value is displayed instead of the address when the location is defined as TBD by setting the `locationTbd` property to `true`.  | validation: maxLength 50
           - name: type | type: LocationType | description: Location type.  
                 - enum:
                 -     VENUE: Event is on-site at a specific physical location.
                 -     ONLINE: Event is online, such as a virtual video conference.
           - name: address | type: Address | description: Exact location address.  
              - name: city | type: string | description: none  
              - name: subdivision | type: string | description: none  
              - name: country | type: string | description: none  
              - name: postalCode | type: string | description: none  
              - name: addressLine1 | type: string | description: none  
              - name: addressLine2 | type: string | description: none  
           - name: locationTbd | type: boolean | description: Whether the event location is TBD.  
        - name: dateAndTimeSettings | type: DateAndTimeSettings | description: Event date and time settings.  | read-only: true 
           - name: dateAndTimeTbd | type: boolean | description: Whether the event date and time are TBD.  
           - name: dateAndTimeTbdMessage | type: string | description: Message that is displayed when time and date is TBD.  **Note:** This field is only used when the `dateAndTimeTbd` field value is `true`.  | validation: maxLength 100
           - name: startDate | type: Date | description: Event start date.  **Note:** This field is only returned when the `dateAndTimeTbd` field value is `false`.  
           - name: endDate | type: Date | description: Event end date.  **Note:** This field is only returned when the `dateAndTimeTbd` field value is `false`.  
           - name: timeZoneId | type: string | description: Event time zone GUID in the [TZ database](https://www.iana.org/time-zones) format.  **Note:** This field is only returned when the `dateAndTimeTbd` field value is `false`.  | validation: maxLength 100
           - name: hideEndDate | type: boolean | description: Whether the end date is hidden in the formatted date and time.  
           - name: showTimeZone | type: boolean | description: Whether the time zone is displayed in the formatted schedule.  
           - name: recurrenceStatus | type: Status | description: Repeating event status.  | read-only: true 
                 - enum:
                 -     ONE_TIME: Event happens only once and can last multiple days.
                 -     RECURRING: A series of events that repeat.
                 -     RECURRING_UPCOMING: Next event in a schedule of recurring events.
                 -     RECURRING_RECENTLY_ENDED: Latest event that ended in a schedule of recurring events.
                 -     RECURRING_RECENTLY_CANCELED: Latest canceled event in a schedule of recurring events
           - name: recurringEvents | type: Recurrences | description: Event repetitions.  
              - name: individualEventDates | type: array<Occurrence> | description: Individual event dates for recurring events.  *Note:** Each date must be manually calculated and provided. There is no support for automatic generation using recurrence rules or patterns (for example, "Weekly").  When you create a recurring event: - Each occurrence is created as an independent event with its own unique GUID. - All occurrences in the series share the same `categoryId`, which allows you to identify all events in the recurring series. - To retrieve all events in a recurring series, query events by `recurringEvents.categoryId`. - Each event in the series can be independently updated or deleted using its individual event GUID.  | validation: maxItems 1000
                 - name: startDate | type: Date | description: Event start date.  
                 - name: endDate | type: Date | description: Event end date.  
                 - name: timeZoneId | type: string | description: Event time zone GUID in the [TZ database](https://www.iana.org/time-zones) format.  | validation: maxLength 100
                 - name: showTimeZone | type: boolean | description: Whether the time zone is displayed in a formatted schedule.  
              - name: categoryId | type: string | description: Recurring event category GUID.  This read-only field is automatically generated and shared by all events in a recurring series. Use this GUID to query and retrieve all occurrences of a recurring event.  | read-only: true | validation: maxLength 100
           - name: formatted | type: Formatted | description: Formatted date and time settings.  
              - name: dateAndTime | type: string | description: Formatted date and time representation. <br> Example of formatting when an event lasts multiple days and is in the UTC time zone: `September 1, 2015 at 10:20 AM – September 5, 2015 at 12:14 PM`. <br> Example of formatting when an event lasts 1 day and is in the GMT+2 time zone: `February 1, 2018, 12:10 – 2:50 PM GMT+2`.  | read-only: true | validation: maxLength 500
              - name: startDate | type: string | description: Formatted start date of the event. Empty for TBD schedules.  | read-only: true | validation: maxLength 500
              - name: startTime | type: string | description: Formatted start time of the event. Empty for TBD schedules.  | read-only: true | validation: maxLength 500
              - name: endDate | type: string | description: Formatted end date of the event. Empty for TBD schedules or when the end date is hidden.  | read-only: true | validation: maxLength 500
              - name: endTime | type: string | description: Formatted end time of the event. Empty for TBD schedules or when the end date is hidden.  | read-only: true | validation: maxLength 500
        - name: eventPageUrl | type: string | description: Event page URL components.  | read-only: true 
        - name: status | type: Status | description: Event status.  | read-only: true 
             - enum:
             -     UPCOMING: Event is published and scheduled to start.
             -     STARTED: Event has started.
             -     ENDED: Event has ended.
             -     CANCELED: Event is canceled.
             -     DRAFT: Event is not public.
     - name: seatingDetails | type: SeatingDetails | description: Seating information including available seats and areas for this ticket definition. <br> **Note:** This field is only returned when `SEATING_DETAILS` is specified in `field` in the request, and when the event has a [seating plan](https://support.wix.com/en/article/wix-events-creating-a-seating-map).  | read-only: true 
        - name: places | type: array<AvailablePlace> | description: List of available places.  | validation: maxItems 50000
           - name: placeId | type: string | description: Place GUID in the format `{sectionId}-{elementId}-{label}`. For example, `0-1-A5`.  | read-only: true | validation: minLength 1, maxLength 20
           - name: label | type: string | description: Human-readable label for this place, such as `A1`, `12`, or `VIP1`.  | read-only: true | validation: minLength 1, maxLength 4
           - name: sectionLabel | type: string | description: High-level division of the venue, where the place is located, such as `Orchestra`, `Balcony`, or `VIP Section`.  | read-only: true | validation: minLength 1, maxLength 20
           - name: elementLabel | type: string | description: Seating element within the section, such as `Row`, `Table`, or `General Admission`.  | read-only: true | validation: minLength 1, maxLength 50
           - name: availableCapacity | type: integer | description: Available capacity at this place.  For general seating type returns the number of remaining spots.  For other types returns `1`. For example, if a table has 5 chairs, each chair is treated as a separate place, which has a capacity of 1.  | read-only: true | validation: minimum 0, maximum 50000
  - name: metadata | type: PagingMetadataV2 | description: Metadata for the paginated results.  
     - name: count | type: integer | description: Number of items returned in the response.  | validation: format int32
     - name: offset | type: integer | description: Offset that was requested.  | validation: format int32
     - name: total | type: integer | description: Total number of items that match the query. Returned if offset paging is used and the `tooManyToCount` flag is not set.  | validation: format int32
     - name: tooManyToCount | type: boolean | description: Flag that indicates the server failed to calculate the `total` field.  
     - name: cursors | type: Cursors | description: Cursors to navigate through the result pages using `next` and `prev`. Returned if cursor paging is used.  
        - name: next | type: string | description: Cursor pointing to next page in the list of results.  | validation: maxLength 36
        - name: prev | type: string | description: Cursor pointing to previous page in the list of results.  | validation: maxLength 36


```

### Examples

### queryTicketDefinitions
```javascript
import { ticketDefinitionsV2 } from '@wix/events';

async function queryTicketDefinitions(query,options) {
  const response = await ticketDefinitionsV2.queryTicketDefinitions(query,options);
};
```

### queryTicketDefinitions (with elevated permissions)
```javascript
import { ticketDefinitionsV2 } from '@wix/events';
import { auth } from '@wix/essentials';

async function myQueryTicketDefinitionsMethod(query,options) {
  const elevatedQueryTicketDefinitions = auth.elevate(ticketDefinitionsV2.queryTicketDefinitions);
  const response = await elevatedQueryTicketDefinitions(query,options);
}
```

### queryTicketDefinitions (self-managed)
Self-managed SDK calls require you to [create a client](https://dev.wix.com/docs/sdk/articles/work-with-the-sdk/about-the-wix-client.md).

```javascript
import { createClient } from '@wix/sdk';
import { ticketDefinitionsV2 } from '@wix/events';
// Import the auth strategy for the relevant access type
// Import the relevant host module if needed

const myWixClient = createClient ({
  modules: { ticketDefinitionsV2 },
  // Include the auth strategy and host as relevant
});


async function queryTicketDefinitions(query,options) {
  const response = await myWixClient.ticketDefinitionsV2.queryTicketDefinitions(query,options);
};
```

---