> Portal Navigation: > > - Append `.md` to any URL under `https://dev.wix.com/docs/` to get its markdown version. > - Pages are either content pages (article or reference text) or menu pages (a list of links to child pages). > - To get a menu page, truncate any URL to a parent path and append `.md` (e.g. `https://dev.wix.com/docs/sdk.md`, `https://dev.wix.com/docs/sdk/core-modules.md`). > - Top-level index of all portals: https://dev.wix.com/docs/llms.txt > - Full concatenated docs: https://dev.wix.com/docs/llms-full.txt # Method name: markCheckoutAsCompleted(_id: string, options: MarkCheckoutAsCompletedOptions) # Method package: wixEcomBackend # Method menu location: wixEcomBackend --> checkout --> markCheckoutAsCompleted # Method Link: https://dev.wix.com/docs/velo/apis/wix-ecom-backend/checkout/mark-checkout-as-completed.md # Method Description: 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. # Method Code Examples: *** Note: do not assume any prop names or enum values other than the ones in the example. ## Mark a checkout as completed ```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 }); ``` ## Mark a checkout as completed (export from backend code) ```javascript /************************************** * Backend code - my-backend-file.web.js * *************************************/ import { Permissions, webMethod } from 'wix-web-module'; import { checkout } from 'wix-ecom-backend'; export const myMarkCheckoutAsCompletedFunction = webMethod(Permissions.Anyone, async (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.web'; // 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 }); ``` ---