Use the Tickets API to create custom ticketing experiences for your events.
You need to have at least one existing event before getting started.
- In the Dashboard, create at least one ticket for an event.
- Retrieve the ID of an event from the Events/Events collection.
- Retrieve the IDs of event tickets from the Events/Tickets collection using the event ID retrieved above.
- Get the event
getForm()function with the event ID retrieved above.
- Retrieve information about the registration form inputs in the form using the
- In the Editor, add user input elements for each form input retrieved above. You may want to set the elements IDs to match the names of form inputs retrieved above so that you will not have to map the names later.
- In the Editor, add elements to display the available tickets and add input elements for site visitors to select tickets.
- In the Editor, add a button that will be used to reserve ticket a site visitor selects.
- When the reserve button is clicked, gather the selected tickets
and use the
reserve()function to reserve the tickets. The function creates a reservation ID to be used later.
- In the Editor, add a button that will be used to checkout reserved tickets.
- When the checkout button is clicked, gather the values entered into the form in
FormValuearray and use
checkout()function to checkout the reservation. The function creates an order.
- Use the payment ID from the order created above to call the Wix Pay API's
startPayment()function to complete the payment process.
- Display the link to the tickets as a PDF.
Was this helpful?