Search.../

getInvoice( )

Generates a preview of an invoice, including the given coupon or pricing plan.

Syntax

function getInvoice(reservationId: string, eventId: string, options: GetInvoiceOptions): Promise<GetInvoiceResponse>

getInvoice Parameters

NAME
TYPE
DESCRIPTION
reservationId
string

Reservation ID.

eventId
string

Event ID to which the invoice belongs.

options
Optional
GetInvoiceOptions

An object representing the available options for generating a preview of a reservation invoice.

Returns

Return Type:

Promise<
GetInvoiceResponse
>
NAME
TYPE
DESCRIPTION
discountErrors
DiscountErrors

Discount errors, if relevant.

expires
Date

Reservation expiration time.

invoice
Invoice

Invoice with applied discount.

reservationOccupied
boolean

Whether this reservation is already used in checkout.

reservationStatus
string

Reservation status. Possible values:

  • RESERVATION_PENDING: The reservation is pending confirmation. It will expire after a certain amount of time.
  • RESERVATION_CONFIRMED: The reservation is confirmed and will not expire.
  • RESERVATION_CANCELED: The reservation is canceled because it's not paid.
  • RESERVATION_CANCELED_MANUALLY: The reservation is canceled manually by the buyer.
  • RESERVATION_EXPIRED: The reservation has expired.
reservations
Array<
TicketReservation
>

Ticket reservations.

Was this helpful?

getInvoice example

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