Related products allow merchants to group products of various types together to display them as suggested purchases to customers. This area of the API allows you to manage how that is done.
It should be noted this is not a necessary thing to do in many stores. Hotcakes will automatically begin to relate products for you based upon purchases of other customers.
The following pre-requisites will be necessary to accomplish the goals of this article:
- General understanding of REST and API’s
If you haven’t already done so, you should probably have a development environment ready to development against, complete with Hotcakes installed and configured.
REST API Endpoints for Product Relationships
There are a handful of REST API endpoints that allow you to display or manage various aspects of relating products to each other. Those endpoints are detailed below.
|ProductRelationshipsCreate||ProductRelationshipDTO||Allows you to create a new product relationship in the store.|
|ProductRelationshipsFind||ProductRelationshipDTO||Used to find a specific product relationship in the store catalog.|
|ProductRelationshipsForProduct||List of ProductRelationshipDTO||Used to find all relationships for a specific product in the store catalog.|
|ProductRelationshipsUnrelate||Boolean||The products that are specified become unrelated from one another. This is the equivalent of a delete.|
|ProductRelationshipsUpdate||ProductRelationshipDTO||When used, you are able to update an existing product relationship.|