What is a Conversation?
A conversation is identified by aconvo_id: an opaque string you create and manage. It groups all interactions for a single user shopping session.
- You choose the
convo_id— it can be a UUID, a session token, or any unique string meaningful to your system. - The same
convo_idmust be used across chat messages, clickthrough events, and signup submissions to maintain session continuity. - The API never auto-generates a
convo_id— ownership belongs entirely to you.
Shopper Input
When a user sends a message,POST to /chat/{convo_id} with a ShopperInput body.
The user’s free-text message to the shopping assistant. This drives the AI’s product search and response generation.
A category/selection pair for narrowing results after an initial search. For example:Use this when a user picks from a list of refinement options returned in a prior
ShopperReply.A price range filter to apply to the search. For example:Both
low_price and high_price are numeric values in the user’s currency.Shopper Reply
The API responds with aShopperReply containing the assistant’s message, matched products, refinement options, and pagination metadata.
The AI-generated text response to display to the user.
Contains the search query the assistant used, a map of results by source, and the price range of returned products.
An optional warning message if the assistant encountered limitations (e.g., no products found, query too broad). Display this to the user when present.
When present, contains a
category and a list of options the user can select to narrow results. Use these to populate a filter UI and pass the user’s selection back as refinement_selection in the next request.Pagination metadata for multi-page result sets. See Pagination in Conversations below.
Spying on Conversation State
During development and debugging, you can inspect the raw internal state of any conversation at any point using the spy endpoint.The
/spy/{convo_id} endpoint is intended for debugging purposes only. Do not use it in production user-facing flows or expose its output directly to end users.Pagination in Conversations
When aShopperReply includes a pagination object and has_next_page is true, there are additional product pages available for the current search.
Check for pagination
After receiving a
ShopperReply, check if pagination is non-null and pagination.has_next_page is true.Extract session identifiers
Pull the
conversation_id and session_id from the pagination object. Also note the next_page_index.Fetch the next page
Call the ranking session pages endpoint:Replace
{conversation_id} with pagination.conversation_id, {session_id} with pagination.session_id, and {page_index} with pagination.next_page_index.The
session_id in the pagination object is distinct from the convo_id. The convo_id identifies the overall user session; the session_id is a short-lived ranking context tied to a specific search query within that session.