Skip to content

Get Products

About

The getProducts query retrieves a paginated list of products from your store with support for advanced sorting and filtering. This query is essential for:

  • Building product catalog browsing interfaces
  • Implementing product search, sorting, and filtering experiences
  • Creating product recommendation systems
  • Syncing product data with external systems

The query supports cursor-based pagination to efficiently handle large product catalogs and includes metadata for:

  • Basic product information (name, SKU, description, vendor)
  • Pricing and inventory details
  • Product images and media
  • Categories, tags, and custom attributes
  • Publication and availability status
  • Created and updated timestamps

Currency & Formatted Prices: All price fields reflect the active currency set via the X-Currency header — both numeric fields (e.g. price, specialPrice, minimumPrice) and formatted fields (e.g. formattedPrice, formattedMinimumPrice) return converted values. The difference is that numeric fields return the converted amount as a number, while formatted fields return the converted amount as a string with the currency symbol prefixed (e.g. "€84.99"). See the "Get Products with Currency Formatted Prices" dropdown example above for all available price fields.

Wishlist & Compare Flags

Every product in the list carries two per-customer boolean flags so you can render the wishlist and compare icon states directly from the catalog response:

FieldDescription
isInWishlistWhether this product is in the signed-in customer's wishlist for the active channel.
isInCompareWhether this product is in the signed-in customer's compare list.

Why they exist: the wishlist and compare lists are their own endpoints and paginate independently of the catalog — a product on catalog page 1 may have its wishlist entry on a different wishlist page, so matching the two lists on the client is unreliable. These flags answer the question per product, in the same response, so the wishlist/compare icon can be highlighted without any extra requests.

Things to know:

  • Authentication is required. Send the customer Bearer token. For guests (no token) both flags are always 0.
  • The flags are 0 / 11 when the product is in the list, 0 when it is not. Over GraphQL they are returned as the strings "1" / "0" (the REST API returns them as 1 / 0 integers). Either way, 0 is falsy and 1 is truthy.
  • A product is considered "in the list" when its own product ID is in the customer's wishlist / compare list — so a configurable parent is flagged when the parent itself was added.

See the "Get Products with Wishlist & Compare Flags" dropdown example above.

Arguments

ArgumentTypeDescription
firstIntThe number of products to return per page (max: 250). Used for forward pagination.
afterStringThe cursor of the product to start after. Used with first for pagination.
lastIntThe number of products to return in reverse (max: 250). Used for backward pagination.
beforeStringThe cursor to start before. Used with last for reverse pagination.
sortKeyProductSortKeysField to sort by: TITLE, PRICE, CREATED_AT, UPDATED_AT. Default: TITLE
reverseBooleanReverse the sort order. Default: false
queryStringSearch query string for filtering products. Supports advanced search syntax.
filterStringJSON string for filtering by type, category, attributes, or price. See examples below.

Possible Returns

FieldTypeDescription
edges[ProductEdge!]!Array of edges containing products and cursors. Each edge represents a connection between nodes.
edges.nodeProduct!The actual product object containing id, name, sku, price, and other product fields.
edges.cursorString!Pagination cursor for this product. Use with after or before arguments.
nodes[Product!]!Flattened array of products without edge information.
pageInfoPageInfo!Pagination metadata object.
pageInfo.hasNextPageBoolean!Whether there are more products after the current page.
pageInfo.hasPreviousPageBoolean!Whether there are products before the current page.
pageInfo.startCursorStringCursor of the first product on the current page.
pageInfo.endCursorStringCursor of the last product on the current page.
totalCountInt!Total number of products matching the query criteria.

Price Fields

FieldTypeDescription
priceFloatBase catalog price. Returns the converted numeric value based on the active currency set via X-Currency header.
formattedPriceStringSame as price but returned as a string with the currency symbol prefixed (e.g. "€84.99").
specialPriceFloatDiscounted price if a special price is set, otherwise null. Reflects currency conversion.
formattedSpecialPriceStringSame as specialPrice but with the currency symbol prefixed.
minimumPriceFloatThe lowest effective price — accounts for special price and configurable variant pricing. Used for price sorting. Reflects currency conversion.
formattedMinimumPriceStringSame as minimumPrice but with the currency symbol prefixed.
maximumPriceFloatThe highest effective price across all variants or configurations. Reflects currency conversion.
formattedMaximumPriceStringSame as maximumPrice but with the currency symbol prefixed.
regularMinimumPriceFloatThe regular (non-discounted) minimum price before any special price is applied. Reflects currency conversion.
formattedRegularMinimumPriceStringSame as regularMinimumPrice but with the currency symbol prefixed.
regularMaximumPriceFloatThe regular (non-discounted) maximum price before any special price is applied. Reflects currency conversion.
formattedRegularMaximumPriceStringSame as regularMaximumPrice but with the currency symbol prefixed.

The difference between numeric and formatted price fields is purely presentational: numeric fields (e.g. price) return the converted amount as a number, while formatted fields (e.g. formattedPrice) return the same converted amount as a string with the currency symbol (e.g. "€84.99"). Both reflect the active currency set via the X-Currency header.

Product Types

Use the filter argument with "type" to fetch products of a specific kind. The filter value must be a single-line JSON string with escaped quotes.

TypeFilter ValueKey Fields
Simple"{\"type\": \"simple\"}"price, specialPrice, images, attributeValues
Configurable"{\"type\": \"configurable\"}"variants, combinations, superAttributeOptions
Booking"{\"type\": \"booking\"}"bookingProducts (type, qty, location, availability)
Virtual"{\"type\": \"virtual\"}"price, specialPrice, attributeValues
Grouped"{\"type\": \"grouped\"}"groupedProductsassociatedProduct
Downloadable"{\"type\": \"downloadable\"}"downloadableLinks, downloadableSamples
Bundle"{\"type\": \"bundle\"}"bundleOptionsbundleOptionProductsproduct

Released under the MIT License.