Skip to content

Get Storefront Product ​

Use these endpoints to get one product for a product page. You can find a product by its ID or by its slug.

Get a product by ID ​

GET /v1/storefront/products/{productId}

Path parameterTypeDescription
productIdstringID of the product.

Get a product by slug ​

GET /v1/storefront/products/slug/{slug}

Path parameterTypeDescription
slugstringUnique slug of the product.

Headers ​

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

Example request ​

javascript
fetch('https://api.shopsynch.com/v1/storefront/products/slug/professional-dslr-camera-0001', {
  method: 'GET',
  headers: { 'X-MerchantApiKey': 'MERCHANT_API_KEY' }
})
  .then(response => response.json())
  .then(data => console.log(data));

Response 200 ​

json
{
  "data": {
    "id": "679f8f5a3b5f2173201c2582",
    "name": "Professional DSLR Camera",
    "slug": "professional-dslr-camera-0001",
    "description": "24.2 MP DSLR camera",
    "summary": "24.2 MP DSLR camera",
    "image": "https://example.com/camera.jpg",
    "images": ["https://example.com/camera.jpg"],
    "productType": "VARIABLE",
    "price": 899.0,
    "newPrice": 899.0,
    "discount": 0,
    "effectivePrice": 899.0,
    "isOnSale": false,
    "attributes": { "Megapixels": "24.2 MP" },
    "brand": "Example",
    "category": "Cameras",
    "categoryId": "66f42a129d0b",
    "variantGroups": [
      {
        "attributeName": "Color",
        "attributeValue": "Graphite Black",
        "skus": [
          { "price": 899.0, "quantityInStock": 45, "attributes": { "Storage": "64GB" } }
        ]
      }
    ],
    "availableQty": 45,
    "isArchived": false,
    "responseVersion": "v2"
  },
  "message": "Product retrieved",
  "status": true
}

Product fields ​

The sample shows some of the fields.

FieldTypeDescription
id, name, slugstringIdentification of the product.
description, summary, highlightsstringText for the product page.
image, thumbnail, imagesstring, arrayImage URLs.
productTypestringSIMPLE, VARIABLE, DIGITAL or BUNDLE.
price, newPrice, discountnumberPrice, price after discount, and discount.
salesPrice, salesStartDate, salesEndDate, effectivePrice, isOnSalevariousSale price data. Show effectivePrice to the customer.
attributesobjectProduct attributes.
specifications, features, tagsarrayProduct details.
brand, category, categoryIdstringBrand and category.
variantGroupsarrayVariant groups. Each group has skus. Send the group ID and SKU ID when you add the product to the cart.
unitTrackingMode, unitCategory, baseUnitKey, unitTiersvariousSelling unit data.
availableQtynumberQuantity that is available.
availabilityMode, scheduledWindow, bookableSlotvariousPre-order and booking settings.
ratingintegerProduct rating.
isArchivedbooleantrue if the product is archived.

Error responses ​

StatusMessage
400'PRODUCT' is no longer available.
404Product not found

Next steps ​

Build with joy