Skip to main content

Update a modifier

PUT 

https://euwest.api.elasticpath.com/pcm/variations/:variationID/options/:optionID/modifiers/:modifierID

Specify whichever attributes you want to change. The values of the other attributes remain the same. If the attributes section is empty, the modifier is not updated.

Request

Path Parameters

    variationID stringrequired

    A unique identifier for the variation.

    optionID stringrequired

    A unique identifier for the option.

    modifierID stringrequired

    A unique identifier for the modifier.

Body

    data objectrequired
    typestringrequired

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

    Possible values: [product-variation-modifier]

    attributes objectrequired
    typestringrequired

    You can specify different modifiers for different options in a variation. When you build child products using options in variations, the properties of a child products depends on the modifier set for the options that are applied to the child product. The table below describes the different types of modifiers.

    ModifierData TypeEffect
    name_equalsstringOverrides the name of the child product with the name specified by the modifier.
    name_appendstringAppends the string specified in the modifier to the name of the child product.
    name_prependstringPrepends the string specified in the modifier to the name of the child product.
    description_equalsstringOverrides the description of the child product.
    description_appendstringAppends the string specified in the modifier to the description of the child product.
    description_prependstringPrepends the string specified in the modifier to the product description of the child product.
    commodity_typestringSets the commodity type of the child product, such as physical or digital.
    pricestringAllows application of price modifiers (price_increment, price_decrement, and price_equals) to the child products.
    price_incrementstringIncreases the price of the child product.
    price_decrementstringDecreases the price of the child product.
    price_equalsstringSets the price of a child product to the amount you specify.
    slug_appendstringAppends the string specified in the modifier to the slug of the child product. Can only contain A-Z, a-z, 0 to 9, hyphen, underscore, and period. Spaces or other special characters like ^, [], *, and $ are not allowed. However, for the slug-builder modifier, you can use {} in the seek field, for example, "seek": :{COLOR}".
    slug_prependstringPrepends the string specified in the modifier to the slug of the child product. Can only contain A-Z, a-z, 0 to 9, hyphen, underscore, and period. Spaces or other special characters like ^, [], *, and $ are not allowed. However, for the slug-builder modifier, you can use {} in the seek field, for example, "seek": :{COLOR}".
    slug_builderstringSets a part of the slug of the child product. Can only contain A-Z, a-z, 0 to 9, hyphen, underscore, and period. Spaces or other special characters like ^, [], *, and $ are not allowed. However, for the slug-builder modifier, you can use {} in the seek field, for example, "seek": :{COLOR}".
    sku_equalsstringSets the SKU of the child product.
    sku_appendstringAppends the string specified in the modifier to the SKU of the child product.
    sku_prependstringPrepends the string specified in the modifier to the SKU of the child product.
    sku_builderstringSets a part of the SKU of the child product.
    statusstringSets the status of the child product, such as draft or live.

    Possible values: [commodity_type, status, price, name_append, name_prepend, name_equals, sku_append, sku_prepend, sku_equals, sku_builder, slug_append, slug_prepend, slug_equals, slug_builder, description_append, description_prepend, description_equals, custom_inputs_equals, build_rules_equals, locales_equals, upc_ean_equals, mpn_equals, external_ref_equals]

    valuestring

    Required for non-builder modifiers. The value of the modifier type.

    seekstring

    Required for builder modifiers. The sub-string to find and replace enclosed in curly brackets for slug_builder and sku_builder.

    setstring

    Required for builder modifiers. The value to replace matches the seek string for slug_builder and sku_builder.

    reference_namestring

    The name of the modifier.

    idstringrequired

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

    Example: 00000000-0000-0000-0000-000000000000

Responses

Successfully returns the updated modifier.

Schema
    data object
    idstring

    A unique identifier for a modifier that is generated automatically when a modifier is created.

    typestring

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

    Possible values: [product-variation-modifier]

    attributes object
    typestring

    You can specify different modifiers for different options in a variation. When you build child products using options in variations, the properties of a child products depends on the modifier set for the options that are applied to the child product. The table below describes the different types of modifiers.

    ModifierData TypeEffect
    name_equalsstringOverrides the name of the child product with the name specified by the modifier.
    name_appendstringAppends the string specified in the modifier to the name of the child product.
    name_prependstringPrepends the string specified in the modifier to the name of the child product.
    description_equalsstringOverrides the description of the child product.
    description_appendstringAppends the string specified in the modifier to the description of the child product.
    description_prependstringPrepends the string specified in the modifier to the product description of the child product.
    commodity_typestringSets the commodity type of the child product, such as physical or digital.
    pricestringAllows application of price modifiers (price_increment, price_decrement, and price_equals) to the child products.
    price_incrementstringIncreases the price of the child product.
    price_decrementstringDecreases the price of the child product.
    price_equalsstringSets the price of a child product to the amount you specify.
    slug_appendstringAppends the string specified in the modifier to the slug of the child product. Can only contain A-Z, a-z, 0 to 9, hyphen, underscore, and period. Spaces or other special characters like ^, [], *, and $ are not allowed. However, for the slug-builder modifier, you can use {} in the seek field, for example, "seek": :{COLOR}".
    slug_prependstringPrepends the string specified in the modifier to the slug of the child product. Can only contain A-Z, a-z, 0 to 9, hyphen, underscore, and period. Spaces or other special characters like ^, [], *, and $ are not allowed. However, for the slug-builder modifier, you can use {} in the seek field, for example, "seek": :{COLOR}".
    slug_builderstringSets a part of the slug of the child product. Can only contain A-Z, a-z, 0 to 9, hyphen, underscore, and period. Spaces or other special characters like ^, [], *, and $ are not allowed. However, for the slug-builder modifier, you can use {} in the seek field, for example, "seek": :{COLOR}".
    sku_equalsstringSets the SKU of the child product.
    sku_appendstringAppends the string specified in the modifier to the SKU of the child product.
    sku_prependstringPrepends the string specified in the modifier to the SKU of the child product.
    sku_builderstringSets a part of the SKU of the child product.
    statusstringSets the status of the child product, such as draft or live.

    Possible values: [commodity_type, status, price, name_append, name_prepend, name_equals, sku_append, sku_prepend, sku_equals, sku_builder, slug_append, slug_prepend, slug_equals, slug_builder, description_append, description_prepend, description_equals, custom_inputs_equals, build_rules_equals, locales_equals, upc_ean_equals, mpn_equals, external_ref_equals]

    valuestring

    Required for non-builder modifiers. The value of the modifier type.

    seekstring

    Required for builder modifiers. The sub-string to find and replace enclosed in curly brackets for slug_builder and sku_builder.

    setstring

    Required for builder modifiers. The value to replace matches the seek string for slug_builder and sku_builder.

    reference_namestring

    The name of the modifier.

    meta object

    The owner of the resource, either organization or store.

    ownerstring

    Possible values: [organization, store]

Authorization: http

name: bearerAuthtype: httpscheme: bearer
var client = new HttpClient();
var request = new HttpRequestMessage(HttpMethod.Put, "https://euwest.api.elasticpath.com/pcm/variations/:variationID/options/:optionID/modifiers/:modifierID");
request.Headers.Add("Accept", "application/json");
request.Headers.Add("Authorization", "Bearer <token>");
var content = new StringContent("{\n \"data\": {\n \"type\": \"product-variation-modifier\",\n \"attributes\": {\n \"type\": \"commodity_type\",\n \"value\": \"string\",\n \"seek\": \"string\",\n \"set\": \"string\",\n \"reference_name\": \"string\"\n },\n \"id\": \"00000000-0000-0000-0000-000000000000\"\n }\n}", null, "application/json");
request.Content = content;
var response = await client.SendAsync(request);
response.EnsureSuccessStatusCode();
Console.WriteLine(await response.Content.ReadAsStringAsync());
Request Collapse all
Base URL
https://euwest.api.elasticpath.com
Auth
Parameters
— pathrequired
— pathrequired
— pathrequired
Body
{
  "data": {
    "type": "product-variation-modifier",
    "attributes": {
      "type": "commodity_type",
      "value": "string",
      "seek": "string",
      "set": "string",
      "reference_name": "string"
    },
    "id": "00000000-0000-0000-0000-000000000000"
  }
}
ResponseClear

Click the Send API Request button above and see the response here!