> 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 # QueryEventGuests # Package: registration # Namespace: EventGuestsService # Method link: https://dev.wix.com/docs/api-reference/business-solutions/events/registration/event-guests/query-event-guests.md ## Permission Scopes: Read Event Tickets and Guest List: SCOPE.DC-EVENTS.READ-GUEST-LIST ## Introduction Retrieves a list of guests given the provided paging, filtering, and sorting. Query Event Guests runs with these defaults, which you can override: - `createdDate` is sorted in `ASC` order - `paging.limit` is `100` - `paging.offset` is `0` To learn about working with _Query_ endpoints, see [API Query Language](https://dev.wix.com/api/rest/getting-started/api-query-language), [Sorting and Paging](https://dev.wix.com/api/rest/getting-started/pagination), and [Field Projection](https://dev.wix.com/api/rest/getting-started/field-projection). --- ## REST API ### Schema ``` Method: queryEventGuests Description: Retrieves a list of guests given the provided paging, filtering, and sorting. Query Event Guests runs with these defaults, which you can override: - `createdDate` is sorted in `ASC` order - `paging.limit` is `100` - `paging.offset` is `0` To learn about working with _Query_ endpoints, see [API Query Language](https://dev.wix.com/api/rest/getting-started/api-query-language), [Sorting and Paging](https://dev.wix.com/api/rest/getting-started/pagination), and [Field Projection](https://dev.wix.com/api/rest/getting-started/field-projection). URL: https://www.wixapis.com/events/v2/guests/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 | description: Predefined sets of fields to return. - enum: - GUEST_DETAILS: Returns `guestDetails` and `tickets`. - GUEST_TOTAL: Returns `totalGuests`. param name: query | type: QueryV2 | required: true - ONE-OF: - required: true - name: paging | type: Paging | description: Paging options to limit and skip the number of items. - name: limit | type: integer | description: Number of items to load. - name: offset | type: integer | description: Number of items to skip in the current sort order. - 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`. - name: limit | type: integer | description: Maximum number of items to return in the results. - name: cursor | type: string | description: Pointer to the next or previous page in the list of results. Pass the relevant cursor token from the `pagingMetadata` object in the previous call's response. Not relevant for the first request. - name: filter | type: object | description: Filter object in the following format:
`"filter" : { "fieldName1": "value1", "fieldName2":{"$operator":"value2"} }`.

**Example:**
`"filter" : { "eventId": "sd3f-jhds-4fs77", "ticketNumber": {"$startsWith":"478"} }`

See [supported fields and operators](https://dev.wix.com/api/rest/wix-events/wix-events/filter-and-sort) for more information. - name: sort | type: array | description: Sort object in the following format:
`[{"fieldName":"sortField1"},{"fieldName":"sortField2","direction":"DESC"}]`

**Example:**
`[{"fieldName":"createdDate","direction":"DESC"}]`

See [supported fields](https://dev.wix.com/api/rest/wix-events/wix-events/filter-and-sort) for more information. - name: fieldName | type: string | description: Name of the field to sort by. - name: order | type: SortOrder | description: Sort order. - enum: ASC, DESC Return type: QueryEventGuestsResponse - name: guests | type: array | description: List of guests. - name: id | type: string | description: Guest GUID. - name: eventId | type: string | description: Event GUID. - name: rsvpId | type: string | description: RSVP GUID.

**Note:** Only applicable when `guestType` is `"RSVP"`. - name: orderNumber | type: string | description: Order number.

**Note:** Only applicable when `guestType` is `"BUYER"` or `"TICKET_HOLDER"`. - name: ticketNumber | type: string | description: Ticket number.

**Note:** Only applicable when `guestType` is `"TICKET_HOLDER"`. - name: tickets | type: array | description: List of names, numbers, and definition GUIDs for each ticket. - name: number | type: string | description: Ticket number. - name: definitionId | type: string | description: Ticket definition GUID. - name: name | type: string | description: Ticket name. - name: contactId | type: string | description: Guest's contact GUID. See the Contacts API for more details. - name: guestDetails | type: GuestDetails | description: Guest details.

Returned only when the `guestDetails` fieldset is sent in the request. - name: email | type: string | description: Email. - name: firstName | type: string | description: First name. - name: lastName | type: string | description: Last name. - name: formResponse | type: FormResponse | description: Form response. - name: inputValues | type: array | 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 | description: Form field values. - name: checkedIn | type: boolean | description: Whether the guest has checked into the event. - name: onlineConferencingLogin | type: OnlineConferencingLogin | description: The login details for the guest to access the online conference event. - name: link | type: string | description: Link URL to the online conference. - name: password | type: string | description: Password for the online conference. - name: phone | type: string | description: Phone extracted from form response. If multiples phone inputs are present, first one is returned. - name: address | type: string | description: Address extracted from form response. If multiples address inputs are present, first one is returned. - name: attendanceStatus | type: AttendanceStatus | description: Attendance status. The attendance status updates based on status values in an RSVP object (for RSVP events) or in an Order object (for ticketed events). For more information, see [Guest Attendance Status Mapping](https://dev.wix.com/docs/api-reference/business-solutions/events/registration/event-guests/guest-attendance-status-mapping.md).

**Note:** For `guestType` of `"BUYER"` or `"TICKET_HOLDER"` the `"IN_WAITLIST"` value is not applicable. - enum: - NOT_ATTENDING: Not attending. - ATTENDING: Attending. - IN_WAITLIST: In a waiting list. - name: secondaryLanguageCode | type: string | description: Secondary language code in [ISO 639-1](https://en.wikipedia.org/wiki/List_of_ISO_639-1_codes) format. Used when the event ticket should be translated into another language. - name: createdDate | type: string | description: Date and time the guest was created in `yyyy-mm-ddThh:mm:sssZ` format. - name: updatedDate | type: string | description: Date and time the guest was updated in `yyyy-mm-ddThh:mm:sssZ` format. - name: attendanceStatusUpdatedDate | type: string | description: Date and time of guest's latest attendance status update. - name: memberId | type: string | description: Site member GUID. - name: guestType | type: GuestType | description: Guest type. - enum: - RSVP: An invited guest, no ticket necessary. - BUYER: The guest who bought the ticket. - TICKET_HOLDER: The guest for whom the ticket was bought. - name: locale | type: string | description: Locale in [IETF BCP 47](https://en.wikipedia.org/wiki/IETF_language_tag) format. Used when the event date and time on a ticket should be formatted into another locale. - name: totalGuests | type: integer | description: Number of total guests in an event (registered guests + additional ones). - name: revision | type: string | description: Revision number, which increments by 1 each time the guest is updated. - name: additionalDetails | type: AdditionalDetails | description: Additional Details - name: createdDate | type: string | description: Date and time the source entity (RSVP or Order) was created. - name: updatedDate | type: string | description: Date and time the source entity (RSVP or Order) was updated. - name: rsvpStatus | type: RsvpStatus | description: Rsvp Status - enum: - YES: Guest is attending the event. - NO: Guest isn't attending the event. - WAITLIST: Guest is on a waitlist. - name: orderStatus | type: OrderStatus | description: Order Status - enum: - UNKNOW_ORDER_STATUS: Order status is not 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 has be paid via offline payment. Status needs to be manually updated to `"PAID"`. - INITIATED: Order is awaiting 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: pagingMetadata | type: PagingMetadataV2 | description: Metadata for the paginated results. - name: count | type: integer | description: Number of items returned in the response. - name: offset | type: integer | description: Offset that was requested. - 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. - 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 string pointing to the next page in the list of results. - name: prev | type: string | description: Cursor pointing to the previous page in the list of results. ``` ### Examples ### Query Ticket holder-type guests with guest details ```curl curl -X POST 'https://www.wixapis.com/events/v2/guests/query' \ -H 'Content-Type: application/json' \ -H 'Authorization: ' \ --data-binary '{ "query": { "filter": { "guestType": "TICKET_HOLDER" }, "fieldsets": [ "guestDetails" ], } }' ``` ### Query RSVP-type guests without guest details ```curl curl -X POST 'https://www.wixapis.com/events/v2/guests/query' \ -H 'Content-Type: application/json' \ -H 'Authorization: ' \ --data-binary '{ "query": { "filter": { "guestType": "RSVP" } } }' ``` ### Query buyer-type guests with guest details ```curl curl -X POST 'https://www.wixapis.com/events/v2/guests/query' \ -H 'Content-Type: application/json' \ -H 'Authorization: ' \ --data-binary '{ "query": { "filter": { "guestType": "BUYER" }, "fieldsets": [ "guestDetails" ], "paging": { "limit": 1 } } }' ``` --- ## JavaScript SDK ### Schema ``` Method: wixClientAdmin.registration.EventGuestsService.queryEventGuests(query, options) Description: Retrieves a list of guests given the provided paging, filtering, and sorting. Query Event Guests runs with these defaults, which you can override: - `createdDate` is sorted in `ASC` order - `paging.limit` is `100` - `paging.offset` is `0` To learn about working with _Query_ endpoints, see [API Query Language](https://dev.wix.com/api/rest/getting-started/api-query-language), [Sorting and Paging](https://dev.wix.com/api/rest/getting-started/pagination), and [Field Projection](https://dev.wix.com/api/rest/getting-started/field-projection). # 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: options | type: QueryEventGuestsOptions none - name: fields | type: array | description: Predefined sets of fields to return. - enum: - GUEST_DETAILS: Returns `guestDetails` and `tickets`. - GUEST_TOTAL: Returns `totalGuests`. param name: query | type: GuestQuery | required: true - ONE-OF: - required: true - name: paging | type: Paging | description: Paging options to limit and skip the number of items. - name: limit | type: integer | description: Number of items to load. - name: offset | type: integer | description: Number of items to skip in the current sort order. - 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`. - name: limit | type: integer | description: Maximum number of items to return in the results. - name: cursor | type: string | description: Pointer to the next or previous page in the list of results. Pass the relevant cursor token from the `pagingMetadata` object in the previous call's response. Not relevant for the first request. - name: filter | type: object | description: Filter object in the following format:
`"filter" : { "fieldName1": "value1", "fieldName2":{"$operator":"value2"} }`.

**Example:**
`"filter" : { "eventId": "sd3f-jhds-4fs77", "ticketNumber": {"$startsWith":"478"} }`

See [supported fields and operators](https://dev.wix.com/api/rest/wix-events/wix-events/filter-and-sort) for more information. - name: sort | type: array | description: Sort object in the following format:
`[{"fieldName":"sortField1"},{"fieldName":"sortField2","direction":"DESC"}]`

**Example:**
`[{"fieldName":"createdDate","direction":"DESC"}]`

See [supported fields](https://dev.wix.com/api/rest/wix-events/wix-events/filter-and-sort) for more information. - name: fieldName | type: string | description: Name of the field to sort by. - name: order | type: SortOrder | description: Sort order. - enum: ASC, DESC Return type: PROMISE - name: guests | type: array | description: List of guests. - name: _id | type: string | description: Guest GUID. - name: eventId | type: string | description: Event GUID. - name: rsvpId | type: string | description: RSVP GUID.

**Note:** Only applicable when `guestType` is `"RSVP"`. - name: orderNumber | type: string | description: Order number.

**Note:** Only applicable when `guestType` is `"BUYER"` or `"TICKET_HOLDER"`. - name: ticketNumber | type: string | description: Ticket number.

**Note:** Only applicable when `guestType` is `"TICKET_HOLDER"`. - name: tickets | type: array | description: List of names, numbers, and definition GUIDs for each ticket. - name: number | type: string | description: Ticket number. - name: definitionId | type: string | description: Ticket definition GUID. - name: name | type: string | description: Ticket name. - name: contactId | type: string | description: Guest's contact GUID. See the Contacts API for more details. - name: guestDetails | type: GuestDetails | description: Guest details.

Returned only when the `guestDetails` fieldset is sent in the request. - name: email | type: string | description: Email. - name: firstName | type: string | description: First name. - name: lastName | type: string | description: Last name. - name: formResponse | type: FormResponse | description: Form response. - name: inputValues | type: array | 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 | description: Form field values. - name: checkedIn | type: boolean | description: Whether the guest has checked into the event. - name: onlineConferencingLogin | type: OnlineConferencingLogin | description: The login details for the guest to access the online conference event. - name: link | type: string | description: Link URL to the online conference. - name: password | type: string | description: Password for the online conference. - name: phone | type: string | description: Phone extracted from form response. If multiples phone inputs are present, first one is returned. - name: address | type: string | description: Address extracted from form response. If multiples address inputs are present, first one is returned. - name: attendanceStatus | type: AttendanceStatus | description: Attendance status. The attendance status updates based on status values in an RSVP object (for RSVP events) or in an Order object (for ticketed events). For more information, see [Guest Attendance Status Mapping](https://dev.wix.com/docs/api-reference/business-solutions/events/registration/event-guests/guest-attendance-status-mapping.md).

**Note:** For `guestType` of `"BUYER"` or `"TICKET_HOLDER"` the `"IN_WAITLIST"` value is not applicable. - enum: - NOT_ATTENDING: Not attending. - ATTENDING: Attending. - IN_WAITLIST: In a waiting list. - name: secondaryLanguageCode | type: string | description: Secondary language code in [ISO 639-1](https://en.wikipedia.org/wiki/List_of_ISO_639-1_codes) format. Used when the event ticket should be translated into another language. - name: _createdDate | type: Date | description: Date and time the guest was created in `yyyy-mm-ddThh:mm:sssZ` format. - name: _updatedDate | type: Date | description: Date and time the guest was updated in `yyyy-mm-ddThh:mm:sssZ` format. - name: attendanceStatusUpdatedDate | type: Date | description: Date and time of guest's latest attendance status update. - name: memberId | type: string | description: Site member GUID. - name: guestType | type: GuestType | description: Guest type. - enum: - RSVP: An invited guest, no ticket necessary. - BUYER: The guest who bought the ticket. - TICKET_HOLDER: The guest for whom the ticket was bought. - name: locale | type: string | description: Locale in [IETF BCP 47](https://en.wikipedia.org/wiki/IETF_language_tag) format. Used when the event date and time on a ticket should be formatted into another locale. - name: totalGuests | type: integer | description: Number of total guests in an event (registered guests + additional ones). - name: revision | type: string | description: Revision number, which increments by 1 each time the guest is updated. - name: additionalDetails | type: AdditionalDetails | description: Additional Details - name: _createdDate | type: Date | description: Date and time the source entity (RSVP or Order) was created. - name: _updatedDate | type: Date | description: Date and time the source entity (RSVP or Order) was updated. - name: rsvpStatus | type: RsvpStatus | description: Rsvp Status - enum: - YES: Guest is attending the event. - NO: Guest isn't attending the event. - WAITLIST: Guest is on a waitlist. - name: orderStatus | type: OrderStatus | description: Order Status - enum: - UNKNOW_ORDER_STATUS: Order status is not 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 has be paid via offline payment. Status needs to be manually updated to `"PAID"`. - INITIATED: Order is awaiting 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: pagingMetadata | type: PagingMetadataV2 | description: Metadata for the paginated results. - name: count | type: integer | description: Number of items returned in the response. - name: offset | type: integer | description: Offset that was requested. - 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. - 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 string pointing to the next page in the list of results. - name: prev | type: string | description: Cursor pointing to the previous page in the list of results. ``` ### Examples ### Retrieve all guests (with elevated permissions) ```javascript import { guests } from "@wix/events"; import { auth } from "@wix/essentials"; const elevatedQueryGuests = auth.elevate(guests.queryGuests); /* Sample options value: * * { * "fields": ["GUEST_DETAILS"] * } * */ export async function myQueryGuestsFunction(options) { try { const items = await elevatedQueryGuests(options) .find() console.log('Success! Guests: ', items) return items; } catch (error) { console.error(error); // Handle the error } } /* Promise resolves to: * { * "_items": [ * { * "eventId": "3a80a30c-643d-4b11-b38f-1150dbe7c538", * "orderNumber": "2SVV-RH7C-P3D", * "tickets": [], * "contactId": "c64c558f-ed41-4395-b820-f8dd66c31702", * "guestDetails": { * "email": "johndoe@mail.com", * "firstName": "John", * "lastName": "Doe", * "formResponse": { * "inputValues": [ * { * "inputName": "firstName", * "value": "John", * "values": [] * }, * { * "inputName": "lastName", * "value": "Doe", * "values": [] * }, * { * "inputName": "email", * "value": "johndoe@mail.com", * "values": [] * } * ] * }, * "checkedIn": true * } * ], * "_originQuery": { * "filterTree": { * "$and": [] * }, * "invalidArguments": [], * "encoder": {}, * "transformationPaths": {}, * "sort": [], * "paging": {}, * "pagingMethod": "CURSOR", * "builderOptions": { * "cursorWithEmptyFilterAndSort": true * } * }, * "_limit": 50, * "_nextCursor": "", * "_prevCursor": "", * "cursors": { * "next": "", * "prev": "" * } * } * } */ ``` ### Retrieve all guests ```javascript import { guests } from "@wix/events"; /* Sample options value: * * { * "fields": ["GUEST_DETAILS"] * } * */ export async function myQueryGuestsFunction(options) { try { const items = await guests.queryGuests(options) .find() console.log('Success! Guests: ', items) return items; } catch (error) { console.error(error); // Handle the error } } /* Promise resolves to: * { * "_items": [ * { * "eventId": "3a80a30c-643d-4b11-b38f-1150dbe7c538", * "orderNumber": "2SVV-RH7C-P3D", * "tickets": [], * "contactId": "c64c558f-ed41-4395-b820-f8dd66c31702", * "guestDetails": { * "email": "johndoe@mail.com", * "firstName": "John", * "lastName": "Doe", * "formResponse": { * "inputValues": [ * { * "inputName": "firstName", * "value": "John", * "values": [] * }, * { * "inputName": "lastName", * "value": "Doe", * "values": [] * }, * { * "inputName": "email", * "value": "johndoe@mail.com", * "values": [] * } * ] * }, * "checkedIn": true * } * ], * "_originQuery": { * "filterTree": { * "$and": [] * }, * "invalidArguments": [], * "encoder": {}, * "transformationPaths": {}, * "sort": [], * "paging": {}, * "pagingMethod": "CURSOR", * "builderOptions": { * "cursorWithEmptyFilterAndSort": true * } * }, * "_limit": 50, * "_nextCursor": "", * "_prevCursor": "", * "cursors": { * "next": "", * "prev": "" * } * } * } */ ``` ### queryGuests (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 { guests } from '@wix/events'; // Import the auth strategy for the relevant access type // Import the relevant host module if needed const myWixClient = createClient ({ modules: { guests }, // Include the auth strategy and host as relevant }); async function queryGuests(query,options) { const response = await myWixClient.guests.queryGuests(query,options); }; ``` ---