Prefer your own design to the widget? Call the same shopper routes the widget uses, straight from your own page. Sellentum picks and explains the products; you draw them.
1. Approve your website
In dashboard settings, add the exact domain your page runs on. Browser calls from any other website are refused.
2. Get a browser pass
On page load, POST to /api/widget/session. The pass lasts 30 minutes, works only on the website that asked for it, and opens one experience: ask for a search pass to search, a finder pass for a finder. Never put an API key in a web page.
3. Ask, then draw
Send the shopper's words with the pass in the X-Sellentum-Widget-Token header. You get ranked products, each with a plain-words reason. Style them any way you like.
4. Report what happened
Send clicks to /api/events with the same pass, so your dashboard reports fill.
const EXPERIENCE = "YOUR_PUBLISHED_SEARCH_ID";
const API = "https://www.sellentum.com";
// 1. A 30-minute browser pass for this website.
const { token } = await fetch(`${API}/api/widget/session`, {
method: "POST",
headers: { "Content-Type": "application/json" },
body: JSON.stringify({ experience: "search", id: EXPERIENCE, pageUrl: location.href }),
}).then((r) => r.json());
// 2. Search. Draw the results in your own design.
const answer = await fetch(`${API}/api/public/search/${EXPERIENCE}`, {
method: "POST",
headers: { "Content-Type": "application/json", "X-Sellentum-Widget-Token": token },
body: JSON.stringify({ query: "waterproof boots under £100" }),
}).then((r) => r.json());
for (const { product, explanation } of answer.results) {
console.log(product.name, product.price, explanation);
}
// 3. Report a click.
fetch(`${API}/api/events`, {
method: "POST",
headers: { "Content-Type": "application/json", "X-Sellentum-Widget-Token": token },
body: JSON.stringify({
quizId: EXPERIENCE,
eventType: "buy_click",
productId: answer.results[0].product.id,
metadata: { experience_type: "search" },
}),
});
POST /api/public/search/{id}Ranked search: { query } → results[] with product and explanation.
GET /api/public/suggest/{id}?q=Typeahead: completions and up to three products.
GET /api/public/finder/{id}A guided finder's questions. POST the shopper's answers to the same address for recommendations.
POST /api/public/assistant/{id}The advisor: a shopper's message in, matched products out.
GET /api/public/configurator/{id}A configurator's options. POST a selection to validate a bundle.
POST /api/eventsShopper events for your reports (views, clicks, feedback).