Skip to main content

Update a variation option

PUT 

/pcm/variations/:variationID/options/:optionID

Update a variation option

Request

Path Parameters

    variationID stringrequired

    A unique identifier for the variation.

    optionID stringrequired

    A unique identifier for the option.

Body

    data objectrequired
    type stringrequired

    Possible values: [product-variation-option]

    This represents the type of resource object being returned. Always product-variation-option.

    attributes objectrequired
    name string

    A human recognizable identifier for the option, also used in the SLUG for child products. Option names can only contain A to Z, a to z, 0 to 9, hyphen, underscore, and period. Spaces or other special characters like ^, [], *, and $ are not allowed.

    description string

    The description of the option.

    sort_order integer

    By default, variations and variation options are sorted alphabetically. You can use the sort_order attribute to sort the order of your variation and variation options in the variation_matrix. The sort order value is visible when you add the variations and variation options to your catalogs. You can then use the sort_order value to program your storefront to display the variation options in the order that you want.

    The variation option with the highest value of sort_order is displayed first. For example, a variation option with a sort_order value of 3 appears before a variation option with a sort_order value of 2.

    You can specify any numbers that you want. You can use 1, 2, 3, or 100, 90, 80, and so on, zero or negative numbers.

    You can set sort_order to either null or omit it entirely from the request if you wish to remove an existing sort_order attribute.

    You must rebuild your products for the sort order changes to take effect.

    id stringrequired

    The unique identifier of the option. Must match the option ID specified in the request path.

Responses

Successfully returns the updated variation option

Schema
    data objectrequired
    id stringrequired

    The unique identifier generated when an option is created.

    type stringrequired

    Possible values: [product-variation-option]

    This represents the type of resource object being returned. Always product-variation-option.

    attributes objectrequired

    A variation option represents an option for selection for a single product-variation. For example, if your variation is color, you might have three possible options; red, green, and blue.

    name string

    A human-recognizable identifier for the option, also used in the SLUG for child products. Option names can only contain A to Z, a to z, 0 to 9, hyphen, underscore, and period. Spaces or other special characters like ^, [], *, and $ are not allowed.

    description string

    A human-recognizable description for the option.

    sort_order integer

    The sort order value is visible when you add the variations and variation options to your catalogs. You can then use the sort_order value to program your storefront to display the variation options in the order that you want. The variation with the highest value of sort_order is displayed first. For example, a variation with a sort_order value of 3 appears before a variation with a sort_order value of 2. You can specify any numbers that you want. You can use 1, 2, 3, or 100, 90, 80, including, zero or negative numbers. You can set sort_order to either null or omit it entirely from the request if you wish to remove an existing sort_order attribute.

    meta objectrequired
    owner string

    Possible values: [organization, store]

    The owner of a resource, either organization or store.

    created_at date-time

    The date and time an option is created.

    updated_at date-time

    The date and time an option is updated.

Loading...