use Product
The hook fetches a single product by its ID. Returns complete product details including variants, media, pricing, and shop information. Use this for product detail pages or when you need full product data for a single item. For fetching multiple products efficiently, use instead which batches requests.
Anchor to useProduct-parametersParameters
- Anchor to paramsparamsparamsUseProductParamsUseProductParamsrequiredrequired
Anchor to useProduct-returnsReturns
- errorerrorError | nullError | null
- loadingloadingbooleanboolean
- productproductProduct | nullProduct | null
The product returned from the query.
- refetchrefetch() => Promise<void>() => Promise<void>
UseProductReturnsUseProductReturns
UseProductReturns
UseProductParams
- fetchPolicy
DataHookFetchPolicy - id
The product ID to fetch.
string - skip
boolean
DataHookFetchPolicy
'cache-first' | 'network-only'UseProductReturns
- error
Error | null - loading
boolean - product
The product returned from the query.
Product | null - refetch
() => Promise<void>
Product
- compareAtPrice
Money | null - defaultVariantId
string - featuredImage
ProductImage | null - id
string - isFavorited
boolean - price
Money - referral
boolean - reviewAnalytics
{ averageRating?: number; reviewCount?: number; } - selectedVariant
ProductVariant - shop
ProductShop - title
string - variants
ProductVariant[]
Money
- amount
Decimal - currencyCode
CurrencyCode
Decimal
stringCurrencyCode
'AED' | 'AFN' | 'ALL' | 'AMD' | 'ANG' | 'AOA' | 'ARS' | 'AUD' | 'AWG' | 'AZN' | 'BAM' | 'BBD' | 'BDT' | 'BGN' | 'BHD' | 'BIF' | 'BMD' | 'BND' | 'BOB' | 'BRL' | 'BSD' | 'BTN' | 'BWP' | 'BYN' | 'BYR' | 'BZD' | 'CAD' | 'CDF' | 'CHF' | 'CLP' | 'CNY' | 'COP' | 'CRC' | 'CVE' | 'CZK' | 'DJF' | 'DKK' | 'DOP' | 'DZD' | 'EGP' | 'ERN' | 'ETB' | 'EUR' | 'FJD' | 'FKP' | 'GBP' | 'GEL' | 'GHS' | 'GIP' | 'GMD' | 'GNF' | 'GTQ' | 'GYD' | 'HKD' | 'HNL' | 'HRK' | 'HTG' | 'HUF' | 'IDR' | 'ILS' | 'INR' | 'IQD' | 'IRR' | 'ISK' | 'JEP' | 'JMD' | 'JOD' | 'JPY' | 'KES' | 'KGS' | 'KHR' | 'KID' | 'KMF' | 'KRW' | 'KWD' | 'KYD' | 'KZT' | 'LAK' | 'LBP' | 'LKR' | 'LRD' | 'LSL' | 'LTL' | 'LVL' | 'LYD' | 'MAD' | 'MDL' | 'MGA' | 'MKD' | 'MMK' | 'MNT' | 'MOP' | 'MRU' | 'MUR' | 'MVR' | 'MWK' | 'MXN' | 'MYR' | 'MZN' | 'NAD' | 'NGN' | 'NIO' | 'NOK' | 'NPR' | 'NZD' | 'OMR' | 'PAB' | 'PEN' | 'PGK' | 'PHP' | 'PKR' | 'PLN' | 'PYG' | 'QAR' | 'RON' | 'RSD' | 'RUB' | 'RWF' | 'SAR' | 'SBD' | 'SCR' | 'SDG' | 'SEK' | 'SGD' | 'SHP' | 'SLL' | 'SOS' | 'SRD' | 'SSP' | 'STD' | 'STN' | 'SYP' | 'SZL' | 'THB' | 'TJS' | 'TMT' | 'TND' | 'TOP' | 'TRY' | 'TTD' | 'TWD' | 'TZS' | 'UAH' | 'UGX' | 'USD' | 'UYU' | 'UZS' | 'VED' | 'VEF' | 'VES' | 'VND' | 'VUV' | 'WST' | 'XAF' | 'XCD' | 'XOF' | 'XPF' | 'XXX' | 'YER' | 'ZAR' | 'ZMW'ProductImage
- altText
string | null - height
number | null - id
string | null - sensitive
boolean | null - thumbhash
string | null - url
string - width
number | null
ProductVariant
- compareAtPrice
Money | null - id
string - image
ProductImage | null - isFavorited
boolean - price
Money - title
string
ProductShop
- id
string - name
string
Examples
import {useProduct} from '@shopify/shop-minis-react'
export default function MyComponent() {
const {product, loading, error} = useProduct({
id: 'gid://shopify/Product/123',
})
console.log({product, loading, error})
}
Examples
Example code
Default
import {useProduct} from '@shopify/shop-minis-react' export default function MyComponent() { const {product, loading, error} = useProduct({ id: 'gid://shopify/Product/123', }) console.log({product, loading, error}) }
Was this page helpful?