> 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

# ListAvailableTickets

# Package: ticketing

# Namespace: CheckoutService

# Method link: https://dev.wix.com/docs/api-reference/business-solutions/events/registration/ticketing/orders/list-available-tickets.md

## Permission Scopes:
Events Checkout: SCOPE.EVENTS.EVENTS-CHECKOUT

## Introduction

Retrieves tickets available to reserve.

---

## REST API

### Schema

```
 Method: listAvailableTickets
 Description: Retrieves tickets available to reserve.
 URL: https://www.wixapis.com/events/v1/checkout/available-tickets
 Method: GET
 Method parameters:
   query param name: eventId | type: eventId | description: Event GUID to list tickets for. If not specified, available tickets for all events on a site will be returned.  | validation: format GUID
   query param name: limit | type: limit | description: Limit.  **Default:** `0`. If you don't pass this field in the request, only `metadata` is returned.  | validation: minimum 0, maximum 100
   query param name: offset | type: offset | description: Offset.  | validation: minimum 0
   query param name: sort | type: sort | description: Sort order.  Default: `created:asc`.  | validation: maxLength 100
   query param name: state | type: array<state>    
                 - enum: INCLUDE_HIDDEN_NOT_ON_SALE
 Return type: ListAvailableTicketsResponse
  - name: metaData | type: ResponseMetaData | description: Ticket definitions meta data.  
     - name: count | type: integer | description: Number of items in the response.  
     - name: offset | type: integer | description: Offset of items.  | validation: minimum 0
     - name: total | type: integer | description: Total number of matching items.  
  - name: definitions | type: array<TicketDefinition> | description: Ticket definitions.  
     - name: id | type: string | description: Ticket definition GUID.  | validation: format GUID
     - name: price | type: Money | description: Ticket price.  
        - name: currency | type: string | description: 3-letter currency code in [ISO-4217 alphabetic](https://en.wikipedia.org/wiki/ISO_4217#Active_codes) format. For example, `USD`.  | validation: format CURRENCY
        - name: value | type: string | description: Monetary amount. Decimal string with a period as a decimal separator (e.g., 3.99). Optionally, starts with a single (-), to indicate that the amount is negative.  | validation: format DECIMAL_VALUE
     - name: free | type: boolean | description: Whether the ticket is free (read only).  
     - name: name | type: string | description: Ticket name.  
     - name: description | type: string | description: Ticket description.  
     - name: limitPerCheckout | type: integer | description: Limit of tickets that can be purchased per checkout. Set to 20 for unlimited ticket definition.  | validation: minimum 0, maximum 20
     - name: orderIndex | type: integer | description: Custom sort index.  
     - name: policy | type: string | description: Policy information plain text block, as printed on the ticket.  
     - name: dashboard | type: Dashboard | description: Sensitive dashboard data.  
        - name: hidden | type: boolean | description: Whether ticket is hidden and cannot be sold.  
        - name: limited | type: boolean | description: Whether the ticket has limited quantity.  
        - name: quantity | type: integer | description: Ticket limit. `NULL` for unlimited ticket definitions.  | validation: format int32
        - name: unsold | type: integer | description: Number of unsold tickets. `NULL` for unlimited ticket definitions.  | validation: format int32
        - name: ticketsSold | type: integer | description: Number of tickets sold.  
        - name: ticketsReserved | type: integer | description: Number of tickets reserved.  
     - name: eventId | type: string | description: Event GUID associated with the ticket.  | validation: format GUID
     - name: wixFeeConfig | type: WixFeeConfig | description: Configuration of the fixed-rate Wix service fee that is applied at checkout to each ticket sold.  | read-only: true 
        - name: type | type: FeeType | description: Fee calculation method.  
             - enum:
             -     FEE_ADDED: Fee is added to the ticket price at checkout.
             -     FEE_INCLUDED: Seller absorbs the fee. It's deducted from the ticket price.
             -     FEE_ADDED_AT_CHECKOUT: Fee is added to the ticket price at checkout.
     - name: salePeriod | type: TicketSalePeriod | description: Ticket sale period.  
        - name: startDate | type: string | description: Ticket sale start timestamp.  | validation: format date-time
        - name: endDate | type: string | description: Ticket sale end timestamp.  | validation: format date-time
        - name: hideNotOnSale | type: boolean | description: Whether to hide this ticket if it isn't on sale.  
     - name: saleStatus | type: TicketSaleStatus | description: Ticket sale status.  | read-only: true 
         - enum:
         -     SALE_SCHEDULED: Ticket sale is scheduled to start.
         -     SALE_STARTED: Ticket sale has started.
         -     SALE_ENDED: Ticket sale has ended.
     - name: state | type: array<State> | description: Ticket state.  
         - enum: INCLUDE_HIDDEN_NOT_ON_SALE
     - name: pricing | type: TicketPricing | description: Ticket pricing.  
        - ONE-OF: 
           - name: fixedPrice | type: Money | description: Ticket price which is read only.  
           - name: minPrice | type: Money | description: Min price per ticket, customizable.  
           - name: pricingOptions | type: PricingOptions | description: Ticket pricing options.  
              - name: options | type: array<PricingOption> | description: Multiple ticket pricing options.  
                 - name: id | type: string | description: Ticket pricing option GUID.  | validation: format GUID
                 - name: name | type: string | description: Ticket pricing option name.  | validation: minLength 1, maxLength 200
                 - name: price | type: Money | description: Ticket pricing option price.  
        - name: pricingType | type: Type | description: Ticket pricing type.  | read-only: true 
             - enum: STANDARD, DONATION


```

### Examples

### ListAvailableTickets
```curl
~~~cURL
curl -X GET 'https://www.wixapis.com/events/v1/checkout/available-tickets?limit=100&eventId=fd56076c-38f4-4705-b9eb-ec322b85c745&sort=orderIndex:asc' \
-H 'Authorization: <AUTH TOKEN>'
~~~
```

---

## JavaScript SDK

### Schema

```
 Method: wixClientAdmin.events.orders.listAvailableTickets(options)
 Description: Retrieves tickets available to reserve.
 Method parameters:
   param name: options | type: ListAvailableTicketsOptions  none  
        - name: eventId | type: string | description: Event GUID to list tickets for. If not specified, available tickets for all events on a site will be returned.  | validation: format GUID
        - name: offset | type: integer | description: Offset.  | validation: minimum 0
        - name: limit | type: integer | description: Limit.  **Default:** `0`. If you don't pass this field in the request, only `metadata` is returned.  | validation: minimum 0, maximum 100
        - name: sort | type: string | description: Sort order.  Default: `created:asc`.  | validation: maxLength 100
        - name: state | type: array<State> | description:   
             - enum: INCLUDE_HIDDEN_NOT_ON_SALE
 Return type: PROMISE<ListAvailableTicketsResponse>
  - name: metaData | type: ResponseMetaData | description: Ticket definitions meta data.  
     - name: count | type: integer | description: Number of items in the response.  
     - name: offset | type: integer | description: Offset of items.  | validation: minimum 0
     - name: total | type: integer | description: Total number of matching items.  
  - name: definitions | type: array<TicketDefinition> | description: Ticket definitions.  
     - name: _id | type: string | description: Ticket definition GUID.  | validation: format GUID
     - name: price | type: Money | description: Ticket price.  
        - name: currency | type: string | description: 3-letter currency code in [ISO-4217 alphabetic](https://en.wikipedia.org/wiki/ISO_4217#Active_codes) format. For example, `USD`.  | validation: format CURRENCY
        - name: value | type: string | description: Monetary amount. Decimal string with a period as a decimal separator (e.g., 3.99). Optionally, starts with a single (-), to indicate that the amount is negative.  | validation: format DECIMAL_VALUE
     - name: free | type: boolean | description: Whether the ticket is free (read only).  
     - name: name | type: string | description: Ticket name.  
     - name: description | type: string | description: Ticket description.  
     - name: limitPerCheckout | type: integer | description: Limit of tickets that can be purchased per checkout. Set to 20 for unlimited ticket definition.  | validation: minimum 0, maximum 20
     - name: orderIndex | type: integer | description: Custom sort index.  
     - name: policy | type: string | description: Policy information plain text block, as printed on the ticket.  
     - name: dashboard | type: Dashboard | description: Sensitive dashboard data.  
        - name: hidden | type: boolean | description: Whether ticket is hidden and cannot be sold.  
        - name: limited | type: boolean | description: Whether the ticket has limited quantity.  
        - name: quantity | type: integer | description: Ticket limit. `NULL` for unlimited ticket definitions.  | validation: format int32
        - name: unsold | type: integer | description: Number of unsold tickets. `NULL` for unlimited ticket definitions.  | validation: format int32
        - name: ticketsSold | type: integer | description: Number of tickets sold.  
        - name: ticketsReserved | type: integer | description: Number of tickets reserved.  
     - name: eventId | type: string | description: Event GUID associated with the ticket.  | validation: format GUID
     - name: wixFeeConfig | type: WixFeeConfig | description: Configuration of the fixed-rate Wix service fee that is applied at checkout to each ticket sold.  | read-only: true 
        - name: type | type: FeeType | description: Fee calculation method.  
             - enum:
             -     FEE_ADDED: Fee is added to the ticket price at checkout.
             -     FEE_INCLUDED: Seller absorbs the fee. It's deducted from the ticket price.
             -     FEE_ADDED_AT_CHECKOUT: Fee is added to the ticket price at checkout.
     - name: salePeriod | type: TicketSalePeriod | description: Ticket sale period.  
        - name: startDate | type: Date | description: Ticket sale start timestamp.  
        - name: endDate | type: Date | description: Ticket sale end timestamp.  
        - name: hideNotOnSale | type: boolean | description: Whether to hide this ticket if it isn't on sale.  
     - name: saleStatus | type: TicketSaleStatus | description: Ticket sale status.  | read-only: true 
         - enum:
         -     SALE_SCHEDULED: Ticket sale is scheduled to start.
         -     SALE_STARTED: Ticket sale has started.
         -     SALE_ENDED: Ticket sale has ended.
     - name: state | type: array<State> | description: Ticket state.  
         - enum: INCLUDE_HIDDEN_NOT_ON_SALE
     - name: pricing | type: TicketPricing | description: Ticket pricing.  
        - ONE-OF: 
           - name: fixedPrice | type: Money | description: Ticket price which is read only.  
           - name: minPrice | type: Money | description: Min price per ticket, customizable.  
           - name: pricingOptions | type: PricingOptions | description: Ticket pricing options.  
              - name: options | type: array<PricingOption> | description: Multiple ticket pricing options.  
                 - name: _id | type: string | description: Ticket pricing option GUID.  | validation: format GUID
                 - name: name | type: string | description: Ticket pricing option name.  | validation: minLength 1, maxLength 200
                 - name: price | type: Money | description: Ticket pricing option price.  
        - name: pricingType | type: Type | description: Ticket pricing type.  | read-only: true 
             - enum: STANDARD, DONATION


```

### Examples

### listAvailableTickets
```javascript
import { orders } from '@wix/events';

async function listAvailableTickets(options) {
  const response = await orders.listAvailableTickets(options);
};
```

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

async function myListAvailableTicketsMethod(options) {
  const elevatedListAvailableTickets = auth.elevate(orders.listAvailableTickets);
  const response = await elevatedListAvailableTickets(options);
}
```

### listAvailableTickets (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 { orders } from '@wix/events';
// Import the auth strategy for the relevant access type
// Import the relevant host module if needed

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


async function listAvailableTickets(options) {
  const response = await myWixClient.orders.listAvailableTickets(options);
};
```

---