The event ticket registration flow is clear in the API documentation: Reserve tickets → Validate form → Checkout → Update order.
And wixEvents . tickets . reserve() allows us to reserve more than one type of ticket at a time. However, wixEvents . tickets . checkout() does not allow for more than one form to be submitted!
If I have two tickets:
let tickets = [{
"ticketId": "c16d5d89-a7af-4718-b700-74dc586ec7e8",
"quantity": 1
},
{
"ticketId": "410b9922-fde2-491c-ab1c-00677229e8c1",
"quantity": 1
}
];
I can reserve them and get back a reservation ID successfully:
let reservationId = await wixEvents.tickets.reserve(eventId, tickets)
The event in the backend requires guests to “Fill out a registration form for each ticket in an order”.
So I for these two tickets I have two formValues arrays setup (as per the docs), along with the reservation ID, that should be enough to checkout the tickets:
let orderNumber = await wixEvents.tickets.checkout(eventId, reservationId, {
"formValues": formValues
})
HOWEVER, tickets.checkout only takes one array of formValues, not an array of formValues as it should, given there are more than one ticket types reserved. As a result, I get this error:
{“message”: “Guests forms size must be equal to tickets quantity: 1 != 2”,“details”:{“error_key”:“INVALID_REQUEST”}
How are we supposed to register more than one guest using the API?