graphqlshopify

Shopify GraphQL API: Create a Basic Product and Set the Price with 2024-10 API version


Old versions of the Shopify GraphQL productCreate mutation seemingly offered a variants field where you could set the price of the product you were creating.

The latest version as of writing this (2024-10) does not seem to have this option.

Is there a way to create a basic product with only one variant (or no variants!) and set a price in a single operation?

And if it must be done in two operations? What is the correct second mutation?


Solution

  • @CleverPatrick , We need to follow these steps:

    First, create a product for ID, then add a variant with price, though productVariantsBulkCreate is preferred even for single variants.