Introduction
With the Wix Events v2 API you can create and manage events on your site. This API can be used to create sites for concerts, sport camps, city tours, weddings, and so on.
The Wix Events v2 API allows you to:
- Create/clone an event. Create an event by defining some properties, such as location, date and time, registration type, etc. In case you have several similar events, you don't have to create a new one each time. You can quickly clone an existing event and refine it by changing some of the properties.
- Update event with the newest information about the event.
- Publish draft event if you initially created an event as a draft.
- List events by category to have a full list of events that belong to the same category.
- Get/Query events to get information about each individual event that matches a filter.
- Bulk delete/cancel events by filter. Save time and effort when managing event by removing/canceling multiple events at once based on specific filters.
More about events
The main defining characteristics for events are:
-
Registration types. These registration types define what type of event they are registering for:
- Ticketing: Customers register by buying tickets. You can create and sell tickets, set currency, handle taxes. For more information, see the Ticket Definitions API.
- RSVP: Customers register by responding with an RSVP without buying tickets. Invitees can RSVP whether they're going to an event. If the guest limit is reached, you can open a waitlist. Additionally, user can set whether guests can see other guests attending the event.
- External: Customers register by either buying tickets or RSVPing on an external platform. You can display events on your site, while enabling ticket sales or RSVP management through an external platform.
- No registration: Customers do not register. This is for displaying events only.
-
Date and time. When defining an event, the event must have a date and time. The event can be either single, or recurring:
- Single event: Happens once and can last multiple days, like a 3-day conference.
- Recurring event: A series of events that repeat, like a workshop that happens once a week. Once you publish the recurring event, you can manage the dates for each individual separately.
-
Location. The event can happen in:
- Physical location: The event happens in a specific venue or physical space, like a conference hall or concert venue.
- Online: The event happens online through a video conference.
When defining event registration
- All events initially have a
registration.type
of eitherRSVP
orTICKETING
, which is the same as theregistration.initialType
property (this property remains unchanged). - To manage event registration externally using another platform, provide an external event registration URL in the
registration.external.url
field. After doing this, the registration type becomesEXTERNAL
, and directs guests to the specified external URL for registration. The existing guest list, originally managed by the Events API, still exists but no longer is maintained by the API. Make sure to manage the guest list from the external platform. - To indicate that guests do not need to register for the event, you can set the
registration.registrationDisabled
property totrue
. After doing this, theregistration.type
value becomesNONE
.
Terminology
- Event: A gathering that an individual or a business holds for a group of people.
- RSVP: A response from the guest indicating whether they plan to attend the event.
- Registration: The process by which individuals sign up to attend an event.
- Attendee: An individual who plans, to or has registered to, participate in an event.
- Category: A classification assigned to events based on their purpose or theme.
- Organizer: The person or entity responsible for planning and hosting the event.
- TBD: Event locations and dates can be “to be determined” yet the event can still be created and offered.
Setup
To use the WixEventsV2 API, install the @wix/events
package using npm or Yarn:
1npm install @wix/events
or
1yarn add @wix/events
Then import { wixEventsV2 }
from @wix/events
:
1import { wixEventsV2 } from '@wix/events'
Cancels multiple events that meet the given criteria.
After cancellation, registration for an event is closed. To reuse the event, clone and publish it again. If event cancellation notifications are enabled, canceling an event automatically triggers the sending of cancellation emails and/or push notifications to registered guests.
Permission Scopes
For app development, you must have one of the following permission scopes:function bulkCancelEventsByFilter(options: BulkCancelEventsByFilterOptions): Promise<void>
Optional fields.
Counts events by status.
Permission Scopes
For app development, you must have one of the following permission scopes:function countEventsByStatus(options: CountEventsByStatusOptions): Promise<CountEventsByStatusResponse>
Optional fields.
Creates an event.
The event includes a default registration form in the selected language, which consists of input fields for first name, last name, and email. See Registration Form for more information.
You can create the event as a draft by setting the draft value to true. Otherwise, the event is published right away.
The event is automatically set up to send daily summary reports of new guests to your business email.
Permission Scopes
For app development, you must have one of the following permission scopes:function createEvent(event: V3Event, options: CreateEventOptions): Promise<V3Event>
Event data.
Optional fields.
Finds an event by ID or URL slug.
Unlike the getEvent
function, which returns a "not found" error, findEvent()
returns an empty response when an event is not found.
Permission Scopes
For app development, you must have one of the following permission scopes:function findEvent(options: FindEventOptions): Promise<FindEventResponse>
Optional fields.
Retrieves an event by ID.
Permission Scopes
For app development, you must have one of the following permission scopes:function getEvent(eventId: string, options: GetEventOptions): Promise<V3Event>
Event ID.
Optional fields.
Retrieves an event by the slug
URL.
The slug is the end of an event URL that refers to a specific event. For example, if an events' URL is https://example.com/events/event/{my-event-slug}
, the slug is my-event-slug
.
Permission Scopes
For app development, you must have one of the following permission scopes:function getEventBySlug(slug: string, options: GetEventBySlugOptions): Promise<GetEventBySlugResponse>
URL slug.
Optional fields.
Creates a query to retrieve a list of events.
The queryEvents()
function builds a query to retrieve a list of events and returns a EventsQueryBuilder
object.
The returned object contains the query definition, which is typically used to run the query using the find()
function.
You can refine the query by chaining EventsQueryBuilder
functions onto the query. EventsQueryBuilder
functions enable you to sort, filter, and control the results queryEvents()
returns.
queryEvents()
runs with these EventsQueryBuilder
defaults, which you can override:
The functions that are chained to queryEvents()
are applied in the order they're called. For example, if you apply ascending('title')
and then descending('status')
, the results are sorted first by the title
, and then, if there are multiple results with the same title
, the items are sorted by status
.
PROPERTY | SUPPORTED FILTERS & SORTING |
---|---|
_id | eq() ,ne() ,in() ,ascending() ,descending() |
dateAndTimeSettings.startDate | eq() ,ne() ,lt() ,le() ,gt() ,ge() ,in() ,ascending() ,descending() |
dateAndTimeSettings.endDate | eq() ,ne() ,lt() ,le() ,gt() ,ge() ,in() ,ascending() ,descending() |
title | eq() ,ne() ,in() ,ascending() ,descending() |
slug | eq() ,ne() ,in() ,ascending() ,descending() |
_createdDate | eq() ,ne() ,lt() ,le() ,gt() ,ge() ,in() ,ascending() ,descending() |
_updatedDate | eq() ,ne() ,lt() ,le() ,gt() ,ge() ,in() ,ascending() ,descending() |
status | eq() ,ne() ,in() |
registration.initialType | eq() |
userId | eq() ,ne() ,in() |
Permission Scopes
For app development, you must have one of the following permission scopes:function queryEvents(options: QueryEventsOptions): EventsQueryBuilder
Optional fields.