# productVariants - admin-graphql - QUERY
Version: 2025-01

## Description
Returns a list of product variants.

### Access Scopes



## Arguments
* [after](/docs/api/admin-graphql/2025-01/scalars/String): String - The elements that come after the specified [cursor](https://shopify.dev/api/usage/pagination-graphql).
* [before](/docs/api/admin-graphql/2025-01/scalars/String): String - The elements that come before the specified [cursor](https://shopify.dev/api/usage/pagination-graphql).
* [first](/docs/api/admin-graphql/2025-01/scalars/Int): Int - The first `n` elements from the [paginated list](https://shopify.dev/api/usage/pagination-graphql).
* [last](/docs/api/admin-graphql/2025-01/scalars/Int): Int - The last `n` elements from the [paginated list](https://shopify.dev/api/usage/pagination-graphql).
* [query](/docs/api/admin-graphql/2025-01/scalars/String): String - A filter made up of terms, connectives, modifiers, and comparators.
| name | type | description | acceptable_values | default_value | example_use |
| ---- | ---- | ---- | ---- | ---- | ---- |
| default | string | Filter by a case-insensitive search of multiple fields in a document. | | | - `query=Bob Norman`<br/> - `query=title:green hoodie` |
| barcode | string | Filter by the product variant [`barcode`](https://shopify.dev/api/admin-graphql/latest/objects/ProductVariant#field-barcode) field. | | | - `barcode:ABC-abc-123` |
| collection | string | Filter by the [ID of the collection](https://shopify.dev/api/admin-graphql/latest/objects/Collection#field-id) that the product variant belongs to. | | | - `collection:465903092033` |
| delivery_profile_id | id | Filter by the product variant [delivery profile ID](https://shopify.dev/api/admin-graphql/latest/objects/ProductVariant#field-deliveryprofile) (`ProductVariant.deliveryProfile.id`). | | | - `delivery_profile_id:108179161409` |
| exclude_composite | boolean | Filter by product variants that aren't composites. | | | - `exclude_composite:true` |
| exclude_variants_with_components | boolean | Filter by whether there are [components](https://shopify.dev/docs/apps/build/product-merchandising/bundles/add-product-fixed-bundle) that are associated with the product variants in a bundle. | | | - `exclude_variants_with_components:true` |
| gift_card | boolean | Filter by the product [`isGiftCard`](https://shopify.dev/api/admin-graphql/latest/objects/Product#field-isgiftcard) field. | | | - `gift_card:true` |
| id | id | Filter by `id` range. | | | - `id:1234`<br/> - `id:>=1234`<br/> - `id:<=1234` |
| inventory_quantity | integer | Filter by an aggregate of inventory across all locations where the product variant is stocked. | | | - `inventory_quantity:10` |
| location_id | id | Filter by the [location ID](https://shopify.dev/api/admin-graphql/latest/objects/Location#field-id) for the product variant. | | | - `location_id:88511152449` |
| managed | boolean | Filter by whether there is fulfillment service tracking associated with the product variants. | | | - `managed:true` |
| managed_by | string | Filter by the fulfillment service that tracks the number of items in stock for the product variant. | | | - `managed_by:shopify` |
| option1 | string | Filter by a custom property that a shop owner uses to define product variants. | | | - `option1:small` |
| option2 | string | Filter by a custom property that a shop owner uses to define product variants. | | | - `option2:medium` |
| option3 | string | Filter by a custom property that a shop owner uses to define product variants. | | | - `option3:large` |
| product_id | id | Filter by the product [`id`](https://shopify.dev/api/admin-graphql/latest/objects/Product#field-id) field. | | | - `product_id:8474977763649` |
| product_ids | string | Filter by a comma-separated list of product [IDs](https://shopify.dev/api/admin-graphql/latest/objects/Product#field-id). | | | - `product_ids:8474977763649,8474977796417` |
| product_publication_status | string | Filter by the publishable status of the resource on a channel, such as the online store. The value is a composite of the [channel `app` ID](https://shopify.dev/api/admin-graphql/latest/objects/Channel#app-price) (`Channel.app.id`) and one of the valid values. | - `approved`<br/> - `rejected`<br/> - `needs_action`<br/> - `awaiting_review`<br/> - `published`<br/> - `demoted`<br/> - `scheduled`<br/> - `provisionally_published` | | - `publishable_status:189769876-approved` |
| product_status | string | Filter by a comma-separated list of product [statuses](https://shopify.dev/api/admin-graphql/latest/objects/Product#field-status). | | | - `product_status:ACTIVE,DRAFT` |
| product_type | string | Filter by the product type that's associated with the product variants. | | | - `product_type:snowboard` |
| publishable_status | string | 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](https://shopify.dev/api/admin-graphql/latest/objects/Channel#app-price) (`Channel.app.id`) or [channel `name`](https://shopify.dev/docs/api/admin-graphql/latest/objects/Channel#field-name) and one of the valid values. | - `online_store_channel`<br/> - `published`<br/> - `unpublished`<br/> - `visible`<br/> - `unavailable`<br/> - `hidden`<br/> - `intended`<br/> - `visible` | | - `publishable_status:published`<br/> - `publishable_status:189769876:visible`<br/> - `publishable_status:pos:hidden` |
| published_status | string | Filter by the published status of the resource on a channel, such as the online store. | - `unset`<br/> - `pending`<br/> - `approved`<br/> - `not approved` | | - `published_status:approved` |
| requires_components | boolean | Filter by whether the product variant can only be purchased with components. [Learn more](https://shopify.dev/apps/build/product-merchandising/bundles#store-eligibility). | | | - `requires_components:true` |
| sku | string | Filter by the product variant [`sku`](https://shopify.dev/api/admin-graphql/latest/objects/ProductVariant#field-sku) field. [Learn more about SKUs](https://help.shopify.com/manual/products/details/sku). | | | - `sku:XYZ-12345` |
| tag | string | Filter objects by the `tag` field. | | | - `tag:my_tag` |
| tag_not | string | Filter by objects that don’t have the specified tag. | | | - `tag_not:my_tag` |
| taxable | boolean | Filter by the product variant [`taxable`](https://shopify.dev/api/admin-graphql/latest/objects/ProductVariant#field-taxable) field. | | | - `taxable:false` |
| title | string | Filter by the product variant [`title`](https://shopify.dev/api/admin-graphql/latest/objects/ProductVariant#field-title) field. | | | - `title:ice` |
| updated_at | time | Filter by date and time when the product variant was updated. | | | - `updated_at:>2020-10-21T23:39:20Z`<br/> - `updated_at:<now`<br/> - `updated_at:<=2024` |
| vendor | string | Filter by the origin or source of the product variant. Learn more about [vendors and managing vendor information](https://help.shopify.com/manual/products/managing-vendor-info). | | | - `vendor:Snowdevil`<br/> - `vendor:Snowdevil OR vendor:Icedevil` |
You can apply one or more filters to a query. Learn more about [Shopify API search syntax](https://shopify.dev/api/usage/search-syntax).

* [reverse](/docs/api/admin-graphql/2025-01/scalars/Boolean): Boolean - Reverse the order of the underlying list.
* [savedSearchId](/docs/api/admin-graphql/2025-01/scalars/ID): ID - The ID of a [saved search](https://shopify.dev/api/admin-graphql/latest/objects/savedsearch#field-id).
The search’s query string is used as the query argument.
* [sortKey](/docs/api/admin-graphql/2025-01/enums/ProductVariantSortKeys): ProductVariantSortKeys - Sort the underlying list using a key. If your query is slow or returns an error, then [try specifying a sort key that matches the field used in the search](https://shopify.dev/api/usage/pagination-graphql#search-performance-considerations).


## Returns
* [edges](/docs/api/admin-graphql/2025-01/objects/ProductVariantEdge): ProductVariantEdge! The connection between the node and its parent. Each edge contains a minimum of the edge's cursor and the node.
* [nodes](/docs/api/admin-graphql/2025-01/objects/ProductVariant): ProductVariant! 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.
* [pageInfo](/docs/api/admin-graphql/2025-01/objects/PageInfo): PageInfo! An object that’s used to retrieve [cursor information](https://shopify.dev/api/usage/pagination-graphql) about the current page.


## Examples
### Get multiple product variants using their IDs and GraphQL aliases
Curl example: "curl -X POST \\\nhttps://your-development-store.myshopify.com/admin/api/2025-01/graphql.json \\\n-H 'Content-Type: application/json' \\\n-H 'X-Shopify-Access-Token: {access_token}' \\\n-d '{\n\"query\": \"query { productVariant1: productVariant(id: \\\"gid://shopify/ProductVariant/30322695\\\") { id title } productVariant2: productVariant(id: \\\"gid://shopify/ProductVariant/43729076\\\") { id title } productVariant3: productVariant(id: \\\"gid://shopify/ProductVariant/113711323\\\") { id title } }\"\n}'\n"
Node example: "const client = new shopify.clients.Graphql({session});\nconst data = await client.query({\n  data: `query {\n    productVariant1: productVariant(id: \"gid://shopify/ProductVariant/30322695\") {\n      id\n      title\n    }\n    productVariant2: productVariant(id: \"gid://shopify/ProductVariant/43729076\") {\n      id\n      title\n    }\n    productVariant3: productVariant(id: \"gid://shopify/ProductVariant/113711323\") {\n      id\n      title\n    }\n  }`,\n});\n"
Ruby example: "session = ShopifyAPI::Auth::Session.new(\n  shop: \"your-development-store.myshopify.com\",\n  access_token: access_token\n)\nclient = ShopifyAPI::Clients::Graphql::Admin.new(\n  session: session\n)\n\nquery = <<~QUERY\n  query {\n    productVariant1: productVariant(id: \"gid://shopify/ProductVariant/30322695\") {\n      id\n      title\n    }\n    productVariant2: productVariant(id: \"gid://shopify/ProductVariant/43729076\") {\n      id\n      title\n    }\n    productVariant3: productVariant(id: \"gid://shopify/ProductVariant/113711323\") {\n      id\n      title\n    }\n  }\nQUERY\n\nresponse = client.query(query: query)\n" 
Remix example: "const { admin } = await authenticate.admin(request);\n\nconst response = await admin.graphql(\n  `#graphql\n  query {\n    productVariant1: productVariant(id: \"gid://shopify/ProductVariant/30322695\") {\n      id\n      title\n    }\n    productVariant2: productVariant(id: \"gid://shopify/ProductVariant/43729076\") {\n      id\n      title\n    }\n    productVariant3: productVariant(id: \"gid://shopify/ProductVariant/113711323\") {\n      id\n      title\n    }\n  }`,\n);\n\nconst data = await response.json();\n"
Graphql query: "query {\n  productVariant1: productVariant(id: \"gid://shopify/ProductVariant/30322695\") {\n    id\n    title\n  }\n  productVariant2: productVariant(id: \"gid://shopify/ProductVariant/43729076\") {\n    id\n    title\n  }\n  productVariant3: productVariant(id: \"gid://shopify/ProductVariant/113711323\") {\n    id\n    title\n  }\n}"
#### Graphql Input
null
#### Graphql Response
{
  "data": {
    "productVariant1": {
      "id": "gid://shopify/ProductVariant/30322695",
      "title": "151cm"
    },
    "productVariant2": {
      "id": "gid://shopify/ProductVariant/43729076",
      "title": "151cm"
    },
    "productVariant3": {
      "id": "gid://shopify/ProductVariant/113711323",
      "title": "155cm"
    }
  }
}

### Get the IDs of the first 10 product variants
Curl example: "curl -X POST \\\nhttps://your-development-store.myshopify.com/admin/api/2025-01/graphql.json \\\n-H 'Content-Type: application/json' \\\n-H 'X-Shopify-Access-Token: {access_token}' \\\n-d '{\n\"query\": \"query { productVariants(first: 10) { edges { node { id } } } }\"\n}'\n"
Node example: "const client = new shopify.clients.Graphql({session});\nconst data = await client.query({\n  data: `query {\n    productVariants(first: 10) {\n      edges {\n        node {\n          id\n        }\n      }\n    }\n  }`,\n});\n"
Ruby example: "session = ShopifyAPI::Auth::Session.new(\n  shop: \"your-development-store.myshopify.com\",\n  access_token: access_token\n)\nclient = ShopifyAPI::Clients::Graphql::Admin.new(\n  session: session\n)\n\nquery = <<~QUERY\n  query {\n    productVariants(first: 10) {\n      edges {\n        node {\n          id\n        }\n      }\n    }\n  }\nQUERY\n\nresponse = client.query(query: query)\n" 
Remix example: "const { admin } = await authenticate.admin(request);\n\nconst response = await admin.graphql(\n  `#graphql\n  query {\n    productVariants(first: 10) {\n      edges {\n        node {\n          id\n        }\n      }\n    }\n  }`,\n);\n\nconst data = await response.json();\n"
Graphql query: "query {\n  productVariants(first: 10) {\n    edges {\n      node {\n        id\n      }\n    }\n  }\n}"
#### Graphql Input
null
#### Graphql Response
{
  "data": {
    "productVariants": {
      "edges": [
        {
          "node": {
            "id": "gid://shopify/ProductVariant/30322695"
          }
        },
        {
          "node": {
            "id": "gid://shopify/ProductVariant/43729076"
          }
        },
        {
          "node": {
            "id": "gid://shopify/ProductVariant/113711323"
          }
        },
        {
          "node": {
            "id": "gid://shopify/ProductVariant/138327650"
          }
        },
        {
          "node": {
            "id": "gid://shopify/ProductVariant/236948360"
          }
        },
        {
          "node": {
            "id": "gid://shopify/ProductVariant/330284860"
          }
        },
        {
          "node": {
            "id": "gid://shopify/ProductVariant/389013007"
          }
        },
        {
          "node": {
            "id": "gid://shopify/ProductVariant/419425742"
          }
        },
        {
          "node": {
            "id": "gid://shopify/ProductVariant/438458761"
          }
        },
        {
          "node": {
            "id": "gid://shopify/ProductVariant/445365074"
          }
        }
      ]
    }
  }
}

### Get the first three product variants sorted by available quantity at a location.
Curl example: "curl -X POST \\\nhttps://your-development-store.myshopify.com/admin/api/2025-01/graphql.json \\\n-H 'Content-Type: application/json' \\\n-H 'X-Shopify-Access-Token: {access_token}' \\\n-d '{\n\"query\": \"query { productVariants(first: 3, query: \\\"location_id:124656943\\\", sortKey: INVENTORY_LEVELS_AVAILABLE) { edges { node { id inventoryItem { inventoryLevel(locationId: \\\"gid://shopify/Location/124656943\\\") { quantities(names: \\\"available\\\") { quantity name } } } } } } }\"\n}'\n"
Node example: "const client = new shopify.clients.Graphql({session});\nconst data = await client.query({\n  data: `query {\n    productVariants(first: 3, query: \"location_id:124656943\", sortKey: INVENTORY_LEVELS_AVAILABLE) {\n      edges {\n        node {\n          id\n          inventoryItem {\n            inventoryLevel(locationId: \"gid://shopify/Location/124656943\") {\n              quantities(names: \"available\") {\n                quantity\n                name\n              }\n            }\n          }\n        }\n      }\n    }\n  }`,\n});\n"
Ruby example: "session = ShopifyAPI::Auth::Session.new(\n  shop: \"your-development-store.myshopify.com\",\n  access_token: access_token\n)\nclient = ShopifyAPI::Clients::Graphql::Admin.new(\n  session: session\n)\n\nquery = <<~QUERY\n  query {\n    productVariants(first: 3, query: \"location_id:124656943\", sortKey: INVENTORY_LEVELS_AVAILABLE) {\n      edges {\n        node {\n          id\n          inventoryItem {\n            inventoryLevel(locationId: \"gid://shopify/Location/124656943\") {\n              quantities(names: \"available\") {\n                quantity\n                name\n              }\n            }\n          }\n        }\n      }\n    }\n  }\nQUERY\n\nresponse = client.query(query: query)\n" 
Remix example: "const { admin } = await authenticate.admin(request);\n\nconst response = await admin.graphql(\n  `#graphql\n  query {\n    productVariants(first: 3, query: \"location_id:124656943\", sortKey: INVENTORY_LEVELS_AVAILABLE) {\n      edges {\n        node {\n          id\n          inventoryItem {\n            inventoryLevel(locationId: \"gid://shopify/Location/124656943\") {\n              quantities(names: \"available\") {\n                quantity\n                name\n              }\n            }\n          }\n        }\n      }\n    }\n  }`,\n);\n\nconst data = await response.json();\n"
Graphql query: "query {\n  productVariants(first: 3, query: \"location_id:124656943\", sortKey: INVENTORY_LEVELS_AVAILABLE) {\n    edges {\n      node {\n        id\n        inventoryItem {\n          inventoryLevel(locationId: \"gid://shopify/Location/124656943\") {\n            quantities(names: \"available\") {\n              quantity\n              name\n            }\n          }\n        }\n      }\n    }\n  }\n}"
#### Graphql Input
null
#### Graphql Response
{
  "data": {
    "productVariants": {
      "edges": [
        {
          "node": {
            "id": "gid://shopify/ProductVariant/419425742",
            "inventoryItem": {
              "inventoryLevel": {
                "quantities": [
                  {
                    "quantity": 0,
                    "name": "available"
                  }
                ]
              }
            }
          }
        },
        {
          "node": {
            "id": "gid://shopify/ProductVariant/30322695",
            "inventoryItem": {
              "inventoryLevel": {
                "quantities": [
                  {
                    "quantity": 1,
                    "name": "available"
                  }
                ]
              }
            }
          }
        },
        {
          "node": {
            "id": "gid://shopify/ProductVariant/43729076",
            "inventoryItem": {
              "inventoryLevel": {
                "quantities": [
                  {
                    "quantity": 1,
                    "name": "available"
                  }
                ]
              }
            }
          }
        }
      ]
    }
  }
}

### Get the first three product variants updated after the specified date
Curl example: "curl -X POST \\\nhttps://your-development-store.myshopify.com/admin/api/2025-01/graphql.json \\\n-H 'Content-Type: application/json' \\\n-H 'X-Shopify-Access-Token: {access_token}' \\\n-d '{\n\"query\": \"query { productVariants(first: 3, query: \\\"updated_at:>2021-01-01\\\") { edges { node { id title price updatedAt inventoryQuantity product { id title } } } } }\"\n}'\n"
Node example: "const client = new shopify.clients.Graphql({session});\nconst data = await client.query({\n  data: `query {\n    productVariants(first: 3, query: \"updated_at:>2021-01-01\") {\n      edges {\n        node {\n          id\n          title\n          price\n          updatedAt\n          inventoryQuantity\n          product {\n            id\n            title\n          }\n        }\n      }\n    }\n  }`,\n});\n"
Ruby example: "session = ShopifyAPI::Auth::Session.new(\n  shop: \"your-development-store.myshopify.com\",\n  access_token: access_token\n)\nclient = ShopifyAPI::Clients::Graphql::Admin.new(\n  session: session\n)\n\nquery = <<~QUERY\n  query {\n    productVariants(first: 3, query: \"updated_at:>2021-01-01\") {\n      edges {\n        node {\n          id\n          title\n          price\n          updatedAt\n          inventoryQuantity\n          product {\n            id\n            title\n          }\n        }\n      }\n    }\n  }\nQUERY\n\nresponse = client.query(query: query)\n" 
Remix example: "const { admin } = await authenticate.admin(request);\n\nconst response = await admin.graphql(\n  `#graphql\n  query {\n    productVariants(first: 3, query: \"updated_at:>2021-01-01\") {\n      edges {\n        node {\n          id\n          title\n          price\n          updatedAt\n          inventoryQuantity\n          product {\n            id\n            title\n          }\n        }\n      }\n    }\n  }`,\n);\n\nconst data = await response.json();\n"
Graphql query: "query {\n  productVariants(first: 3, query: \"updated_at:>2021-01-01\") {\n    edges {\n      node {\n        id\n        title\n        price\n        updatedAt\n        inventoryQuantity\n        product {\n          id\n          title\n        }\n      }\n    }\n  }\n}"
#### Graphql Input
null
#### Graphql Response
{
  "data": {
    "productVariants": {
      "edges": [
        {
          "node": {
            "id": "gid://shopify/ProductVariant/30322695",
            "title": "151cm",
            "price": "10.00",
            "updatedAt": "2021-11-11T11:11:11Z",
            "inventoryQuantity": 3,
            "product": {
              "id": "gid://shopify/Product/20995642",
              "title": "Element"
            }
          }
        },
        {
          "node": {
            "id": "gid://shopify/ProductVariant/43729076",
            "title": "151cm",
            "price": "10.00",
            "updatedAt": "2021-11-11T11:11:11Z",
            "inventoryQuantity": 1,
            "product": {
              "id": "gid://shopify/Product/108828309",
              "title": "Draft"
            }
          }
        },
        {
          "node": {
            "id": "gid://shopify/ProductVariant/113711323",
            "title": "155cm",
            "price": "15.00",
            "updatedAt": "2021-11-11T11:11:11Z",
            "inventoryQuantity": 15,
            "product": {
              "id": "gid://shopify/Product/20995642",
              "title": "Element"
            }
          }
        }
      ]
    }
  }
}

### Retrieves a list of product variants
Curl example: "curl -X POST \\\nhttps://your-development-store.myshopify.com/admin/api/2025-01/graphql.json \\\n-H 'Content-Type: application/json' \\\n-H 'X-Shopify-Access-Token: {access_token}' \\\n-d '{\n\"query\": \"query ProductVariantsList { productVariants(first: 10, query: \\\"product_id:20995642\\\") { nodes { id title } pageInfo { startCursor endCursor } } }\"\n}'\n"
Node example: "const client = new shopify.clients.Graphql({session});\nconst data = await client.query({\n  data: `query ProductVariantsList {\n    productVariants(first: 10, query: \"product_id:20995642\") {\n      nodes {\n        id\n        title\n      }\n      pageInfo {\n        startCursor\n        endCursor\n      }\n    }\n  }`,\n});\n"
Ruby example: "session = ShopifyAPI::Auth::Session.new(\n  shop: \"your-development-store.myshopify.com\",\n  access_token: access_token\n)\nclient = ShopifyAPI::Clients::Graphql::Admin.new(\n  session: session\n)\n\nquery = <<~QUERY\n  query ProductVariantsList {\n    productVariants(first: 10, query: \"product_id:20995642\") {\n      nodes {\n        id\n        title\n      }\n      pageInfo {\n        startCursor\n        endCursor\n      }\n    }\n  }\nQUERY\n\nresponse = client.query(query: query)\n" 
Remix example: "const { admin } = await authenticate.admin(request);\n\nconst response = await admin.graphql(\n  `#graphql\n  query ProductVariantsList {\n    productVariants(first: 10, query: \"product_id:20995642\") {\n      nodes {\n        id\n        title\n      }\n      pageInfo {\n        startCursor\n        endCursor\n      }\n    }\n  }`,\n);\n\nconst data = await response.json();\n"
Graphql query: "query ProductVariantsList {\n  productVariants(first: 10, query: \"product_id:20995642\") {\n    nodes {\n      id\n      title\n    }\n    pageInfo {\n      startCursor\n      endCursor\n    }\n  }\n}"
#### Graphql Input
null
#### Graphql Response
{
  "data": {
    "productVariants": {
      "nodes": [
        {
          "id": "gid://shopify/ProductVariant/30322695",
          "title": "151cm"
        },
        {
          "id": "gid://shopify/ProductVariant/113711323",
          "title": "155cm"
        },
        {
          "id": "gid://shopify/ProductVariant/236948360",
          "title": "158cm"
        }
      ],
      "pageInfo": {
        "startCursor": "eyJsYXN0X2lkIjozMDMyMjY5NSwibGFzdF92YWx1ZSI6IjMwMzIyNjk1In0=",
        "endCursor": "eyJsYXN0X2lkIjoyMzY5NDgzNjAsImxhc3RfdmFsdWUiOiIyMzY5NDgzNjAifQ=="
      }
    }
  }
}