Skip to content

Get Products

Retrieve a paginated list of products with filtering, sorting, and pagination options.

Endpoint

GET /api/shop/products

Request Headers

HeaderRequiredDescription
Content-TypeYesapplication/json
X-STOREFRONT-KEYYesYour storefront API key

Query Parameters

ParameterTypeDefaultDescription
pageinteger1Page number
limitinteger10Items per page (max: 100)
sortstringnameSort by (name, price, rating, newest)
directionstringascSort direction (asc, desc)
categoryinteger-Filter by category ID
minPricedecimal-Minimum price filter
maxPricedecimal-Maximum price filter
searchstring-Search query
statusinteger1Product status (1=active, 0=inactive)

Response Fields (200 OK)

FieldTypeDescription
idintegerProduct ID
namestringProduct name
slugstringURL-friendly product identifier
skustringStock keeping unit
pricedecimalProduct price
specialPricedecimalSale price (if applicable)
typestringProduct type (simple, configurable, bundle)
imageUrlstringMain product image URL
ratingdecimalAverage rating (0-5)
reviewsintegerNumber of reviews
inStockbooleanStock availability
descriptionstringShort product description

Pagination Response

FieldTypeDescription
totalintegerTotal products matching filters
perPageintegerItems per page
currentPageintegerCurrent page
lastPageintegerLast page number

Use Cases

  • Display product listings on category pages
  • Implement product search functionality
  • Build product filtering and sorting
  • Create product carousels
  • Load products for comparison

Released under the MIT License.