> 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`).
> - Top-level index of all portals: https://dev.wix.com/docs/llms.txt
> - Full concatenated docs: https://dev.wix.com/docs/llms-full.txt

# createTicketReservation

# Package: @wix/events

# Namespace: ticketReservations

# Method link: https://dev.wix.com/docs/api-reference/business-solutions/events/registration/ticketing/ticket-reservations/create-ticket-reservation.md

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

## Introduction

Creates a ticket reservation.

Reserves specified tickets for a limited time while a customer completes their purchase.
The reservation will have `PENDING` status and will automatically expire after the
event's configured reservation duration (typically 5-30 minutes) unless confirmed.

---

## JavaScript SDK

### Schema

```
 Method: wixClientAdmin.events.ticketReservations.createTicketReservation(ticketReservation)
 Description: Creates a ticket reservation.  Reserves specified tickets for a limited time while a customer completes their purchase. The reservation will have `PENDING` status and will automatically expire after the event's configured reservation duration (typically 5-30 minutes) unless confirmed.
 # Note: If the parameter `a.b` is listed under required parameters, `b` is only required if `a` is also present.
 Required parameters:  ticketReservation, ticketReservation.tickets.ticketDefinitionId, ticketReservation.tickets.quantity
 Method parameters: 
   param name: ticketReservation | type: TicketReservation | description: A ticket reservation holds tickets for a specified time period during the checkout process.  When a site visitor selects tickets for an event, a ticket reservation is created to temporarily reserve those tickets while the visitor completes their purchase. The reservation prevents other visitors from purchasing the same tickets and includes pricing, seat information (if applicable), and an expiration time. | required: true 
        - name: tickets | type: array<TicketLineItem> | description: List of ticket line items included in this reservation.  Each line item represents tickets of the same type, pricing option, and seating arrangement. Multiple line items are created when reserving different ticket types or seating sections.  | validation: minItems 1, maxItems 50
           - name: ticketDefinitionId | type: string | description: GUID of the [ticket definition](https://dev.wix.com/docs/api-reference/business-solutions/events/ticket-definitions-v3/introduction.md) being reserved.  | validation: format GUID
           - name: quantity | type: integer | description: Number of tickets to reserve for this line item.  | validation: minimum 1, maximum 50, format int32
           - name: ticketInfo | type: TicketInfo | description: Detailed information about the tickets in this line item.  
              - name: seatId | type: string | description: Unique identifier for the assigned seat at the event venue.  Required for events with assigned seating. Each ticket in the line item can have a different seat assignment within the same section or area.  | validation: minLength 1, maxLength 36
              - name: guestPrice | type: string | description: The guest enters the ticket price. This pricing method is applied to donation.  | validation: format DECIMAL_VALUE, immutable, decimalValue {"maxScale":4}
              - name: pricingOptionId | type: string | description: GUID of the pricing option selected for this ticket.  | validation: format GUID
              - name: pricingPlan | type: PricingPlan | description: Pricing plan benefits applied to this ticket.  Contains information about subscription plan discounts or benefits that affect the ticket pricing for this customer.  
                 - name: orderId | type: string | description: Order GUID of the pricing plan purchase.  References the specific order through which the customer acquired their subscription plan benefits.  | validation: format GUID
                 - name: planId | type: string | description: Unique identifier of the pricing plan.  References the specific subscription plan that grants pricing benefits or discounts for this ticket reservation.  | validation: format GUID
              - name: priceOverride | type: string | description: Override price that replaces the standard ticket price.  Used for promotional pricing, staff discounts, or other special pricing that differs from the standard ticket definition price.  | validation: format DECIMAL_VALUE, immutable, decimalValue {"maxScale":4}
        - name: additionalReservationSettings | type: AdditionalReservationSettings | description: Advanced configuration options that modify default reservation behavior.  Use these settings to override standard validation rules, such as availability limits or hidden ticket restrictions.  | validation: immutable
           - name: disableTicketLimitValidation | type: boolean | description: Whether to bypass ticket availability limits when creating the reservation.  When `true`, allows creating reservations even if tickets appear sold out. Use with caution as this can lead to overselling. Typically used for admin purposes or special circumstances.  
           - name: enableHiddenTicketReservation | type: boolean | description: Whether to allow reservations for tickets marked as hidden.  Hidden tickets are not displayed in the standard ticket selection on the site. Enable this to allow reservations for hidden tickets through direct API calls.  
        - name: extendedFields | type: ExtendedFields | description: Extended fields allow you to add custom properties beyond the standard reservation data.  Learn more about [extended fields](https://dev.wix.com/docs/build-apps/develop-your-app/extensions/backend-extensions/schema-plugins/about-schema-plugin-extensions.md).  
           - 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: tags | type: Tags | description: Tags allow you to classify ticket reservations.  Learn more about [tags](https://dev.wix.com/docs/rest/business-management/tags/introduction.md).  
           - name: privateTags | type: TagList | description: Tags that require an additional permission in order to access them, normally not given to site members or visitors.  
              - name: tagIds | type: array<string> | description: List of tag GUIDs.  | validation: maxItems 100, maxLength 5
           - name: tags | type: TagList | description: Tags that are exposed to anyone who has access to the labeled entity itself, including site members and visitors.  
 Return type: PROMISE<TicketReservation>
  - name: _id | type: string | description: Ticket reservation GUID.  | read-only: true | validation: format GUID
  - name: revision | type: string | description: Revision number, which increments by 1 each time the ticket reservation is updated. To prevent conflicting changes, the current revision must be passed when updating the ticket reservation.  | read-only: true | validation: format int64
  - name: _createdDate | type: Date | description: Date and time the ticket reservation was created.  | read-only: true 
  - name: _updatedDate | type: Date | description: Date and time the ticket reservation was updated.  | read-only: true 
  - name: expirationDate | type: Date | description: Date and time when a `PENDING` ticket reservation will automatically expire if not confirmed.  When a reservation expires, tickets are released back to the available inventory. Expiration time is calculated based on the event's reservation duration settings. To set the reservation duration, call [Create Event](https://dev.wix.com/docs/api-reference/business-solutions/events/events-v3/create-event.md) API.  **Note:** This field only applies to `PENDING` reservations.  | read-only: true 
  - name: status | type: ReservationStatus | description: Reservation status.  | read-only: true 
     - enum:
     -     PENDING: Initial state when tickets are reserved. Will automatically expire after the expiration time if not confirmed.
     -     CONFIRMED: Reservation is confirmed and tickets are secured. No expiration time applies.
     -     CANCELED: Reservation was cancelled due to payment failure or system timeout, and tickets were released back to inventory.
     -     CANCELED_MANUALLY: Reservation was manually cancelled by the site owner, and tickets were released back to inventory.
     -     EXPIRED: Reservation exceeded its expiration time and tickets were released back to inventory.
  - name: memberId | type: string | description: GUID of the site member who created this reservation.  Only returned when the reservation was created by a logged-in site member.  Learn more about [identities](https://dev.wix.com/docs/api-reference/articles/get-started/about-identities.md).  | read-only: true | validation: format GUID
  - name: visitorId | type: string | description: GUID of the site visitor who created this reservation.  Returned for both logged-in members and anonymous visitors.  Learn more about [identities](https://dev.wix.com/docs/api-reference/articles/get-started/about-identities.md).  | read-only: true | validation: format GUID
  - name: tickets | type: array<TicketLineItem> | description: List of ticket line items included in this reservation.  Each line item represents tickets of the same type, pricing option, and seating arrangement. Multiple line items are created when reserving different ticket types or seating sections.  | validation: minItems 1, maxItems 50
     - name: ticketLineItemId | type: string | description: Ticket line item GUID.  | read-only: true | validation: format GUID
     - name: eventId | type: string | description: GUID of the event these tickets are for.  | read-only: true | validation: format GUID
     - name: ticketDefinitionId | type: string | description: GUID of the [ticket definition](https://dev.wix.com/docs/api-reference/business-solutions/events/ticket-definitions-v3/introduction.md) being reserved.  | validation: format GUID
     - name: quantity | type: integer | description: Number of tickets to reserve for this line item.  | validation: minimum 1, maximum 50, format int32
     - name: ticketInfo | type: TicketInfo | description: Detailed information about the tickets in this line item.  
        - name: seatId | type: string | description: Unique identifier for the assigned seat at the event venue.  Required for events with assigned seating. Each ticket in the line item can have a different seat assignment within the same section or area.  | validation: minLength 1, maxLength 36
        - name: seatInfo | type: SeatInfo | description: Detailed seat location information.  Includes section, row, seat number, and other venue-specific identifiers to help customers locate their assigned seats.  | read-only: true 
           - 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: maxLength 20
           - name: areaLabel | type: string | description: General admission or general seating area label.  | read-only: true | validation: maxLength 50
           - name: tableLabel | type: string | description: Table label for events with table seating.  | read-only: true | validation: maxLength 50
           - name: rowLabel | type: string | description: Row label within a section.  | read-only: true | validation: maxLength 50
           - name: seatLabel | type: string | description: Individual seat label within a row or at a table.  | read-only: true | validation: maxLength 4
           - name: configurationId | type: string | description: Seating plan GUID from the Wix Events & Tickets app.  | read-only: true | validation: format GUID
        - name: guestPrice | type: string | description: The guest enters the ticket price. This pricing method is applied to donation.  | validation: format DECIMAL_VALUE, immutable, decimalValue {"maxScale":4}
        - name: pricingOptionId | type: string | description: GUID of the pricing option selected for this ticket.  | validation: format GUID
        - name: pricingOptionName | type: string | description: Display name of the selected pricing option.  | read-only: true | validation: maxLength 200
        - name: pricingPlan | type: PricingPlan | description: Pricing plan benefits applied to this ticket.  Contains information about subscription plan discounts or benefits that affect the ticket pricing for this customer.  
           - name: orderId | type: string | description: Order GUID of the pricing plan purchase.  References the specific order through which the customer acquired their subscription plan benefits.  | validation: format GUID
           - name: planId | type: string | description: Unique identifier of the pricing plan.  References the specific subscription plan that grants pricing benefits or discounts for this ticket reservation.  | validation: format GUID
        - name: priceOverride | type: string | description: Override price that replaces the standard ticket price.  Used for promotional pricing, staff discounts, or other special pricing that differs from the standard ticket definition price.  | validation: format DECIMAL_VALUE, immutable, decimalValue {"maxScale":4}
     - name: removedQuantity | type: integer | description: Number of tickets that are removed from this line item after manually updating reservation in the dashboard.  | read-only: true | validation: minimum 0, maximum 50, format int32
     - name: policy | type: string | description: Terms and conditions that apply to this ticket type.  | read-only: true | validation: minLength 1, maxLength 50000
     - name: ticketName | type: string | description: Display name of the ticket type for this line item.  | read-only: true | validation: minLength 1, maxLength 30
     - name: price | type: Money | description: Price per individual ticket in this line item.  Represents the base price for one ticket before any quantity calculations. This price includes any pricing option discounts but excludes service fees.  | read-only: true 
        - name: value | type: string | description: Monetary amount. Decimal string with a period as a decimal separator (for example, 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 (for example, USD).  | validation: format CURRENCY
     - name: subTotal | type: Money | description: Total price for all tickets in this line item.  Calculated as `price` multiplied by `quantity`. This represents the subtotal for this line item before taxes and service fees are applied.  | read-only: true 
  - name: additionalReservationSettings | type: AdditionalReservationSettings | description: Advanced configuration options that modify default reservation behavior.  Use these settings to override standard validation rules, such as availability limits or hidden ticket restrictions.  | validation: immutable
     - name: disableTicketLimitValidation | type: boolean | description: Whether to bypass ticket availability limits when creating the reservation.  When `true`, allows creating reservations even if tickets appear sold out. Use with caution as this can lead to overselling. Typically used for admin purposes or special circumstances.  
     - name: enableHiddenTicketReservation | type: boolean | description: Whether to allow reservations for tickets marked as hidden.  Hidden tickets are not displayed in the standard ticket selection on the site. Enable this to allow reservations for hidden tickets through direct API calls.  
  - name: extendedFields | type: ExtendedFields | description: Extended fields allow you to add custom properties beyond the standard reservation data.  Learn more about [extended fields](https://dev.wix.com/docs/build-apps/develop-your-app/extensions/backend-extensions/schema-plugins/about-schema-plugin-extensions.md).  
     - 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: tags | type: Tags | description: Tags allow you to classify ticket reservations.  Learn more about [tags](https://dev.wix.com/docs/rest/business-management/tags/introduction.md).  
     - name: privateTags | type: TagList | description: Tags that require an additional permission in order to access them, normally not given to site members or visitors.  
        - name: tagIds | type: array<string> | description: List of tag GUIDs.  | validation: maxItems 100, maxLength 5
     - name: tags | type: TagList | description: Tags that are exposed to anyone who has access to the labeled entity itself, including site members and visitors.  

 Possible Errors:
   HTTP Code: 404 | Status Code: NOT_FOUND | Application Code: UNSUPPORTED_PRICING_OPTION | Description: none
   HTTP Code: 404 | Status Code: NOT_FOUND | Application Code: EVENT_NOT_FOUND | Description: none
   HTTP Code: 404 | Status Code: NOT_FOUND | Application Code: TICKET_DEFINITION_NOT_FOUND | Description: none


```

### Examples

### createTicketReservation
```javascript
import { ticketReservations } from '@wix/events';

async function createTicketReservation(ticketReservation) {
  const response = await ticketReservations.createTicketReservation(ticketReservation);
};
```

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

async function myCreateTicketReservationMethod(ticketReservation) {
  const elevatedCreateTicketReservation = auth.elevate(ticketReservations.createTicketReservation);
  const response = await elevatedCreateTicketReservation(ticketReservation);
}
```

### createTicketReservation (self-hosted)
Self-hosted 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 { ticketReservations } from '@wix/events';
// Import the auth strategy for the relevant access type
// Import the relevant host module if needed

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


async function createTicketReservation(ticketReservation) {
  const response = await myWixClient.ticketReservations.createTicketReservation(ticketReservation);
};
```

---