Products
Product search, detail lookups, and related products
Access via client.products.
Methods
search(params?)
Full-text and faceted product search with cursor pagination.
const results = await client.products.search({
q: 'stol',
limit: 24,
offset: 0,
sort: 'price_asc',
filters: { categoryId: '...', inStock: true },
})
// → ProductSearchResponse { products, facets, total, nextCursor }
suggest(params)
Typeahead suggestions for search inputs.
const suggestions = await client.products.suggest({ q: 'sto', limit: 5 })
// → SuggestResponse { suggestions }
getByHandle(handle)
Load a single product by its URL slug. Use on product detail pages.
const product = await client.products.getByHandle('stockholm-oak-chair')
// → StorefrontProduct
getBySku(sku)
Load a product by its SKU. Useful for POS lookups or barcode-scan flows.
const product = await client.products.getBySku('CHAIR-OAK-001')
getBatch(skus)
Fetch multiple products in one request.
const { products } = await client.products.getBatch(['SKU-1', 'SKU-2', 'SKU-3'])
getRelated(sku)
Related product groups (cross-sell, upsell, similar).
const groups = await client.products.getRelated('CHAIR-OAK-001')
// → RelatedProductGroup[] — each group has a type and products array
getVariantGroup(variantGroupId)
All products sharing a variant group — use to build variant selectors.
const variants = await client.products.getVariantGroup(product.variantGroupId)
Key types
interface StorefrontProduct {
productId: string
sku: string
name: string
handle: string
type: 'simple' | 'bundle' | 'variant'
status?: 'active' | 'inactive' | 'draft' | 'hidden'
sellingPriceIncVat?: number
listingPriceIncVat?: number
discountPercentage?: number
isDiscounted?: boolean
variantGroupId?: string
variants?: StorefrontVariant[]
assets?: StorefrontAsset[]
stockLevels?: StorefrontStockLevel[]
attributes?: StorefrontAttribute[]
// ...
}
Full type reference → /sdk-reference/interfaces/index.StorefrontProduct.html