Create Product Modifier

Create a new product modifier

POST https://api.moltin.com/v2/variations/:variationId/options/:optionId/modifiers

Path Parameters

NameTypeDescription

variationId

string

The ID of the variation belonging to this modifier.

optionId

string

The ID of the option belonging to the modifier.

Headers

NameTypeDescription

Authorization

string

The Bearer token used to grant access to the API.

Request Body

NameTypeDescription

type

string

Represents the type of object being created (should be modifier).

modifier_type

string

price_increment, price_decrement, price_equals, sku_builder, slug_builder, description_equals, description_prepend, description_append, commoditytype, name_equals, name_prepend, name_append, slug_equals, slug_append, sku_equals, sku_prepend, sku_append, status

value

string

A payload specific to the type of modifier.

{
    "data": {
        "id": "5ecf77e7-047a-4a3d-ad8c-b559ecd3df36",
        "name": "Paint colour",
        "options": [
            {
                "description": "Our most popular color",
                "id": "71784b68-9d82-420b-a5fc-00fe4bca8b2e",
                "modifiers": [
                    {
                        "id": "8080083a-4765-47ac-9ea8-ea875acd0f92",
                        "type": "name_equals",
                        "value": "Updated product name"
                    }
                ],
                "name": "Blue"
            }
        ],
        "relationships": {
            "options": {
                "data": [
                    {
                        "id": "71784b68-9d82-420b-a5fc-00fe4bca8b2e",
                        "type": "option"
                    }
                ]
            }
        },
        "type": "product-variation"
    }
}
curl -X POST https://api.moltin.com/v2/variations/:variationId/options/:optionId/modifiers \
     -H "Authorization: Bearer XXXX" \
     -H "Content-Type: application/json" \
     -d $'{
      "data": {
        "type": "modifier",
        "modifier_type": "name_equals",
        "value": "Updated product name"
      }
    }

Last updated