> 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

# Package: ticketing

# Namespace: tickets

# Webhook link: https://dev.wix.com/docs/api-reference/business-solutions/events/registration/ticketing/tickets/order-updated.md

# Webhook Permissions Scopes IDs:
Read Basic Events Order Info: SCOPE.DC-EVENTS.READ-BASIC-ORDERS

## REST API

### Schema

```
Webhook: Order Updated
Description: 
Payload: OrderUpdated
  - name: timestamp | type: string | description: Date and time the order was updated.
  - name: language | type: string | description: Site language when the order was initiated.
  - name: locale | type: string | description: Locale in which the order was created.
  - name: eventId | type: string | description: Event GUID to which the order belongs.
  - name: orderNumber | type: string | description: Unique order number.
  - name: contactId | type: string | description: Contact GUID associated with the order.
  - name: memberId | type: string | description: Member GUID associated with the order.
  - name: created | type: string | description: Date and time the order was created.
  - name: updated | type: string | description: Date and time the order was updated.
  - name: firstName | type: string | description: Buyer first name.
  - name: lastName | type: string | description: Buyer last name.
  - name: email | type: string | description: Buyer email.
  - name: checkoutForm | type: FormResponse | description: Checkout form response.
     - name: inputValues | type: array<InputValue> | description: Form field inputs.
        - name: inputName | type: string | description: Form field input name.
        - name: value | type: string | description: Form field value.
        - name: values | type: array<string> | description: Form field values.
  - name: confirmed | type: boolean | description: Whether order is confirmed - occurs once payment gateway processes the payment and funds reach merchant's account.
  - name: status | type: OrderStatus | description: Order status.
     - enum:
     -     NA_ORDER_STATUS: Order status isn't available for this request fieldset.
     -     FREE: Order is confirmed, no payment is required.
     -     PENDING: Order was paid, but the payment gateway suspended the payment.
     -     PAID: Order is paid.
     -     OFFLINE_PENDING: Order is confirmed but must be paid via offline payment. Status needs to be manually updated to `"PAID"`.
     -     INITIATED: Order is waiting for payment at the cashier.
     -     CANCELED: Order is canceled.
     -     DECLINED: Order payment is declined.
     -     AUTHORIZED: Order payment is authorized.
     -     VOIDED: Order payment is voided.
     -     PARTIALLY_PAID: Order is partially paid with less than the total amount.
  - name: method | type: string | description: Payment method used for paid tickets purchase, i.e. "payPal", "creditCard", etc.
  - name: tickets | type: array<Ticket> | description: Tickets generated after payment.
     - name: ticketNumber | type: string | description: Unique issued ticket number.
     - name: ticketDefinitionId | type: string | description: Ticket definition GUID.
     - name: checkIn | type: CheckIn | description: Ticket check-in.
        - name: created | type: string | description: Time of a ticket's check-in.
     - 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`.
        - 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.
     - name: archived | type: boolean | description: Whether ticket is archived.
     - name: firstName | type: string | description: Guest first name.
     - name: lastName | type: string | description: Guest last name.
     - name: email | type: string | description: Guest email.
     - name: contactId | type: string | description: Contact GUID associated with this ticket.
     - name: confirmed | type: boolean | description: Whether ticket is confirmed
     - name: memberId | type: string | description: Member GUID associated with this ticket.
     - name: form | type: FormResponse | description: Ticket form response (only assigned tickets contain separate forms).
     - name: ticketName | type: string | description: Ticket name.
     - name: anonymized | type: boolean | description: Anonymized tickets no longer contain personally identifiable information (PII).
     - name: onlineConferencingLogin | type: OnlineConferencingLogin | description: URL and password to online conference
        - name: link | type: string | description: Link URL to the online conference.
        - name: password | type: string | description: Password for the online conference.
     - name: seatId | type: string | description: Seat GUID associated with this ticket.
     - name: canceled | type: boolean | description: Whether ticket is canceled.
  - name: archived | type: boolean | description: Whether order was archived and excluded from results.
  - name: triggeredByAnonymizeRequest | type: boolean | description: Whether event was triggered by GDPR delete request.

```

### Examples


```curl
{
  "timestamp": "2020-04-28T12:24:29.768Z",
  "eventId": "566e7be9-1410-4095-ae7a-349a4ac95c6b",
  "orderNumber": "FMXC-BZG3-OT",
  "contactId": "eea3ac0f-f9e6-4ed3-a135-99743c8e90b8",
  "memberId": "b272b0bb-d013-415a-8461-e8a175fe8dc6",
  "created": "2020-04-28T12:23:51.523Z",
  "firstName": "John",
  "lastName": "Doe",
  "email": "john.doe@somedomain.com",
  "confirmed": true,
  "status": "PAID",
  "method": "payPal",
  "archived": false,
  "checkoutForm": {
    "inputValues": [
      {
        "inputName": "firstName",
        "value": "John"
      },
      {
        "inputName": "lastName",
        "value": "Doe"
      },
      {
        "inputName": "email",
        "value": "john.doe@somedomain.com"
      }
    ]
  },
  "tickets": [
    {
      "ticketNumber": "FMXC-BZG3-OT021",
      "ticketDefinitionId": "d72874cb-012a-4ad2-afbb-57fe8cf1e308",
      "checkIn": {
        "created": "2020-04-28T12:24:20.102Z"
      },
      "price": {
        "amount": "123.00",
        "currency": "USD"
      },
      "archived": false,
      "firstName": "John",
      "lastName": "Doe",
      "email": "john.doe@somedomain.com",
      "contactId": "eea3ac0f-f9e6-4ed3-a135-99743c8e90b8",
      "memberId": "b272b0bb-d013-415a-8461-e8a175fe8dc6",
      "confirmed": true,
      "form": {
        "inputValues": [
          {
            "inputName": "custom",
            "value": "Another comment"
          },
          {
            "inputName": "email",
            "value": "john.doe@somedomain.com"
          },
          {
            "inputName": "lastName",
            "value": "Doe"
          },
          {
            "inputName": "firstName",
            "value": "John"
          },
          {
            "inputName": "date",
            "value": "2020-04-28"
          },
          {
            "inputName": "comment",
            "value": "Comment"
          },
          {
            "inputName": "address",
            "values": [
              "Wix Playground, 100 Gansevoort St",
              "New York City",
              "New York",
              "USA",
              "NY 10014"
            ]
          },
          {
            "inputName": "phone",
            "value": "(555) 555-1234"
          }
        ]
      }
    },
    {
      "ticketNumber": "FMXC-BZG3-OT041",
      "ticketDefinitionId": "9c3dc432-f1a6-408f-82d8-4f64c7ff581b",
      "price": {
        "amount": "0.00",
        "currency": "USD"
      },
      "archived": false,
      "firstName": "Jane",
      "lastName": "Doe",
      "email": "jane.doe@somedomain.com",
      "contactId": "e11af3d4-c205-4d3a-b687-58d4dda78a6c",
      "memberId": "62bc4004-548c-46ad-a699-55ef307273e3",
      "confirmed": true,
      "form": {
        "inputValues": [
          {
            "inputName": "custom",
            "value": "Another comment"
          },
          {
            "inputName": "email",
            "value": "jane.doe@somedomain.com"
          },
          {
            "inputName": "lastName",
            "value": "Doe"
          },
          {
            "inputName": "firstName",
            "value": "Jane"
          },
          {
            "inputName": "date",
            "value": "2020-04-28"
          },
          {
            "inputName": "comment",
            "value": "Comment"
          },
          {
            "inputName": "address",
            "values": [
              "Wix Playground, 100 Gansevoort St",
              "New York City",
              "New York",
              "USA",
              "NY 10014"
            ]
          },
          {
            "inputName": "phone",
            "value": "(555) 555-1234"
          }
        ]
      }
    }
  ]
}

```

---

## JavaScript SDK

### Schema

```
Webhook: onTicketOrderUpdated
Description: 
Payload: TicketOrderUpdatedEnvelope
  - name: data | type: OrderUpdated | description: none
     - name: timestamp | type: Date | description: Date and time the order was updated.
     - name: language | type: string | description: Site language when the order was initiated.
     - name: locale | type: string | description: Locale in which the order was created.
     - name: eventId | type: string | description: Event GUID to which the order belongs.
     - name: orderNumber | type: string | description: Unique order number.
     - name: contactId | type: string | description: Contact GUID associated with the order.
     - name: memberId | type: string | description: Member GUID associated with the order.
     - name: created | type: Date | description: Date and time the order was created.
     - name: updated | type: Date | description: Date and time the order was updated.
     - name: firstName | type: string | description: Buyer first name.
     - name: lastName | type: string | description: Buyer last name.
     - name: email | type: string | description: Buyer email.
     - name: checkoutForm | type: FormResponse | description: Checkout form response.
        - name: inputValues | type: array<InputValue> | description: Form field inputs.
           - name: inputName | type: string | description: Form field input name.
           - name: value | type: string | description: Form field value.
           - name: values | type: array<string> | description: Form field values.
     - name: confirmed | type: boolean | description: Whether order is confirmed - occurs once payment gateway processes the payment and funds reach merchant's account.
     - name: status | type: OrderStatus | description: Order status.
         - enum:
         -     NA_ORDER_STATUS: Order status isn't available for this request fieldset.
         -     FREE: Order is confirmed, no payment is required.
         -     PENDING: Order was paid, but the payment gateway suspended the payment.
         -     PAID: Order is paid.
         -     OFFLINE_PENDING: Order is confirmed but must be paid via offline payment. Status needs to be manually updated to `"PAID"`.
         -     INITIATED: Order is waiting for payment at the cashier.
         -     CANCELED: Order is canceled.
         -     DECLINED: Order payment is declined.
         -     AUTHORIZED: Order payment is authorized.
         -     VOIDED: Order payment is voided.
         -     PARTIALLY_PAID: Order is partially paid with less than the total amount.
     - name: method | type: string | description: Payment method used for paid tickets purchase, i.e. "payPal", "creditCard", etc.
     - name: tickets | type: array<Ticket> | description: Tickets generated after payment.
        - name: ticketNumber | type: string | description: Unique issued ticket number.
        - name: ticketDefinitionId | type: string | description: Ticket definition GUID.
        - name: checkIn | type: CheckIn | description: Ticket check-in.
           - name: created | type: Date | description: Time of a ticket's check-in.
        - 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`.
           - 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.
        - name: archived | type: boolean | description: Whether ticket is archived.
        - name: firstName | type: string | description: Guest first name.
        - name: lastName | type: string | description: Guest last name.
        - name: email | type: string | description: Guest email.
        - name: contactId | type: string | description: Contact GUID associated with this ticket.
        - name: confirmed | type: boolean | description: Whether ticket is confirmed
        - name: memberId | type: string | description: Member GUID associated with this ticket.
        - name: form | type: FormResponse | description: Ticket form response (only assigned tickets contain separate forms).
        - name: ticketName | type: string | description: Ticket name.
        - name: anonymized | type: boolean | description: Anonymized tickets no longer contain personally identifiable information (PII).
        - name: onlineConferencingLogin | type: OnlineConferencingLogin | description: URL and password to online conference
           - name: link | type: string | description: Link URL to the online conference.
           - name: password | type: string | description: Password for the online conference.
        - name: seatId | type: string | description: Seat GUID associated with this ticket.
        - name: canceled | type: boolean | description: Whether ticket is canceled.
     - name: archived | type: boolean | description: Whether order was archived and excluded from results.
     - name: triggeredByAnonymizeRequest | type: boolean | description: Whether event was triggered by GDPR delete request.
  - name: metadata | type: BaseEventMetadata | description: none
     - name: instanceId | type: string | description: App instance GUID.
     - name: eventType | type: string | description: Event type.
     - name: identity | type: IdentificationData | description: The identification type and identity data.
        - ONE-OF:
           - name: anonymousVisitorId | type: string | description: GUID of a site visitor that has not logged in to the site.
           - name: memberId | type: string | description: GUID of a site visitor that has logged in to the site.
           - name: wixUserId | type: string | description: GUID of a Wix user (site owner, contributor, etc.).
           - name: appId | type: string | description: GUID of an app.
        - name: identityType | type: WebhookIdentityType | description: 
             - enum: UNKNOWN, ANONYMOUS_VISITOR, MEMBER, WIX_USER, APP
     - name: accountInfo | type: AccountInfo | description: Details related to the account
        - name: accountId | type: string | description: GUID of the Wix account associated with the event.
        - name: parentAccountId | type: string | description: GUID of the parent Wix account. Only included when accountId belongs to a child account.
        - name: siteId | type: string | description: GUID of the Wix site associated with the event. Only included when the event is tied to a specific site.

```

### Examples


```javascript
import { tickets } from '@wix/events';

tickets.onTicketOrderUpdated((event) => {
    // handle your event here
});
```


```javascript
import { createClient, AppStrategy } from '@wix/sdk';
import { tickets } from '@wix/events';

const wixClient = createClient({
  auth: AppStrategy({
    appId: 'MY-APP-ID',
    publicKey: 'YOUR_APP_PUBLIC_KEY',
  }),
  modules: {
      tickets,
    },
});

wixClient.tickets.onTicketOrderUpdated((event) => {
    // handle your event here
});
```

---