Shopify Admin API - Create Product

Topic summary

A developer is experiencing issues with Shopify’s Admin GraphQL API when creating products with multiple options.

The Problem:

  • When creating a product with two options (“Størrelse” with 3 values and “Ramme” with 5 values), only the first combination variant appears in the Shopify UI
  • The API response correctly shows all option values, and querying the product by ID returns the expected data
  • However, the UI only displays one variant (e.g., “A4 / Ingen ramme”) instead of all possible combinations

Attempted Solutions:

  • One responder suggested the issue might be related to the 3-option maximum per variant, but this didn’t resolve the problem
  • The original poster confirmed the mutation still doesn’t create all expected variants in the UI

Current Understanding:

  • Another participant explained this appears to be default Shopify behavior: products have at least one variant by default
  • Variants for each option combination must be explicitly created using productVariant mutations
  • A field called hasVariants can be checked when querying products

Status: The issue remains unresolved regarding automatic variant generation, with the discussion suggesting manual variant creation may be required.

Summarized with AI on November 8. AI used: claude-sonnet-4-5-20250929.

Hello,

I am trying out the shopify admin API, and I have reason to believe that it doesn’t work as intended when creating a product. Can you please confirm

I send this mutation:

mutation {
  productCreate(input:{
      title: "aa - Magnus Test Product", 
  productType: "Print", 
  vendor: "Test",
  status: DRAFT,
    productOptions: [{
      name: "Størrelse",
      position: 1,
      values: [
        {name: "A4 (21x29.7 cm)"},
        {name:"30x40 cm"}, 
        {name: "50x70 cm"}
      ]
    },
    {
        name: "Ramme",
        position:2,
        values: [
            {name: "Ingen ramme"},
            {name: "Sort ramme"},
            {name: "Massiv eg"},
            {name: "Hvid ramme"},
            {name: "Ege look"}
        ]
    }
    ]
  }) {
    product {
      id,
        options (first: 100) {
        name,
        optionValues {
          name,  
        }
      }
    }
  }
}

And get this response:

{
    "data": {
        "productCreate": {
            "product": {
                "id": "gid://shopify/Product/9446736462165",
                "options": [
                    {
                        "name": "Størrelse",
                        "optionValues": [
                            {
                                "name": "A4 (21x29.7 cm)"
                            },
                            {
                                "name": "30x40 cm"
                            },
                            {
                                "name": "50x70 cm"
                            }
                        ]
                    },
                    {
                        "name": "Ramme",
                        "optionValues": [
                            {
                                "name": "Ingen ramme"
                            },
                            {
                                "name": "Sort ramme"
                            },
                            {
                                "name": "Massiv eg"
                            },
                            {
                                "name": "Hvid ramme"
                            },
                            {
                                "name": "Ege look"
                            }
                        ]
                    }
                ]
            }
        }
    },
    "extensions": {
        "cost": {
            "requestedQueryCost": 12,
            "actualQueryCost": 12,
            "throttleStatus": {
                "maximumAvailable": 2000,
                "currentlyAvailable": 1988,
                "restoreRate": 100
            }
        }
    }
}

So far, so good.

It seems like shopify does correctly catch my options. The thing is visible whenever I query the product by ID. HOWEVER

When i go to the UI of the product, it doesn’t quite seem to work.

I can only see the first of the two options, and then a variant has been created for the combination of the two options.

“A4 / ingen ramme” for example (see image as well)

How come this is only created for the first combinations, and what is the approach to make it happen for all?

Best regards,

magnussampson

Hi @magnussampson ,

Since each variant can have a maximum of 3 options, please try again.

mutation {
  productCreate(input:{
      title: "aa - Magnus Test Product", 
  productType: "Print", 
  vendor: "Test",
  status: DRAFT,
    productOptions: [
    {
      name: "Størrelse",
      position: 1,
      values: [
        {name: "A4 (21x29.7 cm)"},
        {name:"30x40 cm"}, 
        {name: "50x70 cm"}
      ]
    },
    {
        name: "Ramme",
        position:2,
        values: [
            {name: "Ingen ramme"},
            {name: "Sort ramme"},
            {name: "Massiv eg"}
        ]
    }
    ]
  }) {
    product {
      id,
        options (first: 100) {
        name,
        optionValues {
          name,  
        }
      }
    }
  }
}

Hi! Thanks for the quick answer. Unfortunately that didn’t change anything.

AS before I seem to get the correct response but when looking in the UI I’ve only managed to create one of the provided options

Best regards,

Magnus

Hi,there

I think this is the default behavior. Shopify’s default behavior ensures that products have at least one variant. By using the Product query GraphQL , you can easily check the presence of variants for a product, you will find there is a filed called hasVariant of every option. Only you create the productVariant explicitly for corresponding option combination . The variant in UI can be visible.