Overview
Use the Related Products API to retrieve products similar to the ones currently displayed. To receive recommendations, provide the product ID of the item you want related products for.
Which products are returned
The related products can be defined by client-set rules. If no rules are specified, the API returns products from the same category as the provided product ID.
The API also lets you specify the number of related products and their titles to be displayed.
Endpoint
| Method | Path |
|---|---|
POST | /api/v1/getRelatedProducts |
POST | /api/v2/getRelatedProducts |
Request body
{
"product_id": 1786, //required
"token": "{{ website_token }}" //required
}
Successful response
{
"title": "Related Products",
"rule_id": 11,
"size": 6,
"data": [
{
"short_description": null,
"first_click_position": 0,
"link": "http://www.local.magento.com/hollister-backyard-sweatshirt.html",
"description": "Kick off your weekend in the Hollister Backyard.",
"created_at": "2021-09-01 08:54:33",
"availability": 1,
"configurable_options": [ …
],
…
},
…
]
}