Skip to main content
Fetch products from your store, including variants, addons, and custom fields.

getProducts

Fetches all products from the store.

Response

Product[]
Array of products
Use product images by surface:
  • cdn_image_url for product cards, category grids, cart rows, and search results
  • detail_image_url for product detail pages, image galleries, and zoom
  • images[] for the full gallery
Simple example: if your custom storefront currently renders the PDP hero from cdn_image_url, you should switch that hero to detail_image_url to get the higher-resolution image.

Example: Product Grid

getProduct

Fetches a single product by ID or slug.

Parameters

string
required
Product unique ID or URL slug

Example: Product Detail Page

getCategories

Fetches all unique product category IDs from your store.

Example: Category Filter

Product Groups

Stores can organize products into groups (e.g. “Server Boosts”, “Tokens”). Groups come from getStorefront():
Breaking change in @shoppexio/storefront 1.0.0 (and the underlying storefront API): groups no longer embed full product objects in products_bound. Each group now carries product_uniqids (an array of product references), and every public product — standalone and group-bound — appears exactly once in the flat products list. If your integration reads group.products_bound, it will see undefined and must migrate to the lookup pattern below.

Group object

string
Unique group identifier
string
Group name
string[]
References to the group’s products. Resolve them against the flat products list — the full product objects are not embedded in the group.
number
Number of products in the group
number
Display order of the group

Resolving group products

Build a lookup from the flat products list and resolve each group’s references:
If you install the SDK from npm, the same resolution is available as a named import:
Migrating from 0.3.x? Replace every group.products_bound read with the lookup above. getProducts() now returns the complete flat catalog (group-bound products included), so you no longer need to merge group products into your listing yourself. If you call the REST API directly: /v1/storefront/products/public/:slug groups carry product_uniqids, and /v1/storefront/products/shop/:name no longer returns groups at all — read groups from the public catalog or bootstrap payload instead.

Working with Variants

Products can have multiple variant types:

Standard Variants

Variants like size or color that don’t change the price:

Price Variants

Variants that have different prices:

Addons

Optional extras the customer can add:

Error Handling


Next Steps

Cart API

Add products to the shopping cart

Store API

Fetch store metadata and branding