Sample Flow

This article shares a possible use case your app could support, as well as a sample flow that could support this use case. This can be a helpful jumping-off point as you plan your app's implementation.

Set up and retrieve basic customizations for a clothing store

  1. Create a Customization with type PRODUCT_OPTION, and with different product colors (choices): red, green, blue.
    • Render type must be SWATCH_CHOICES and choice type must be ONE_COLOR.
    Copy
  2. Create a Customization, with type PRODUCT_OPTION, and with different product sizes (choices): S, M, L, XL.
    • Render type must be TextChoices and choice types must be CHOICE_TEXT.
    Copy
  3. Create a Customization, with type MODIFIER, in order to specify free text to be on a product.
    • Render type must be FREE_TEXT.
    • Set freeTextInput.title to "Choose text to be on shirt", and have and a range of 10-50 characters.
    Copy
  4. Add customization choices to the Color customization (for example, add yellow).
    Copy
  5. Query for all the customizations of type PRODUCT_OPTION and render type SWATCH_CHOICES.
    Copy

Create product with new option

In order to assign a new non-existing option to a new product, you can provide the option to the Create Product request.

To do this, your app can call Create Product with a new product and assign a new option to the product by passing a the name, option_render_type and choices:

Copy

Note that if an option with option.name already exists, it will assign the existing option to the product.

Create product with new modifier

In order to assign a new non-existing modifier to a new product, you can provide the modifier to the Create Product request.

To do this, your app can call Create Product with a new product and assign a new option to the product by passing a the name, modifier_render_type and free_text_settings:

Copy

Note that if a modifier with modifier.name already exists, it will assign the existing modifier to the product.

Update option name

In order to change the name of an option which will update all products to which it was assigned, your app can call the Update Customization endpoint with the requested changes:

Copy

Delete a modifier

In order to delete a modifier which will remove it from any product to which it was assigned, your app can call the Delete Customization endpoint with the customizationId of the modifier you want to delete:

Copy
Did this help?