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>
Event ID to which the order belongs.
An object representing the available options for confirming an order.
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>
Event ID to which the checkout belongs.
An object representing the available options for checking out a reserved ticket.
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>
Event ID to which the order belongs.
An object representing the available options for confirming an order.
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>
Event ID to which the reservation belongs.
An object representing the available options for creating a reservation.
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>
Reservation ID.
Event ID to which the invoice belongs.
An object representing the available options for generating a preview of a reservation invoice.
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>
An object containing identifiers for the order to be retrieved.
An object representing the available options for getting an 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>
An object representing the available options for retrieving a summary of total ticket sales.
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>
An object representing the available options for retrieving a list of tickets available for reservation.
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>
An object representing the available options for retrieving a list of orders.
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>
An object representing the available options for retrieving a list of tickets available for reservation.
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>
An object containing identifiers for the order to be updated.
An object representing the available options for updating an order.