Requires write_products
access scope. Also: The user must have a permission to create products.
Creates a product with attributes such as title, description, vendor, and media.
The productCreate
mutation helps you create many products at once, avoiding the tedious or time-consuming process of adding them one by one in the Shopify admin. Common examples include creating products for a new collection, launching a new product line, or adding seasonal products.
You can define product options and values, allowing you to create products with different variations like sizes or colors. You can also associate media files to your products, including images and videos.
The productCreate
mutation only supports creating a product with its initial product variant. To create multiple product variants for a single product and manage prices, use the productVariantsBulkCreate
mutation.
The productCreate
mutation has a throttle that takes effect when a store has 50,000 product variants. After this threshold is reached, no more than 1,000 new product variants can be created per day.
After you create a product, you can make subsequent edits to the product using one of the following mutations:
publishablePublish
: Used to publish the product and make it available to customers. The productCreate
mutation creates products in an unpublished state by default, so you must perform a separate operation to publish the product.productUpdate
: Used to update a single product, such as changing the product's title, description, vendor, or associated media.productSet
: Used to perform multiple operations on products, such as creating or modifying product options and variants.Learn more about the product model and adding product data.
The media to add to the product.
The attributes of the new product.
The shop associated with the product.
The list of errors that occurred from executing the mutation.
mutation { productCreate(product: {title: "Cool socks", productOptions: [{name: "Color", values: [{name: "Red"}, {name: "Blue"}]}, {name: "Size", values: [{name: "Small"}, {name: "Large"}]}]}) { product { id title options { id name position optionValues { id name hasVariants } } } userErrors { field message } } }
curl -X POST \ https://your-development-store.myshopify.com/admin/api/2025-07/graphql.json \ -H 'Content-Type: application/json' \ -H 'X-Shopify-Access-Token: {access_token}' \ -d '{ "query": "mutation { productCreate(product: {title: \"Cool socks\", productOptions: [{name: \"Color\", values: [{name: \"Red\"}, {name: \"Blue\"}]}, {name: \"Size\", values: [{name: \"Small\"}, {name: \"Large\"}]}]}) { product { id title options { id name position optionValues { id name hasVariants } } } userErrors { field message } } }" }'
const { admin } = await authenticate.admin(request); const response = await admin.graphql( `#graphql mutation { productCreate(product: {title: "Cool socks", productOptions: [{name: "Color", values: [{name: "Red"}, {name: "Blue"}]}, {name: "Size", values: [{name: "Small"}, {name: "Large"}]}]}) { product { id title options { id name position optionValues { id name hasVariants } } } userErrors { field message } } }`, ); const data = await response.json();
const client = new shopify.clients.Graphql({session}); const data = await client.query({ data: `mutation { productCreate(product: {title: "Cool socks", productOptions: [{name: "Color", values: [{name: "Red"}, {name: "Blue"}]}, {name: "Size", values: [{name: "Small"}, {name: "Large"}]}]}) { product { id title options { id name position optionValues { id name hasVariants } } } userErrors { field message } } }`, });
session = ShopifyAPI::Auth::Session.new( shop: "your-development-store.myshopify.com", access_token: access_token ) client = ShopifyAPI::Clients::Graphql::Admin.new( session: session ) query = <<~QUERY mutation { productCreate(product: {title: "Cool socks", productOptions: [{name: "Color", values: [{name: "Red"}, {name: "Blue"}]}, {name: "Size", values: [{name: "Small"}, {name: "Large"}]}]}) { product { id title options { id name position optionValues { id name hasVariants } } } userErrors { field message } } } QUERY response = client.query(query: query)
RetroSearch is an open source project built by @garambo | Open a GitHub Issue
Search and Browse the WWW like it's 1997 | Search results from DuckDuckGo
HTML:
3.2
| Encoding:
UTF-8
| Version:
0.7.4