palbaseDocs

Palbase Commerce & Promotions · API

POST/commerce/catalog/recommend

Generate storefront product recommendations using built-in or custom strategies

Return ranked product recommendations for built-in strategies (relevance, trending, bestsellers, new_arrivals, top_rated, similar, fbt, cart_complementary, personalized) or custom project strategies, with merchandising rules and optional discovery.rank hook.

Called by your app, with the publishable key; or a signed-in user of your app, with their token and the publishable key; or your server, with the project's secret key.

Request body

strategystring · optionalBuilt-in or custom strategy key.
product_idstring · optionalAnchor product UUID or handle (for similar/fbt).
cart_idstring · optionalAuthorized cart UUID (for cart_complementary).
product_idsstring[] · optionalExplicit seed product UUIDs.
category_idstring · optionalOptional contextual category UUID.
brand_idstring · optionalOptional contextual brand UUID.
store_idstring · optionalOptional contextual store UUID.
channelstring · optionalOptional sales channel key.
regionstring · optionalOptional region key.
currencystring · optionalOptional ISO 4217 currency code.
limitinteger (int64) · optionalMaximum recommendations to return (default 12, values >100 are clamped to 100).
exclude_product_idsstring[] · optionalProduct UUIDs to exclude from recommendations.
in_stockboolean · optionalRestrict recommendations to in-stock products.
paramsobject · optionalAdditional strategy-specific parameters.
curl
curl -X POST "https://<your-ref>.palbase.studio/commerce/catalog/recommend" \
  -H "apikey: $PALBASE_SECRET_KEY" \
  -H "content-type: application/json" \
  -d '{"strategy":"string","product_id":"string","cart_id":"string","product_ids":["string"],"category_id":"string","brand_id":"string","store_id":"string","channel":"string","region":"string","currency":"string","limit":0,"exclude_product_ids":["string"],"in_stock":false,"params":{}}'

Responses

200Ranked product recommendations

defaultStandard Palbase JSON error envelope (`error` and `error_description`).

Operation StorefrontRecommendProducts of commerce's contract.