WooRec

DocsPricingSupport
Docs

API Reference

Engine API

The official reference for the WooRec communication layer. All endpoints use the POST method to ensure secure and ample data transmission for recommendation contexts.

POST/i2i

Item-to-Item

Fetches related products for a specific item. Typically used on Product Detail Pages to show "You may also like".

Body Parameters

scene

string • Required

The scenario identifier. e.g: WOOREC_SCENE_UPSELL.

product

integer • Required

The source Product ID to base recommendations on.

limit

integer • Default: 8

Number of items to return.

ts

integer • Required

Current Unix Timestamp (for caching/validation).
POST/rec

Feed (List View)

Generates a personalized feed for category pages or the homepage. Supports pagination.

Body Parameters

scene

string • Required

The scenario identifier. Constant: WOOREC_SCENE_LIST.

category_id

integer • Optional

Filter by WooCommerce Category ID.

page

integer • Default: 1

Pagination index.

limit

integer • Default: 12

Items per page.

ts

integer • Required

Current Unix Timestamp.
POST/trace

Trace Event

Batched event logging. Designed to handle exposure tracking for multiple products at once (e.g., viewing a category page).

Body Parameters

action

string • Required

Example: view_item_list.

count

integer • Required

Total number of items in the 'products' array.

products

array[int] • Required

List of Product IDs that were exposed/interacted with.

ts

integer • Required

Event occurrence timestamp.

I2I Payload

PHP Args

wp_remote_post(..., [
  'body' => [
    'scene' => 'upsell',
    'product' => 5501,
    'limit' => 6,
    'ts' => time()
  ]
]);

List Payload

PHP Args

wp_remote_post(..., [
  'body' => [
    'scene' => 'list',
    'category_id' => 12,
    'page' => 2,
    'limit' => 12,
    'ts' => time()
  ]
]);

Trace Payload

PHP Args

wp_remote_post(..., [
  'body' => [
    'action' => 'view_item_list',
    'count' => 3,
    'products' => [101, 102, 103],
    'ts' => time()
  ]
]);