Search.../

checkout( )

Developer Preview

Checkout reserved tickets. Creates order and associates it with a site contact. Guest details must be sent according to Registration Form input fields. (To change an existing "INITIATED, "PENDING", or "OFFLINE_PENDING" order, call the Update Checkout endpoint).

Note: This function is restricted and only runs if you elevate permissions using the wix-auth.elevate() function.

Syntax

function checkout(eventId: string, options: CheckoutOptionsForRequest): Promise<CheckoutResponse>

checkout Parameters

NAME
TYPE
DESCRIPTION
eventId
string

Event ID.

options
Optional
CheckoutOptionsForRequest

An object representing the available options for checking out a reserved ticket.

Returns

Return Type:

Promise<
CheckoutResponse
>
NAME
TYPE
DESCRIPTION
expires
Date

Time when the order expires, applies to orders with status = INITIATED.

order
Order

Created order.

reservations
Array<
TicketReservation
>

Ticket reservations.

Was this helpful?

checkout example

Copy Code
1import { checkout } from 'wix-events.v2';
2
3 async function checkout(eventId, options) {
4 try {
5 const result = await checkout.checkout(eventId, options);
6
7 return result;
8 } catch (error) {
9 console.error(error);
10 // Handle the error
11 }
12 }
13