Create Product Modifier

post
Create a new product modifier

https://api.moltin.com/v2/variations/:variationId/options/:optionId/modifiers
Request
Response
Path Parameters
variationId
required
string
The ID of the variation belonging to this modifier.
optionId
required
string
The ID of the option belonging to the modifier.
Headers
Authorization
required
string
The Bearer token used to grant access to the API.
Body Parameters
type
optional
string
Represents the type of object being created (should be modifier).
modifier_type
optional
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
optional
string
A payload specific to the type of modifier.
201: Created
{
"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
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"
}
}