> 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 # CreateCustomization # Package: catalogV3 # Namespace: CustomizationService # Method link: https://dev.wix.com/docs/api-reference/business-solutions/stores/catalog-v3/customizations-v3/create-customization.md ## Permission Scopes: Customization write in v3 catalog: SCOPE.STORES.CUSTOMIZATION_WRITE ## Introduction Creates a customization. --- ## REST API ### Schema ``` Method: createCustomization Description: Creates a customization. URL: https://www.wixapis.com/stores/v3/customizations Method: POST # Note: If the parameter `a.b` is listed under required parameters, `b` is only required if `a` is also present. Required parameters: customization, customization.name, customization.customizationType, customization.choicesSettings.choices, customization.freeTextInput.title, customization.customizationRenderType Method parameters: param name: customization | type: Customization | description: Customizations include options and modifiers which can later be applied to products. Options are designed to add variations to a product, where modifiers add a customizable change to the product but without creating another variant. | required: true - ONE-OF: - required: true - 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. | required: true - 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. | required: true - 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: 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: 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: altText | type: string | description: Image alt text. - 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: name | type: string | description: Customization name for options (for example, `"color"`, `"size"`) and modifiers (for example, `"greeting card"`). | required: true - name: customizationType | type: CustomizationType | description: Customization type. | required: true - enum: PRODUCT_OPTION, MODIFIER - name: customizationRenderType | type: CustomizationRenderType | description: Customization render type. Defines how the customization will be displayed in the storefront. | required: true - enum: - FREE_TEXT: Customization by free text input. - TEXT_CHOICES: Customization by selection of text choices. - SWATCH_CHOICES: Customization by selection of colors. Return type: CreateCustomizationResponse - name: customization | type: Customization | description: Created customization. - 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. Possible Errors: HTTP Code: 400 | Status Code: INVALID_ARGUMENT | Application Code: PRIMARY_CHOICE_HIERARCHY_VIOLATION | Description: A choice that is a primary of other choices can't also be a linked choice. Only a single level of grouping is supported. HTTP Code: 400 | Status Code: INVALID_ARGUMENT | Application Code: PRIMARY_CHOICE_NOT_FOUND | Description: `primaryChoiceIds` contains an GUID that doesn't match any existing choice in the customization. HTTP Code: 400 | Status Code: INVALID_ARGUMENT | Application Code: PRIMARY_CHOICE_SELF_REFERENCE | Description: Choice references itself in `primaryChoiceIds`. HTTP Code: 400 | Status Code: INVALID_ARGUMENT | Application Code: ID_NOT_ALLOWED_IN_REQUEST | Description: Caller doesn't have the required permissions to pass GUIDs in the request. HTTP Code: 400 | Status Code: INVALID_ARGUMENT | Application Code: MIXED_CHOICE_IDS_CONSISTENCY | Description: Some choices have GUIDs while others don't. All choices must have GUIDs or none of them can have GUIDs. HTTP Code: 400 | Status Code: INVALID_ARGUMENT | Application Code: CUSTOMIZATION_WITH_ONLY_ID_OR_CHOICE_IDS | Description: Customization GUID provided without choice GUIDs or vice versa. Provide both customization GUID and choice GUIDs together. HTTP Code: 400 | Status Code: INVALID_ARGUMENT | Application Code: DUPLICATE_CHOICE_NAME | Description: Duplicate choice name found. Each choice name must be unique within the customization. HTTP Code: 400 | Status Code: INVALID_ARGUMENT | Application Code: ONLY_SPACES_STRING_ERROR | Description: Text field contains only spaces. Provide valid text content. HTTP Code: 400 | Status Code: INVALID_ARGUMENT | Application Code: INVALID_CUSTOMIZATION_RENDER_TYPE | Description: Customization type and render type don't match. For example, product options can't have a free text render type. HTTP Code: 428 | Status Code: FAILED_PRECONDITION | Application Code: INVALID_FREE_TEXT_SETTINGS | Description: `maxCharCount` is less than `minCharCount` or exceeds 500. HTTP Code: 428 | Status Code: FAILED_PRECONDITION | Application Code: MODIFIERS_LIMIT_EXCEEDED | Description: Number of modifiers exceeded the limit. HTTP Code: 428 | Status Code: FAILED_PRECONDITION | Application Code: OPTIONS_LIMIT_EXCEEDED | Description: Number of product options exceeded the limit. ``` ### Examples ### Create Customization of type Modifier Creates a customization with a text choices modifier ```curl curl -X POST \ 'https://www.wixapis.com/stores/v3/customizations' \ -H 'Content-Type: application/json' \ -H 'Authorization: ' \ -d '{ "customization": { "customizationRenderType": "TEXT_CHOICES", "customizationType": "MODIFIER", "name": "Material", "choicesSettings": { "choices": [ { "choiceType": "CHOICE_TEXT", "name": "Cotton" }, { "choiceType": "CHOICE_TEXT", "name": "Polyester" }, { "choiceType": "CHOICE_TEXT", "name": "Wool" } ] } } }' ``` ### Create Customization of type Modifier Creates a customization with a free text modifier ```curl curl -X POST \ 'https://www.wixapis.com/stores/v3/customizations' \ -H 'Content-Type: application/json' \ -H 'Authorization: ' \ -d '{ "customization": { "customizationRenderType": "FREE_TEXT", "customizationType": "MODIFIER", "name": "Name for Personalization", "freeTextInput": { "title": "Add your name for personalization" } } }' ``` ### Create Customization of type Option Creates a customization with a swatch choices option ```curl curl -X POST \ 'https://www.wixapis.com/stores/v3/customizations' \ -H 'Content-Type: application/json' \ -H 'Authorization: ' \ -d '{ "customization": { "customizationType": "PRODUCT_OPTION", "customizationRenderType": "SWATCH_CHOICES", "name": "Color", "choicesSettings": { "choices": [ { "choiceType": "ONE_COLOR", "name": "Blue", "colorCode": "#0000FF" }, { "choiceType": "ONE_COLOR", "name": "Yellow", "colorCode": "#FFFF00" }, { "choiceType": "ONE_COLOR", "name": "Green", "colorCode": "#008000" } ] } } }' ``` ### Create Customization of type Modifier Creates a customization with a swatch choices modifier ```curl curl -X POST \ 'https://www.wixapis.com/stores/v3/customizations' \ -H 'Content-Type: application/json' \ -H 'Authorization: ' \ -d '{ "customization": { "customizationType": "MODIFIER", "customizationRenderType": "SWATCH_CHOICES", "name": "Color", "choicesSettings": { "choices": [ { "choiceType": "ONE_COLOR", "name": "Pink", "colorCode": "#FFC0CB" }, { "choiceType": "ONE_COLOR", "name": "Black", "colorCode": "#000000" } ] } } }' ``` ### Create Customization of type Option Creates a customization with a text choices option ```curl curl -X POST \ 'https://www.wixapis.com/stores/v3/customizations' \ -H 'Content-Type: application/json' \ -H 'Authorization: ' \ -d '{ "customization": { "customizationRenderType": "TEXT_CHOICES", "customizationType": "PRODUCT_OPTION", "name": "Size", "choicesSettings": { "choices": [ { "choiceType": "CHOICE_TEXT", "name": "Small" }, { "choiceType": "CHOICE_TEXT", "name": "Medium" }, { "choiceType": "CHOICE_TEXT", "name": "Large" } ] } } }' ``` --- ## JavaScript SDK ### Schema ``` Method: wixClientAdmin.catalogV3.CustomizationService.createCustomization(customization) Description: Creates a customization. # Note: If the parameter `a.b` is listed under required parameters, `b` is only required if `a` is also present. Required parameters: customization, customization.name, customization.customizationType, customization.choicesSettings.choices, customization.freeTextInput.title, customization.customizationRenderType Method parameters: param name: customization | type: Customization | description: Customizations include options and modifiers which can later be applied to products. Options are designed to add variations to a product, where modifiers add a customizable change to the product but without creating another variant. | required: true - ONE-OF: - required: true - 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. | required: true - 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. | required: true - 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: 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: 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: name | type: string | description: Customization name for options (for example, `"color"`, `"size"`) and modifiers (for example, `"greeting card"`). | required: true - name: customizationType | type: CustomizationType | description: Customization type. | required: true - enum: PRODUCT_OPTION, MODIFIER - name: customizationRenderType | type: CustomizationRenderType | description: Customization render type. Defines how the customization will be displayed in the storefront. | required: true - enum: - FREE_TEXT: Customization by free text input. - TEXT_CHOICES: Customization by selection of text choices. - SWATCH_CHOICES: Customization by selection of colors. Return type: PROMISE - 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. Possible Errors: HTTP Code: 400 | Status Code: INVALID_ARGUMENT | Application Code: PRIMARY_CHOICE_HIERARCHY_VIOLATION | Description: A choice that is a primary of other choices can't also be a linked choice. Only a single level of grouping is supported. HTTP Code: 400 | Status Code: INVALID_ARGUMENT | Application Code: PRIMARY_CHOICE_NOT_FOUND | Description: `primaryChoiceIds` contains an GUID that doesn't match any existing choice in the customization. HTTP Code: 400 | Status Code: INVALID_ARGUMENT | Application Code: PRIMARY_CHOICE_SELF_REFERENCE | Description: Choice references itself in `primaryChoiceIds`. HTTP Code: 400 | Status Code: INVALID_ARGUMENT | Application Code: ID_NOT_ALLOWED_IN_REQUEST | Description: Caller doesn't have the required permissions to pass GUIDs in the request. HTTP Code: 400 | Status Code: INVALID_ARGUMENT | Application Code: MIXED_CHOICE_IDS_CONSISTENCY | Description: Some choices have GUIDs while others don't. All choices must have GUIDs or none of them can have GUIDs. HTTP Code: 400 | Status Code: INVALID_ARGUMENT | Application Code: CUSTOMIZATION_WITH_ONLY_ID_OR_CHOICE_IDS | Description: Customization GUID provided without choice GUIDs or vice versa. Provide both customization GUID and choice GUIDs together. HTTP Code: 400 | Status Code: INVALID_ARGUMENT | Application Code: DUPLICATE_CHOICE_NAME | Description: Duplicate choice name found. Each choice name must be unique within the customization. HTTP Code: 400 | Status Code: INVALID_ARGUMENT | Application Code: ONLY_SPACES_STRING_ERROR | Description: Text field contains only spaces. Provide valid text content. HTTP Code: 400 | Status Code: INVALID_ARGUMENT | Application Code: INVALID_CUSTOMIZATION_RENDER_TYPE | Description: Customization type and render type don't match. For example, product options can't have a free text render type. HTTP Code: 428 | Status Code: FAILED_PRECONDITION | Application Code: INVALID_FREE_TEXT_SETTINGS | Description: `maxCharCount` is less than `minCharCount` or exceeds 500. HTTP Code: 428 | Status Code: FAILED_PRECONDITION | Application Code: MODIFIERS_LIMIT_EXCEEDED | Description: Number of modifiers exceeded the limit. HTTP Code: 428 | Status Code: FAILED_PRECONDITION | Application Code: OPTIONS_LIMIT_EXCEEDED | Description: Number of product options exceeded the limit. ``` ### Examples ### Create a swatch choices modifier ```javascript import { customizationsV3 } from "@wix/stores"; const customization = { customizationType: "MODIFIER", customizationRenderType: "SWATCH_CHOICES", name: "Color", choicesSettings: { choices: [ { choiceType: "ONE_COLOR", name: "Pink", colorCode: "#FFC0CB" }, { choiceType: "ONE_COLOR", name: "Black", colorCode: "#000000" } ] } }; async function createCustomization() { const response = await customizationsV3.createCustomization(customization); } ``` ### Create a text choices modifier ```javascript import { customizationsV3 } from "@wix/stores"; const customization = { customizationRenderType: "TEXT_CHOICES", customizationType: "MODIFIER", name: "Material", choicesSettings: { choices: [ { choiceType: "CHOICE_TEXT", name: "Cotton" }, { choiceType: "CHOICE_TEXT", name: "Polyester" }, { choiceType: "CHOICE_TEXT", name: "Wool" } ] } }; async function createCustomization() { const response = await customizationsV3.createCustomization(customization); } ``` ### Create a free text modifier ```javascript import { customizationsV3 } from "@wix/stores"; const customization = { customizationRenderType: "FREE_TEXT", customizationType: "MODIFIER", name: "Name for Personalization", freeTextInput: { title: "Add your name for personalization" } }; async function createCustomization() { const response = await customizationsV3.createCustomization(customization); } ``` ### Create a swatch choices product option ```javascript import { customizationsV3 } from "@wix/stores"; const customization = { customizationType: "PRODUCT_OPTION", customizationRenderType: "SWATCH_CHOICES", name: "Color", choicesSettings: { choices: [ { choiceType: "ONE_COLOR", name: "Blue", colorCode: "#0000FF" }, { choiceType: "ONE_COLOR", name: "Yellow", colorCode: "#FFFF00" }, { choiceType: "ONE_COLOR", name: "Green", colorCode: "#008000" } ] } }; async function createCustomization() { const response = await customizationsV3.createCustomization(customization); } ``` ### Create a text choices product option ```javascript import { customizationsV3 } from "@wix/stores"; const customization = { customizationRenderType: "TEXT_CHOICES", customizationType: "PRODUCT_OPTION", name: "Size", choicesSettings: { choices: [ { choiceType: "CHOICE_TEXT", name: "Small" }, { choiceType: "CHOICE_TEXT", name: "Medium" }, { choiceType: "CHOICE_TEXT", name: "Large" } ] } }; async function createCustomization() { const response = await customizationsV3.createCustomization(customization); } ``` ### createCustomization (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 createCustomization(customization) { const response = await myWixClient.customizationsV3.createCustomization(customization); }; ``` ---