Skip to content

Get Storefront Products ​

Use this endpoint to get a page of the products that the store shows to customers. The API always excludes archived products. The API sets archived=false and ignores any other value.

Endpoint ​

GET /v1/storefront/products

Headers ​

json
{
  "X-MerchantApiKey": "MERCHANT_API_KEY"
}

Query parameters ​

Pagination and sorting ​

ParameterTypeDefaultDescription
pageinteger0Page number. The first page is 0.
limitinteger20Number of products on each page.
sortFieldParamstringCREATED_ATField to sort by, for example NAME, PRICE or CREATED_AT.
sortDirectionParamstringDESCASC or DESC.

Filters ​

ParameterTypeDescription
searchstringSearch text for the product name or description.
categorystringID of the category.
categoryNamestringExact name of the category. Use this instead of category.
unitCategorystringUnit category. Separate more than one value with commas, for example GRAIN,PRODUCE.
brandstringID of the brand.
brandNamestringExact name of the brand. Use this instead of brand.
colorstringID of the color.
colorNamestringExact name of the color. Use this instead of color.
createdAtFromstringReturn products that were created on or after this date (ISO 8601).
createdAtTostringReturn products that were created on or before this date (ISO 8601).
minPricenumberMinimum price.
maxPricenumberMaximum price.
availabilitybooleantrue returns products that have stock.
lowStockbooleantrue returns products at or below their reorder level (and above zero).
statusstringProduct status, for example ACTIVE.
minRatingnumberMinimum rating.
archivedbooleanArchive status. The default is false.
tagsstringTags. Separate more than one value with commas.

Example request ​

javascript
fetch('https://api.shopsynch.com/v1/storefront/products?page=0&limit=12&categoryName=Beverages&minPrice=500', {
  method: 'GET',
  headers: { 'X-MerchantApiKey': 'MERCHANT_API_KEY' }
})
  .then(response => response.json())
  .then(data => console.log(data));

Response 200 ​

json
{
  "data": {
    "products": [
      {
        "id": "679f8f5a3b5f2173201c2582",
        "name": "Professional DSLR Camera",
        "slug": "professional-dslr-camera-0001",
        "productType": "VARIABLE",
        "image": "https://example.com/camera.jpg",
        "price": 899.0,
        "newPrice": 899.0,
        "effectivePrice": 899.0,
        "isOnSale": false,
        "category": "Cameras",
        "brand": "Example",
        "availableQty": 45,
        "isArchived": false
      }
    ],
    "total": 1,
    "totalPages": 1,
    "currentPage": 1
  },
  "message": "Products retrieved",
  "status": true
}

Each item in products is a product (V2) in its public form. The sample shows some of the fields. See Product fields.

Data fields ​

FieldTypeDescription
productsarrayProducts on this page.
totalintegerTotal number of products that match the filters.
totalPagesintegerTotal number of pages.
currentPageintegerCurrent page. This value starts at 1. The page request parameter starts at 0.

The API caches this response.

Next steps ​

Build with joy