Skip to main content

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.

MethodEndpointDescription
GET/V1/mst-related/blocksList blocks (supports standard searchCriteria filtering)
GET/V1/mst-related/blocks/:idGet a single block by ID
POST/V1/mst-related/blocksCreate a block
PUT/V1/mst-related/blocks/:idUpdate a block
DELETE/V1/mst-related/blocks/:idDelete 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.

MethodEndpointDescription
GET/V1/mst-related/rulesList rules (supports standard searchCriteria filtering)
GET/V1/mst-related/rules/:idGet a single rule by ID
POST/V1/mst-related/rulesCreate a rule
PUT/V1/mst-related/rules/:idUpdate a rule
DELETE/V1/mst-related/rules/:idDelete 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.

MethodEndpointDescription
GET/V1/mst-related/analyticsList analytics records
GET/V1/mst-related/analytics/:idGet a single analytics record
POST/V1/mst-related/analyticsCreate an analytics record
DELETE/V1/mst-related/analytics/:idDelete 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.

MethodEndpointDescription
GET/V1/mst-related/analytics-aggregatedList aggregated analytics records
GET/V1/mst-related/analytics-aggregated/:idGet a single aggregated record

Fields: block_id, day, impression, click, order, revenue, created_at.