markCheckoutAsCompleted( )


Marks a checkout as completed - checkout.complete boolean is set to true.

The markCheckoutAsCompleted() function returns a Promise that resolves when the specified checkout is marked as completed.

Permissions
Manage eCommerce - all permissions
Manage Stores - all permissions
Manage Orders
Manage Restaurants - all permissions
Learn more about app permissions.
Method Declaration
Copy
function markCheckoutAsCompleted(_id: string): Promise<void>;
Method Parameters
_idstringRequired

Checkout ID.

JavaScript
/************************************** * Backend code - my-backend-file.jsw * *************************************/ import { checkout } from "wix-ecom-backend"; export async function myMarkCheckoutAsCompletedFunction(checkoutId) { try { await checkout.markCheckoutAsCompleted(checkoutId); console.log("Success! Checkout marked as completed"); return; } catch (error) { console.error(error); // Handle the error } } /************* * Page code * ************/ import { myMarkCheckoutAsCompletedFunction } from "backend/my-backend-file"; // Sample checkoutId: const checkoutId = "96a61a4b-6b61-47d1-a039-0213a8230ccd"; myMarkCheckoutAsCompletedFunction(checkoutId) .then(() => { console.log("Success! Checkout marked as completed"); return; }) .catch((error) => { console.error(error); // Handle the error });
Errors

This method doesn’t return any custom errors, but may return standard errors. Learn more about standard Wix errors.

Did this help?