Serverless AI Product Suggestion

AI powered product suggestion service that recommends the most relevant products based on catalog, user searches, context, and order history.

Endpoint

Suggest relevant products for a user based on catalog, searches, context, and order history.

POSThttps://api.xtartapp.com/data/suggestion

*Authentication

You must use a Bearer token provided by the dashboard to use for authentication. Add the token to the Authorization header.

Request body

NameTypeRequiredMaxDescription
productsarrayYes1000Array of product objects to suggest.
products[].idstringYes50The id of the product.
products[].titlestringYes100The title of the product.
products[].pricenumberNo-The price of the product.
lastSearchesarrayYes10Array of recent user search strings (max 10 items, each max 50 chars)
lastSearches[]stringYes50The search string.
contextarrayNo3Array of context strings (max 3 items, each max 500 chars)
lastOrderedProductsarrayNo10Array of last ordered product objects (max 10 items). Each must have id (max 50 chars), title (max 100 chars), quantity (number), price (number)
lastOrderedProducts[].idstringYes50The id of the product.
lastOrderedProducts[].titlestringYes100The title of the product.
lastOrderedProducts[].quantitynumberNo-
lastOrderedProducts[].pricenumberNo-

Response

NameTypeDescription
suggestedProductsarrayArray of suggested product objects, each with id, title, and price (optional).
suggestedProducts[].idstringThe id of the suggested product.
suggestedProducts[].titlestringThe title of the suggested product.
suggestedProducts[].pricenumberThe price of the suggested product (optional).
totalnumberThe total number of suggested products.
keywordsarrayArray of keywords for customer search.

Errors

{
   "error": "string", 
   "code": "string"
}
HTTP StatusError CodeMessage
400INVALID_PAYLOADOccurs when the payload is invalid.
400INVALID_REQUESTEx.: The request is invalid.
400DATA_SUGGESTION_ERROREx: could not suggest products | parsing error
400INSUFFICIENT_BALANCEThe user has insufficient balance
401UNAUTHORIZEDEx.: The token is invalid.
429TOO_MANY_REQUESTSEx.: The request limit has been reached.