Skip to content

Similar and Top Selling Products ​

Similar products ​

Use this endpoint to get products in the same category as a product. Use it for a "Related products" section.

GET /v1/storefront/products/similar/by/category/{productId}

ParameterInTypeDefaultDescription
productIdpathstringID of the reference product.
limitqueryinteger4Maximum number of products to return.
javascript
fetch('https://api.shopsynch.com/v1/storefront/products/similar/by/category/679f8f5a3b5f2173201c2582?limit=4', {
  method: 'GET',
  headers: { 'X-MerchantApiKey': 'MERCHANT_API_KEY' }
})
  .then(response => response.json())
  .then(data => console.log(data));

Response 200. The data field is an array of products. See Product fields.

json
{
  "data": [ { "id": "679f8f5a3b5f2173201c2583", "name": "Mirrorless Camera", "price": 749.0 } ],
  "message": "Similar products retrieved",
  "status": true
}

If the reference product is archived, the API returns 400: "'PRODUCT' is no longer available."

Top selling products ​

Use this endpoint to get the products that sold the most units.

GET /v1/storefront/products/top-selling

ParameterTypeDefaultDescription
startDatestringStart of the date range.
endDatestringEnd of the date range.
limitinteger10Maximum number of products to return.
javascript
fetch('https://api.shopsynch.com/v1/storefront/products/top-selling?limit=10', {
  method: 'GET',
  headers: { 'X-MerchantApiKey': 'MERCHANT_API_KEY' }
})
  .then(response => response.json())
  .then(data => console.log(data));

Response 200. The data field is an array of products with basic details. The response does not show business metrics such as revenue.

json
{
  "data": [ { "id": "679f8f5a3b5f2173201c2582", "name": "Professional DSLR Camera" } ],
  "message": "Top selling products retrieved",
  "status": true
}

Build with joy