Search.../

checkout( )

Checkouts the reserved tickets.

Description

Creates an order and associates it with a site visitor contact. Guest details are received from the Registration Form input fields.

There is a possibility to use a separate ready-made Wix checkout form where the user will be redirected from your non-Wix site or a custom ticket picker created with Velo. To build the checkout form path, get your event base URL by using the getEvent() function and add the following path: /{{EVENT_PAGE_SLUG}}/{{SLUG}}/ticket-form?reservationId={{YOUR_RESERVATION_ID}}

Example: https://johndoe.wixsite.com/weddings/event-details/doe-wedding/ticket-form?reservationId=2be6d34a-2a1e-459f-897b-b4a66e73f69a

Syntax

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

checkout Parameters

NAME
TYPE
DESCRIPTION
eventId
string

Event ID to which the checkout belongs.

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

Order expiration time. Note: Only applicable to orders with the INITIATED status.

order
Order

Created order.

orderPageUrl
string

Order page URL.

reservations
Array<
TicketReservation
>

Ticket reservations.

Was this helpful?

checkout example

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