Skip to main content

Reference · Data models

This page lists the public Neuroon DTOs: the contract the widget signs against the API. The widget's canonical types live at and the backend's at api/src/main/java/.../dto/.

Product

The product as the widget receives it from SearchResponse.results[].

FieldTypeRequiredNotes
idstringyesNeuroon UUID.
shopIdstringyesShop UUID.
shopNamestringyesShop name.
namestringyesProduct name.
descriptionstringno
pricenumberyesRegular price.
salePricenumbernoIf present, computes discount.
currencystringyesISO 4217.
urlstringyesFinal URL (host).
imageUrlstringno
categoriesstring[]yes
tagsstring[]yes
brandsstring[]yes
inStockbooleanyes
scorenumbernoInternal relevance score (debug).
ratingnumberno0-5.
reviewCountnumberno
stockCountnumbernoIf ≤ 5, the widget shows a "Low stock" badge.
externalIdstringnoHost id (WC post_id, etc.) used for conversion tracking.
badgeenumnoBESTSELLER | TRENDING | TOP_RATED.
aiReasonstringnoConversational reason ("ideal for asphalt").
aiScorenumbernoAI re-ranker score.

SearchResponse

Canonical response of GET /api/widget/search and POST /api/widget/search. Type at.

FieldTypeRequiredNotes
querystringyesNormalized query after post-process.
resultsProduct[]yes
totalnumberyesTotal products matching filters.
searchLogIdstringyesTurn identifier (attribution).
queryTimeMsnumberyesBackend latency.
intentIdstringnoIntent detection.
conversationIdstringnoContinuation across turns.
isNewConversationbooleannotrue when a conversation started.
turnNumbernumberno1, 2, 3…
filtersAppliedFiltersAppliednoFilters applied to ranking.
availableFiltersAvailableFiltersnoFilter drawer.
guidedFiltersGuidedFilter[]noDynamic questions.
querySuggestionsQuerySuggestion[]noSuggested refinements.
topProductsTopProduct[]noHighlighted carousel.
aiResponsestringnoConversational text.
comparisonComparisonResponseno
clarificationClarificationResultno
buyersGuideBuyersGuideno
kitProductKitno
followUpFollowUpResponseno
recommendationsRecommendationsResponseno
cartActionCartActionnoAction requested from the widget.
quickRepliesQuickReply[]noQuick reply chips.
responseLanguagestringnoISO of the agent's language (es, en…).

CartState

interface CartState {
items: CartItem[]
totalItems: number
subtotal: string // host-formatted: "232,48 €"
total: string // host-formatted
currency: string // ISO 4217
shipping?: CartShippingInfo
}
CartItem fieldTypeRequiredNotes
keystringyesUnique item identifier in the cart.
idstringyesNeuroon productId.
externalIdstringnoHost id (WC post_id).
namestringyes
pricestringyesHost-formatted.
quantitynumberyes
imagestringno
urlstringno
variantstringno"Size: 42, Color: Black".
maxQuantitynumberno

CartShippingInfo adds freeShippingThreshold, currentAmount, delta, thresholdMet, destinationCountry, availableCountries[], formattedThreshold and formattedDelta. See cart-integration for the flow.

Event (analytics)

FieldTypeRequiredNotes
typestringyessnake_case (category_click, kit_view…).
searchLogIdstringrecommendedTies to a search turn.
metadataobjectnoFree-form pairs (no PII).
timestampISO-8601 stringnoIf omitted, the backend stamps it.

CartAction

type CartActionType = 'REMOVE' | 'UPDATE_QUANTITY' | 'ADD_SUGGESTION' | 'CLEAR' | 'SET_DESTINATION_COUNTRY'

interface CartAction {
type: CartActionType
productId?: string
externalProductId?: string
externalId?: string // legacy alias
itemKey?: string
newQuantity?: number
countryCode?: string // ISO-3166-1 alpha-2 uppercase
confirmationPrompt?: string
product?: CartActionProduct // only on ADD_SUGGESTION
}

Suggestion

interface Suggestion {
type: 'query' | 'category' | 'brand' | 'product'
text: string
count?: number
icon?: string
product?: Product
}

GuidedFilter

interface GuidedFilter {
id: string
question: string
type: 'SINGLE_CHOICE' | 'MULTI_CHOICE' | 'RANGE'
priority: number
options: FilterOptionDTO[]
}

interface FilterOptionDTO {
label: string
filter: Record<string, unknown>
count?: number
isSelected?: boolean
isRecommended?: boolean
detectionSource?: 'QUERY_ANALYSIS' | 'TRENDING' | 'INTENT_BASED'
detectionReason?: string
}

Further reading