Establishing inventory management for basic Shopify products without variants using GraphQL

I’m exploring Shopify’s GraphQL admin API and I’m facing challenges while trying to set up inventory management for simple products that don’t require any variants or options.

Initially, here’s how I’m creating the product:

mutation {
  productCreate(product: {
    title: "Fantastic Hoodie",
    productOptions: [{
      name: "Fabric Type",
      values: [{name: "Wool"}, {name: "Acrylic"}]
    }, {
      name: "Cut",
      values: [{name: "Standard"}, {name: "Athletic"}]
    }]
  }) {
    product {
      id
      title
      options {
        id
        name
        position
        optionValues {
          id
          name
          hasVariants
        }
      }
    }
    userErrors {
      field
      message
    }
  }
}

This method successfully creates the product and returns the product ID. However, I’m struggling to find a way to incorporate inventory tracking for this product. The productCreate mutation appears to lack a feature for defining inventory items necessary for managing stock, prices, and other inventory aspects.

I considered using productVariantsBulkCreate to implement inventory tracking but it needs option values, which I prefer to avoid:

{
  "data": {
    "productVariantsBulkCreate": {
      "productVariants": [],
      "userErrors": [
        {
          "field": ["variants", "0"],
          "message": "Option values required for Title"
        }
      ]
    }
  }
}

I’ve also reviewed the inventory-related mutations, but they don’t seem useful for creating new inventory items, as they mainly focus on modifying existing inventory.

What’s the best method to create a basic product with inventory management but no variants?

You’re overcomplicating this. Shopify always creates a default variant behind the scenes - even for simple products. That’s just how it works. Ditch the productOptions from your mutation entirely. Just use basic productCreate with title and other fields. After you create the product, query it to grab the auto-generated variant ID. Then use inventoryItemUpdate or inventoryLevelSet to manage stock. I’ve been using Shopify’s GraphQL API for two years and this works every time. Here’s the thing - Shopify’s inventory system runs on variants, period. Stop fighting the default variant and just work with it. Once you’ve got that variant ID, managing inventory is easy with the standard mutations.

You’re mixing up product creation patterns. Your mutation includes productOptions, which forces Shopify into variant mode - but you’re not providing the variant data it needs. For a simple product without variants, just remove productOptions from your productCreate mutation. Shopify will still create a default variant internally (you can’t avoid this, and you actually want it for inventory tracking). After creating the product, fetch the default variant that was auto-generated. Use a product query to get the variant ID, then use inventoryLevelSet or inventoryBulkAdjustQuantityAtLocation mutations to set stock levels. Here’s the thing - inventory in Shopify is always tied to variants, even for simple products. You can’t bypass this, but you can work with it by embracing the default variant instead of trying to avoid variants completely.

Your productCreate mutation is the problem - you’re adding productOptions when you don’t need them. Just create a bare product without options. Shopify automatically creates a default variant anyway. Then query the product to get that default variant ID and use inventoryLevelSet for stock management. That’s it - skip productVariantsBulkCreate and all the fancy stuff.