RECIPE: Attend an Event

When to use this recipe

  • "What's happening next month?" / "Which events are free?" / "Show me only the Community events"
  • "Tell me about the retreat: when, where, how much?"
  • "I'd like to come to Open Studio Night, I'm Dana Cohen…" (RSVP yes) / "I can't make it after all" (RSVP no)
  • "Get me 2 Early Bird tickets" / "Are there tickets left?"
  • "Add it to my calendar"

Inputs you need

InputHow to get it
Visitor tokenSTEP 1
Event id, slug, registration.initialType (RSVP or TICKETING), dates, location, categories, calendar linksSTEP 2
Ticket definition ids and prices (ticketed events)STEP 3
Guest first name, last name, email (RSVP) — the form is built in, do not invent extra fieldsAsk the visitor
reservationId (tickets)STEP 5

Decision tree

  • "What's on?" / "Which are free?" → STEP 1 + STEP 2. Free = registration.initialType === "RSVP".
  • "Only the events" → STEP 2 with fields: ["CATEGORIES"], filter client-side on categories.categories[].name.
  • "Tell me about X / how much are tickets?" → STEP 2 + STEP 3 (ticketed only).
  • "I'll come" / "I can't come" (free event) → STEP 2 → STEP 4. status: "YES"; "NO" only when registration.rsvp.responseType === "YES_AND_NO".
  • "Get me N tickets" → STEP 2 → STEP 3 → STEP 5 → STEP 6. Expect the payment gate on sites without a payment provider (Common errors #4).
  • "Add to calendar" → STEP 2: calendarUrls.google / calendarUrls.ics.

Date and time rules

  • dateAndTimeSettings.formatted.dateAndTime is already a human string in the event's timezone (e.g. October 24, 2026, 9:00 AM – 1:30 PM GMT+3) — quote it as is.
  • dateAndTimeSettings.startDate is UTC; use it only for sorting and for "next month" arithmetic in the business timezone (GetBusinessDetailstimeZone).
  • Never list past events: filter status to UPCOMING/STARTED.

STEP 1: Get a visitor token

GenerateVisitorToken once; reuse it.


STEP 2: List or find events

POST https://www.wixapis.com/events/v3/events/query

Copy

Filtering by slug in the query returned nothing on this site — fetch the upcoming list and match slug/title client-side.

Copy

STEP 3: Ticket types and prices (ticketed events)

POST https://www.wixapis.com/events/v1/checkout/available-tickets/query — the visitor-public read. ticket-definitions endpoints are management-only and 403 the visitor.

Copy
Copy

Remaining stock is not exposed to visitors — answer "on sale" / "sale ended", never a count. Empty definitions with saleStatus missing means sold out or not yet on sale.


STEP 4: RSVP to a free event

POST https://www.wixapis.com/events/v2/rsvps — body must be wrapped in rsvp.

Copy

{ "rsvp": { "id": "…", "status": "YES", "email": "dana@example.com", … } }. Tell the visitor a confirmation email is on its way. Use "status": "NO" only when the event's rsvp.responseType is YES_AND_NO.


STEP 5: Reserve paid tickets

POST https://www.wixapis.com/events/v1/ticket-reservations — body must be wrapped in ticketReservation.

Copy

Success → { "id": "<reservationId>", "status": "PENDING", "expires": "…" } (held ~20 minutes). On a site with no payment provider the same call returns 403 { "message": "No payment method configured" } — that is a site-owner setting, not a bug; tell the visitor tickets aren't on sale online yet and offer the contact details from GetBusinessDetails.


STEP 6: Send the visitor to the ticket checkout

POST https://www.wixapis.com/_api/redirects-api/v1/redirect-session

Copy

redirectSession.fullUrl. Never hand-build /event-details/<slug>/ticket-form (404 on headless sites) and never call the legacy POST /events/v1/checkout to pay inline.


Common errors and how to avoid them

1. ExecuteWixAPI masks the real error as "Visitor token rejected (HTTP 403)"

Both the 400 ticketReservation must not be empty and the 403 No payment method configured came back as a token error from the sandbox. Re-run the single call with CallWixSiteAPI to read the real message before deciding what to tell the visitor.

2. 400 rsvp.firstName must not be empty / ticketReservation must not be empty

You sent a flat body. Wrap: { "rsvp": { … } } and { "ticketReservation": { "tickets": [ … ] } }.

3. POST /events/v1/tickets/available/query → 404

The visitor read is POST /events/v1/checkout/available-tickets/query. Docs search "available tickets" lists it as Query Available Tickets.

4. 403 No payment method configured on ticket reservation

Expected on sites without a payment provider / premium plan. Do not retry with another token; explain and point to the business contact.

5. Query by slug returns events: []

Query the upcoming list and match client-side.

6. Listing categories through /events/v1/categories

Management-only. Request fields: ["CATEGORIES"] on the event query and read categories.categories[].name.


Constants

ConstantValue
Wix Events app id140603ad-af8d-84a5-2c80-a0f60cb47351
Events query fields["DETAILS", "TEXTS", "REGISTRATION", "URLS", "CATEGORIES"]

References

Last updated: 17 September 2026

Did this help?