Product API
For the Product API to work on a site, Frosmo Recommendations must be enabled for the site. To enable the feature, if it's not already enabled, contact Frosmo support.
The Product API allows you to retrieve product data from the Frosmo back end. You can retrieve the full data for one or more products based on product IDs. To get the IDs, use the Graniitti API.
For an introduction to recommendations, see Feature: Recommendation.
Product API vs. Graniitti API
You can retrieve product data through both the Product API and the Graniitti API. Here's how the two APIs differ:
-
The Product API returns the full data for a product. The Graniitti API only returns the main details for a product, namely its ID, name, and type.
-
The Product API does not require authentication. The Graniitti API uses token-based authentication.
-
The Product API requires the ID of each product whose data to return. The Graniitti API can retrieve all products for a site (no product IDs required) or a single product based on its ID.
-
The Product API only cares about product data. The Graniitti API can additionally retrieve and manage relevant products for a modification.
In a nutshell:
-
If you want to retrieve the full data for a product, use the Product API.
-
If you want to find out the IDs of products, or if you want to map products to modifications, use the Graniitti API.
For more information about the Graniitti API, see the Graniitti API guide.
Product API vs. Frosmo data layer
The Product API returns the exact same product data you send to the Frosmo back end through the Frosmo data layer. However, the product object properties and structure differ between the data layer and the API:
-
Data layer uses the
frosmoProduct
prefix for all product object properties. For example:frosmoProductId
andfrosmoProductName
-
Product API omits the prefix in the returned product data. For example:
id
andname
-
frosmoProductCategory
in the data layer maps totype
in the Product API. -
Data layer uses a flat object structure. The Product API nests all product data under the
attributes
property, exceptid
,name
, andtype
, which are returned in theproduct
object root.
For more information about the data layer and its product object model, see Frosmo data layer and Tracking products with the data layer.