REST API
The Automatic Related Products extension exposes its Blocks, Rules, and Analytics data through the standard Magento REST API, so you can manage them programmatically or pull recommendation performance data into external systems.
All endpoints require a Magento access token (integration, admin, or customer token, as applicable) with access to the Mirasvit_Related::related ACL resource. For general authentication and request/response details, refer to the Magento REST API developer guide.
Product blocks - /V1/mst-related/blocks
Manage product blocks.
| Method | Endpoint | Description |
|---|---|---|
| GET | /V1/mst-related/blocks | List blocks (supports standard searchCriteria filtering) |
| GET | /V1/mst-related/blocks/:id | Get a single block by ID |
| POST | /V1/mst-related/blocks | Create a block |
| PUT | /V1/mst-related/blocks/:id | Update a block |
| DELETE | /V1/mst-related/blocks/:id | Delete a block |
Key fields on a block object mirror the Product block settings, including name, priority, is_active, store_ids, rule_id, layout_position, layout_conditions, display_title, display_products_limit, display_sort_attribute, display_sort_direction, display_is_use_slider, display_template, is_prepend_related/is_prepend_up_sells/is_prepend_cross_sells, is_exclude_out_of_stock, and is_ignore_subsequent.
Product selection rules - /V1/mst-related/rules
Manage product selection rules.
| Method | Endpoint | Description |
|---|---|---|
| GET | /V1/mst-related/rules | List rules (supports standard searchCriteria filtering) |
| GET | /V1/mst-related/rules/:id | Get a single rule by ID |
| POST | /V1/mst-related/rules | Create a rule |
| PUT | /V1/mst-related/rules/:id | Update a rule |
| DELETE | /V1/mst-related/rules/:id | Delete a rule |
Key fields: name, source (the Primary Source - all, bought_together, also_bought, viewed_together, or recently_viewed), and conditions_serialized (the serialized condition builder tree).
Analytics - /V1/mst-related/analytics
Raw impression/click/order/revenue events recorded per block.
| Method | Endpoint | Description |
|---|---|---|
| GET | /V1/mst-related/analytics | List analytics records |
| GET | /V1/mst-related/analytics/:id | Get a single analytics record |
| POST | /V1/mst-related/analytics | Create an analytics record |
| DELETE | /V1/mst-related/analytics/:id | Delete an analytics record |
Fields: block_id, action (impression, click, order, or revenue), value, session_id, created_at.
Aggregated analytics - /V1/mst-related/analytics-aggregated (read-only)
Daily aggregated totals per block, used to build the reporting shown for each block.
| Method | Endpoint | Description |
|---|---|---|
| GET | /V1/mst-related/analytics-aggregated | List aggregated analytics records |
| GET | /V1/mst-related/analytics-aggregated/:id | Get a single aggregated record |
Fields: block_id, day, impression, click, order, revenue, created_at.