--- title: productByIdentifier - GraphQL Admin description: Return a product by an identifier. api_version: 2025-10 api_name: admin type: query api_type: graphql source_url: html: https://shopify.dev/docs/api/admin-graphql/latest/queries/productByIdentifier md: https://shopify.dev/docs/api/admin-graphql/latest/queries/productByIdentifier.md --- # product​By​Identifier query Requires `read_products` access scope. Return a product by an identifier. ## Arguments * identifier [Product​Identifier​Input!](https://shopify.dev/docs/api/admin-graphql/latest/input-objects/ProductIdentifierInput) required The identifier of the product. *** ## Possible returns * Product [Product](https://shopify.dev/docs/api/admin-graphql/latest/objects/Product) The `Product` object lets you manage products in a merchant’s store. Products are the goods and services that merchants offer to customers. They can include various details such as title, description, price, images, and options such as size or color. You can use [product variants](https://shopify.dev/docs/api/admin-graphql/latest/objects/productvariant) to create or update different versions of the same product. You can also add or update product [media](https://shopify.dev/docs/api/admin-graphql/latest/interfaces/media). Products can be organized by grouping them into a [collection](https://shopify.dev/docs/api/admin-graphql/latest/objects/collection). Learn more about working with [Shopify's product model](https://shopify.dev/docs/apps/build/graphql/migrate/new-product-model/product-model-components), including limitations and considerations. *** ## Examples * ### Find a product by custom id #### Query ```graphql query($identifier: ProductIdentifierInput!) { product: productByIdentifier(identifier: $identifier) { id handle title } } ``` #### Variables ```json { "identifier": { "customId": { "namespace": "custom", "key": "id", "value": "1001" } } } ``` #### cURL ```bash curl -X POST \ https://your-development-store.myshopify.com/admin/api/2025-10/graphql.json \ -H 'Content-Type: application/json' \ -H 'X-Shopify-Access-Token: {access_token}' \ -d '{ "query": "query($identifier: ProductIdentifierInput!) { product: productByIdentifier(identifier: $identifier) { id handle title } }", "variables": { "identifier": { "customId": { "namespace": "custom", "key": "id", "value": "1001" } } } }' ``` #### React Router ```javascript import { authenticate } from "../shopify.server"; export const loader = async ({request}) => { const { admin } = await authenticate.admin(request); const response = await admin.graphql( `#graphql query($identifier: ProductIdentifierInput!) { product: productByIdentifier(identifier: $identifier) { id handle title } }`, { variables: { "identifier": { "customId": { "namespace": "custom", "key": "id", "value": "1001" } } }, }, ); const json = await response.json(); return json.data; } ``` #### Ruby ```ruby 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($identifier: ProductIdentifierInput!) { product: productByIdentifier(identifier: $identifier) { id handle title } } QUERY variables = { "identifier": { "customId": { "namespace": "custom", "key": "id", "value": "1001" } } } response = client.query(query: query, variables: variables) ``` #### Node.js ```javascript const client = new shopify.clients.Graphql({session}); const data = await client.query({ data: { "query": `query($identifier: ProductIdentifierInput!) { product: productByIdentifier(identifier: $identifier) { id handle title } }`, "variables": { "identifier": { "customId": { "namespace": "custom", "key": "id", "value": "1001" } } }, }, }); ``` #### Response ```json { "product": { "id": "gid://shopify/Product/20995642", "handle": "element", "title": "Element" } } ``` * ### Find a product by handle #### Query ```graphql query($identifier: ProductIdentifierInput!) { product: productByIdentifier(identifier: $identifier) { id handle title } } ``` #### Variables ```json { "identifier": { "handle": "boots" } } ``` #### cURL ```bash curl -X POST \ https://your-development-store.myshopify.com/admin/api/2025-10/graphql.json \ -H 'Content-Type: application/json' \ -H 'X-Shopify-Access-Token: {access_token}' \ -d '{ "query": "query($identifier: ProductIdentifierInput!) { product: productByIdentifier(identifier: $identifier) { id handle title } }", "variables": { "identifier": { "handle": "boots" } } }' ``` #### React Router ```javascript import { authenticate } from "../shopify.server"; export const loader = async ({request}) => { const { admin } = await authenticate.admin(request); const response = await admin.graphql( `#graphql query($identifier: ProductIdentifierInput!) { product: productByIdentifier(identifier: $identifier) { id handle title } }`, { variables: { "identifier": { "handle": "boots" } }, }, ); const json = await response.json(); return json.data; } ``` #### Ruby ```ruby 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($identifier: ProductIdentifierInput!) { product: productByIdentifier(identifier: $identifier) { id handle title } } QUERY variables = { "identifier": { "handle": "boots" } } response = client.query(query: query, variables: variables) ``` #### Node.js ```javascript const client = new shopify.clients.Graphql({session}); const data = await client.query({ data: { "query": `query($identifier: ProductIdentifierInput!) { product: productByIdentifier(identifier: $identifier) { id handle title } }`, "variables": { "identifier": { "handle": "boots" } }, }, }); ``` #### Response ```json { "product": { "id": "gid://shopify/Product/121709582", "handle": "boots", "title": "Boots" } } ``` [Open in GraphiQL](http://localhost:3457/graphiql?query=query\(%24identifier%3A%20ProductIdentifierInput!\)%20%7B%0A%20%20product%3A%20productByIdentifier\(identifier%3A%20%24identifier\)%20%7B%0A%20%20%20%20id%0A%20%20%20%20handle%0A%20%20%20%20title%0A%20%20%7D%0A%7D\&variables=%7B%0A%20%20%22identifier%22%3A%20%7B%0A%20%20%20%20%22customId%22%3A%20%7B%0A%20%20%20%20%20%20%22namespace%22%3A%20%22custom%22%2C%0A%20%20%20%20%20%20%22key%22%3A%20%22id%22%2C%0A%20%20%20%20%20%20%22value%22%3A%20%221001%22%0A%20%20%20%20%7D%0A%20%20%7D%0A%7D) ```javascript import { authenticate } from "../shopify.server"; export const loader = async ({request}) => { const { admin } = await authenticate.admin(request); const response = await admin.graphql( `#graphql query($identifier: ProductIdentifierInput!) { product: productByIdentifier(identifier: $identifier) { id handle title } }`, { variables: { "identifier": { "customId": { "namespace": "custom", "key": "id", "value": "1001" } } }, }, ); const json = await response.json(); return json.data; } ``` ##### GQL ``` query($identifier: ProductIdentifierInput!) { product: productByIdentifier(identifier: $identifier) { id handle title } } ``` ##### cURL ``` curl -X POST \ https://your-development-store.myshopify.com/admin/api/2025-10/graphql.json \ -H 'Content-Type: application/json' \ -H 'X-Shopify-Access-Token: {access_token}' \ -d '{ "query": "query($identifier: ProductIdentifierInput!) { product: productByIdentifier(identifier: $identifier) { id handle title } }", "variables": { "identifier": { "customId": { "namespace": "custom", "key": "id", "value": "1001" } } } }' ``` ##### React Router ``` import { authenticate } from "../shopify.server"; export const loader = async ({request}) => { const { admin } = await authenticate.admin(request); const response = await admin.graphql( `#graphql query($identifier: ProductIdentifierInput!) { product: productByIdentifier(identifier: $identifier) { id handle title } }`, { variables: { "identifier": { "customId": { "namespace": "custom", "key": "id", "value": "1001" } } }, }, ); const json = await response.json(); return json.data; } ``` ##### Node.js ``` const client = new shopify.clients.Graphql({session}); const data = await client.query({ data: { "query": `query($identifier: ProductIdentifierInput!) { product: productByIdentifier(identifier: $identifier) { id handle title } }`, "variables": { "identifier": { "customId": { "namespace": "custom", "key": "id", "value": "1001" } } }, }, }); ``` ##### Ruby ``` 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($identifier: ProductIdentifierInput!) { product: productByIdentifier(identifier: $identifier) { id handle title } } QUERY variables = { "identifier": { "customId": { "namespace": "custom", "key": "id", "value": "1001" } } } response = client.query(query: query, variables: variables) ``` ## Input variables JSON ```json { "identifier": { "customId": { "namespace": "custom", "key": "id", "value": "1001" } } } ``` ## Response JSON ```json { "product": { "id": "gid://shopify/Product/20995642", "handle": "element", "title": "Element" } } ```