> 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 # QueryCustomizations # Package: catalogV3 # Namespace: CustomizationService # Method link: https://dev.wix.com/docs/api-reference/business-solutions/stores/catalog-v3/customizations-v3/query-customizations.md ## Permission Scopes: Read customizations in v3 catalog: SCOPE.STORES.CUSTOMIZATION_READ ## Introduction Retrieves a list of up to 100 customizations, given the provided filtering, sorting, and cursor paging. Pass supported values to the `fields` array in the request to include those fields in the response. Query Customizations runs with these defaults, which you can override: - `createdDate` is sorted in `DESC` order - `cursorPaging.limit` is `100` To learn about working with _Query_ endpoints, see [API Query Language](https://dev.wix.com/docs/api-reference/articles/work-with-wix-apis/data-retrieval/about-the-wix-api-query-language.md), and [Sorting and Paging](https://dev.wix.com/docs/api-reference/articles/work-with-wix-apis/data-retrieval/about-sorting-and-paging.md). --- ## REST API ### Schema ``` Method: queryCustomizations Description: Retrieves a list of up to 100 customizations, given the provided filtering, sorting, and cursor paging. Pass supported values to the `fields` array in the request to include those fields in the response. Query Customizations runs with these defaults, which you can override: - `createdDate` is sorted in `DESC` order - `cursorPaging.limit` is `100` To learn about working with _Query_ endpoints, see [API Query Language](https://dev.wix.com/docs/api-reference/articles/work-with-wix-apis/data-retrieval/about-the-wix-api-query-language.md), and [Sorting and Paging](https://dev.wix.com/docs/api-reference/articles/work-with-wix-apis/data-retrieval/about-sorting-and-paging.md). URL: https://www.wixapis.com/stores/v3/customizations/query Method: POST Method parameters: param name: fields | type: array | description: Fields to include in the response. Supported values: `ASSIGNED_PRODUCTS_COUNT` - enum: - ASSIGNED_PRODUCTS_COUNT: Assigned products count. - CHOICE_DISPLAY_IMAGE: Returns display images for choices. param name: query | type: CursorQuery - name: cursorPaging | type: CursorPaging | description: Cursor token pointing to a page of results. Not used in the first request. Following requests use the cursor token and not `filter` or `sort`. - name: limit | type: integer | description: Maximum number of items to return in the results. - name: cursor | type: string | description: Pointer to the next or previous page in the list of results. Pass the relevant cursor token from the `pagingMetadata` object in the previous call's response. Not relevant for the first request. - name: filter | type: object | description: Filter object in the following format: `"filter" : { "fieldName1": "value1", "fieldName2":{"$operator":"value2"} }` Example of operators: `$eq`, `$ne`, `$lt`, `$lte`, `$gt`, `$gte`, `$in`, `$hasSome`, `$hasAll`, `$startsWith`, `$contains` - name: sort | type: array | description: Sort object in the following format: `[{"fieldName":"sortField1","order":"ASC"},{"fieldName":"sortField2","order":"DESC"}]` - name: fieldName | type: string | description: Name of the field to sort by. - name: order | type: SortOrder | description: Sort order. - enum: - ASC: Ascending order. - DESC: Descending order. Return type: QueryCustomizationsResponse - name: customizations | type: array | description: List of customizations. - ONE-OF: - name: freeTextInput | type: FreeTextSettings | description: Free text input settings. > **Note:** To be passed along with `customizationRenderType: FREE_TEXT`. - name: minCharCount | type: integer | description: Minimum text character length. - name: maxCharCount | type: integer | description: Maximum text character length. - name: defaultAddedPrice | type: string | description: Default amount added to a product's price when this choice is assigned to a modifier. - name: title | type: string | description: Title to display to customer for their free-text input. - name: key | type: string | description: A read-only identifier generated from the title. Use `key` in the `catalogReference.options` object when [integrating Catalog V3 with eCommerce APIs](https://dev.wix.com/docs/api-reference/business-solutions/stores/catalog-v3/e-commerce-integration.md). - name: choicesSettings | type: ChoicesSettings | description: Choices settings. > **Note:** Must be passed along with `customizationRenderType` of `SWATCH_CHOICES` and `TEXT_CHOICES`. - name: choices | type: array | description: List of choices. - ONE-OF: - name: colorCode | type: string | description: Color code in HEX format, [as described by MDN](https://developer.mozilla.org/en-US/docs/Web/CSS/hex-color). - name: id | type: string | description: Choice GUID. - name: choiceType | type: ChoiceType | description: Choice type. > **Notes:** > + For `customizationRenderType: SWATCH_CHOICES`, the supported `choiceType` value is: `ONE_COLOR`. > + For a `customizationRenderType` of `TEXT_CHOICES`, the supported `choiceType` value is: `CHOICE_TEXT`. - enum: - CHOICE_TEXT: For a `customizationRenderType` of `TEXT_CHOICES`. - ONE_COLOR: For `customizationRenderType: SWATCH_CHOICES`. - name: key | type: string | description: A read-only identifier generated from the choice name. Use `key` in the `catalogReference.options` object when [integrating Catalog V3 with eCommerce APIs](https://dev.wix.com/docs/api-reference/business-solutions/stores/catalog-v3/e-commerce-integration.md). - name: name | type: string | description: Choice name. - name: defaultAddedPrice | type: string | description: Default amount added to a product's price when this customization is assigned to a modifier. - name: displayImage | type: Image | description: Optional image displayed alongside a ONE_COLOR choice in the storefront. Only valid for ONE_COLOR choices; not populated for other choice types. - name: id | type: string | description: WixMedia image GUID. - name: url | type: string | description: Image URL. - name: height | type: integer | description: Original image height. - name: width | type: integer | description: Original image width. - name: altText | type: string | description: Image alt text. - name: filename | type: string | description: Image filename. - name: primaryChoiceIds | type: array | description: IDs of the primary choices this choice is grouped under. A choice that has `primaryChoiceIds` is a "linked" choice; a choice without `primaryChoiceIds` is a "primary" choice. A linked choice can reference up to 4 primary choices and appears nested under each of them on the storefront, rather than in the top-level choice list. Only one level of grouping is supported: a primary choice cannot itself be a linked choice. - name: id | type: string | description: Customization GUID. - name: revision | type: string | description: Revision number, which increments by 1 each time the customization is updated. To prevent conflicting changes, the current revision must be passed when updating the customization. Ignored when creating a customization. - name: createdDate | type: string | description: Date and time the customization was created. - name: updatedDate | type: string | description: Date and time the customization was updated. - name: key | type: string | description: A read-only identifier generated from the customization name. Use `key` in the `catalogReference.options` object when [integrating Catalog V3 with eCommerce APIs](https://dev.wix.com/docs/api-reference/business-solutions/stores/catalog-v3/e-commerce-integration.md). - name: name | type: string | description: Customization name for options (for example, `"color"`, `"size"`) and modifiers (for example, `"greeting card"`). - name: customizationType | type: CustomizationType | description: Customization type. - enum: PRODUCT_OPTION, MODIFIER - name: customizationRenderType | type: CustomizationRenderType | description: Customization render type. Defines how the customization will be displayed in the storefront. - enum: - FREE_TEXT: Customization by free text input. - TEXT_CHOICES: Customization by selection of text choices. - SWATCH_CHOICES: Customization by selection of colors. - name: assignedProductsCount | type: integer | description: Number of products this customization is assigned to. > **Note:** Returned only when you pass `"ASSIGNED_PRODUCTS_COUNT"` to the `fields` array in Customizations API requests. - name: pagingMetadata | type: CursorPagingMetadata | description: Details on the paged set of results returned. - name: count | type: integer | description: Number of items returned in the response. - name: cursors | type: Cursors | description: Cursor strings that point to the next page, previous page, or both. - name: next | type: string | description: Cursor string pointing to the next page in the list of results. - name: prev | type: string | description: Cursor pointing to the previous page in the list of results. - name: hasNext | type: boolean | description: Whether there are more pages to retrieve following the current page. + `true`: Another page of results can be retrieved. + `false`: This is the last page. ``` ### Examples ### Query Customization, part 2 of paging Queries Existing Customizations by customizationRenderType; sorted by name in ascending order; second part of paging ```curl curl -X POST \ 'https://www.wixapis.com/stores/v3/customizations/query' \ -H 'Content-Type: application/json' \ -H 'Authorization: ' \ -d '{ "query": { "cursorPaging": { "cursor": "A3mXp6TqVw4R9Lk25c10e662746f5ce9e2145f16.DljyP8VnR3djdXN0b21pemF0aW9uUmVuZGVyVHlwZRINGgt0ZXh0Q2hvaWNlcxoSCgRuYW1lGgoaCE1hdGVyaWFsIiQ2YWUwYzdiOC04ZmE5LTRlMWYtYTJkMi0yODc1MzliNzMzMmQ" } } }' ``` ### Query Customization, part 1 of paging Queries Existing Customizations by customizationRenderType; sorted by name in ascending order; first part of paging with limit of 2 results per page ```curl curl -X POST \ 'https://www.wixapis.com/stores/v3/customizations/query' \ -H 'Content-Type: application/json' \ -H 'Authorization: ' \ -d '{ "query": { "sort": [ { "order": "ASC", "fieldName": "name" } ], "filter": { "customizationRenderType": "TEXT_CHOICES" }, "cursorPaging": { "limit": 2 } } }' ``` ### Query Customization with one result Queries Existing Customizations by customizationRenderType; ```curl curl -X POST \ 'https://www.wixapis.com/stores/v3/customizations/query' \ -H 'Content-Type: application/json' \ -H 'Authorization: ' \ -d '{ "query": { "filter": { "customizationRenderType": "SWATCH_CHOICES" }, "cursorPaging": { "limit": 10 } } }' ``` --- ## JavaScript SDK ### Schema ``` Method: wixClientAdmin.catalogV3.CustomizationService.queryCustomizations(query, options) Description: Retrieves a list of up to 100 customizations, given the provided filtering, sorting, and cursor paging. Pass supported values to the `fields` array in the request to include those fields in the response. Query Customizations runs with these defaults, which you can override: - `createdDate` is sorted in `DESC` order - `cursorPaging.limit` is `100` To learn about working with _Query_ endpoints, see [API Query Language](https://dev.wix.com/docs/api-reference/articles/work-with-wix-apis/data-retrieval/about-the-wix-api-query-language.md), and [Sorting and Paging](https://dev.wix.com/docs/api-reference/articles/work-with-wix-apis/data-retrieval/about-sorting-and-paging.md). # Note: If the parameter `a.b` is listed under required parameters, `b` is only required if `a` is also present. Required parameters: query Method parameters: param name: options | type: QueryCustomizationsOptions none - name: fields | type: array | description: Fields to include in the response. Supported values: `ASSIGNED_PRODUCTS_COUNT` - enum: - ASSIGNED_PRODUCTS_COUNT: Assigned products count. - CHOICE_DISPLAY_IMAGE: Returns display images for choices. param name: query | type: CustomizationQuery | required: true - name: cursorPaging | type: CursorPaging | description: Cursor token pointing to a page of results. Not used in the first request. Following requests use the cursor token and not `filter` or `sort`. - name: limit | type: integer | description: Maximum number of items to return in the results. - name: cursor | type: string | description: Pointer to the next or previous page in the list of results. Pass the relevant cursor token from the `pagingMetadata` object in the previous call's response. Not relevant for the first request. - name: filter | type: object | description: Filter object in the following format: `"filter" : { "fieldName1": "value1", "fieldName2":{"$operator":"value2"} }` Example of operators: `$eq`, `$ne`, `$lt`, `$lte`, `$gt`, `$gte`, `$in`, `$hasSome`, `$hasAll`, `$startsWith`, `$contains` - name: sort | type: array | description: Sort object in the following format: `[{"fieldName":"sortField1","order":"ASC"},{"fieldName":"sortField2","order":"DESC"}]` - name: fieldName | type: string | description: Name of the field to sort by. - name: order | type: SortOrder | description: Sort order. - enum: - ASC: Ascending order. - DESC: Descending order. Return type: PROMISE - name: customizations | type: array | description: List of customizations. - ONE-OF: - name: freeTextInput | type: FreeTextSettings | description: Free text input settings. > **Note:** To be passed along with `customizationRenderType: FREE_TEXT`. - name: minCharCount | type: integer | description: Minimum text character length. - name: maxCharCount | type: integer | description: Maximum text character length. - name: defaultAddedPrice | type: string | description: Default amount added to a product's price when this choice is assigned to a modifier. - name: title | type: string | description: Title to display to customer for their free-text input. - name: key | type: string | description: A read-only identifier generated from the title. Use `key` in the `catalogReference.options` object when [integrating Catalog V3 with eCommerce APIs](https://dev.wix.com/docs/api-reference/business-solutions/stores/catalog-v3/e-commerce-integration.md). - name: choicesSettings | type: ChoicesSettings | description: Choices settings. > **Note:** Must be passed along with `customizationRenderType` of `SWATCH_CHOICES` and `TEXT_CHOICES`. - name: choices | type: array | description: List of choices. - ONE-OF: - name: colorCode | type: string | description: Color code in HEX format, [as described by MDN](https://developer.mozilla.org/en-US/docs/Web/CSS/hex-color). - name: _id | type: string | description: Choice GUID. - name: choiceType | type: ChoiceType | description: Choice type. > **Notes:** > + For `customizationRenderType: SWATCH_CHOICES`, the supported `choiceType` value is: `ONE_COLOR`. > + For a `customizationRenderType` of `TEXT_CHOICES`, the supported `choiceType` value is: `CHOICE_TEXT`. - enum: - CHOICE_TEXT: For a `customizationRenderType` of `TEXT_CHOICES`. - ONE_COLOR: For `customizationRenderType: SWATCH_CHOICES`. - name: key | type: string | description: A read-only identifier generated from the choice name. Use `key` in the `catalogReference.options` object when [integrating Catalog V3 with eCommerce APIs](https://dev.wix.com/docs/api-reference/business-solutions/stores/catalog-v3/e-commerce-integration.md). - name: name | type: string | description: Choice name. - name: defaultAddedPrice | type: string | description: Default amount added to a product's price when this customization is assigned to a modifier. - name: displayImage | type: string | description: Optional image displayed alongside a ONE_COLOR choice in the storefront. Only valid for ONE_COLOR choices; not populated for other choice types. - name: primaryChoiceIds | type: array | description: IDs of the primary choices this choice is grouped under. A choice that has `primaryChoiceIds` is a "linked" choice; a choice without `primaryChoiceIds` is a "primary" choice. A linked choice can reference up to 4 primary choices and appears nested under each of them on the storefront, rather than in the top-level choice list. Only one level of grouping is supported: a primary choice cannot itself be a linked choice. - name: _id | type: string | description: Customization GUID. - name: revision | type: string | description: Revision number, which increments by 1 each time the customization is updated. To prevent conflicting changes, the current revision must be passed when updating the customization. Ignored when creating a customization. - name: _createdDate | type: Date | description: Date and time the customization was created. - name: _updatedDate | type: Date | description: Date and time the customization was updated. - name: key | type: string | description: A read-only identifier generated from the customization name. Use `key` in the `catalogReference.options` object when [integrating Catalog V3 with eCommerce APIs](https://dev.wix.com/docs/api-reference/business-solutions/stores/catalog-v3/e-commerce-integration.md). - name: name | type: string | description: Customization name for options (for example, `"color"`, `"size"`) and modifiers (for example, `"greeting card"`). - name: customizationType | type: CustomizationType | description: Customization type. - enum: PRODUCT_OPTION, MODIFIER - name: customizationRenderType | type: CustomizationRenderType | description: Customization render type. Defines how the customization will be displayed in the storefront. - enum: - FREE_TEXT: Customization by free text input. - TEXT_CHOICES: Customization by selection of text choices. - SWATCH_CHOICES: Customization by selection of colors. - name: assignedProductsCount | type: integer | description: Number of products this customization is assigned to. > **Note:** Returned only when you pass `"ASSIGNED_PRODUCTS_COUNT"` to the `fields` array in Customizations API requests. - name: pagingMetadata | type: CursorPagingMetadata | description: Details on the paged set of results returned. - name: count | type: integer | description: Number of items returned in the response. - name: cursors | type: Cursors | description: Cursor strings that point to the next page, previous page, or both. - name: next | type: string | description: Cursor string pointing to the next page in the list of results. - name: prev | type: string | description: Cursor pointing to the previous page in the list of results. - name: hasNext | type: boolean | description: Whether there are more pages to retrieve following the current page. + `true`: Another page of results can be retrieved. + `false`: This is the last page. ``` ### Examples ### Query customizations by swatch choices render type Query customizations filtered by swatch choices render type ```javascript import { customizationsV3 } from "@wix/stores"; const options = { query: { filter: { customizationRenderType: "SWATCH_CHOICES" }, cursorPaging: { limit: 10 } } }; async function queryCustomizations() { const response = await customizationsV3.queryCustomizations(options); } /* Promise resolves to: * { * "customizations": [ * { "_id": "932c2554-...", "name": "Color", "customizationType": "MODIFIER", "customizationRenderType": "SWATCH_CHOICES" }, * { "_id": "b2c3d4e5-...", "name": "Color", "customizationType": "PRODUCT_OPTION", "customizationRenderType": "SWATCH_CHOICES" } * ], * "pagingMetadata": { "count": 2, "cursors": {}, "hasNext": false } * } */ ``` ### Query customizations using cursor pagination Fetch the next page of results using a cursor ```javascript import { customizationsV3 } from "@wix/stores"; const options = { query: { cursorPaging: { cursor: "A3mXp6TqVw4R9Lk25c10e662746f5ce9e2145f16.DljyP8VnR3djdXN0b21pemF0aW9uUmVuZGVyVHlwZRINGgt0ZXh0Q2hvaWNlcxoSCgRuYW1lGgoaCE1hdGVyaWFsIiQ2YWUwYzdiOC04ZmE5LTRlMWYtYTJkMi0yODc1MzliNzMzMmQ" } } }; async function queryCustomizations() { const response = await customizationsV3.queryCustomizations(options); } /* Promise resolves to: * { * "customizations": [ * { "_id": "6ae0c7b8-...", "name": "Fabric", "customizationType": "MODIFIER", "customizationRenderType": "TEXT_CHOICES" } * ], * "pagingMetadata": { "count": 1, "cursors": {}, "hasNext": false } * } */ ``` ### Query customizations by render type Query customizations filtered by render type and sorted by name ```javascript import { customizationsV3 } from "@wix/stores"; const options = { query: { sort: [ { order: "ASC", fieldName: "name" } ], filter: { customizationRenderType: "TEXT_CHOICES" }, cursorPaging: { limit: 2 } } }; async function queryCustomizations() { const response = await customizationsV3.queryCustomizations(options); } /* Promise resolves to: * { * "customizations": [ * { "_id": "128db854-...", "name": "Material", "customizationType": "MODIFIER", "customizationRenderType": "TEXT_CHOICES" }, * { "_id": "a1b2c3d4-...", "name": "Size", "customizationType": "PRODUCT_OPTION", "customizationRenderType": "TEXT_CHOICES" } * ], * "pagingMetadata": { "count": 2, "cursors": { "next": "A3mXp6Tq..." }, "hasNext": true } * } */ ``` ### queryCustomizations (self-hosted) Self-hosted SDK calls require you to [create a client](https://dev.wix.com/docs/sdk/articles/work-with-the-sdk/about-the-wix-client.md). ```javascript import { createClient } from '@wix/sdk'; import { customizationsV3 } from '@wix/stores'; // Import the auth strategy for the relevant access type // Import the relevant host module if needed const myWixClient = createClient ({ modules: { customizationsV3 }, // Include the auth strategy and host as relevant }); async function queryCustomizations(query,options) { const response = await myWixClient.customizationsV3.queryCustomizations(query,options); }; ``` ---