Search.../

getInvoice( )

Developer Preview

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

Note: This function is restricted and only runs if you elevate permissions using the wix-auth.elevate() function.

Syntax

function getInvoice(identifiers: GetInvoiceIdentifiers, options: GetInvoiceOptions): Promise<GetInvoiceResponse>

getInvoice Parameters

NAME
TYPE
DESCRIPTION
identifiers
GetInvoiceIdentifiers

An object containing identifiers for the reservation invoice preview to be generated.

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

Time when the reservation expires.

invoice
Invoice

Invoice with applied discount.

reservationOccupied
boolean

Whether this reservation is already used in checkout.

reservationStatus
string

Reservation status.

reservations
Array<
TicketReservation
>

Ticket reservations.

Was this helpful?

getInvoice example

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