> 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: queryCheckoutTemplates() # Method package: wixEcomBackend # Method menu location: wixEcomBackend --> checkoutTemplates --> queryCheckoutTemplates # Method Link: https://dev.wix.com/docs/velo/apis/wix-ecom-backend/checkout-templates/query-checkout-templates.md # Method Description: Creates a query to retrieve a list of checkout templates. The `queryCheckoutTemplates()` function builds a query to retrieve a list of checkout templates and returns a `CheckoutTemplatesQueryBuilder` object. The returned object contains the query definition, which is typically used to run the query using the `find()` function. You can refine the query by chaining `CheckoutTemplatesQueryBuilder` functions onto the query. `CheckoutTemplatesQueryBuilder` functions enable you to sort, filter, and control the results that `queryCheckoutTemplates()` returns. `queryCheckoutTemplates()` runs with the following `CheckoutTemplatesQueryBuilder` default that you can override: + `ascending("_id")` The functions that are chained to `queryCheckoutTemplates()` are applied in the order they are called. For example, if you apply `ascending("status")` and then `ascending("_id")`, the results are sorted first by the `"status"`, and then, if there are multiple results with the same `"status"`, the items are sorted by `"_id"`. The following `CheckoutTemplatesQueryBuilder` functions are supported for the `queryCheckoutTemplates()` function. For a full description of the checkout template object, see the object returned for the `items` property in `CheckoutTemplatesQueryResult`. |PROPERTY |SUPPORTED FILTERS & SORTING |:---:|:---:| |`_id`|[`eq()`](/checkout-templates-query-builder/eq),[`ne()`](/checkout-templates-query-builder/ne),[`exists()`](/checkout-templates-query-builder/exists),[`in()`](/checkout-templates-query-builder/in),[`hasSome()`](/checkout-templates-query-builder/has-some),[`startsWith()`](/checkout-templates-query-builder/starts-with),[`ascending()`](/checkout-templates-query-builder/ascending),[`descending()`](/checkout-templates-query-builder/descending)| |`status`|[`eq()`](/checkout-templates-query-builder/eq),[`ne()`](/checkout-templates-query-builder/ne),[`exists()`](/checkout-templates-query-builder/exists),[`in()`](/checkout-templates-query-builder/in),[`hasSome()`](/checkout-templates-query-builder/has-some),[`ascending()`](/checkout-templates-query-builder/ascending),[`descending()`](/checkout-templates-query-builder/descending)| # Method Code Examples: *** Note: do not assume any prop names or enum values other than the ones in the example. ## queryCheckoutTemplates example for dashboard page code ```javascript import { checkoutTemplates } from 'wix-ecom-backend'; async function queryCheckoutTemplates() { const { items } = checkoutTemplates.queryCheckoutTemplates().find(); } ``` ## queryCheckoutTemplates example for exporting from backend code ```javascript import { checkoutTemplates } from 'wix-ecom-backend'; import { webMethod, Permissions } from 'wix-web-module'; import { elevate } from 'wix-auth'; const elevatedQueryCheckoutTemplates = elevate(checkoutTemplates.queryCheckoutTemplates); export const queryCheckoutTemplates = webMethod( Permissions.Anyone, async (options) => { try { const result = await elevatedQueryCheckoutTemplates(options); return result; } catch (error) { console.error(error); // Handle the error } } ); ``` ---