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).
This function requires elevated permissions and runs only on the backend and on dashboard pages.
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.
import { orders } from "wix-events.v2";
async function confirmOrder(eventId, options) {
try {
const result = await orders.confirmOrder(eventId, options);
return result;
} catch (error) {
console.error(error);
// Handle the error
}
}
This method doesn’t return any custom errors, but may return standard errors. Learn more about standard Wix errors.