Triggered when an order created from this checkout is successfully paid for or when a checkout is marked as completed.
function onCheckoutCompleted(handler: function): void;
handler(event: CheckoutCompletedEnvelope): void | Promise<void>
import { checkout } from "@wix/ecom";
checkout.onCheckoutCompleted((event) => {
// handle your event here
});