Introduction
With the Orders API you can manage and track ticket orders, create/cancel tickets reservations, and check out the reserved tickets.
To get yourself comfortable with creating ticket reservation and checkout flows, you can check out these Velo example sites:
Even though these examples are for the wix-events-frontend
module, they still can be a great start to practice the flows.
With the Orders API you can:
- Get a list of all orders.
- Update an order or change its status.
- Get a summary of total ticket sales.
- Create and cancel ticket reservation.
- Checkout tickets.
- Get an invoice.
Terminology
- Order: Process by which a customer or attendee purchases one or more tickets for an event or activity. It involves the selection of desired tickets, providing necessary information such as payment details and contact information, and completing the transaction to secure the tickets.
- Event: A gathering organized by an individual or business for a group of people.
Setup
To use the Orders API, install the @wix/events
package using npm or Yarn:
1npm install @wix/events
or
1yarn add @wix/events
Then import { orders }
from @wix/events
:
1import { orders } from '@wix/events'
Archives multiple orders.
Permission Scopes
For app development, you must have one of the following permission scopes:function bulkUpdateOrders(eventId: string, options: BulkUpdateOrdersOptions): Promise<BulkUpdateOrdersResponse>
Checkouts the reserved tickets.
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
Permission Scopes
For app development, you must have one of the following permission scopes:function checkout(eventId: string, options: CheckoutOptionsForRequest): Promise<CheckoutResponse>
Confirms an order.
This function changes order status from INITIATED
, PENDING
, OFFLINE_PENDING
to PAID
.
Confirming orders with INITIATED
or PENDING
status triggers an email with the tickets to the buyer (and to additional guests, if provided).
Permission Scopes
For app development, you must have one of the following permission scopes:function confirmOrder(eventId: string, options: ConfirmOrderOptions): Promise<ConfirmOrderResponse>
Reserves tickets for 20 minutes.
Reserved tickets are deducted from ticket stock and cannot be bought by another site visitor. When the reservation expires, the tickets are added back to the stock.
Permission Scopes
For app development, you must have one of the following permission scopes:function createReservation(eventId: string, options: CreateReservationOptions): Promise<CreateReservationResponse>
Retrieves checkout details.
Permission Scopes
For app development, you must have one of the following permission scopes:function getCheckoutOptions(): Promise<GetCheckoutOptionsResponse>
Generates a preview of an invoice, including the given coupon or pricing plan.
Permission Scopes
For app development, you must have one of the following permission scopes:function getInvoice(reservationId: string, eventId: string, options: GetInvoiceOptions): Promise<GetInvoiceResponse>
Retrieves an order, including ticket data.
Permission Scopes
For app development, you must have one of the following permission scopes:function getOrder(identifiers: GetOrderIdentifiers, options: GetOrderOptions): Promise<Order>
Retrieves a summary of total ticket sales.
Permission Scopes
For app development, you must have one of the following permission scopes:function getSummary(options: GetSummaryOptions): Promise<GetSummaryResponse>
Returns tickets available to reserve.
Permission Scopes
For app development, you must have one of the following permission scopes:function listAvailableTickets(options: ListAvailableTicketsOptions): Promise<ListAvailableTicketsResponse>
Retrieves a list of orders, including ticket data.
Permission Scopes
For app development, you must have one of the following permission scopes:function listOrders(options: ListOrdersOptions): Promise<ListOrdersResponse>
Returns tickets available to reserve.
Permission Scopes
For app development, you must have one of the following permission scopes:function queryAvailableTickets(options: QueryAvailableTicketsOptions): Promise<QueryAvailableTicketsResponse>
Updates an order.
Permission Scopes
For app development, you must have one of the following permission scopes:function updateOrder(identifiers: UpdateOrderIdentifiers, options: UpdateOrderOptions): Promise<UpdateOrderResponse>