Magento REST icon

Magento REST

Consume Magento REST API

Product → List

AI-generated

Summary

List products from Magento with optional filtering, sorting, pagination, and field selection.

Inputs

  • searchCriteria — Build searchCriteria for filtering, sorting, pagination, and optional field selection. Filter groups use AND logic between groups and OR logic within groups. Sort orders define ordering. Page size and current page control pagination. Fields limits returned columns via comma-separated list or Magento syntax like 'items[id,sku,name]'.
  • websiteCode — Store view code for multi-store Magento instances. Prepends to URL as /rest/{code}/V1... . Defaults to empty (root store). Loaded from store views via loadWebsiteCodes, custom values allowed.
  • simplifyOutput — When enabled, flattens the response structure. Converts custom_attributes array to object, flattens extension_attributes, and simplifies product_links by link type and media_gallery_entries into an images array with url, roles, position, id, and disabled.

Output shape

Magento product list JSON response, typically containing an items array with product objects. If simplifyOutput is true, each item has custom_attributes flattened to an object, extension_attributes flattened to top-level keys (e.g., extension_* ), product_links simplified to an object keyed by link_type with linked product SKUs, and media_gallery_entries simplified to an images array with url, roles, position, id, and disabled.

No request body is sent. The operation performs a GET to /rest/V1/products (or /rest/{websiteCode}/V1/products if websiteCode is set). Query parameters are constructed from searchCriteria via the createSearchCriteriaPreSend helper, which builds searchCriteria[filter_groups][], searchCriteria[sort_orders][], searchCriteria[pageSize], searchCriteria[currentPage], and optionally fields=items[...].

Examples

Example 1: List all products with SKU and name only

searchCriteria: { filterGroups: [], sortOrders: [{ field: 'sku', direction: 'ASC' }], fields: 'sku,name' }

Links

Discussion