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
Event ID to which the checkout belongs.
An object representing the available options for checking out a reserved ticket.
Returns
Return Type:
NAME
TYPE
DESCRIPTION
Order expiration time.
Note: Only applicable to orders with the INITIATED
status.
Created order.
Order page URL.
Ticket reservations.
Was this helpful?
checkout example
1import { orders } from 'wix-events.v2';23 async function checkout(eventId, options) {4 try {5 const result = await orders.checkout(eventId, options);67 return result;8 } catch (error) {9 console.error(error);10 // Handle the error11 }12 }13