Retrieves a list of product variants associated with a product.
A product variant is a specific version of a product that comes in more than one option, such as size or color. For example, if a merchant sells t-shirts with options for size and color, then a small, blue t-shirt would be one product variant and a large, blue t-shirt would be another.
Use the productVariants
query when you need to:
The productVariants
query supports pagination to handle large product catalogs and saved searches for frequently used product variant queries.
The productVariants
query returns product variants with their associated metadata, including:
Learn more about working with Shopify's product model.
ProductVariantConnection!The elements that come after the specified cursor.
The elements that come before the specified cursor.
A filter made up of terms, connectives, modifiers, and comparators. You can apply one or more filters to a query. Learn more about Shopify API search syntax.
Filter by a case-insensitive search of multiple fields in a document.
Example:
query=Bob Norman
query=title:green hoodie
Filter by the product variant barcode
field.
Example:
barcode:ABC-abc-123
Filter by the ID of the collection that the product variant belongs to.
Example:
collection:465903092033
Filter by the product variant delivery profile ID (ProductVariant.deliveryProfile.id
).
Example:
delivery_profile_id:108179161409
Filter by product variants that aren't composites.
Example:
exclude_composite:true
Filter by whether there are components that are associated with the product variants in a bundle.
Example:
exclude_variants_with_components:true
Filter by id
range.
Example:
id:1234
id:>=1234
id:<=1234
Filter by an aggregate of inventory across all locations where the product variant is stocked.
Example:
inventory_quantity:10
Filter by the location ID for the product variant.
Example:
location_id:88511152449
Filter by whether there is fulfillment service tracking associated with the product variants.
Filter by the fulfillment service that tracks the number of items in stock for the product variant.
Example:
managed_by:shopify
Filter by a custom property that a shop owner uses to define product variants.
Filter by a custom property that a shop owner uses to define product variants.
Filter by a custom property that a shop owner uses to define product variants.
Filter by the product id
field.
Example:
product_id:8474977763649
Filter by a comma-separated list of product IDs.
Example:
product_ids:8474977763649,8474977796417
Filter by the publication status of the resource on a channel, such as the online store. The value is a composite of the channel app
ID (Channel.app.id
) and one of the valid values.
Valid values:
approved
rejected
needs_action
awaiting_review
published
demoted
scheduled
provisionally_published
Example:
product_publication_status:189769876-approved
Filter by a comma-separated list of product statuses.
Example:
product_status:ACTIVE,DRAFT
Filter by the product type that's associated with the product variants.
Example:
product_type:snowboard
Filter by the publishable status of the resource on a channel, such as the online store. The value is a composite of either the channel app
ID (Channel.app.id
) or channel name
and one of the valid values.
Valid values:
online_store_channel
published
unpublished
visible
unavailable
hidden
intended
visible
Example:
publishable_status:published
publishable_status:189769876-visible
publishable_status:pos-hidden
Filter by the published status of the resource on a channel, such as the online store.
Valid values:
unset
pending
approved
not approved
Example:
published_status:approved
Filter by whether the product variant can only be purchased with components. Learn more.
Example:
requires_components:true
Filter objects by the tag
field.
Filter by objects that don’t have the specified tag.
Filter by the product variant taxable
field.
Filter by the product variant title
field.
Filter by date and time when the product variant was updated.
Example:
updated_at:>2020-10-21T23:39:20Z
updated_at:<now
updated_at:<=2024
Reverse the order of the underlying list.
The ID of a saved search. The search’s query string is used as the query argument.
The connection between the node and its parent. Each edge contains a minimum of the edge's cursor and the node.
A list of nodes that are contained in ProductVariantEdge. You can fetch data about an individual node, or you can follow the edges to fetch data about a collection of related nodes. At each node, you specify the fields that you want to retrieve.
query ProductVariantsList { productVariants(first: 10, query: "product_id:20995642") { nodes { id title } pageInfo { startCursor endCursor } } }
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": "query ProductVariantsList { productVariants(first: 10, query: \"product_id:20995642\") { nodes { id title } pageInfo { startCursor endCursor } } }" }'
const { admin } = await authenticate.admin(request); const response = await admin.graphql( `#graphql query ProductVariantsList { productVariants(first: 10, query: "product_id:20995642") { nodes { id title } pageInfo { startCursor endCursor } } }`, ); const data = await response.json();
const client = new shopify.clients.Graphql({session}); const data = await client.query({ data: `query ProductVariantsList { productVariants(first: 10, query: "product_id:20995642") { nodes { id title } pageInfo { startCursor endCursor } } }`, });
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 query ProductVariantsList { productVariants(first: 10, query: "product_id:20995642") { nodes { id title } pageInfo { startCursor endCursor } } } 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