Skip to main content
POST
/
apis
/
ecommerce-service
/
public
/
recommendation
/
v2
/
widgets
/
{widgetId}
Get Recommendations for a Widget Context
curl --request POST \
  --url https://{base-address}/apis/ecommerce-service/public/recommendation/v2/widgets/{widgetId} \
  --header 'Content-Type: application/json' \
  --data '{
  "context_type": "<string>",
  "context_data": "<string>",
  "product_ids": [
    "<string>"
  ],
  "category_ids": [
    "<string>"
  ],
  "user_id": "<string>",
  "filter": [
    {
      "group": {
        "operator": "<string>",
        "rules": [
          {
            "action": "<string>",
            "field_name": "<string>",
            "value": "<string>"
          }
        ]
      }
    }
  ]
}'
{
  "Status": "success",
  "Data": {
    "records": [
      {
        "id": "<string>",
        "tenant_id": "<string>",
        "workspace_id": "<string>",
        "content_model_id": "<string>",
        "content_model_data_id": "<string>",
        "version_no": 123,
        "version_name": "<string>",
        "language": [
          "<string>"
        ],
        "modified_by": "<string>",
        "modified_at": "2023-11-07T05:31:56Z",
        "created_by": "<string>",
        "created_at": "2023-11-07T05:31:56Z",
        "store_id": "<string>",
        "channel_id": [
          "<string>"
        ],
        "_version_": "<string>",
        "in_stock": 123,
        "brand_page_slug": "<string>",
        "revenue": 123,
        "category_ids": [
          "<string>"
        ],
        "variants_sku_count": 123,
        "sku_for_analytics": [
          "<string>"
        ],
        "provider": "<string>",
        "provider_id": "<string>",
        "images": [
          {
            "id": "<string>",
            "product_id": "<string>",
            "is_thumbnail": true,
            "sort_order": 123,
            "description": "<string>",
            "image_file": "<string>",
            "url_zoom": "<string>",
            "url_standard": "<string>",
            "url_thumbnail": "<string>",
            "url_tiny": "<string>",
            "date_modified": "2023-11-07T05:31:56Z"
          }
        ],
        "price": 123,
        "description": "<string>",
        "sku": "<string>",
        "type": "<string>",
        "name": "<string>",
        "page_slug": "<string>",
        "page_title": "<string>",
        "menu_title": "<string>",
        "condition": [
          "<string>"
        ],
        "sort_order": 123,
        "is_price_hidden": true,
        "availability": "<string>",
        "upc": "<string>",
        "warranty": "<string>",
        "is_featured": true,
        "is_visible": true,
        "is_free_shipping": true,
        "fixed_cost_shipping_price": 123,
        "inventory_tracking": "<string>",
        "inventory_warning_level": 123,
        "inventory_level": 123,
        "brand": "<string>",
        "brand_id": "<string>",
        "product_tax_code": "<string>",
        "tax_class_id": "<string>",
        "map_price": 123,
        "sale_price": 123,
        "retail_price": 123,
        "cost_price": 123,
        "height": 123,
        "depth": 123,
        "width": 123,
        "weight": 123
      }
    ],
    "_meta_": {
      "tenant_id": "<string>",
      "workspace_id": "<string>",
      "env_type": "<string>",
      "store_hash": "<string>",
      "content_model_id": "<string>",
      "_fields_": {}
    }
  }
}
Before calling this endpoint, make sure you’ve generated an API token and picked the correct domain. See Authentication & Base URLs.

Headers

x-customer-group-id
string

Optional customer group identifier for segment-specific responses.

x-ecomm-provider
string

E-commerce provider for contextualizing the API call (e.g., shopify, magento, etc.).

Path Parameters

widgetId
string
required

Unique identifier of the widget to retrieve.

Query Parameters

fields
string
required

Comma-separated list of fields to include in the response

locale
string
required

Specifies the language or region for the response data

store_id
string

Identifier of the store within the e-commerce platform.

channel_id
string

Sales or distribution channel identifier.

location_id
string

Identifier for the regional location from the BigCommerce admin panel.

currency
string

Currency code for price displays.

include_fields_meta
boolean

Whether to include metadata about the fields in the response. If true, returns metadata for each filterable field.

skip
integer

Number of items to skip for pagination offset.

limit
integer

Maximum number of items to return.

Body

application/json
context_type
string

Specify the type of context for the request (e.g., product, category, web_pages, cart, etc)

context_data
string

Context-specific data, relevant to the context_type

product_ids
string[]

List of product IDs to seed “similar items” recommendations.

category_ids
string[]

List of category IDs to seed category-based recommendations.

user_id
string

Unique identifier for the user or user email.

filter
object[]

Query filter expression to narrow results

Response

A list of recommended products with optional metadata.

Status
string
Example:

"success"

Data
object