Skip to main content

Create variant option

Use the Create variant options mutation to create a variant for physical goods (physical product or hardware service).

The mutation requires you to have a product shell in place.

EXAMPLE-- For the product iPhone 13 Pro, variant options are Finish, Capacity and Carrier. Use the mutation to define these options and the input type for these options. The input type for Finish is color and for Capacity and Carrier the input type is text.

Mutation

mutation($input: AddProductVariantOptionInput!){
addProductVariantOption(input: $input) {
product {
id
variantOptions {
code
name {
locale
value
}
inputType
}
}
userErrors{
... on UserError {
__typename
message
path
}
}
}
}

Was this page helpful?